izen-react-starter 2.6.6 → 2.6.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/README.md +18 -1
- package/dist/{2SSKDMRQ-DwuBdJst.js → 2SSKDMRQ-CPBYAtDa.js} +2 -2
- package/dist/{AP7HFJJL-BQ7-oeqZ.js → AP7HFJJL-jrKNrw7_.js} +1 -1
- package/dist/{WDYDFRGG-D2D8oewI.js → WDYDFRGG-D_luAdZf.js} +2 -2
- package/dist/{index-Cgfpj5x7.js → index-CfJZ-Sh7.js} +1678 -1679
- package/dist/react-starter.js +1 -1
- package/dist/react-starter.umd.cjs +51 -51
- package/dist/src/components/modals/PopupModal.d.ts.map +1 -1
- package/dist/src/rbac/RBACProvider.d.ts +6 -2
- package/dist/src/rbac/RBACProvider.d.ts.map +1 -1
- package/dist/src/rbac/access-rules.d.ts +1 -0
- package/dist/src/rbac/access-rules.d.ts.map +1 -1
- package/dist/src/rbac/useAccessControl.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A modern React component library built with Vite, TypeScript, and best practices
|
|
|
4
4
|
|
|
5
5
|
## Changelog
|
|
6
6
|
|
|
7
|
-
- 2026-01-12: Added `DashboardLayout` component with integrated `AppSidebar`, header, and overlay support. Sidebar now supports `collapsible: 'icon'` for desktop toggle and `'offcanvas'` for mobile sheet behavior. Updated `ApiService` interface to include `setTokenGetter` method for token management.
|
|
7
|
+
- 2026-01-12: Added `publicResources` prop to `RBACConfig` for defining resources accessible without authentication. The `useAccessControl` hook now checks `publicResources` first, allowing guest access to specified resources. Added `DashboardLayout` component with integrated `AppSidebar`, header, and overlay support. Sidebar now supports `collapsible: 'icon'` for desktop toggle and `'offcanvas'` for mobile sheet behavior. Updated `ApiService` interface to include `setTokenGetter` method for token management.
|
|
8
8
|
- 2026-01-02: `BrowserRouter` removed from inside `AppProvider`. Consumers must wrap `AppProvider` (and any `react-router-dom` usage) in their own router at the app root.
|
|
9
9
|
|
|
10
10
|
## Features
|
|
@@ -887,6 +887,7 @@ import {
|
|
|
887
887
|
const rbacConfig: RBACConfig = {
|
|
888
888
|
roles: ['admin', 'editor', 'viewer'],
|
|
889
889
|
resources: ['posts', 'comments', 'users'],
|
|
890
|
+
publicResources: ['auth', 'public'], // Resources accessible without authentication
|
|
890
891
|
rules: {
|
|
891
892
|
admin: {
|
|
892
893
|
[CommonActions.Manage]: { can: 'all' },
|
|
@@ -904,6 +905,10 @@ const rbacConfig: RBACConfig = {
|
|
|
904
905
|
viewer: {
|
|
905
906
|
[CommonActions.Read]: { can: 'all' },
|
|
906
907
|
},
|
|
908
|
+
guest: {
|
|
909
|
+
[CommonActions.Create]: { can: ['auth'] }, // Guest can create auth (register/login)
|
|
910
|
+
[CommonActions.Read]: { can: ['public'] }, // Guest can read public resources
|
|
911
|
+
},
|
|
907
912
|
},
|
|
908
913
|
};
|
|
909
914
|
|
|
@@ -934,6 +939,18 @@ function AdminPanel() {
|
|
|
934
939
|
);
|
|
935
940
|
}
|
|
936
941
|
|
|
942
|
+
// Public resources are automatically accessible without authentication
|
|
943
|
+
function PublicForm() {
|
|
944
|
+
const { isAllowed } = useAccessControl();
|
|
945
|
+
|
|
946
|
+
// This returns true even if user is not authenticated, because 'auth' is in publicResources
|
|
947
|
+
if (isAllowed('create', 'auth')) {
|
|
948
|
+
return <RegistrationForm />;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
return null;
|
|
952
|
+
}
|
|
953
|
+
|
|
937
954
|
// Using the wrapper component
|
|
938
955
|
function Dashboard() {
|
|
939
956
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-
|
|
2
|
-
import { g as h, c as v, a as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-jrKNrw7_.js";
|
|
2
|
+
import { g as h, c as v, a as e } from "./index-CfJZ-Sh7.js";
|
|
3
3
|
var C = (r) => {
|
|
4
4
|
const [t, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var xs = Object.defineProperty;
|
|
2
2
|
var $s = (e, t, n) => t in e ? xs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Re = (e, t, n) => $s(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-
|
|
4
|
+
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-CfJZ-Sh7.js";
|
|
5
5
|
var zs = (e) => e != null, Ks = (e) => e.filter(zs);
|
|
6
6
|
function Bs(e) {
|
|
7
7
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-
|
|
2
|
-
import { g as d, c as f, a as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-jrKNrw7_.js";
|
|
2
|
+
import { g as d, c as f, a as e } from "./index-CfJZ-Sh7.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|