rc-lib-ui 1.3.5 → 1.3.7

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.
@@ -1,3 +1,4 @@
1
+ import { NetworkStatusInfoTracker } from 'dev-classes';
1
2
  import { WsApiE_StatusConnect_OR } from './deps/WsApi';
2
3
  import { WsApi_Response } from './deps/WsApi/WsApi.types';
3
4
  export interface SocketApi_Options_P {
@@ -5,7 +6,9 @@ export interface SocketApi_Options_P {
5
6
  listUrlsCheckConnectNetwork?: string[];
6
7
  }
7
8
  type SocketApi_StateProps_OR = 'isDisconnect' | 'isActiveReConnect' | 'isOfflineSocket' | 'isGotWasFirstConnection' | 'isStartCheckNetwork';
8
- export type SocketApi_StateProps_P = Record<SocketApi_StateProps_OR, boolean>;
9
+ export type SocketApi_StateProps_P = Record<SocketApi_StateProps_OR, boolean> & {
10
+ infoNetwork: NetworkStatusInfoTracker;
11
+ };
9
12
  export type SocketApi_StatusConnect_OR = WsApiE_StatusConnect_OR;
10
13
  export type BasePayloadSocket = {
11
14
  action: string;
package/dist/hooks.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import { useState as v, useRef as A, useEffect as l, useCallback as r } from "react";
2
2
  import { T as p } from "./index-DjJlkTF6.js";
3
3
  import { s as h } from "./index-B7GqTJat.js";
4
- const b = ({ defaultIsActive: c = !0, timer: n = 5e3, onDeActive: i }) => {
4
+ const b = ({ defaultIsActive: s = !0, timer: c = 5e3, onDeActive: n }) => {
5
5
  const [t, u] = v({
6
- isActive: c
7
- }), s = h(t, u), e = A(null);
8
- l(() => (e.current = new p(n, () => {
9
- i && i(), s({ isActive: !1 });
10
- }), c && e.current.startTime(), () => {
6
+ isActive: s
7
+ }), i = h(t, u), e = A(null);
8
+ l(() => (e.current = new p(c, () => {
9
+ n && n(), i({ isActive: !1 });
10
+ }), s && e.current.startTime(), () => {
11
11
  e.current && e.current.resetTime();
12
- }), [n, i]);
12
+ }), [c]);
13
13
  const a = r(() => {
14
- t.isActive || (s({ isActive: !0 }), e.current && (e.current.resetTime(), e.current.startTime()));
14
+ t.isActive || (i({ isActive: !0 }), e.current && (e.current.resetTime(), e.current.startTime()));
15
15
  }, [t.isActive]), m = r(() => {
16
16
  e.current && t.isActive && (e.current.resetTime(), e.current.startTime());
17
- }, [t.isActive]), f = r(() => {
18
- e.current && t.isActive && e.current.pauseTime();
19
17
  }, [t.isActive]), o = r(() => {
18
+ e.current && t.isActive && e.current.pauseTime();
19
+ }, [t.isActive]), f = r(() => {
20
20
  e.current && t.isActive && e.current.startTime();
21
21
  }, [t.isActive]), T = r(() => {
22
- s({ isActive: !1 }), e.current && e.current.resetTime();
22
+ i({ isActive: !1 }), e.current && e.current.resetTime();
23
23
  }, []);
24
24
  return {
25
25
  isActive: t.isActive,
26
26
  handleActive: a,
27
27
  handleResetTimer: m,
28
- handlePauseTimer: f,
29
- handleResumeTimer: o,
28
+ handlePauseTimer: o,
29
+ handleResumeTimer: f,
30
30
  handleDeActive: T
31
31
  };
32
32
  };
package/dist/socket.js CHANGED
@@ -35,7 +35,7 @@ const T = {
35
35
  getIsOfflineSocket: (o) => o.isOfflineSocket,
36
36
  getInfoNoConnectServer: (o) => o.infoNoConnectServer,
37
37
  getIsDisableConnectSocket: (o) => o.isDisableConnectSocket
38
- }, b = (o) => m(o), Q = M("span")({
38
+ }, w = (o) => m(o), Q = M("span")({
39
39
  backgroundColor: "rgba(0,0,0,0.3)",
40
40
  color: "#fff",
41
41
  display: "flex",
@@ -76,7 +76,7 @@ const T = {
76
76
  height: "100%"
77
77
  }
78
78
  })), j = ({ text: o = "Происходит подключение к серверу", className: e, ...t }) => {
79
- const n = b(R.getStatusConnectSocket), i = b(R.getStatusIsReConnectSocket);
79
+ const n = w(R.getStatusConnectSocket), i = w(R.getStatusIsReConnectSocket);
80
80
  return /* @__PURE__ */ D(
81
81
  Z,
82
82
  {
@@ -100,26 +100,26 @@ class ee {
100
100
  }, i = (u) => {
101
101
  t != null && t.controlAction && (t == null || t.controlAction(u));
102
102
  };
103
- let a = !0, l, c, f;
103
+ let c = !0, l, a, f;
104
104
  const S = (u = !0) => {
105
105
  const h = "Ручное завершение startActionEvery";
106
- a = !1, clearInterval(l), n(null), u ? c && c({ status: u, msg: h + ": (true)" }) : f && f({ status: u, msg: h + ": (false)" });
106
+ c = !1, clearInterval(l), n(null), u ? a && a({ status: u, msg: h + ": (true)" }) : f && f({ status: u, msg: h + ": (false)" });
107
107
  };
108
108
  return {
109
109
  promise: new Promise((u, h) => {
110
- c = u, f = h;
110
+ a = u, f = h;
111
111
  let y = 0, d = 0;
112
112
  l = setInterval(
113
113
  () => {
114
114
  if (y += t.interval, d += 1, t != null && t.cutoffTime && y > t.cutoffTime || t != null && t.countAction && (t == null ? void 0 : t.countAction) < d) {
115
- a = !1, clearInterval(l), n(null), h({ status: !1, msg: Error("Время загрузки истекло") });
115
+ c = !1, clearInterval(l), n(null), h({ status: !1, msg: Error("Время загрузки истекло") });
116
116
  return;
117
117
  }
118
- e() && (a = !1, clearInterval(l), n(null), u({ status: !0, msg: "cb вернул true" }));
118
+ e() && (c = !1, clearInterval(l), n(null), u({ status: !0, msg: "cb вернул true" }));
119
119
  },
120
120
  t.interval < 200 ? 200 : t.interval
121
121
  ), n(l), i({
122
- getIsActiveEvent: () => a,
122
+ getIsActiveEvent: () => c,
123
123
  stop: S
124
124
  });
125
125
  }),
@@ -131,24 +131,24 @@ class ee {
131
131
  e().then(() => {
132
132
  i === 1 && (i = 0);
133
133
  });
134
- let a = setInterval(() => {
135
- i === 1 && t(), clearInterval(a);
134
+ let c = setInterval(() => {
135
+ i === 1 && t(), clearInterval(c);
136
136
  }, n * 1e3);
137
137
  });
138
- r(this, "oneOfPromise", (e, t, { second: n }) => new Promise((i, a) => {
139
- let l = 1, c = { status: !1, msg: "" };
138
+ r(this, "oneOfPromise", (e, t, { second: n }) => new Promise((i, c) => {
139
+ let l = 1, a = { status: !1, msg: "" };
140
140
  e().then((S) => {
141
141
  l === 1 && (l = 0, i(S));
142
142
  }).catch((S) => {
143
- l === 1 && (l = 0, c.msg = S, a(S));
143
+ l === 1 && (l = 0, a.msg = S, c(S));
144
144
  });
145
145
  let f = setInterval(() => {
146
146
  if (l === 1) {
147
147
  if (l = 0, typeof t == "function") {
148
- a({ status: !1, msg: "", ...t(c) });
148
+ c({ status: !1, msg: "", ...t(a) });
149
149
  return;
150
150
  }
151
- a({ status: !1, msg: "oneOfPromise reject" });
151
+ c({ status: !1, msg: "oneOfPromise reject" });
152
152
  }
153
153
  clearInterval(f);
154
154
  }, n * 1e3);
@@ -207,9 +207,9 @@ class te {
207
207
  ["message", this.msgHandler],
208
208
  ["error", this.errHandler]
209
209
  ];
210
- for (let a = 0; a < t.length; a++) {
211
- const [l, c] = t[a];
212
- e === "add" ? (n = this.state.ws) == null || n.addEventListener(l, c) : (i = this.state.ws) == null || i.removeEventListener(l, c);
210
+ for (let c = 0; c < t.length; c++) {
211
+ const [l, a] = t[c];
212
+ e === "add" ? (n = this.state.ws) == null || n.addEventListener(l, a) : (i = this.state.ws) == null || i.removeEventListener(l, a);
213
213
  }
214
214
  });
215
215
  r(this, "openHandler", () => {
@@ -223,8 +223,8 @@ class te {
223
223
  try {
224
224
  const { action: n } = t, i = this.findDataRequestByAction(n);
225
225
  if (i) {
226
- const { cb: a, ...l } = i, { payload: c, ...f } = l;
227
- this.events.publish("msg", { ...t, request: { ...f, ...c } });
226
+ const { cb: c, ...l } = i, { payload: a, ...f } = l;
227
+ this.events.publish("msg", { ...t, request: { ...f, ...a } });
228
228
  } else
229
229
  this.events.publish("msg", t);
230
230
  n && this.filterSaveItemsByResponse(t);
@@ -261,7 +261,7 @@ class te {
261
261
  const e = this.initOptions;
262
262
  return e || this.errorInitSocket(), e;
263
263
  });
264
- r(this, "findDataRequestByAction", (e) => this.getItemsRequestSaveByAction(e).sort((i, a) => a.requestTime - i.requestTime)[0]);
264
+ r(this, "findDataRequestByAction", (e) => this.getItemsRequestSaveByAction(e).sort((i, c) => c.requestTime - i.requestTime)[0]);
265
265
  }
266
266
  resetState() {
267
267
  this.state = this.copyState(this.stateDefault);
@@ -275,8 +275,8 @@ class te {
275
275
  filterSaveItemsByResponse(e) {
276
276
  const t = this.getRequestSave(), n = [];
277
277
  for (let i = 0; i < t.length; i++) {
278
- const a = t[i];
279
- a.payload.action !== e.action ? n.push(a) : a.cb && a.cb(e);
278
+ const c = t[i];
279
+ c.payload.action !== e.action ? n.push(c) : c.cb && c.cb(e);
280
280
  }
281
281
  this.state.arrSaveReq = n;
282
282
  }
@@ -335,16 +335,16 @@ const s = class s {
335
335
  s.state.isDisconnect || (s.setState({ isDisconnect: !0 }), console.log("DISCONNECT WS"), s.wsApi.disconnect(), s.resetState(), s.events.resetSubscribers(), (e = this.networkTicker) == null || e.destroy());
336
336
  }
337
337
  static send(e, t) {
338
- const { action: n, ...i } = e, a = i != null && i.request_id ? i.request_id : W(), l = Date.now();
338
+ const { action: n, ...i } = e, c = i != null && i.request_id ? i.request_id : W(), l = Date.now();
339
339
  s.wsApi.setRequestSave({
340
340
  requestAction: n,
341
- request_id: a,
341
+ request_id: c,
342
342
  requestTime: l,
343
343
  payload: { action: n, ...i },
344
344
  cb: t
345
345
  });
346
- const c = s.wsApi.getSocket();
347
- if (!c || c.readyState !== 1) {
346
+ const a = s.wsApi.getSocket();
347
+ if (!a || a.readyState !== 1) {
348
348
  console.log("Нет подключения к сокету. Запрос сохранён в setRequestSave");
349
349
  return;
350
350
  }
@@ -355,16 +355,16 @@ const s = class s {
355
355
  }
356
356
  static async request(e, t = {}) {
357
357
  return new Promise((n, i) => {
358
- var d, g;
358
+ var d, b;
359
359
  if ((d = t == null ? void 0 : t.signal) != null && d.aborted) {
360
360
  i(new DOMException("Aborted", "AbortError"));
361
361
  return;
362
362
  }
363
- const a = e.action, l = e.request_id ? e.request_id : W(), c = Date.now();
363
+ const c = e.action, l = e.request_id ? e.request_id : W(), a = Date.now();
364
364
  s.wsApi.setRequestSave({
365
- requestAction: a,
365
+ requestAction: c,
366
366
  request_id: l,
367
- requestTime: c,
367
+ requestTime: a,
368
368
  payload: e,
369
369
  cb: void 0
370
370
  });
@@ -372,23 +372,23 @@ const s = class s {
372
372
  t != null && t.timeout && (f = setTimeout(() => {
373
373
  h(), i(new Error("Request timeout"));
374
374
  }, t.timeout));
375
- const S = (v) => {
376
- h(), i(v);
377
- }, C = (v) => {
375
+ const S = (p) => {
376
+ h(), i(p);
377
+ }, C = (p) => {
378
378
  var N;
379
- const I = this.wsApi.findDataRequestByAction(a);
380
- !I || ((N = v == null ? void 0 : v.request) == null ? void 0 : N.requestAction) !== I.requestAction || (h(), n({ ...v }));
379
+ const I = this.wsApi.findDataRequestByAction(c);
380
+ !I || ((N = p == null ? void 0 : p.request) == null ? void 0 : N.requestAction) !== I.requestAction || (h(), n({ ...p }));
381
381
  }, u = () => {
382
382
  h(), i(new DOMException("Aborted", "AbortError"));
383
383
  }, h = () => {
384
- var v;
385
- s.off("msg", C), s.off("error", S), f && clearTimeout(f), (v = t == null ? void 0 : t.signal) == null || v.removeEventListener("abort", u);
384
+ var p;
385
+ s.off("msg", C), s.off("error", S), f && clearTimeout(f), (p = t == null ? void 0 : t.signal) == null || p.removeEventListener("abort", u);
386
386
  };
387
- s.on("msg", C), s.on("error", S), (g = t == null ? void 0 : t.signal) == null || g.addEventListener("abort", u);
387
+ s.on("msg", C), s.on("error", S), (b = t == null ? void 0 : t.signal) == null || b.addEventListener("abort", u);
388
388
  const y = s.wsApi.getSocket();
389
389
  if (!y || y.readyState !== 1) {
390
- const v = "Нет подключения к сокету";
391
- console.error(v), h(), i(new Error(v));
390
+ const p = "Нет подключения к сокету";
391
+ console.error(p), h(), i(new Error(p));
392
392
  return;
393
393
  }
394
394
  s.wsApi.send(e);
@@ -400,8 +400,12 @@ r(s, "state", {
400
400
  isActiveReConnect: !1,
401
401
  isOfflineSocket: !0,
402
402
  isGotWasFirstConnection: !1,
403
- isStartCheckNetwork: !1
403
+ isStartCheckNetwork: !1,
404
404
  //не используеться
405
+ infoNetwork: {
406
+ isNetwork: !1,
407
+ typeNetwork: ""
408
+ }
405
409
  }), r(s, "options", {
406
410
  isReConnectNetworkOnline: !1,
407
411
  listUrlsCheckConnectNetwork: []
@@ -417,8 +421,8 @@ r(s, "state", {
417
421
  s.state.isActiveReConnect && s.stopReConnect(!1);
418
422
  }), r(s, "splitOptions", (e) => Object.entries(e).reduce(
419
423
  (t, [n, i]) => {
420
- const a = s.wsApi.getOptions();
421
- return n in a ? { ...t, WsOptions: { ...t.WsOptions, [n]: i } } : { ...t, SocketApiOptions: { ...t.SocketApiOptions, [n]: i } };
424
+ const c = s.wsApi.getOptions();
425
+ return n in c ? { ...t, WsOptions: { ...t.WsOptions, [n]: i } } : { ...t, SocketApiOptions: { ...t.SocketApiOptions, [n]: i } };
422
426
  },
423
427
  { WsOptions: {}, SocketApiOptions: {} }
424
428
  )), /*---------------------------------------------------------------------------------------------------------------------------*/
@@ -434,7 +438,8 @@ r(s, "setNetworkStatus", (e) => {
434
438
  }), r(s, "init", (e) => {
435
439
  const { WsOptions: t, SocketApiOptions: n } = s.splitOptions(e);
436
440
  s.networkTicker = new $(n.listUrlsCheckConnectNetwork ?? []), s.networkTicker.startEvents((i) => {
437
- s.setNetworkStatus(i);
441
+ const c = s.getState();
442
+ i.typeNetwork == c.infoNetwork.typeNetwork && i.isNetwork == c.infoNetwork.isNetwork || (s.setNetworkStatus(i), s.setState({ infoNetwork: i }));
438
443
  }), s.setOptions(n), s.wsApi.init(t), s.wsApi.events.subscribe("status", (i) => {
439
444
  s.setState({ isOfflineSocket: i !== "ready" });
440
445
  });
@@ -454,7 +459,7 @@ r(s, "socketReConnect", () => {
454
459
  watchIdInterval: (l) => {
455
460
  s.saveID.idReConnect = l;
456
461
  },
457
- controlAction: ({ stop: l, getIsActiveEvent: c }) => {
462
+ controlAction: ({ stop: l, getIsActiveEvent: a }) => {
458
463
  s.stopReConnect = l;
459
464
  }
460
465
  }
@@ -469,21 +474,21 @@ r(s, "socketReConnect", () => {
469
474
  });
470
475
  }
471
476
  });
472
- let p = s;
477
+ let v = s;
473
478
  const se = (o, e = {}) => {
474
- const t = o.action, { skip: n = !1, timeout: i = 5e3 } = e, [a, l] = B({
479
+ const t = o.action, { skip: n = !1, timeout: i = 5e3 } = e, [c, l] = B({
475
480
  data: null,
476
481
  error: "",
477
482
  isLoading: !1,
478
483
  isError: !1,
479
484
  isSuccess: !1
480
- }), c = b(R.getStatusReady), f = b(R.getStatusConnectSocket), S = x(null), C = x(e);
485
+ }), a = w(R.getStatusReady), f = w(R.getStatusConnectSocket), S = x(null), C = x(e);
481
486
  C.current = e;
482
487
  const u = A(async () => {
483
- var g, v, I, N;
488
+ var b, p, I, N;
484
489
  if (n) return;
485
- l((w) => ({
486
- ...w,
490
+ l((g) => ({
491
+ ...g,
487
492
  isLoading: !0,
488
493
  isError: !1,
489
494
  isSuccess: !1,
@@ -492,17 +497,17 @@ const se = (o, e = {}) => {
492
497
  })), S.current = new AbortController();
493
498
  const d = S.current.signal;
494
499
  try {
495
- const w = await p.request(o, { timeout: i, signal: d });
500
+ const g = await v.request(o, { timeout: i, signal: d });
496
501
  if (d.aborted) return;
497
502
  l((q) => ({
498
503
  ...q,
499
- data: w,
504
+ data: g,
500
505
  isSuccess: !0,
501
506
  isLoading: !1
502
- })), (v = (g = C.current).onSuccess) == null || v.call(g, w);
503
- } catch (w) {
507
+ })), (p = (b = C.current).onSuccess) == null || p.call(b, g);
508
+ } catch (g) {
504
509
  if (d.aborted) return;
505
- const q = w instanceof Error ? w.message : String(w);
510
+ const q = g instanceof Error ? g.message : String(g);
506
511
  l((J) => ({
507
512
  ...J,
508
513
  error: q,
@@ -511,59 +516,59 @@ const se = (o, e = {}) => {
511
516
  })), (N = (I = C.current).onError) == null || N.call(I, q);
512
517
  }
513
518
  }, [n, t, o, i]);
514
- O(() => (!n && c && u(), () => {
519
+ O(() => (!n && a && u(), () => {
515
520
  var d;
516
521
  (d = S.current) == null || d.abort();
517
- }), [u, n, c]), O(() => {
518
- !c && f === "pending" && l((d) => ({
522
+ }), [u, n, a]), O(() => {
523
+ !a && f === "pending" && l((d) => ({
519
524
  ...d,
520
525
  isError: !1,
521
526
  isSuccess: !1,
522
527
  error: "Потеряно соединение с сервером"
523
528
  }));
524
- }, [c, f]);
529
+ }, [a, f]);
525
530
  const h = A(() => {
526
531
  var d;
527
532
  return (d = S.current) == null || d.abort(), u();
528
533
  }, [u]), y = A(() => {
529
534
  var d;
530
- (d = S.current) == null || d.abort(), l((g) => ({ ...g, isLoading: !1 }));
535
+ (d = S.current) == null || d.abort(), l((b) => ({ ...b, isLoading: !1 }));
531
536
  }, []);
532
537
  return {
533
- ...a,
538
+ ...c,
534
539
  refetch: h,
535
540
  abort: y
536
541
  };
537
542
  }, Re = (o, e) => se(o, e), ne = (o) => {
538
- const { isModal: e } = b(R.getInfoNoConnectServer), t = b(R.getStatusIsReConnectSocket), n = b(R.getIsDisableConnectSocket), i = b(R.getStatusConnectSocket), [a, l] = B({
543
+ const { isModal: e } = w(R.getInfoNoConnectServer), t = w(R.getStatusIsReConnectSocket), n = w(R.getIsDisableConnectSocket), i = w(R.getStatusConnectSocket), [c, l] = B({
539
544
  isNetwork: !1,
540
545
  typeNetwork: ""
541
546
  });
542
- return O(() => (p.on("network", (c) => {
543
- console.log("network: ", c), l((f) => ({ ...f, isNetwork: c.isNetwork, typeNetwork: c.typeNetwork }));
544
- }), p.init(o.init), typeof o.onMount == "function" && o.onMount(), p.on("status", (c) => {
547
+ return O(() => (v.on("network", (a) => {
548
+ console.log("network: ", a), l((f) => ({ ...f, isNetwork: a.isNetwork, typeNetwork: a.typeNetwork }));
549
+ }), v.init(o.init), typeof o.onMount == "function" && o.onMount(), v.on("status", (a) => {
545
550
  const f = m.getState(), { isReadySocket: S, infoNoConnectServer: { isModal: C }, isOfflineSocket: u } = f;
546
- c !== "ready" && S && k.setStatusReady({ isReadySocket: !1 }), !S && c === "ready" && (k.setStatusReady({ isReadySocket: !0 }), C && u && (console.log("Вырубаем модалку т.к. сокет законектился после окончания timeOffReConnect"), k.setInfoNoConnectServer({ isModal: !1 }), k.setIsOfflineSocket({ isOfflineSocket: !1 }))), k.setStatusConnectSocket({ statusConnect: c });
547
- }), p.on("error", (c) => {
548
- console.log("error: ", c);
549
- }), p.on("reConnect", (c) => {
550
- console.log('on"reConnect" (status): ', c);
551
+ a !== "ready" && S && k.setStatusReady({ isReadySocket: !1 }), !S && a === "ready" && (k.setStatusReady({ isReadySocket: !0 }), C && u && (console.log("Вырубаем модалку т.к. сокет законектился после окончания timeOffReConnect"), k.setInfoNoConnectServer({ isModal: !1 }), k.setIsOfflineSocket({ isOfflineSocket: !1 }))), k.setStatusConnectSocket({ statusConnect: a });
552
+ }), v.on("error", (a) => {
553
+ console.log("error: ", a);
554
+ }), v.on("reConnect", (a) => {
555
+ console.log('on"reConnect" (status): ', a);
551
556
  const f = m.getState(), { isReConnectSocket: S, infoNoConnectServer: { isModal: C } } = f;
552
- S !== c && k.setStatusIsReConnectSocket({ isReConnectSocket: c }), C && c && k.setInfoNoConnectServer({ isModal: !1 });
553
- }), p.on("timeOffReConnect", (c) => {
554
- if (console.log("timeOffReConnect: ", c), k.setIsOfflineSocket({ isOfflineSocket: !c.status }), !c.status) {
557
+ S !== a && k.setStatusIsReConnectSocket({ isReConnectSocket: a }), C && a && k.setInfoNoConnectServer({ isModal: !1 });
558
+ }), v.on("timeOffReConnect", (a) => {
559
+ if (console.log("timeOffReConnect: ", a), k.setIsOfflineSocket({ isOfflineSocket: !a.status }), !a.status) {
555
560
  const f = m.getState(), { infoNoConnectServer: { isModal: S, isSelectOffline: C } } = f;
556
561
  let u = !1;
557
562
  !S && !C && (u = !0), u && k.setInfoNoConnectServer({ isModal: u });
558
563
  }
559
- }), p.connect(), () => {
560
- typeof o.onUnmount == "function" && o.onUnmount(), console.dir("disconnect"), p.disconnect();
564
+ }), v.connect(), () => {
565
+ typeof o.onUnmount == "function" && o.onUnmount(), console.dir("disconnect"), v.disconnect();
561
566
  }), []), O(() => {
562
- a.isNetwork && !n && !e && !t && ["close"].includes(i) && a.typeNetwork !== "none" && (console.log("Запущен socketReConnect"), p.socketReConnect());
563
- }, [n, e, t, i, a.typeNetwork, a.isNetwork]), O(() => {
564
- t && (!a.isNetwork || i === "ready") && (console.log("Запущен stopReConnect"), p.stopReConnect());
565
- }, [t, a.isNetwork, i]), O(() => {
566
- n && (console.log("isDisableConnectSocket: ", n), k.setIsOfflineSocket({ isOfflineSocket: !0 }), p.close());
567
+ c.isNetwork && !n && !e && !t && ["close"].includes(i) && c.typeNetwork !== "none" && (console.log("Запущен socketReConnect"), v.socketReConnect());
568
+ }, [n, e, t, i, c.typeNetwork, c.isNetwork]), O(() => {
569
+ t && (!c.isNetwork || i === "ready") && (console.log("Запущен stopReConnect"), v.stopReConnect());
570
+ }, [t, c.isNetwork, i]), O(() => {
571
+ n && (console.log("isDisableConnectSocket: ", n), k.setIsOfflineSocket({ isOfflineSocket: !0 }), v.close());
567
572
  }, [n]), null;
568
573
  }, oe = E.memo(ne), ie = M(P, {
569
574
  shouldForwardProp: (o) => ![""].includes(o)
@@ -576,14 +581,14 @@ const se = (o, e = {}) => {
576
581
  padding: "1px 10px"
577
582
  }
578
583
  })), re = ({ children: o, className: e, isNetwork: t, ...n }) => {
579
- const i = b(R.getIsOfflineSocket), a = b(R.getIsDisableConnectSocket), l = i || !t, c = "Оффлайн";
584
+ const i = w(R.getIsOfflineSocket), c = w(R.getIsDisableConnectSocket), l = i || !t, a = "Оффлайн";
580
585
  return /* @__PURE__ */ D(
581
586
  ie,
582
587
  {
583
588
  in: l,
584
589
  className: L("socket-offline", e),
585
590
  ...n,
586
- children: typeof o == "function" ? o({ isDisableConnectSocket: a }) : a ? `Режим ${c}` : c
591
+ children: typeof o == "function" ? o({ isDisableConnectSocket: c }) : c ? `Режим ${a}` : a
587
592
  }
588
593
  );
589
594
  }, ce = E.memo(re), ae = ({ children: o }) => {
@@ -596,7 +601,7 @@ const se = (o, e = {}) => {
596
601
  k.setInfoNoConnectServer({ isModal: !1, isSelectOffline: !0 }), k.setIsDisableConnectSocket({ isDisableConnectSocket: !0 });
597
602
  }, []);
598
603
  return o({ offlineActive: e });
599
- }, Se = E.memo(ue), be = {
604
+ }, Se = E.memo(ue), we = {
600
605
  ConnectDetection: _,
601
606
  OfflineDetection: ce,
602
607
  Buttons: {
@@ -606,12 +611,12 @@ const se = (o, e = {}) => {
606
611
  Initialization: oe
607
612
  };
608
613
  export {
609
- be as Socket,
610
- p as SocketApi,
614
+ we as Socket,
615
+ v as SocketApi,
611
616
  Re as createRequestSocketApi,
612
617
  k as socketActions,
613
618
  R as socketSelectors,
614
619
  m as socketStore,
615
620
  se as useRequestSocketApi,
616
- b as useSocketSelector
621
+ w as useSocketSelector
617
622
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rc-lib-ui",
3
3
  "private": false,
4
- "version": "1.3.5",
4
+ "version": "1.3.7",
5
5
  "author": "SinGlEBW",
6
6
  "license": "MIT",
7
7
  "type": "module",