@lanaqi/rsr 0.0.2 → 0.0.3
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 +46 -28
- package/dist/access/blocker.d.ts +3 -3
- package/dist/access/resource.d.ts +5 -5
- package/dist/access/storer.d.ts +3 -3
- package/dist/bridge.d.ts +2 -2
- package/dist/index.js +815 -374
- package/dist/security/blocker.d.ts +5 -10
- package/dist/security/context.d.ts +9 -0
- package/dist/security/index.d.ts +4 -0
- package/dist/security/provider.d.ts +8 -14
- package/dist/warpper/permission.d.ts +5 -9
- package/package.json +19 -15
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { type ComponentType, type PropsWithChildren } from 'react';
|
|
2
|
-
import { type SecurityBundler } from './provider';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param children 子组件
|
|
6
|
-
* @constructor
|
|
2
|
+
* 安全阻断器组件属性
|
|
7
3
|
*/
|
|
8
|
-
export
|
|
4
|
+
export interface SecurityBlockerProps extends React.PropsWithChildren {
|
|
5
|
+
}
|
|
9
6
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param Component 组件
|
|
12
|
-
* @param bundler 打包器
|
|
7
|
+
* 安全阻断器组件
|
|
13
8
|
*/
|
|
14
|
-
export declare
|
|
9
|
+
export declare function SecurityBlocker({ children }: SecurityBlockerProps): import("react").ReactNode;
|
package/dist/security/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
2
1
|
import type { AccessProvider } from '../access';
|
|
3
2
|
import { AccessGuarderBuilder } from '../builder';
|
|
4
3
|
/**
|
|
@@ -6,26 +5,21 @@ import { AccessGuarderBuilder } from '../builder';
|
|
|
6
5
|
*/
|
|
7
6
|
export type SecurityBundler = (builder: AccessGuarderBuilder) => AccessProvider;
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* 安全提供者组件属性
|
|
10
9
|
*/
|
|
11
|
-
export
|
|
10
|
+
export interface SecurityProviderProps extends React.PropsWithChildren {
|
|
12
11
|
/**
|
|
13
12
|
* 打包器
|
|
14
13
|
*/
|
|
15
14
|
readonly bundler: SecurityBundler;
|
|
16
|
-
}
|
|
15
|
+
}
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export declare const SecurityContext: import("react").Context<AccessProvider | null>;
|
|
21
|
-
/**
|
|
22
|
-
* 安全上下文钩子
|
|
17
|
+
* 安全提供者组件
|
|
23
18
|
*/
|
|
24
|
-
export declare
|
|
19
|
+
export declare function SecurityProvider({ children, bundler }: SecurityProviderProps): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
25
20
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param
|
|
21
|
+
* 安全阻断器包装
|
|
22
|
+
* @param Component 组件
|
|
28
23
|
* @param bundler 打包器
|
|
29
|
-
* @constructor
|
|
30
24
|
*/
|
|
31
|
-
export declare
|
|
25
|
+
export declare const withSecurityBlocker: (Component: React.ComponentType, bundler: SecurityBundler) => () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import type { ComponentType, PropsWithChildren } from 'react';
|
|
2
1
|
import type { AccessPermission, AccessPermissions } from '../access';
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* 拥有权限组件属性
|
|
5
4
|
*/
|
|
6
|
-
export
|
|
5
|
+
export interface HavePermissionProps extends React.PropsWithChildren {
|
|
7
6
|
/**
|
|
8
7
|
* 条件
|
|
9
8
|
*/
|
|
10
9
|
readonly term: AccessPermission | AccessPermissions;
|
|
11
|
-
}
|
|
10
|
+
}
|
|
12
11
|
/**
|
|
13
12
|
* 拥有权限组件
|
|
14
|
-
* @param children 子组件
|
|
15
|
-
* @param term 条件
|
|
16
|
-
* @constructor
|
|
17
13
|
*/
|
|
18
|
-
export declare function HavePermission({ children, term }:
|
|
14
|
+
export declare function HavePermission({ children, term }: HavePermissionProps): import("react").ReactNode;
|
|
19
15
|
/**
|
|
20
16
|
* 拥有权限包装
|
|
21
17
|
* @param Component 组件
|
|
22
18
|
* @param term 条件
|
|
23
19
|
*/
|
|
24
|
-
export declare const withHavePermission: (Component: ComponentType, term: AccessPermission | AccessPermissions) => () => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const withHavePermission: (Component: React.ComponentType, term: AccessPermission | AccessPermissions) => () => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lanaqi/rsr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"module": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
-
"files": [
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
14
16
|
"keywords": [
|
|
15
17
|
"react",
|
|
16
18
|
"router",
|
|
@@ -24,7 +26,7 @@
|
|
|
24
26
|
"router-guard",
|
|
25
27
|
"react-router-guard",
|
|
26
28
|
"react-router",
|
|
27
|
-
"react-router
|
|
29
|
+
"react-router",
|
|
28
30
|
"modern-js",
|
|
29
31
|
"modernjs",
|
|
30
32
|
"auth",
|
|
@@ -53,20 +55,22 @@
|
|
|
53
55
|
"release": "npm run build && npm publish"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
|
-
"@biomejs/biome": "
|
|
57
|
-
"@rsbuild/plugin-
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@types/react
|
|
61
|
-
"react": "^19.2.
|
|
62
|
-
"react-
|
|
63
|
-
"react
|
|
64
|
-
"
|
|
58
|
+
"@biomejs/biome": "2.4.15",
|
|
59
|
+
"@rsbuild/plugin-babel": "^1.1.2",
|
|
60
|
+
"@rsbuild/plugin-react": "^2.0.0",
|
|
61
|
+
"@rslib/core": "0.21.5",
|
|
62
|
+
"@types/react": "^19.2.14",
|
|
63
|
+
"@types/react-dom": "^19.2.3",
|
|
64
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
65
|
+
"react": "^19.2.6",
|
|
66
|
+
"react-dom": "^19.2.6",
|
|
67
|
+
"react-router": "^7.15.1",
|
|
68
|
+
"typescript": "^6.0.3"
|
|
65
69
|
},
|
|
66
70
|
"peerDependencies": {
|
|
67
|
-
"react": ">=
|
|
68
|
-
"react-dom": ">=
|
|
69
|
-
"react-router
|
|
71
|
+
"react": ">=19.0.0",
|
|
72
|
+
"react-dom": ">=19.0.0",
|
|
73
|
+
"react-router": "^7.0.0"
|
|
70
74
|
},
|
|
71
75
|
"private": false,
|
|
72
76
|
"publishConfig": {
|