react-ecosistema-unp 1.7.0-pre.3 → 1.7.0-pre.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.
@@ -1 +1 @@
1
- .title-container{display:flex;gap:1rem;align-items:center;align-content:center}.logo-subtitle-container{height:100%;display:flex;gap:.66rem;align-items:center}.red-section{height:60px;width:10px;background-color:#d13c47;border-top-right-radius:7px;border-bottom-right-radius:7px}.img-logo{height:52px;object-fit:cover}.title{font-weight:500;font-size:1.55rem;color:#232323}.subtitle{font-size:1.05rem;color:#3f3f3f}.subtitle-container{display:flex;flex-direction:column}
1
+ .title-container{display:flex;gap:1rem;align-items:center;align-content:center}.logo-subtitle-container{height:100%;display:flex;gap:.66rem;align-items:center}.red-section{height:60px;width:10px;background-color:#d13c47;border-top-right-radius:7px;border-bottom-right-radius:7px}.img-logo{height:52px;object-fit:cover}.title{font-weight:500;font-size:1.55rem;color:#232323}.subtitle{font-size:1.05rem;color:#3f3f3f}.title{font-weight:500;font-size:clamp(1rem,2.5vw,1.55rem);color:#232323}.subtitle{font-size:clamp(.8rem,2vw,1.05rem);color:#3f3f3f}.subtitle-container{display:flex;flex-direction:column}
@@ -1 +1 @@
1
- .table_container{display:flex;flex-direction:column;gap:1.5rem;text-align:center;margin-top:.75rem}.table-scroll{position:relative;max-height:70vh;overflow-y:auto;overflow-x:auto;margin-right:5px;margin-left:5px;border-radius:10px;box-shadow:0 2px 12px #00000016;background:#f9fafa}.table-scroll th,.table-scroll td{white-space:nowrap;word-wrap:normal;min-width:100px;padding-left:15px;padding-right:15px}.table-scroll::-webkit-scrollbar{width:20px}.table-scroll::-webkit-scrollbar-track{background:linear-gradient(to bottom right,#f9fafa,#f9fafa,#fff);border-top-right-radius:10px;border-bottom-right-radius:10px}.table-scroll::-webkit-scrollbar-thumb{background-color:#303d50;border-radius:10px;border:6px solid transparent;background-clip:padding-box}thead tr th{background-color:#fff!important;border-bottom:1px solid #DEE2E6!important;position:sticky;top:0;z-index:2}.table td,.table th{text-align:center;vertical-align:middle}.table{margin-bottom:0!important}.table-header-unp{background-color:#f9fafa!important;color:#2c2c2c!important;font-weight:600;font-size:1.1rem;padding:1.25rem 0!important}.cell-with-modal{transition:background-color .3s ease}.cell-with-modal:hover{background-color:#303d50!important;color:#fff;font-weight:600}.data-count,.data-unp{font-weight:500;font-size:.85rem;margin-top:1rem;margin-left:5px;margin-right:5px;color:#8c8c8f}.animation-container{gap:2rem;height:73vh;display:flex;flex-direction:column;justify-content:center;align-items:center;color:#919191}@media (min-width: 1800px){.table-scroll{max-height:75vh}}.search-column-input{border-radius:11px!important;padding-right:40px!important;box-shadow:0 1px 6px #00000012!important}.cell-redirect:hover{background-color:#303d50;color:#fff;font-weight:600;cursor:pointer}
1
+ .table_container{display:flex;flex-direction:column;gap:1.5rem;text-align:center}.table-scroll{position:relative;max-height:70vh;overflow-y:auto;overflow-x:auto;margin-right:5px;margin-left:5px;border-radius:10px;box-shadow:0 2px 12px #00000016;background:#f9fafa}@media (max-height: 780px){.table-scroll{max-height:65vh!important}}@media (max-height: 670px){.table-scroll{max-height:60vh!important}}@media (max-height: 590px){.table-scroll{max-height:55vh!important}}@media (max-height: 520px){.table-scroll{max-height:50vh!important}}@media (max-height: 470px){.table-scroll{max-height:40vh!important}}.table-scroll th,.table-scroll td{white-space:nowrap;word-wrap:normal;min-width:100px;padding-left:15px;padding-right:15px}.table-scroll::-webkit-scrollbar{width:16px}.table-scroll::-webkit-scrollbar-track{background:linear-gradient(to bottom right,#f9fafa,#f9fafa,#fff);border-top-right-radius:10px;border-bottom-right-radius:10px}.table-scroll::-webkit-scrollbar-thumb{background-color:#303d50;border-radius:10px;border:6px solid transparent;background-clip:padding-box}thead tr th{background-color:#fff!important;border-bottom:1px solid #DEE2E6!important;position:sticky;top:0;z-index:2}.table td,.table th{text-align:center;vertical-align:middle}.table{margin-bottom:0!important}.table-header-unp{background-color:#f9fafa!important;color:#2c2c2c!important;font-weight:600;font-size:1.1rem;padding:1.25rem 0!important}.cell-with-modal{transition:background-color .3s ease}.cell-with-modal:hover{background-color:#303d50!important;color:#fff;font-weight:600}.data-count,.data-unp{font-weight:500;font-size:.85rem;margin-top:1rem;margin-left:5px;margin-right:5px;color:#8c8c8f}.animation-container{gap:2rem;height:73vh;display:flex;flex-direction:column;justify-content:center;align-items:center;color:#919191}@media (min-width: 1800px){.table-scroll{max-height:75vh}}.search-column-input{border-radius:11px!important;padding-right:40px!important;box-shadow:0 1px 6px #00000012!important}.cell-redirect:hover{background-color:#3c2970;color:#fff;font-weight:600;cursor:pointer}
@@ -4,8 +4,5 @@ declare const AuthContext: React.Context<AuthContextType | undefined>;
4
4
  interface AuthProviderProps {
5
5
  children: ReactNode;
6
6
  }
7
- /**
8
- * @deprecated since version 1.7.x
9
- */
10
7
  declare const AuthProvider: React.FC<AuthProviderProps>;
11
8
  export { AuthContext, AuthProvider };
@@ -2,8 +2,17 @@ import { default as React, ReactNode } from 'react';
2
2
  export type ConnectionStatus = 'connected' | 'connecting' | 'disconnected';
3
3
  interface WebSocketContextType {
4
4
  connectionStatus: ConnectionStatus;
5
+ /**
6
+ * @deprecated función experimental, no se recomienda su uso.
7
+ */
5
8
  connectWebSocket: (url: string) => void;
9
+ /**
10
+ * @deprecated función experimental, no se recomienda su uso.
11
+ */
6
12
  disconnectWebSocket: () => void;
13
+ /**
14
+ * @deprecated función experimental, no se recomienda su uso.
15
+ */
7
16
  sendWebSocketMessage: (data: any) => void;
8
17
  }
9
18
  export declare const WebSocketProvider: React.FC<{
@@ -1,14 +1,14 @@
1
- import { jsx as h } from "react/jsx-runtime";
2
- import { useState as m, useEffect as p } from "react";
3
- import { useNavigate as w, useLocation as u, Outlet as k } from "react-router-dom";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as u } from "react";
3
+ import { useNavigate as p, useLocation as w, Outlet as k } from "react-router-dom";
4
4
  import { j as v } from "../../index-CuHybtft.js";
5
- const V = () => {
6
- const [i, e] = m(!1), r = w(), c = u(), o = `${window.location.protocol}//${window.location.host}/`;
7
- return p(() => {
5
+ const $ = () => {
6
+ const [r, t] = h(!1), i = p(), c = w(), e = `${window.location.protocol}//${window.location.host}/`;
7
+ return u(() => {
8
8
  (async () => {
9
9
  try {
10
10
  if ((await fetch(
11
- `${o}api-auth/auth/validate_jwt/`,
11
+ `${e}api-auth/auth/validate_jwt/`,
12
12
  {
13
13
  method: "POST",
14
14
  headers: {
@@ -17,25 +17,24 @@ const V = () => {
17
17
  credentials: "include"
18
18
  }
19
19
  )).ok) {
20
- const n = sessionStorage.getItem("user_token");
21
- if (n) {
22
- const l = v(n).datos_basicos.servicios.map((t) => t.url).filter((t) => !!t), s = c.pathname, d = l.map(
23
- (t) => t.startsWith("/") ? t : `/${t}`
24
- ), f = s.startsWith("/") ? s : `/${s}`;
25
- d.some(
26
- (t) => f.startsWith(t)
27
- ) ? e(!0) : (e(!1), window.location.href = o);
20
+ const a = sessionStorage.getItem("user_token");
21
+ if (a) {
22
+ const l = v(a).datos_basicos.servicios.map((o) => o.url).filter((o) => !!o), s = c.pathname, m = l.map(
23
+ (o) => o.startsWith("/") ? o : `/${o}`
24
+ ), d = s.startsWith("/") ? s : `/${s}`;
25
+ m.some(
26
+ (o) => d.startsWith(o)
27
+ ) ? t(!0) : (t(!1), sessionStorage.removeItem("user_token"), window.location.href = e);
28
28
  } else
29
- e(!1), window.location.href = o;
29
+ t(!1), sessionStorage.removeItem("user_token"), window.location.href = e;
30
30
  } else
31
- window.location.href = o;
32
- } catch (a) {
33
- console.error("Validation error:", a), window.location.href = o;
34
- } finally {
31
+ sessionStorage.removeItem("user_token"), window.location.href = e;
32
+ } catch (n) {
33
+ console.error("Validation error:", n), sessionStorage.removeItem("user_token"), window.location.href = e;
35
34
  }
36
35
  })();
37
- }, [r]), i ? /* @__PURE__ */ h(k, {}) : null;
36
+ }, [i]), r ? /* @__PURE__ */ f(k, {}) : null;
38
37
  };
39
38
  export {
40
- V as ProtectedRoute
39
+ $ as ProtectedRoute
41
40
  };
@@ -1,13 +1,13 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useState as i, useEffect as s } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useState as a, useEffect as i } from "react";
3
3
  import { useNavigate as l, Outlet as c } from "react-router-dom";
4
- const h = () => {
5
- const [e, n] = i(!1), r = l(), o = `${window.location.protocol}//${window.location.host}/`;
6
- return s(() => {
4
+ const p = () => {
5
+ const [t, r] = a(!1), n = l(), e = `${window.location.protocol}//${window.location.host}/`;
6
+ return i(() => {
7
7
  (async () => {
8
8
  try {
9
9
  if ((await fetch(
10
- `${o}/auth/validate/`,
10
+ `${e}/auth/validate/`,
11
11
  {
12
12
  method: "POST",
13
13
  headers: {
@@ -16,16 +16,15 @@ const h = () => {
16
16
  credentials: "include"
17
17
  }
18
18
  )).ok)
19
- n(!0);
19
+ r(!0);
20
20
  else
21
- return window.location.href = o;
22
- } catch (t) {
23
- return console.error("Validation error:", t), window.location.href = o;
24
- } finally {
21
+ return sessionStorage.removeItem("user_token"), window.location.href = e;
22
+ } catch (o) {
23
+ return console.error("Validation error:", o), sessionStorage.removeItem("user_token"), window.location.href = e;
25
24
  }
26
25
  })();
27
- }, [r]), e ? /* @__PURE__ */ a(c, {}) : null;
26
+ }, [n]), t ? /* @__PURE__ */ s(c, {}) : null;
28
27
  };
29
28
  export {
30
- h as UserRoute
29
+ p as UserRoute
31
30
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-ecosistema-unp",
3
3
  "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
4
  "private": false,
5
- "version": "1.7.0-pre.3",
5
+ "version": "1.7.0-pre.5",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {