corp-chat-library-antd-react-socket 1.1.7 → 1.1.8
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 +65 -64
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as N, jsxs as Ee } from "react/jsx-runtime";
|
|
2
2
|
import * as F from "react";
|
|
3
|
-
import re, { useRef as ge, cloneElement as tc, forwardRef as Xi, useState as J, useImperativeHandle as rc, useEffect as
|
|
3
|
+
import re, { useRef as ge, cloneElement as tc, forwardRef as Xi, useState as J, useImperativeHandle as rc, useEffect as de, version as nc, isValidElement as oc, useMemo as Tt, useContext as vt, createContext as Jr, useLayoutEffect as ic, useCallback as Xe } from "react";
|
|
4
4
|
import { Badge as ac, Space as Yi, Popover as ar, Button as Ze, Layout as zt, Upload as sc, Input as cc, Divider as lc, Empty as Wr, FloatButton as uc, Modal as dc, Dropdown as fc } from "antd";
|
|
5
5
|
import { SearchOutlined as gc, DragOutlined as jo, SettingOutlined as hc, BellOutlined as vc, DownloadOutlined as pc, LockOutlined as mc, EyeInvisibleOutlined as yc, PaperClipOutlined as bc, UploadOutlined as Sc, SmileOutlined as Cc, SendOutlined as xc, CalendarOutlined as Ec, CheckOutlined as Vo, FileFilled as Qi, FileTextFilled as Ji, FileZipFilled as Zi, FileMarkdownFilled as ea, FilePptFilled as ta, FileExcelFilled as ra, FileWordFilled as na, FilePdfFilled as oa, FileImageFilled as ia, LoadingOutlined as wc, ArrowDownOutlined as _c, CloseOutlined as $c, MessageOutlined as Oc } from "@ant-design/icons";
|
|
6
6
|
import Tc from "react-draggable";
|
|
@@ -223,7 +223,7 @@ var ll = /* @__PURE__ */ re.forwardRef(function(e, t) {
|
|
|
223
223
|
className: Re(U, x(x({}, "".concat(U, "-hidden"), !W), "".concat(U, "-has-suffix"), !!c))
|
|
224
224
|
}, te);
|
|
225
225
|
}
|
|
226
|
-
var ie = "".concat(s, "-affix-wrapper"), le = Re(ie, x(x(x(x(x({}, "".concat(s, "-disabled"), v), "".concat(ie, "-disabled"), v), "".concat(ie, "-focused"), f), "".concat(ie, "-readonly"), h), "".concat(ie, "-input-with-clear-btn"), c && p && S), _?.affixWrapper, b?.affixWrapper, b?.variant),
|
|
226
|
+
var ie = "".concat(s, "-affix-wrapper"), le = Re(ie, x(x(x(x(x({}, "".concat(s, "-disabled"), v), "".concat(ie, "-disabled"), v), "".concat(ie, "-focused"), f), "".concat(ie, "-readonly"), h), "".concat(ie, "-input-with-clear-btn"), c && p && S), _?.affixWrapper, b?.affixWrapper, b?.variant), fe = (c || p) && /* @__PURE__ */ re.createElement("span", {
|
|
227
227
|
className: Re("".concat(s, "-suffix"), b?.suffix),
|
|
228
228
|
style: A?.suffix
|
|
229
229
|
}, B, c);
|
|
@@ -236,7 +236,7 @@ var ll = /* @__PURE__ */ re.forwardRef(function(e, t) {
|
|
|
236
236
|
}), l && /* @__PURE__ */ re.createElement("span", {
|
|
237
237
|
className: Re("".concat(s, "-prefix"), b?.prefix),
|
|
238
238
|
style: A?.prefix
|
|
239
|
-
}, l), L,
|
|
239
|
+
}, l), L, fe);
|
|
240
240
|
}
|
|
241
241
|
if (al(e)) {
|
|
242
242
|
var ue = "".concat(s, "-group"), se = "".concat(ue, "-addon"), pe = "".concat(ue, "-wrapper"), be = Re("".concat(s, "-wrapper"), ue, _?.wrapper, b?.wrapper), Fe = Re(pe, x({}, "".concat(pe, "-disabled"), v), _?.group, b?.groupWrapper);
|
|
@@ -415,7 +415,7 @@ var yl = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKe
|
|
|
415
415
|
w.current && cl(w.current, ne);
|
|
416
416
|
}, k = hl(e.defaultValue, {
|
|
417
417
|
value: e.value
|
|
418
|
-
}), L = K(k, 2), H = L[0], B = L[1], W = H == null ? "" : String(H), U = J(null), te = K(U, 2), ie = te[0], le = te[1],
|
|
418
|
+
}), L = K(k, 2), H = L[0], B = L[1], W = H == null ? "" : String(H), U = J(null), te = K(U, 2), ie = te[0], le = te[1], fe = ml(y, f), ue = fe.max || v, se = fe.strategy(W), pe = !!ue && se > ue;
|
|
419
419
|
rc(t, function() {
|
|
420
420
|
var ae;
|
|
421
421
|
return {
|
|
@@ -435,16 +435,16 @@ var yl = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKe
|
|
|
435
435
|
input: w.current,
|
|
436
436
|
nativeElement: ((ae = M.current) === null || ae === void 0 ? void 0 : ae.nativeElement) || w.current
|
|
437
437
|
};
|
|
438
|
-
}),
|
|
438
|
+
}), de(function() {
|
|
439
439
|
T.current && (T.current = !1), $(function(ae) {
|
|
440
440
|
return ae && d ? !1 : ae;
|
|
441
441
|
});
|
|
442
442
|
}, [d]);
|
|
443
443
|
var be = function(ne, Se, ut) {
|
|
444
444
|
var nt = Se;
|
|
445
|
-
if (!E.current &&
|
|
446
|
-
if (nt =
|
|
447
|
-
max:
|
|
445
|
+
if (!E.current && fe.exceedFormatter && fe.max && fe.strategy(Se) > fe.max) {
|
|
446
|
+
if (nt = fe.exceedFormatter(Se, {
|
|
447
|
+
max: fe.max
|
|
448
448
|
}), Se !== nt) {
|
|
449
449
|
var ot, St;
|
|
450
450
|
le([((ot = w.current) === null || ot === void 0 ? void 0 : ot.selectionStart) || 0, ((St = w.current) === null || St === void 0 ? void 0 : St.selectionEnd) || 0]);
|
|
@@ -453,7 +453,7 @@ var yl = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKe
|
|
|
453
453
|
return;
|
|
454
454
|
B(nt), w.current && Bo(w.current, ne, n, nt);
|
|
455
455
|
};
|
|
456
|
-
|
|
456
|
+
de(function() {
|
|
457
457
|
if (ie) {
|
|
458
458
|
var ae;
|
|
459
459
|
(ae = w.current) === null || ae === void 0 || ae.setSelectionRange.apply(ae, X(ie));
|
|
@@ -517,13 +517,13 @@ var yl = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKe
|
|
|
517
517
|
}));
|
|
518
518
|
}, Oe = function() {
|
|
519
519
|
var ne = Number(ue) > 0;
|
|
520
|
-
if (h ||
|
|
521
|
-
var Se =
|
|
520
|
+
if (h || fe.show) {
|
|
521
|
+
var Se = fe.showFormatter ? fe.showFormatter({
|
|
522
522
|
value: W,
|
|
523
523
|
count: se,
|
|
524
524
|
maxLength: ue
|
|
525
525
|
}) : "".concat(se).concat(ne ? " / ".concat(ue) : "");
|
|
526
|
-
return /* @__PURE__ */ re.createElement(re.Fragment, null,
|
|
526
|
+
return /* @__PURE__ */ re.createElement(re.Fragment, null, fe.show && /* @__PURE__ */ re.createElement("span", {
|
|
527
527
|
className: Re("".concat(u, "-show-count-suffix"), x({}, "".concat(u, "-show-count-has-suffix"), !!h), C?.count),
|
|
528
528
|
style: V({}, _?.count)
|
|
529
529
|
}, Se), h);
|
|
@@ -683,7 +683,7 @@ function Cl() {
|
|
|
683
683
|
function le(z) {
|
|
684
684
|
return C(z) === g;
|
|
685
685
|
}
|
|
686
|
-
function
|
|
686
|
+
function fe(z) {
|
|
687
687
|
return C(z) === d;
|
|
688
688
|
}
|
|
689
689
|
function ue(z) {
|
|
@@ -701,7 +701,7 @@ function Cl() {
|
|
|
701
701
|
function Fe(z) {
|
|
702
702
|
return C(z) === u;
|
|
703
703
|
}
|
|
704
|
-
ve.ContextConsumer = _, ve.ContextProvider = b, ve.Element = P, ve.ForwardRef = A, ve.Fragment = R, ve.Lazy = I, ve.Memo = D, ve.Portal = $, ve.Profiler = E, ve.StrictMode = T, ve.Suspense = w, ve.SuspenseList = M, ve.isAsyncMode = L, ve.isConcurrentMode = H, ve.isContextConsumer = B, ve.isContextProvider = W, ve.isElement = U, ve.isForwardRef = te, ve.isFragment = ie, ve.isLazy = le, ve.isMemo =
|
|
704
|
+
ve.ContextConsumer = _, ve.ContextProvider = b, ve.Element = P, ve.ForwardRef = A, ve.Fragment = R, ve.Lazy = I, ve.Memo = D, ve.Portal = $, ve.Profiler = E, ve.StrictMode = T, ve.Suspense = w, ve.SuspenseList = M, ve.isAsyncMode = L, ve.isConcurrentMode = H, ve.isContextConsumer = B, ve.isContextProvider = W, ve.isElement = U, ve.isForwardRef = te, ve.isFragment = ie, ve.isLazy = le, ve.isMemo = fe, ve.isPortal = ue, ve.isProfiler = se, ve.isStrictMode = pe, ve.isSuspense = be, ve.isSuspenseList = Fe, ve.isValidElementType = O, ve.typeOf = C;
|
|
705
705
|
})()), ve;
|
|
706
706
|
}
|
|
707
707
|
var Go;
|
|
@@ -3210,7 +3210,7 @@ function Ru() {
|
|
|
3210
3210
|
var v = vt(Wt), h = s || v, f = h && h._init;
|
|
3211
3211
|
process.env.NODE_ENV !== "production" && we(t.length === 2 ? s ? f : !0 : f, "useWatch requires a form instance since it can not auto detect from context.");
|
|
3212
3212
|
var y = Pe(n), p = ge(y);
|
|
3213
|
-
return p.current = y, Pu(y),
|
|
3213
|
+
return p.current = y, Pu(y), de(
|
|
3214
3214
|
function() {
|
|
3215
3215
|
if (f) {
|
|
3216
3216
|
var S = h.getFieldsValue, O = h.getInternalHooks, C = O(Ot), _ = C.registerWatch, b = function(I, D) {
|
|
@@ -5616,14 +5616,14 @@ function Tf(e) {
|
|
|
5616
5616
|
}), function() {
|
|
5617
5617
|
if (h.injectStyle === !1)
|
|
5618
5618
|
return [];
|
|
5619
|
-
var U = xf(I), te = U.token, ie = U.flush, le = Ti(p, A, v),
|
|
5619
|
+
var U = xf(I), te = U.token, ie = U.flush, le = Ti(p, A, v), fe = ".".concat(C), ue = $i(p, A, le, {
|
|
5620
5620
|
deprecatedTokens: h.deprecatedTokens
|
|
5621
5621
|
});
|
|
5622
5622
|
D && le && Z(le) === "object" && Object.keys(le).forEach(function(Fe) {
|
|
5623
5623
|
le[Fe] = "var(".concat(Vr(Fe, _i(p, D.prefix)), ")");
|
|
5624
5624
|
});
|
|
5625
5625
|
var se = Zt(te, {
|
|
5626
|
-
componentCls:
|
|
5626
|
+
componentCls: fe,
|
|
5627
5627
|
prefixCls: C,
|
|
5628
5628
|
iconCls: ".".concat(T),
|
|
5629
5629
|
antCls: ".".concat(E),
|
|
@@ -6211,7 +6211,7 @@ const Qf = (function(e) {
|
|
|
6211
6211
|
};
|
|
6212
6212
|
}, []), [n, r];
|
|
6213
6213
|
});
|
|
6214
|
-
var xs = bt() ? ic :
|
|
6214
|
+
var xs = bt() ? ic : de, Es = function(t) {
|
|
6215
6215
|
return +setTimeout(t, 16);
|
|
6216
6216
|
}, ws = function(t) {
|
|
6217
6217
|
return clearTimeout(t);
|
|
@@ -6315,7 +6315,7 @@ function ng(e, t, r, n) {
|
|
|
6315
6315
|
Oe === Ar && ne ? Se = C?.(ae, $e) : Oe === Ir && ne ? Se = _?.(ae, $e) : Oe === Nr && ne && (Se = b?.(ae, $e)), ne && Se !== !1 && ie();
|
|
6316
6316
|
}
|
|
6317
6317
|
}
|
|
6318
|
-
}),
|
|
6318
|
+
}), fe = Qf(le), ue = K(fe, 1), se = ue[0], pe = function(Oe) {
|
|
6319
6319
|
switch (Oe) {
|
|
6320
6320
|
case Ar:
|
|
6321
6321
|
return x(x(x({}, at, g), Dt, h), kt, p);
|
|
@@ -6355,18 +6355,18 @@ function ng(e, t, r, n) {
|
|
|
6355
6355
|
var ae = pe(Oe);
|
|
6356
6356
|
Oe && (e || ae[at]) ? (w(Oe), je()) : w(xt), rt.current = t;
|
|
6357
6357
|
}
|
|
6358
|
-
}, [t]),
|
|
6358
|
+
}, [t]), de(function() {
|
|
6359
6359
|
// Cancel appear
|
|
6360
6360
|
(H === Ar && !s || // Cancel enter
|
|
6361
6361
|
H === Ir && !i || // Cancel leave
|
|
6362
6362
|
H === Nr && !c) && w(xt);
|
|
6363
|
-
}, [s, i, c]),
|
|
6363
|
+
}, [s, i, c]), de(function() {
|
|
6364
6364
|
return function() {
|
|
6365
6365
|
B.current = !1, clearTimeout(W.current);
|
|
6366
6366
|
};
|
|
6367
6367
|
}, []);
|
|
6368
6368
|
var _e = F.useRef(!1);
|
|
6369
|
-
|
|
6369
|
+
de(function() {
|
|
6370
6370
|
I && (_e.current = !0), I !== void 0 && H === xt && ((_e.current || I) && P?.(I), _e.current = !0);
|
|
6371
6371
|
}, [I, H]);
|
|
6372
6372
|
var Ae = k;
|
|
@@ -6649,7 +6649,7 @@ const yg = (e) => {
|
|
|
6649
6649
|
result: te,
|
|
6650
6650
|
slider: ie,
|
|
6651
6651
|
breadcrumb: le,
|
|
6652
|
-
menu:
|
|
6652
|
+
menu: fe,
|
|
6653
6653
|
pagination: ue,
|
|
6654
6654
|
input: se,
|
|
6655
6655
|
textArea: pe,
|
|
@@ -6740,7 +6740,7 @@ const yg = (e) => {
|
|
|
6740
6740
|
result: te,
|
|
6741
6741
|
slider: ie,
|
|
6742
6742
|
breadcrumb: le,
|
|
6743
|
-
menu:
|
|
6743
|
+
menu: fe,
|
|
6744
6744
|
pagination: ue,
|
|
6745
6745
|
empty: be,
|
|
6746
6746
|
badge: Fe,
|
|
@@ -7015,7 +7015,7 @@ var Tg = `
|
|
|
7015
7015
|
var r = vt(Oo), n = r.csp, o = r.prefixCls, i = r.layer, a = Tg;
|
|
7016
7016
|
o && (a = a.replace(/anticon/g, o)), i && (a = "@layer ".concat(i, ` {
|
|
7017
7017
|
`).concat(a, `
|
|
7018
|
-
}`)),
|
|
7018
|
+
}`)), de(function() {
|
|
7019
7019
|
var s = t.current, l = _g(s);
|
|
7020
7020
|
Ft(a, "@ant-design-icons", {
|
|
7021
7021
|
prepend: !i,
|
|
@@ -7142,7 +7142,7 @@ function kg(e, t) {
|
|
|
7142
7142
|
!((o = e.current) === null || o === void 0) && o.input && ((i = e.current) === null || i === void 0 ? void 0 : i.input.getAttribute("type")) === "password" && (!((a = e.current) === null || a === void 0) && a.input.hasAttribute("value")) && ((s = e.current) === null || s === void 0 || s.input.removeAttribute("value"));
|
|
7143
7143
|
}));
|
|
7144
7144
|
};
|
|
7145
|
-
return
|
|
7145
|
+
return de(() => (n(), () => r.current.forEach((o) => {
|
|
7146
7146
|
o && clearTimeout(o);
|
|
7147
7147
|
})), []), n;
|
|
7148
7148
|
}
|
|
@@ -8223,10 +8223,10 @@ const Ws = /* @__PURE__ */ Xi((e, t) => {
|
|
|
8223
8223
|
status: te,
|
|
8224
8224
|
hasFeedback: ie,
|
|
8225
8225
|
feedbackIcon: le
|
|
8226
|
-
} = vt(Gr),
|
|
8226
|
+
} = vt(Gr), fe = Vg(te, o), ue = sh(e) || !!ie, se = ge(ue);
|
|
8227
8227
|
if (process.env.NODE_ENV !== "production") {
|
|
8228
8228
|
const _e = Kt("Input");
|
|
8229
|
-
|
|
8229
|
+
de(() => {
|
|
8230
8230
|
var Ae;
|
|
8231
8231
|
ue && !se.current && process.env.NODE_ENV !== "production" && _e(document.activeElement === ((Ae = E.current) === null || Ae === void 0 ? void 0 : Ae.input), "usage", "When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ"), se.current = ue;
|
|
8232
8232
|
}, [ue]);
|
|
@@ -8268,7 +8268,7 @@ const Ws = /* @__PURE__ */ Xi((e, t) => {
|
|
|
8268
8268
|
}, p?.input, I.input, M),
|
|
8269
8269
|
variant: Re({
|
|
8270
8270
|
[`${$}-${ke}`]: rt
|
|
8271
|
-
}, Bi($,
|
|
8271
|
+
}, Bi($, fe)),
|
|
8272
8272
|
affixWrapper: Re({
|
|
8273
8273
|
[`${$}-affix-wrapper-sm`]: B === "small",
|
|
8274
8274
|
[`${$}-affix-wrapper-lg`]: B === "large",
|
|
@@ -8282,14 +8282,14 @@ const Ws = /* @__PURE__ */ Xi((e, t) => {
|
|
|
8282
8282
|
[`${$}-group-wrapper-lg`]: B === "large",
|
|
8283
8283
|
[`${$}-group-wrapper-rtl`]: _ === "rtl",
|
|
8284
8284
|
[`${$}-group-wrapper-${ke}`]: rt
|
|
8285
|
-
}, Bi(`${$}-group-wrapper`,
|
|
8285
|
+
}, Bi(`${$}-group-wrapper`, fe, ie), M)
|
|
8286
8286
|
})
|
|
8287
8287
|
}))));
|
|
8288
8288
|
});
|
|
8289
8289
|
process.env.NODE_ENV !== "production" && (Ws.displayName = "Input");
|
|
8290
8290
|
function lh({ onSearchChange: e }) {
|
|
8291
8291
|
const [t, r] = J("");
|
|
8292
|
-
return
|
|
8292
|
+
return de(() => {
|
|
8293
8293
|
const n = setTimeout(() => {
|
|
8294
8294
|
e(t.trim());
|
|
8295
8295
|
}, 300);
|
|
@@ -8408,8 +8408,8 @@ function dh() {
|
|
|
8408
8408
|
case d:
|
|
8409
8409
|
return k ? H(1, U) : H(0, U + 1);
|
|
8410
8410
|
case u:
|
|
8411
|
-
var le = this.$locale().weekStart || 0,
|
|
8412
|
-
return H(k ? te -
|
|
8411
|
+
var le = this.$locale().weekStart || 0, fe = (W < le ? W + 7 : W) - le;
|
|
8412
|
+
return H(k ? te - fe : te + (6 - fe), U);
|
|
8413
8413
|
case c:
|
|
8414
8414
|
case v:
|
|
8415
8415
|
return B(ie + "Hours", 0);
|
|
@@ -8455,7 +8455,7 @@ function dh() {
|
|
|
8455
8455
|
if (!this.isValid()) return j.invalidDate || h;
|
|
8456
8456
|
var k = w || "YYYY-MM-DDTHH:mm:ssZ", L = I.z(this), H = this.$H, B = this.$m, W = this.$M, U = j.weekdays, te = j.months, ie = j.meridiem, le = function(se, pe, be, Fe) {
|
|
8457
8457
|
return se && (se[pe] || se(M, k)) || be[pe].slice(0, Fe);
|
|
8458
|
-
},
|
|
8458
|
+
}, fe = function(se) {
|
|
8459
8459
|
return I.s(H % 12 || 12, se, "0");
|
|
8460
8460
|
}, ue = ie || function(se, pe, be) {
|
|
8461
8461
|
var Fe = se < 12 ? "AM" : "PM";
|
|
@@ -8493,9 +8493,9 @@ function dh() {
|
|
|
8493
8493
|
case "HH":
|
|
8494
8494
|
return I.s(H, 2, "0");
|
|
8495
8495
|
case "h":
|
|
8496
|
-
return
|
|
8496
|
+
return fe(1);
|
|
8497
8497
|
case "hh":
|
|
8498
|
-
return
|
|
8498
|
+
return fe(2);
|
|
8499
8499
|
case "a":
|
|
8500
8500
|
return ue(H, B, !0);
|
|
8501
8501
|
case "A":
|
|
@@ -8585,7 +8585,7 @@ function dh() {
|
|
|
8585
8585
|
}
|
|
8586
8586
|
var fh = dh();
|
|
8587
8587
|
const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
8588
|
-
const t = ge(null), [r, n] = J(!1), [o, i] = J("disconnected"), [a, s] = J(null), l = ge(a), [c, u] = J(""), [d, g] = J(""), [m, v] = J(!1), [h, f] = J(0), [y, p] = J(null), [S, O] = J(null), [C, _] = J(null), [b, P] = J(null), [A, R] = J(null), [I, D] = J(null), [$, E] = J(null), [T, w] = J(null), [M, j] = J([]), k = ge(M), [L, H] = J([]), B = ge(L), [W, U] = J(0), [te, ie] = J(0), [le,
|
|
8588
|
+
const t = ge(null), [r, n] = J(!1), [o, i] = J("disconnected"), [a, s] = J(null), l = ge(a), [c, u] = J(""), [d, g] = J(""), [m, v] = J(!1), [h, f] = J(0), [y, p] = J(null), [S, O] = J(null), [C, _] = J(null), [b, P] = J(null), [A, R] = J(null), [I, D] = J(null), [$, E] = J(null), [T, w] = J(null), [M, j] = J([]), k = ge(M), [L, H] = J([]), B = ge(L), [W, U] = J(0), [te, ie] = J(0), [le, fe] = J(!1), [ue, se] = J(!1), [pe, be] = J(!1), [Fe, z] = J(0), [je, Ce] = J({
|
|
8589
8589
|
message: "",
|
|
8590
8590
|
description: "",
|
|
8591
8591
|
type: "info"
|
|
@@ -8622,7 +8622,7 @@ const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
|
8622
8622
|
console.log("CHAT WEBSOCKET CONNECT ERROR");
|
|
8623
8623
|
}));
|
|
8624
8624
|
}, [ke, m, h, c, d, y, I, $, T]);
|
|
8625
|
-
|
|
8625
|
+
de(() => {
|
|
8626
8626
|
if (console.log("init", ke), ke && a && c && h && d) {
|
|
8627
8627
|
console.log("Attempting to connect with:", { HTTP_HOST: c, BFF_PORT: h, userdata: a });
|
|
8628
8628
|
const q = setTimeout(() => {
|
|
@@ -8638,11 +8638,11 @@ const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
|
8638
8638
|
hasBFF_PORT: !!h,
|
|
8639
8639
|
hasCSRF_TOKEN: !!d
|
|
8640
8640
|
});
|
|
8641
|
-
}, [a, c, h, d, _e]),
|
|
8641
|
+
}, [a, c, h, d, _e]), de(() => {
|
|
8642
8642
|
console.log("BEFORE UPDATE CHATS chatsRef", L), B.current = L;
|
|
8643
|
-
}, [L]),
|
|
8643
|
+
}, [L]), de(() => {
|
|
8644
8644
|
k.current = M;
|
|
8645
|
-
}, [M]),
|
|
8645
|
+
}, [M]), de(() => {
|
|
8646
8646
|
if (!c) return;
|
|
8647
8647
|
console.log("SET_PROD_AXIOS_INSTANCE");
|
|
8648
8648
|
const q = Pc.create({
|
|
@@ -8650,9 +8650,11 @@ const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
|
8650
8650
|
timeout: 3e5
|
|
8651
8651
|
});
|
|
8652
8652
|
console.log(q), p(q);
|
|
8653
|
-
}, [c])
|
|
8653
|
+
}, [c]), de(() => {
|
|
8654
|
+
a && (console.log("userdataRef"), l.current = a);
|
|
8655
|
+
}, [a]);
|
|
8654
8656
|
const Ae = Xe(async (q = null) => {
|
|
8655
|
-
if (console.log("fetchChatsList"),
|
|
8657
|
+
if (console.log("fetchChatsList"), fe(!0), m)
|
|
8656
8658
|
try {
|
|
8657
8659
|
if (!y || !S || !d) {
|
|
8658
8660
|
console.log("fetchChatsList false");
|
|
@@ -8674,7 +8676,7 @@ const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
|
8674
8676
|
} catch (Y) {
|
|
8675
8677
|
console.log(Y);
|
|
8676
8678
|
} finally {
|
|
8677
|
-
|
|
8679
|
+
fe(!1);
|
|
8678
8680
|
}
|
|
8679
8681
|
}, [le, d, y, S]), $e = Xe(async (q, Y = null) => {
|
|
8680
8682
|
if (console.log("fetchChatMessages"), !ue && (se(!0), m))
|
|
@@ -8723,7 +8725,6 @@ const Rt = /* @__PURE__ */ aa(fh), Us = Jr(void 0), gh = ({ children: e }) => {
|
|
|
8723
8725
|
const We = await (await fetch(b, {
|
|
8724
8726
|
method: "POST",
|
|
8725
8727
|
headers: {
|
|
8726
|
-
"Content-Type": "application/json",
|
|
8727
8728
|
"X-CSRF-TOKEN": d
|
|
8728
8729
|
},
|
|
8729
8730
|
body: Le
|
|
@@ -8905,7 +8906,7 @@ function hh({ search: e, onSelectChat: t, selectedChatId: r }) {
|
|
|
8905
8906
|
/* methods */
|
|
8906
8907
|
fetchChatsList: i
|
|
8907
8908
|
} = rr(), a = n?.user?.id;
|
|
8908
|
-
|
|
8909
|
+
de(() => {
|
|
8909
8910
|
i(e);
|
|
8910
8911
|
}, [e]);
|
|
8911
8912
|
const s = Xe(
|
|
@@ -9286,7 +9287,7 @@ const xh = ({
|
|
|
9286
9287
|
markMessagesAsRead: o
|
|
9287
9288
|
}) => {
|
|
9288
9289
|
const i = ge(null), a = ge(/* @__PURE__ */ new Set());
|
|
9289
|
-
|
|
9290
|
+
de(() => {
|
|
9290
9291
|
if (!e.length || !o || !n?.current) return;
|
|
9291
9292
|
const s = setTimeout(() => {
|
|
9292
9293
|
const l = e.filter((u) => u.type !== "divider" && u.message).filter((u) => {
|
|
@@ -9320,7 +9321,7 @@ const xh = ({
|
|
|
9320
9321
|
i.current = c, l.forEach(({ element: u }) => c.observe(u));
|
|
9321
9322
|
}, 0);
|
|
9322
9323
|
return () => clearTimeout(s);
|
|
9323
|
-
}, [e, t, r, n?.current, o]),
|
|
9324
|
+
}, [e, t, r, n?.current, o]), de(() => {
|
|
9324
9325
|
a.current.clear();
|
|
9325
9326
|
}, [r]);
|
|
9326
9327
|
}, Eh = ({
|
|
@@ -9330,7 +9331,7 @@ const xh = ({
|
|
|
9330
9331
|
offset: n = 100
|
|
9331
9332
|
}) => {
|
|
9332
9333
|
const o = ge(!1), i = ge(null), a = ge(0), s = ge(0);
|
|
9333
|
-
|
|
9334
|
+
de(() => {
|
|
9334
9335
|
const l = e.current;
|
|
9335
9336
|
if (!l || !t) return;
|
|
9336
9337
|
const c = new IntersectionObserver(
|
|
@@ -9392,7 +9393,7 @@ const xh = ({
|
|
|
9392
9393
|
containerRef: t,
|
|
9393
9394
|
offset: r = 100
|
|
9394
9395
|
}) => {
|
|
9395
|
-
|
|
9396
|
+
de(() => {
|
|
9396
9397
|
const n = t.current;
|
|
9397
9398
|
if (!n) return;
|
|
9398
9399
|
const o = () => {
|
|
@@ -9481,18 +9482,18 @@ function _h({ chatId: e }) {
|
|
|
9481
9482
|
// контейнер с сообщениями, за которым следим
|
|
9482
9483
|
offset: 500
|
|
9483
9484
|
// офсет, расстояние до низа контейнера
|
|
9484
|
-
}),
|
|
9485
|
+
}), de(() => {
|
|
9485
9486
|
const $ = C.find((E) => E.chat_id === e);
|
|
9486
9487
|
!$ && e && !_ && !b ? (console.log("Fetching chat messages for:", e), S.length = 0, P(e, null)) : $ && (console.log("Chat found:", $), u($));
|
|
9487
|
-
}, [C, e, _, b]),
|
|
9488
|
+
}, [C, e, _, b]), de(() => {
|
|
9488
9489
|
I && I?.user && a(I?.user?.id);
|
|
9489
|
-
}, [I]),
|
|
9490
|
+
}, [I]), de(() => {
|
|
9490
9491
|
t.current && p.length > 0 && !m && (t.current.scrollTop = t.current.scrollHeight, v(!0));
|
|
9491
|
-
}, [p]),
|
|
9492
|
+
}, [p]), de(() => {
|
|
9492
9493
|
v(!1);
|
|
9493
|
-
}, [e]),
|
|
9494
|
+
}, [e]), de(() => {
|
|
9494
9495
|
g(c?.total - c?.messages?.length > 0);
|
|
9495
|
-
}, [c]),
|
|
9496
|
+
}, [c]), de(() => {
|
|
9496
9497
|
const $ = t.current;
|
|
9497
9498
|
if (!$) return;
|
|
9498
9499
|
const E = () => {
|
|
@@ -9578,9 +9579,9 @@ function Th() {
|
|
|
9578
9579
|
}
|
|
9579
9580
|
const Fh = ({ open: e, onOk: t, onCancel: r, positionCorner: n }) => {
|
|
9580
9581
|
const o = ge(null), i = ge(null), [a, s] = J(!1), [l, c] = J({ x: 0, y: 0 }), u = !n, d = (v, h, f) => Math.min(Math.max(v, h), f);
|
|
9581
|
-
|
|
9582
|
+
de(() => {
|
|
9582
9583
|
e && c({ x: 0, y: 0 });
|
|
9583
|
-
}, [e]),
|
|
9584
|
+
}, [e]), de(() => {
|
|
9584
9585
|
if (e && n) {
|
|
9585
9586
|
const h = window.innerWidth, f = window.innerHeight, y = o.current ? o.current.offsetWidth : 500, p = o.current ? o.current.offsetHeight : 400;
|
|
9586
9587
|
let S = 0, O = 0;
|
|
@@ -9679,11 +9680,11 @@ const Fh = ({ open: e, onOk: t, onCancel: r, positionCorner: n }) => {
|
|
|
9679
9680
|
init: a,
|
|
9680
9681
|
fetchChatsList: s
|
|
9681
9682
|
} = rr(), [l, c] = J(0);
|
|
9682
|
-
|
|
9683
|
+
de(() => {
|
|
9683
9684
|
n || console.log("disconnected");
|
|
9684
|
-
}, [n]),
|
|
9685
|
+
}, [n]), de(() => {
|
|
9685
9686
|
s(null);
|
|
9686
|
-
}, [a, o]),
|
|
9687
|
+
}, [a, o]), de(() => {
|
|
9687
9688
|
e && e?.user && c(e.user.id);
|
|
9688
9689
|
}, [e]);
|
|
9689
9690
|
const u = Tt(() => {
|
|
@@ -9756,7 +9757,7 @@ const Fh = ({ open: e, onOk: t, onCancel: r, positionCorner: n }) => {
|
|
|
9756
9757
|
setUpdateSms: f,
|
|
9757
9758
|
setInit: y
|
|
9758
9759
|
} = rr();
|
|
9759
|
-
return
|
|
9760
|
+
return de(() => {
|
|
9760
9761
|
console.log("CORP-CHAT userdata", e), console.log("CORP-CHAT httpParams", t), console.log("CORP-CHAT fetchParams", r), console.log("CORP-CHAT socketSubscribe", n), console.log("CORP-CHAT socketActions", o);
|
|
9761
9762
|
let p = !1, S = !1, O = !1, C = !1, _ = !1;
|
|
9762
9763
|
e && i(e), e && (p = !0), t && t?.HTTP_HOST && a(t?.HTTP_HOST), t && t?.CSRF_TOKEN && s(t?.CSRF_TOKEN), t && t?.PRODMODE && l(t?.PRODMODE), t && t?.BFF_PORT && c(t?.BFF_PORT), t && t?.HTTP_HOST && t?.CSRF_TOKEN && t?.PRODMODE && t?.BFF_PORT && (S = !0), r && r?.fetchChatsListPath && u(r?.fetchChatsListPath), r && r?.fetchChatMessagesPath && d(r?.fetchChatMessagesPath), r && r?.sendSmsPath && g(r?.sendSmsPath), r && r?.markMessagesAsReadPath && m(r?.markMessagesAsReadPath), r && r?.fetchChatsListPath && r?.fetchChatMessagesPath && r?.sendSmsPath && r?.markMessagesAsReadPath && (O = !0), n && n?.subscribeToChat && v(n?.subscribeToChat), n && n?.subscribeToChat && (C = !0), o && o?.newSms && h(o?.newSms), o && o?.updateSms && f(o?.updateSms), o && o?.newSms && o?.updateSms && (_ = !0), p && S && O && C && _ && y(!0);
|
|
@@ -9788,9 +9789,9 @@ const Fh = ({ open: e, onOk: t, onCancel: r, positionCorner: n }) => {
|
|
|
9788
9789
|
socketSubscribe: o,
|
|
9789
9790
|
socketActions: i
|
|
9790
9791
|
} = e;
|
|
9791
|
-
return
|
|
9792
|
+
return de(() => {
|
|
9792
9793
|
console.log("CORP-CHAT MOUNTED");
|
|
9793
|
-
}, []),
|
|
9794
|
+
}, []), de(() => {
|
|
9794
9795
|
console.log("CORP-CHAT PARAMS", e);
|
|
9795
9796
|
}, [e]), /* @__PURE__ */ N("div", { children: t && r && n && o && i ? /* @__PURE__ */ N(gh, { children: /* @__PURE__ */ N(Rh, { ...e }) }) : /* @__PURE__ */ N("div", { children: "AAAAdd userdata, httpParams, fetchParams, socketSubscribe, socketActions" }) });
|
|
9796
9797
|
};
|
package/package.json
CHANGED