@phonghq/go-chat 1.0.58 → 1.0.60
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/chat/App.vue.js +5 -2
- package/dist/components/chat/call/Calling.vue.js +10 -4
- package/dist/composable/usePlivo.js +4 -0
- package/dist/go-chat.es.js +18 -18
- package/dist/go-chat.umd.js +11 -11
- package/dist/plugins/mqtt.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/chat/App.vue.js
CHANGED
|
@@ -214,11 +214,14 @@ defineExpose({
|
|
|
214
214
|
startCall: async () => {
|
|
215
215
|
await callingRef.value?.answer();
|
|
216
216
|
},
|
|
217
|
-
endCall: () =>
|
|
217
|
+
endCall: () => {
|
|
218
|
+
console.log('9999999999999999999999999999999');
|
|
219
|
+
callingRef.value?.endCall();
|
|
220
|
+
},
|
|
218
221
|
openSettings,
|
|
219
222
|
initData: (data) => handleExposeInit(data),
|
|
220
223
|
backToHome,
|
|
221
|
-
closeCallingModal: () => callingRef.value?.closeModal()
|
|
224
|
+
closeCallingModal: () => callingRef.value?.closeModal()
|
|
222
225
|
});
|
|
223
226
|
debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
|
|
224
227
|
const __VLS_defaults = {
|
|
@@ -31,11 +31,13 @@ const handlePlivoCallBack = (status, data) => {
|
|
|
31
31
|
getUserOffer(data?.phone ?? '');
|
|
32
32
|
}
|
|
33
33
|
else if (status == PLIVO_CALL_STATUS.CONNECT_FAILED || status == PLIVO_CALL_STATUS.NO_ANSWER) {
|
|
34
|
+
console.log('5555555555555555555555555555555555555555555');
|
|
34
35
|
endCall();
|
|
35
36
|
}
|
|
36
37
|
else if (status == PLIVO_CALL_STATUS.CALL_END) {
|
|
37
38
|
errorMessage.value = data?.message ?? '';
|
|
38
39
|
const closeModal = data?.reason == 'ORIGINATOR_CANCEL';
|
|
40
|
+
console.log('6666666666666666666666666666666666666666666666666');
|
|
39
41
|
endCall({ closeModal });
|
|
40
42
|
}
|
|
41
43
|
else if (status == PLIVO_CALL_STATUS.CALL_START) {
|
|
@@ -98,6 +100,7 @@ onUnmounted(() => {
|
|
|
98
100
|
clearInterval(timer);
|
|
99
101
|
if (timeOut)
|
|
100
102
|
clearTimeout(timeOut);
|
|
103
|
+
console.log('7777777777777777777777777777777777777777777777777');
|
|
101
104
|
endCall();
|
|
102
105
|
errorMessage.value = '';
|
|
103
106
|
});
|
|
@@ -116,6 +119,7 @@ function startTimer() {
|
|
|
116
119
|
}, 1000);
|
|
117
120
|
}
|
|
118
121
|
function endCall(option) {
|
|
122
|
+
console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
|
|
119
123
|
if (option?.closeModal) {
|
|
120
124
|
closeModal();
|
|
121
125
|
}
|
|
@@ -202,6 +206,7 @@ const startCall = async (data) => {
|
|
|
202
206
|
callStatus.value = PLIVO_CALL_STATUS.CALLING;
|
|
203
207
|
}
|
|
204
208
|
catch (e) {
|
|
209
|
+
console.log('111111111111111111111111');
|
|
205
210
|
endCall();
|
|
206
211
|
console.log(e);
|
|
207
212
|
errorMessage.value = e?.message || JSON.stringify(e);
|
|
@@ -213,6 +218,7 @@ const answer = async () => {
|
|
|
213
218
|
await plivoCallAnswer();
|
|
214
219
|
}
|
|
215
220
|
catch (e) {
|
|
221
|
+
console.log('222222222222222222222222222222');
|
|
216
222
|
endCall();
|
|
217
223
|
callStatus.value = PLIVO_CALL_STATUS.CONNECT_FAILED;
|
|
218
224
|
errorMessage.value = e?.message || JSON.stringify(e);
|
|
@@ -242,6 +248,7 @@ const getUserOffer = async (phone) => {
|
|
|
242
248
|
};
|
|
243
249
|
const handleTimeLimitError = () => {
|
|
244
250
|
errorMessage.value = 'Call time limit reached. This call has ended.';
|
|
251
|
+
console.log('3333333333333333333333333333333333333333333333');
|
|
245
252
|
endCall();
|
|
246
253
|
};
|
|
247
254
|
const exportRecordFile = async () => {
|
|
@@ -249,6 +256,7 @@ const exportRecordFile = async () => {
|
|
|
249
256
|
};
|
|
250
257
|
const handleAfterClose = () => {
|
|
251
258
|
record_link.value = '';
|
|
259
|
+
errorMessage.value = '';
|
|
252
260
|
uuidEnd = '';
|
|
253
261
|
};
|
|
254
262
|
let __VLS_exposed;
|
|
@@ -403,7 +411,7 @@ const { default: __VLS_8 } = __VLS_2.slots;
|
|
|
403
411
|
// @ts-ignore
|
|
404
412
|
[handleMute,];
|
|
405
413
|
} },
|
|
406
|
-
...{ class: "w-16 h-16 shadow-lg bg-white
|
|
414
|
+
...{ class: "w-16 h-16 shadow-lg bg-white text-black rounded-full flex items-center justify-center shadow-3xl transition" },
|
|
407
415
|
});
|
|
408
416
|
/** @type {[typeof IconMic, ]} */ ;
|
|
409
417
|
// @ts-ignore
|
|
@@ -427,7 +435,7 @@ const { default: __VLS_8 } = __VLS_2.slots;
|
|
|
427
435
|
// @ts-ignore
|
|
428
436
|
[endCall,];
|
|
429
437
|
} },
|
|
430
|
-
...{ class: "w-16 h-16 bg-white
|
|
438
|
+
...{ class: "w-16 h-16 bg-white text-white rounded-full flex items-center justify-center shadow-3xl transition" },
|
|
431
439
|
});
|
|
432
440
|
/** @type {[typeof IconClose, ]} */ ;
|
|
433
441
|
// @ts-ignore
|
|
@@ -534,7 +542,6 @@ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
|
534
542
|
/** @type {__VLS_StyleScopedClasses['h-16']} */ ;
|
|
535
543
|
/** @type {__VLS_StyleScopedClasses['shadow-lg']} */ ;
|
|
536
544
|
/** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
|
|
537
|
-
/** @type {__VLS_StyleScopedClasses['hover:bg-green-600']} */ ;
|
|
538
545
|
/** @type {__VLS_StyleScopedClasses['text-black']} */ ;
|
|
539
546
|
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
540
547
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
@@ -545,7 +552,6 @@ __VLS_asFunctionalElement(__VLS_elements.audio, __VLS_elements.audio)({
|
|
|
545
552
|
/** @type {__VLS_StyleScopedClasses['w-16']} */ ;
|
|
546
553
|
/** @type {__VLS_StyleScopedClasses['h-16']} */ ;
|
|
547
554
|
/** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
|
|
548
|
-
/** @type {__VLS_StyleScopedClasses['hover:bg-green-600']} */ ;
|
|
549
555
|
/** @type {__VLS_StyleScopedClasses['text-white']} */ ;
|
|
550
556
|
/** @type {__VLS_StyleScopedClasses['rounded-full']} */ ;
|
|
551
557
|
/** @type {__VLS_StyleScopedClasses['flex']} */ ;
|
|
@@ -71,6 +71,7 @@ export function usePlivo(callback) {
|
|
|
71
71
|
CallUuid = call?.callUUID;
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
|
+
console.log('e11111111111111', error);
|
|
74
75
|
callback(PLIVO_CALL_STATUS.CALL_END);
|
|
75
76
|
}
|
|
76
77
|
};
|
|
@@ -87,6 +88,7 @@ export function usePlivo(callback) {
|
|
|
87
88
|
};
|
|
88
89
|
const handleCallTerminated = (data, callInfo) => {
|
|
89
90
|
if (CallUuid === callInfo.callUUID) {
|
|
91
|
+
console.log('e22222222222222', data);
|
|
90
92
|
callback(PLIVO_CALL_STATUS.CALL_END, { message: data?.reason });
|
|
91
93
|
CallUuid = '';
|
|
92
94
|
}
|
|
@@ -150,12 +152,14 @@ export function usePlivo(callback) {
|
|
|
150
152
|
console.log('handleCallFailed', data);
|
|
151
153
|
if (custom_reject)
|
|
152
154
|
custom_reject?.(data);
|
|
155
|
+
console.log('e,3333333333333333333333333333', data);
|
|
153
156
|
callback(PLIVO_CALL_STATUS.CALL_END, { message: data });
|
|
154
157
|
if (data == 'User Denied Media Access') {
|
|
155
158
|
alert('Microphone access is blocked. Please enable the microphone permission to make a call.');
|
|
156
159
|
}
|
|
157
160
|
};
|
|
158
161
|
const handleIncomingCallCanceled = (callInfo) => {
|
|
162
|
+
console.log('e444444444444444', callInfo);
|
|
159
163
|
callback(PLIVO_CALL_STATUS.CALL_END, { reason: callInfo.reason ?? '' });
|
|
160
164
|
};
|
|
161
165
|
const handleMediaPermission = (e) => {
|
package/dist/go-chat.es.js
CHANGED
|
@@ -46806,7 +46806,7 @@ const K6 = 5, qc = async () => {
|
|
|
46806
46806
|
const i = new TextDecoder("utf-8");
|
|
46807
46807
|
t = JSON.parse(i.decode(e));
|
|
46808
46808
|
}
|
|
46809
|
-
eu.filter((i) => i.topic === V).forEach((i) => {
|
|
46809
|
+
console.log(t, `Received from ${V}`), eu.filter((i) => i.topic === V).forEach((i) => {
|
|
46810
46810
|
i.callBack(V, t);
|
|
46811
46811
|
});
|
|
46812
46812
|
} catch (t) {
|
|
@@ -71089,15 +71089,15 @@ function Miq(q) {
|
|
|
71089
71089
|
q(aV.CHECK_USER_OFFER, B);
|
|
71090
71090
|
const S = await E();
|
|
71091
71091
|
(I = e == null ? void 0 : e.client) == null || I.setRingTone(!0), q(aV.RINGING, { ...B, limit_time: S }), t = M == null ? void 0 : M.callUUID;
|
|
71092
|
-
} catch {
|
|
71093
|
-
q(aV.CALL_END);
|
|
71092
|
+
} catch (B) {
|
|
71093
|
+
console.log("e11111111111111", B), q(aV.CALL_END);
|
|
71094
71094
|
}
|
|
71095
71095
|
}, l = (M) => {
|
|
71096
71096
|
t = M.callUUID, q(aV.CALLING), i == null || i();
|
|
71097
71097
|
}, u = (M) => {
|
|
71098
71098
|
M.callUUID == t && (i == null || i(), q(aV.CALL_START));
|
|
71099
71099
|
}, c = (M, I) => {
|
|
71100
|
-
t === I.callUUID && (q(aV.CALL_END, { message: M == null ? void 0 : M.reason }), t = "");
|
|
71100
|
+
t === I.callUUID && (console.log("e22222222222222", M), q(aV.CALL_END, { message: M == null ? void 0 : M.reason }), t = "");
|
|
71101
71101
|
}, d = (M, I = "1") => {
|
|
71102
71102
|
let B = M.replace(/[^0-9]/g, "");
|
|
71103
71103
|
return B != null && B.startsWith(I) ? B.slice(I.toString().length) : B;
|
|
@@ -71127,9 +71127,9 @@ function Miq(q) {
|
|
|
71127
71127
|
var I, B, S, D, x;
|
|
71128
71128
|
M == aV.RINGING ? (B = (I = e == null ? void 0 : e.client) == null ? void 0 : I.reject) == null || B.call(I, t) : (M == aV.CALL_START || M == aV.CALLING) && ((D = (S = e == null ? void 0 : e.client) == null ? void 0 : S.hangup) == null || D.call(S)), (x = e == null ? void 0 : e.client) == null || x.setRingTone(!1);
|
|
71129
71129
|
}, v = (M, I) => {
|
|
71130
|
-
console.log("handleCallFailed", M), n && (n == null || n(M)), q(aV.CALL_END, { message: M }), M == "User Denied Media Access" && alert("Microphone access is blocked. Please enable the microphone permission to make a call.");
|
|
71130
|
+
console.log("handleCallFailed", M), n && (n == null || n(M)), console.log("e,3333333333333333333333333333", M), q(aV.CALL_END, { message: M }), M == "User Denied Media Access" && alert("Microphone access is blocked. Please enable the microphone permission to make a call.");
|
|
71131
71131
|
}, y = (M) => {
|
|
71132
|
-
q(aV.CALL_END, { reason: M.reason ?? "" });
|
|
71132
|
+
console.log("e444444444444444", M), q(aV.CALL_END, { reason: M.reason ?? "" });
|
|
71133
71133
|
}, _ = (M) => {
|
|
71134
71134
|
console.log("MediaPermission", M), (M == null ? void 0 : M.status) == "failure" && q(aV.MEDIA_PERMISSION_FAIL);
|
|
71135
71135
|
}, g = (M) => {
|
|
@@ -71270,11 +71270,11 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71270
71270
|
else if (F == aV.CHECK_USER_OFFER)
|
|
71271
71271
|
L((U == null ? void 0 : U.phone) ?? "");
|
|
71272
71272
|
else if (F == aV.CONNECT_FAILED || F == aV.NO_ANSWER)
|
|
71273
|
-
Y();
|
|
71273
|
+
console.log("5555555555555555555555555555555555555555555"), Y();
|
|
71274
71274
|
else if (F == aV.CALL_END) {
|
|
71275
71275
|
m.value = (U == null ? void 0 : U.message) ?? "";
|
|
71276
71276
|
const z = (U == null ? void 0 : U.reason) == "ORIGINATOR_CANCEL";
|
|
71277
|
-
Y({ closeModal: z });
|
|
71277
|
+
console.log("6666666666666666666666666666666666666666666666666"), Y({ closeModal: z });
|
|
71278
71278
|
} else F == aV.CALL_START ? ((tq = _.value) == null || tq.pause(), x()) : F == aV.MEDIA_PERMISSION_FAIL && yG();
|
|
71279
71279
|
}, {
|
|
71280
71280
|
plivoLogin: n,
|
|
@@ -71310,7 +71310,7 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71310
71310
|
Nf("We’re having trouble connecting the call. Please try again in a moment");
|
|
71311
71311
|
}
|
|
71312
71312
|
}), Mi(() => {
|
|
71313
|
-
I && clearInterval(I), Y(), m.value = "";
|
|
71313
|
+
I && clearInterval(I), console.log("7777777777777777777777777777777777777777777777777"), Y(), m.value = "";
|
|
71314
71314
|
});
|
|
71315
71315
|
function x() {
|
|
71316
71316
|
let F = 0;
|
|
@@ -71322,7 +71322,7 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71322
71322
|
}
|
|
71323
71323
|
function Y(F) {
|
|
71324
71324
|
var U;
|
|
71325
|
-
F != null && F.closeModal && T(), (U = _.value) == null || U.pause(), G(g.value, D), s(a.value), a.value = aV.CALL_END, clearInterval(I), h.value = !1, E.value = !1, f.value = "00:00", I && clearInterval(I), D = "";
|
|
71325
|
+
console.log("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), F != null && F.closeModal && T(), (U = _.value) == null || U.pause(), G(g.value, D), s(a.value), a.value = aV.CALL_END, clearInterval(I), h.value = !1, E.value = !1, f.value = "00:00", I && clearInterval(I), D = "";
|
|
71326
71326
|
}
|
|
71327
71327
|
const T = () => {
|
|
71328
71328
|
var F;
|
|
@@ -71361,13 +71361,13 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71361
71361
|
}
|
|
71362
71362
|
D = "call", await r(F.phone), a.value = aV.CALLING;
|
|
71363
71363
|
} catch (U) {
|
|
71364
|
-
Y(), console.log(U), m.value = (U == null ? void 0 : U.message) || JSON.stringify(U), a.value = aV.CONNECT_FAILED;
|
|
71364
|
+
console.log("111111111111111111111111"), Y(), console.log(U), m.value = (U == null ? void 0 : U.message) || JSON.stringify(U), a.value = aV.CONNECT_FAILED;
|
|
71365
71365
|
}
|
|
71366
71366
|
}, Q = async () => {
|
|
71367
71367
|
try {
|
|
71368
71368
|
await o();
|
|
71369
71369
|
} catch (F) {
|
|
71370
|
-
Y(), a.value = aV.CONNECT_FAILED, m.value = (F == null ? void 0 : F.message) || JSON.stringify(F);
|
|
71370
|
+
console.log("222222222222222222222222222222"), Y(), a.value = aV.CONNECT_FAILED, m.value = (F == null ? void 0 : F.message) || JSON.stringify(F);
|
|
71371
71371
|
}
|
|
71372
71372
|
}, L = async (F) => {
|
|
71373
71373
|
var z;
|
|
@@ -71388,11 +71388,11 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71388
71388
|
};
|
|
71389
71389
|
g.value = tq, a.value !== aV.CALL_END && a.value !== aV.CHECK_USER_OFFER && t("userCalling", g.value);
|
|
71390
71390
|
}, $ = () => {
|
|
71391
|
-
m.value = "Call time limit reached. This call has ended.", Y();
|
|
71391
|
+
m.value = "Call time limit reached. This call has ended.", console.log("3333333333333333333333333333333333333333333333"), Y();
|
|
71392
71392
|
}, P = async () => {
|
|
71393
71393
|
liq(v.value);
|
|
71394
71394
|
}, Vq = () => {
|
|
71395
|
-
v.value = "";
|
|
71395
|
+
v.value = "", m.value = "";
|
|
71396
71396
|
};
|
|
71397
71397
|
return V({ startCall: J, endCall: Y, userRemoter: g, callStatus: a, answer: Q, label: p, closeModal: T }), (F, U) => (vq(), Cq(ne, null, [
|
|
71398
71398
|
qV(ZO, {
|
|
@@ -71446,14 +71446,14 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71446
71446
|
a.value == fq(aV).CALL_START ? (vq(), Cq("button", {
|
|
71447
71447
|
key: 1,
|
|
71448
71448
|
onClick: U[0] || (U[0] = (H) => k()),
|
|
71449
|
-
class: "w-16 h-16 shadow-lg bg-white
|
|
71449
|
+
class: "w-16 h-16 shadow-lg bg-white text-black rounded-full flex items-center justify-center shadow-3xl transition"
|
|
71450
71450
|
}, [
|
|
71451
71451
|
qV(Iiq, { mute: E.value }, null, 8, ["mute"])
|
|
71452
71452
|
])) : fV("", !0),
|
|
71453
71453
|
a.value == fq(aV).CALL_END ? (vq(), Cq("button", {
|
|
71454
71454
|
key: 2,
|
|
71455
71455
|
onClick: U[1] || (U[1] = (H) => Y({ closeModal: !0 })),
|
|
71456
|
-
class: "w-16 h-16 bg-white
|
|
71456
|
+
class: "w-16 h-16 bg-white text-white rounded-full flex items-center justify-center shadow-3xl transition"
|
|
71457
71457
|
}, [
|
|
71458
71458
|
qV(yiq)
|
|
71459
71459
|
])) : fV("", !0),
|
|
@@ -71487,7 +71487,7 @@ const Siq = /* @__PURE__ */ FV(Biq, [["render", Tiq]]), Riq = { class: "text-sm
|
|
|
71487
71487
|
}, null, 8, Qiq)
|
|
71488
71488
|
], 64));
|
|
71489
71489
|
}
|
|
71490
|
-
}), Fiq = /* @__PURE__ */ FV(Piq, [["__scopeId", "data-v-
|
|
71490
|
+
}), Fiq = /* @__PURE__ */ FV(Piq, [["__scopeId", "data-v-3262475a"]]), jiq = ["onClick"], Liq = { class: "cursor-pointer" }, Ziq = /* @__PURE__ */ Hq({
|
|
71491
71491
|
__name: "SelectBase",
|
|
71492
71492
|
props: {
|
|
71493
71493
|
modelValue: {},
|
|
@@ -72229,7 +72229,7 @@ const gnq = /* @__PURE__ */ FV(vnq, [["render", _nq]]), ynq = { class: "w-[480px
|
|
|
72229
72229
|
},
|
|
72230
72230
|
endCall: () => {
|
|
72231
72231
|
var G;
|
|
72232
|
-
|
|
72232
|
+
console.log("9999999999999999999999999999999"), (G = h.value) == null || G.endCall();
|
|
72233
72233
|
},
|
|
72234
72234
|
openSettings: S,
|
|
72235
72235
|
initData: (G) => s(G),
|