@variamosple/variamos-components 0.2.5 → 0.4.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/README.md +29 -42
- package/dist/Common/Events.d.ts +3 -2
- package/dist/Common/Events.js +18 -11
- package/dist/Common/fieldOf.d.ts +2 -0
- package/dist/Common/fieldOf.js +7 -0
- package/dist/Common/isAllowedFor.d.ts +7 -0
- package/dist/Common/isAllowedFor.js +9 -0
- package/dist/Components/AuthWrapper/index.js +6 -6
- package/dist/Components/ConfirmationModal/index.js +3 -3
- package/dist/Components/Footer/index.js +1 -1
- package/dist/Components/Header/BugFormModal.d.ts +2 -0
- package/dist/Components/Header/BugFormModal.js +39 -37
- package/dist/Components/Header/HeaderOptions.js +79 -86
- package/dist/Components/Header/MenuItem.js +24 -34
- package/dist/Components/Header/SubHeader.js +17 -29
- package/dist/Components/Header/index.js +25 -13
- package/dist/Components/Header/submitBugReport.d.ts +14 -0
- package/dist/Components/Header/submitBugReport.js +22 -0
- package/dist/Components/NotAuthorized/index.js +1 -1
- package/dist/Components/Notifications/NotificationBell.js +10 -10
- package/dist/Components/Notifications/NotificationCard.d.ts +9 -0
- package/dist/Components/Notifications/NotificationCard.js +81 -0
- package/dist/Components/Notifications/NotificationDrawer.js +139 -191
- package/dist/Components/Notifications/NotificationSettings.js +32 -28
- package/dist/Components/Notifications/mutedEventTypes.js +9 -9
- package/dist/Components/Notifications/notificationText.d.ts +7 -0
- package/dist/Components/Notifications/notificationText.js +38 -0
- package/dist/Components/Paginator/index.js +22 -22
- package/dist/Components/ProtectedRoute/index.js +18 -18
- package/dist/Components/index.d.ts +1 -1
- package/dist/Components/index.js +10 -10
- package/dist/Context/AnalyticsContext.d.ts +2 -2
- package/dist/Context/AnalyticsContext.js +15 -15
- package/dist/Context/MenuContext.js +39 -47
- package/dist/Context/NotificationContext.d.ts +2 -14
- package/dist/Context/NotificationContext.js +393 -458
- package/dist/Context/SessionContext.js +72 -78
- package/dist/Context/index.d.ts +1 -1
- package/dist/Context/index.js +11 -11
- package/dist/Context/notificationAccessToken.d.ts +1 -3
- package/dist/Context/notificationAccessToken.js +15 -19
- package/dist/Context/notificationApi.d.ts +43 -0
- package/dist/Context/notificationApi.js +83 -0
- package/dist/Context/storedSessionToken.d.ts +8 -0
- package/dist/Context/storedSessionToken.js +11 -0
- package/dist/Context/useNotificationState.d.ts +35 -0
- package/dist/Context/useNotificationState.js +92 -0
- package/dist/Hooks/useDebouncedValue.js +20 -16
- package/dist/Hooks/usePaginatedQuery.js +14 -20
- package/dist/Hooks/useQuery.js +6 -6
- package/dist/Model/ResponseModel.d.ts +2 -2
- package/dist/Model/ResponseModel.js +9 -4
- package/dist/Model/SessionInfoResponse.d.ts +0 -1
- package/dist/main.js +21 -21
- package/package.json +19 -17
package/dist/Hooks/useQuery.js
CHANGED
|
@@ -2,18 +2,18 @@ import { useState as t, useCallback as g } from "react";
|
|
|
2
2
|
function D({
|
|
3
3
|
queryFunction: a
|
|
4
4
|
}) {
|
|
5
|
-
const [
|
|
6
|
-
(s) => (u(s), e(!0), a(s).then((
|
|
7
|
-
e(!1),
|
|
5
|
+
const [l, o] = t(), [n, u] = t(null), [d, e] = t(!1), [i, c] = t(!1), [f] = t(null), L = g(
|
|
6
|
+
(s) => (u(s), e(!0), a(s).then((r) => (o(r.data), r)).finally(() => {
|
|
7
|
+
e(!1), c(!0);
|
|
8
8
|
})),
|
|
9
9
|
[a]
|
|
10
10
|
);
|
|
11
11
|
return {
|
|
12
|
-
data:
|
|
12
|
+
data: l,
|
|
13
13
|
loadData: L,
|
|
14
|
-
filter:
|
|
14
|
+
filter: n,
|
|
15
15
|
isLoading: d,
|
|
16
|
-
isLoaded:
|
|
16
|
+
isLoaded: i,
|
|
17
17
|
error: f
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -3,8 +3,8 @@ export declare class ResponseModel<Type> {
|
|
|
3
3
|
errorCode?: number | undefined;
|
|
4
4
|
message?: string | undefined;
|
|
5
5
|
totalCount?: number | undefined;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
constructor(transactionId?: string | undefined, errorCode?: number | undefined, message?: string | undefined, totalCount?: number | undefined);
|
|
7
|
+
data?: Type;
|
|
8
8
|
withData(data: Type): this;
|
|
9
9
|
withError(errorCode: number, errorMessage: string): this;
|
|
10
10
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var i = Object.defineProperty;
|
|
2
|
+
var h = (r, t, s) => t in r ? i(r, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[t] = s;
|
|
3
|
+
var e = (r, t, s) => h(r, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
class d {
|
|
5
|
+
// The data is set with withData: a fifth parameter was never passed
|
|
6
|
+
constructor(t, s, o, a) {
|
|
7
|
+
e(this, "data");
|
|
8
|
+
this.transactionId = t, this.errorCode = s, this.message = o, this.totalCount = a;
|
|
4
9
|
}
|
|
5
10
|
withData(t) {
|
|
6
11
|
return this.data = t, this;
|
|
@@ -10,5 +15,5 @@ class a {
|
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
17
|
export {
|
|
13
|
-
|
|
18
|
+
d as ResponseModel
|
|
14
19
|
};
|
package/dist/main.js
CHANGED
|
@@ -4,16 +4,16 @@ import { confirmationModalDefaultProps as p } from "./Components/ConfirmationMod
|
|
|
4
4
|
import { Footer as m } from "./Components/Footer/index.js";
|
|
5
5
|
import { Header as a } from "./Components/Header/index.js";
|
|
6
6
|
import { NotAuthorized as u } from "./Components/NotAuthorized/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { NotificationBell as l } from "./Components/Notifications/NotificationBell.js";
|
|
8
|
+
import { NotificationDrawer as c } from "./Components/Notifications/NotificationDrawer.js";
|
|
9
|
+
import { NotificationSettings as N } from "./Components/Notifications/NotificationSettings.js";
|
|
10
|
+
import { Paginator as M } from "./Components/Paginator/index.js";
|
|
11
|
+
import { ProtectedRoute as y } from "./Components/ProtectedRoute/index.js";
|
|
12
12
|
import { AnalyticsContext as R, AnalyticsProvider as V, PAGE_VISIT_EVENT as b } from "./Context/AnalyticsContext.js";
|
|
13
13
|
import { MenuContext as E, MenuContextProvider as S, useMenu as T } from "./Context/MenuContext.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { NotificationProvider as w, useNotifications as B } from "./Context/NotificationContext.js";
|
|
15
|
+
import { RouterContext as Q, getBasePath as U, isAbsoluteUrl as W, useRouter as _ } from "./Context/RouterContext.js";
|
|
16
|
+
import { SessionProvider as F, useSession as G } from "./Context/SessionContext.js";
|
|
17
17
|
import { withPageVisit as j } from "./HOC/WithPageVisit.js";
|
|
18
18
|
import { useDebouncedValue as q } from "./Hooks/useDebouncedValue.js";
|
|
19
19
|
import { usePageVisibility as K } from "./Hooks/usePageVisibility.js";
|
|
@@ -35,29 +35,29 @@ export {
|
|
|
35
35
|
E as MenuContext,
|
|
36
36
|
S as MenuContextProvider,
|
|
37
37
|
u as NotAuthorized,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
l as NotificationBell,
|
|
39
|
+
c as NotificationDrawer,
|
|
40
|
+
w as NotificationProvider,
|
|
41
|
+
N as NotificationSettings,
|
|
42
42
|
b as PAGE_VISIT_EVENT,
|
|
43
43
|
eo as PagedModel,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
M as Paginator,
|
|
45
|
+
y as ProtectedRoute,
|
|
46
46
|
to as ResponseModel,
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
Q as RouterContext,
|
|
48
|
+
F as SessionProvider,
|
|
49
49
|
xo as UserRegistration,
|
|
50
50
|
p as confirmationModalDefaultProps,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
U as getBasePath,
|
|
52
|
+
W as isAbsoluteUrl,
|
|
53
53
|
fo as mapToWebTarget,
|
|
54
54
|
q as useDebouncedValue,
|
|
55
55
|
T as useMenu,
|
|
56
|
-
|
|
56
|
+
B as useNotifications,
|
|
57
57
|
K as usePageVisibility,
|
|
58
58
|
O as usePaginatedQuery,
|
|
59
59
|
Y as useQuery,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
_ as useRouter,
|
|
61
|
+
G as useSession,
|
|
62
62
|
j as withPageVisit
|
|
63
63
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variamosple/variamos-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -14,10 +14,16 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"dev": "vite",
|
|
16
16
|
"build": "tsc --p ./tsconfig.lib.json && vite build",
|
|
17
|
-
"
|
|
17
|
+
"check-package": "node scripts/check-package.mjs && publint --strict",
|
|
18
|
+
"typecheck": "tsc --noEmit -p tsconfig.app.json && tsc --noEmit -p tsconfig.lib.json && tsc --noEmit -p tsconfig.node.json",
|
|
19
|
+
"lint": "biome check --error-on-warnings . && node scripts/check-suppressions.mjs",
|
|
20
|
+
"format": "biome format --write .",
|
|
21
|
+
"find-deadcode": "knip",
|
|
18
22
|
"preview": "vite preview",
|
|
19
23
|
"test": "vitest run",
|
|
20
|
-
"prepack": "npm run build"
|
|
24
|
+
"prepack": "npm run build",
|
|
25
|
+
"spell": "cspell --no-progress --dot --gitignore \"**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs,json,jsonc,css,md,yml,yaml,sh}\"",
|
|
26
|
+
"prepare": "husky"
|
|
21
27
|
},
|
|
22
28
|
"peerDependencies": {
|
|
23
29
|
"react": "^18.3.1 || ^19.0.0",
|
|
@@ -29,31 +35,27 @@
|
|
|
29
35
|
"socket.io-client": "^4.8.1"
|
|
30
36
|
},
|
|
31
37
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
38
|
+
"@biomejs/biome": "^2.6.7",
|
|
39
|
+
"@commitlint/cli": "^21.2.4",
|
|
40
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
41
|
+
"@types/node": "^26.6.6",
|
|
34
42
|
"@types/react": "^19.2.18",
|
|
35
|
-
"@types/react-bootstrap": "^0.32.37",
|
|
36
43
|
"@types/react-dom": "^19.2.4",
|
|
37
44
|
"@vitejs/plugin-react": "^4.3.4",
|
|
38
|
-
"
|
|
39
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
40
|
-
"eslint-plugin-react-refresh": "^0.4.18",
|
|
45
|
+
"cspell": "^10.5.0",
|
|
41
46
|
"glob": "^14.0.4",
|
|
42
|
-
"
|
|
47
|
+
"husky": "^9.1.7",
|
|
48
|
+
"knip": "^6.45.1",
|
|
49
|
+
"lint-staged": "^17.6.0",
|
|
50
|
+
"publint": "^0.3.25",
|
|
43
51
|
"react": "^19.2.8",
|
|
44
52
|
"react-dom": "^19.2.8",
|
|
45
|
-
"typescript": "
|
|
46
|
-
"typescript-eslint": "^8.22.0",
|
|
53
|
+
"typescript": "^6.0.3",
|
|
47
54
|
"vite": "^6.4.5",
|
|
48
55
|
"vite-plugin-dts": "^5.1.2",
|
|
49
56
|
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
50
57
|
"vitest": "^4.1.12"
|
|
51
58
|
},
|
|
52
|
-
"overrides": {
|
|
53
|
-
"@typescript-eslint/typescript-estree": {
|
|
54
|
-
"minimatch": "^11.0.1"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
59
|
"allowScripts": {
|
|
58
60
|
"esbuild@0.25.12": true
|
|
59
61
|
}
|