@variamosple/variamos-components 0.0.23 → 0.1.0
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/Components/AuthWrapper/index.js +18 -38
- package/dist/Components/ConfirmationModal/index.d.ts +1 -1
- package/dist/Components/ConfirmationModal/index.js +19 -280
- package/dist/Components/Footer/index.js +6 -6
- package/dist/Components/Header/BugFormModal.d.ts +14 -0
- package/dist/Components/Header/BugFormModal.js +100 -0
- package/dist/Components/Header/HeaderOptions.js +85 -31
- package/dist/Components/Header/MenuItem.js +19 -20
- package/dist/Components/Header/SubHeader.js +35 -9
- package/dist/Components/Header/index.js +24 -25
- package/dist/Components/NotAuthorized/index.js +10 -11
- package/dist/Components/Paginator/index.js +56 -128
- package/dist/Components/ProtectedRoute/index.js +10 -10
- package/dist/Context/AnalyticsContext.js +7 -7
- package/dist/Context/MenuContext.js +16 -16
- package/dist/Context/SessionContext.js +35 -35
- package/dist/HOC/WithPageVisit.d.ts +1 -1
- package/dist/HOC/WithPageVisit.js +6 -6
- package/dist/assets/index.css +1 -1
- package/package.json +10 -7
- package/dist/AbstractModalHeader-UzCRSxIO.js +0 -1690
- package/dist/Anchor-DJG5WYYF.js +0 -40
- package/dist/Button-DWo2Fl71.js +0 -78
- package/dist/Button-GQJKgb76.js +0 -33
- package/dist/Container-BLjzOisH.js +0 -22
- package/dist/Nav-CdxSljzW.js +0 -144
- package/dist/NavDropdown-AuV3RgfC.js +0 -1764
- package/dist/NavLink-ebvp1HCw.js +0 -173
- package/dist/SubHeader-gTVD9DIX.js +0 -481
- package/dist/ThemeProvider-Q3gZ4GF2.js +0 -72
- package/dist/jsx-runtime-Drh4NO5G.js +0 -633
- package/dist/useEventCallback-Bfo0-hwZ.js +0 -16
- package/dist/useMergedRefs-BpAaCckn.js +0 -16
- package/dist/useWindow-rGE2GXIv.js +0 -118
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext as K, useState as
|
|
3
|
-
import { Events as
|
|
4
|
-
import { usePageVisibility as
|
|
5
|
-
const y = K(void 0),
|
|
6
|
-
d &&
|
|
1
|
+
import { jsx as G } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as K, useState as T, useEffect as k, useContext as N } from "react";
|
|
3
|
+
import { Events as V } from "../Common/Events.js";
|
|
4
|
+
import { usePageVisibility as z } from "../Hooks/usePageVisibility.js";
|
|
5
|
+
const y = K(void 0), x = "guestId", f = (d) => {
|
|
6
|
+
d && V.publish("variamosNavigate", d);
|
|
7
7
|
}, m = (d) => {
|
|
8
8
|
d && localStorage.setItem("authToken", d);
|
|
9
|
-
},
|
|
9
|
+
}, J = ({
|
|
10
10
|
loginUrl: d,
|
|
11
|
-
getSessionInfo:
|
|
11
|
+
getSessionInfo: e,
|
|
12
12
|
requestSignUp: v,
|
|
13
13
|
requestSignIn: w,
|
|
14
14
|
requestSignInAsGuest: C,
|
|
15
15
|
requestLogout: P,
|
|
16
16
|
children: b
|
|
17
17
|
}) => {
|
|
18
|
-
const [E, t] =
|
|
19
|
-
|
|
20
|
-
c(!0),
|
|
18
|
+
const [E, t] = T(null), [A, c] = T(!0), g = !!E, I = z();
|
|
19
|
+
k(() => {
|
|
20
|
+
c(!0), e().then((o) => {
|
|
21
21
|
var a, n, i;
|
|
22
22
|
o != null && o.errorCode ? t(null) : (m((a = o == null ? void 0 : o.data) == null ? void 0 : a.authToken), t(((n = o == null ? void 0 : o.data) == null ? void 0 : n.user) ?? null), f((i = o == null ? void 0 : o.data) == null ? void 0 : i.redirect));
|
|
23
23
|
}).catch(() => {
|
|
24
24
|
t(null);
|
|
25
25
|
}).finally(() => c(!1));
|
|
26
|
-
}, [
|
|
27
|
-
if (g &&
|
|
26
|
+
}, [e]), k(() => {
|
|
27
|
+
if (g && I) {
|
|
28
28
|
const o = () => {
|
|
29
|
-
|
|
30
|
-
var i, r,
|
|
31
|
-
n != null && n.errorCode ? t(null) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((
|
|
29
|
+
e().then((n) => {
|
|
30
|
+
var i, r, h;
|
|
31
|
+
n != null && n.errorCode ? t(null) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((h = n == null ? void 0 : n.data) == null ? void 0 : h.redirect));
|
|
32
32
|
}).catch(() => {
|
|
33
33
|
t(null);
|
|
34
34
|
});
|
|
@@ -39,28 +39,28 @@ const y = K(void 0), k = "guestId", f = (d) => {
|
|
|
39
39
|
}, 6e4);
|
|
40
40
|
return () => clearInterval(a);
|
|
41
41
|
}
|
|
42
|
-
}, [g,
|
|
43
|
-
const
|
|
42
|
+
}, [g, I, e]);
|
|
43
|
+
const L = (o) => {
|
|
44
44
|
if (!v)
|
|
45
45
|
throw new Error("requestSignUp is not defined.");
|
|
46
46
|
return c(!0), v(o).finally(() => c(!1));
|
|
47
|
-
},
|
|
47
|
+
}, U = (o) => {
|
|
48
48
|
if (!w)
|
|
49
49
|
throw new Error("requestSignIn is not defined.");
|
|
50
|
-
return c(!0), w(o).then((a) => a != null && a.errorCode ? a :
|
|
51
|
-
var i, r,
|
|
52
|
-
return n != null && n.errorCode ? (t(null), a.withError(n.errorCode, n.message)) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((
|
|
50
|
+
return c(!0), w(o).then((a) => a != null && a.errorCode ? a : e().then((n) => {
|
|
51
|
+
var i, r, h;
|
|
52
|
+
return n != null && n.errorCode ? (t(null), a.withError(n.errorCode, n.message)) : (m((i = n == null ? void 0 : n.data) == null ? void 0 : i.authToken), t(((r = n == null ? void 0 : n.data) == null ? void 0 : r.user) ?? null), f((h = n == null ? void 0 : n.data) == null ? void 0 : h.redirect)), a;
|
|
53
53
|
}).catch(() => (t(null), a.withError(500, "Sign in error.")))).finally(() => c(!1));
|
|
54
|
-
},
|
|
54
|
+
}, j = () => {
|
|
55
55
|
if (!C)
|
|
56
56
|
throw new Error("requestSignInAsGuest is not defined.");
|
|
57
57
|
c(!0);
|
|
58
|
-
const o = localStorage.getItem(
|
|
58
|
+
const o = localStorage.getItem(x);
|
|
59
59
|
return C(o).then((a) => {
|
|
60
60
|
var n;
|
|
61
|
-
return a != null && a.errorCode ? a : (localStorage.setItem(
|
|
62
|
-
var r,
|
|
63
|
-
return i != null && i.errorCode ? (t(null), a.withError(i.errorCode, i.message)) : (m((r = i == null ? void 0 : i.data) == null ? void 0 : r.authToken), t(((
|
|
61
|
+
return a != null && a.errorCode ? a : (localStorage.setItem(x, ((n = a == null ? void 0 : a.data) == null ? void 0 : n.id) || ""), e().then((i) => {
|
|
62
|
+
var r, h, S;
|
|
63
|
+
return i != null && i.errorCode ? (t(null), a.withError(i.errorCode, i.message)) : (m((r = i == null ? void 0 : i.data) == null ? void 0 : r.authToken), t(((h = i == null ? void 0 : i.data) == null ? void 0 : h.user) ?? null), f((S = i == null ? void 0 : i.data) == null ? void 0 : S.redirect)), a;
|
|
64
64
|
}).catch(() => (t(null), a.withError(500, "Sign in error."))));
|
|
65
65
|
}).finally(() => c(!1));
|
|
66
66
|
}, q = () => {
|
|
@@ -70,28 +70,28 @@ const y = K(void 0), k = "guestId", f = (d) => {
|
|
|
70
70
|
}, 200);
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
return /* @__PURE__ */ G
|
|
73
|
+
return /* @__PURE__ */ G(
|
|
74
74
|
y.Provider,
|
|
75
75
|
{
|
|
76
76
|
value: {
|
|
77
77
|
user: E,
|
|
78
78
|
isAuthenticated: g,
|
|
79
79
|
logout: q,
|
|
80
|
-
signUp:
|
|
81
|
-
signIn:
|
|
82
|
-
signInAsGuest:
|
|
83
|
-
isLoading:
|
|
80
|
+
signUp: L,
|
|
81
|
+
signIn: U,
|
|
82
|
+
signInAsGuest: j,
|
|
83
|
+
isLoading: A
|
|
84
84
|
},
|
|
85
85
|
children: b
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
|
-
},
|
|
88
|
+
}, M = () => {
|
|
89
89
|
const d = N(y);
|
|
90
90
|
if (d === void 0)
|
|
91
91
|
throw new Error("useSession must be used within a SessionProvider");
|
|
92
92
|
return d;
|
|
93
93
|
};
|
|
94
94
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
J as SessionProvider,
|
|
96
|
+
M as useSession
|
|
97
97
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare function withPageVisit<T extends object>(WrappedComponent: React.ComponentType<T>, id: string): (props: T) =>
|
|
2
|
+
export declare function withPageVisit<T extends object>(WrappedComponent: React.ComponentType<T>, id: string): (props: T) => React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import e from "react";
|
|
3
3
|
import { Events as m } from "../Common/Events.js";
|
|
4
4
|
import { PAGE_VISIT_EVENT as f } from "../Context/AnalyticsContext.js";
|
|
5
|
-
function E(
|
|
6
|
-
return (o) => (
|
|
7
|
-
m.publish(f, { id:
|
|
8
|
-
}, []), /* @__PURE__ */
|
|
5
|
+
function E(r, t) {
|
|
6
|
+
return (o) => (e.useEffect(() => {
|
|
7
|
+
m.publish(f, { id: t });
|
|
8
|
+
}, []), /* @__PURE__ */ i(r, { ...o }));
|
|
9
9
|
}
|
|
10
10
|
export {
|
|
11
11
|
E as withPageVisit
|
package/dist/assets/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._footer_cvhpi_1{height:50px;min-height:50px;background-color:var(--dark-color-font);color:#fff;text-align:center;margin-top:auto;display:flex;justify-content:center;align-items:center}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variamosple/variamos-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"prepack": "npm run build"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"react": "^18.3.1",
|
|
22
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
23
23
|
"react-bootstrap": "^2.10.9",
|
|
24
24
|
"react-bootstrap-icons": "^1.11.5",
|
|
25
|
-
"react-dom": "^18.3.1"
|
|
25
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@variamosple/variamos-components": "file:"
|
|
@@ -30,21 +30,24 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@eslint/js": "^9.19.0",
|
|
32
32
|
"@types/node": "^22.13.4",
|
|
33
|
-
"@types/react": "^
|
|
33
|
+
"@types/react": "^19.2.18",
|
|
34
34
|
"@types/react-bootstrap": "^0.32.37",
|
|
35
|
-
"@types/react-dom": "^
|
|
35
|
+
"@types/react-dom": "^19.2.4",
|
|
36
36
|
"@vitejs/plugin-react": "^4.3.4",
|
|
37
37
|
"eslint": "^9.19.0",
|
|
38
38
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
39
39
|
"eslint-plugin-react-refresh": "^0.4.18",
|
|
40
40
|
"glob": "^11.0.1",
|
|
41
41
|
"globals": "^15.14.0",
|
|
42
|
-
"react": "^
|
|
43
|
-
"react-dom": "^
|
|
42
|
+
"react": "^19.2.8",
|
|
43
|
+
"react-dom": "^19.2.8",
|
|
44
44
|
"typescript": "~5.7.2",
|
|
45
45
|
"typescript-eslint": "^8.22.0",
|
|
46
46
|
"vite": "^6.1.0",
|
|
47
47
|
"vite-plugin-dts": "^4.5.0",
|
|
48
48
|
"vite-plugin-lib-inject-css": "^2.2.1"
|
|
49
|
+
},
|
|
50
|
+
"allowScripts": {
|
|
51
|
+
"esbuild@0.25.12": true
|
|
49
52
|
}
|
|
50
53
|
}
|