@grasp-labs/ds-microfrontends-integration 0.24.2 → 0.25.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/groups/GroupGuard.d.ts +31 -0
- package/dist/components/groups/GroupsProvider.d.ts +1 -1
- package/dist/components/groups/index.d.ts +1 -1
- package/dist/components/schemaFields/DefaultFieldRenderer.d.ts +6 -0
- package/dist/components/schemaFields/SchemaFields.d.ts +5 -2
- package/dist/components/schemaFields/SchemaFields.stories.d.ts +8 -1
- package/dist/components/schemaFields/index.d.ts +2 -1
- package/dist/{index-DWI6fl0D.js → index-Cw60PS3o.js} +6521 -6482
- package/dist/{index.esm-fQDYRCEr-B_OscmDH.js → index.esm-fQDYRCEr-jok3LQJQ.js} +1 -1
- package/dist/index.js +37 -36
- package/dist/lib/schema/schemaResolver/utils.d.ts +4 -4
- package/dist/types/Navigation.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/groups/RouteGuard.d.ts +0 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as o } from "./index-
|
|
1
|
+
import { O as o } from "./index-Cw60PS3o.js";
|
|
2
2
|
import { useState as J, useEffect as De, createContext as Zt, useRef as ce, useContext as Gt, useMemo as le, useCallback as Re } from "react";
|
|
3
3
|
const $e = (e, t, n, r, a) => {
|
|
4
4
|
if (!r) throw new Error(a ?? `Invalid property path: ${t}
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { A as s, B as
|
|
1
|
+
import { A as s, B as l, D as r, c as t, E as i, F as u, a as d, G as o, J as n, L as F, N as g, S as c, T as m, d as p, V, i as h, j as v, f as D, k as S, w as f, y as P, H as b, m as x, n as y, l as G, o as T, x as E, p as L, g as N, C as R, q as A, s as I, t as j, v as B, z as C, r as H, u as J, b as O, e as k, h as q } from "./index-Cw60PS3o.js";
|
|
2
2
|
export {
|
|
3
3
|
s as ArrayField,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
i as
|
|
8
|
-
u as
|
|
9
|
-
d as
|
|
10
|
-
o as
|
|
11
|
-
n as
|
|
12
|
-
F as
|
|
13
|
-
g as
|
|
14
|
-
c as
|
|
15
|
-
m as
|
|
16
|
-
p as
|
|
17
|
-
V as
|
|
18
|
-
h as
|
|
19
|
-
v as
|
|
4
|
+
l as BooleanField,
|
|
5
|
+
r as DateField,
|
|
6
|
+
t as DefaultFieldRenderer,
|
|
7
|
+
i as EnumField,
|
|
8
|
+
u as FieldError,
|
|
9
|
+
d as GroupGuard,
|
|
10
|
+
o as GroupsProvider,
|
|
11
|
+
n as JsonField,
|
|
12
|
+
F as LanguageProvider,
|
|
13
|
+
g as NumberField,
|
|
14
|
+
c as SchemaFields,
|
|
15
|
+
m as TextField,
|
|
16
|
+
p as ToastProvider,
|
|
17
|
+
V as VaultField,
|
|
18
|
+
h as VaultInput,
|
|
19
|
+
v as VaultInputField,
|
|
20
|
+
D as VaultProvider,
|
|
20
21
|
S as VaultSecretDialog,
|
|
21
|
-
|
|
22
|
+
f as buildDefaultValues,
|
|
22
23
|
P as createFieldDescriptor,
|
|
23
24
|
b as createRuleHandler,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
x as defineNavigation,
|
|
26
|
+
y as extractConstraints,
|
|
27
|
+
G as extractPaths,
|
|
28
|
+
T as getArrayItemsSchema,
|
|
29
|
+
E as getDefaultValue,
|
|
30
|
+
L as getFieldType,
|
|
31
|
+
N as getLanguage,
|
|
32
|
+
R as getSchemaResolver,
|
|
33
|
+
A as isEnumField,
|
|
34
|
+
I as isNullable,
|
|
35
|
+
j as isObjectWithoutProperties,
|
|
36
|
+
B as isReadOnly,
|
|
37
|
+
C as parseSchemaFields,
|
|
38
|
+
H as resolveSchema,
|
|
39
|
+
J as useGroups,
|
|
40
|
+
O as useLanguage,
|
|
41
|
+
k as useToast,
|
|
42
|
+
q as useVault
|
|
42
43
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { FieldValues, Path } from 'react-hook-form';
|
|
1
2
|
import { CustomErrorHandler, ZodIssue } from 'src/types';
|
|
2
|
-
type Rule = {
|
|
3
|
-
path
|
|
3
|
+
export type Rule<TFieldValues extends FieldValues = FieldValues> = {
|
|
4
|
+
path?: Path<TFieldValues>;
|
|
4
5
|
code?: ZodIssue["code"];
|
|
5
6
|
when?: (issue: ZodIssue) => boolean;
|
|
6
7
|
message: string | ((issue: ZodIssue) => string);
|
|
7
8
|
};
|
|
8
|
-
export declare const createRuleHandler: (rules: Rule[]) => CustomErrorHandler;
|
|
9
|
+
export declare const createRuleHandler: <TFieldValues extends FieldValues = FieldValues>(rules: Rule<TFieldValues>[]) => CustomErrorHandler;
|
|
9
10
|
export declare const convertDatesToStringForValidation: (value: unknown) => unknown;
|
|
10
|
-
export {};
|
|
@@ -11,10 +11,10 @@ export type BaseItem = {
|
|
|
11
11
|
labelKey: string;
|
|
12
12
|
icon: IconName;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* When specified, the item should only be visible to users with
|
|
14
|
+
* Groups required to access this navigation item.
|
|
15
|
+
* When specified, the item should only be visible to users with all of the listed groups.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
requiredGroups?: string[];
|
|
18
18
|
};
|
|
19
19
|
export type RouteConfig = BaseItem & {
|
|
20
20
|
path: string;
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export type RouteGuardProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
requiredGroups: string | string[];
|
|
5
|
-
fallback?: ReactNode;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* RouteGuard component that conditionally renders children based on user groups.
|
|
9
|
-
*
|
|
10
|
-
* @param requiredGroups - Single group name or array of group names. If array, user needs at least one group.
|
|
11
|
-
* @param fallback - Optional component to render when access is denied
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* // User needs admin group
|
|
16
|
-
* <RouteGuard requiredGroups="admin">
|
|
17
|
-
* <AdminPanel />
|
|
18
|
-
* </RouteGuard>
|
|
19
|
-
*
|
|
20
|
-
* // User needs at least one of these groups
|
|
21
|
-
* <RouteGuard requiredGroups={['admin', 'moderator']}>
|
|
22
|
-
* <ModeratedContent />
|
|
23
|
-
* </RouteGuard>
|
|
24
|
-
*
|
|
25
|
-
* // With fallback
|
|
26
|
-
* <RouteGuard requiredGroups="admin" fallback={<AccessDenied />}>
|
|
27
|
-
* <AdminPanel />
|
|
28
|
-
* </RouteGuard>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare const RouteGuard: ({ children, requiredGroups, fallback, }: RouteGuardProps) => ReactNode;
|