zcw-shared 2.22.1 → 2.22.2

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.
@@ -0,0 +1,10 @@
1
+ export declare const TAILWIND_MD_MIN_WIDTH_PX: 768;
2
+ export declare const BELOW_MD_MAX_WIDTH_PX: 767;
3
+ export declare const BELOW_MD_MEDIA_QUERY: "(max-width: 767px)";
4
+ export interface IsBelowMdViewportDeps {
5
+ matchMedia?: (query: string) => {
6
+ matches: boolean;
7
+ };
8
+ innerWidth?: number;
9
+ }
10
+ export declare function isBelowMdViewport(deps: IsBelowMdViewportDeps): boolean;
@@ -0,0 +1,13 @@
1
+ export const TAILWIND_MD_MIN_WIDTH_PX = 768;
2
+ export const BELOW_MD_MAX_WIDTH_PX = 767;
3
+ export const BELOW_MD_MEDIA_QUERY = `(max-width: ${BELOW_MD_MAX_WIDTH_PX}px)`;
4
+ export function isBelowMdViewport(deps) {
5
+ if (deps.matchMedia) {
6
+ return deps.matchMedia(BELOW_MD_MEDIA_QUERY).matches;
7
+ }
8
+ if (deps.innerWidth != null) {
9
+ return deps.innerWidth <= BELOW_MD_MAX_WIDTH_PX;
10
+ }
11
+ return false;
12
+ }
13
+ //# sourceMappingURL=isBelowMdViewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBelowMdViewport.js","sourceRoot":"","sources":["../../../src/functions/browser/isBelowMdViewport.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAY,CAAA;AAGpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAY,CAAA;AAGjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,qBAAqB,KAAc,CAAA;AAoBtF,MAAM,UAAU,iBAAiB,CAAC,IAA2B;IAC3D,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAA;IACtD,CAAC;IACD,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,UAAU,IAAI,qBAAqB,CAAA;IACjD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcw-shared",
3
- "version": "2.22.1",
3
+ "version": "2.22.2",
4
4
  "files": [
5
5
  "references",
6
6
  "dist",
@@ -12,19 +12,6 @@
12
12
  "license": "ISC",
13
13
  "type": "module",
14
14
  "description": "",
15
- "scripts": {
16
- "build": "tsc -p tsconfig.build.json && tsx scripts/generate-exports.ts",
17
- "publish:patch": "npx tsx scripts/publish.ts patch",
18
- "publish:minor": "npx tsx scripts/publish.ts minor",
19
- "publish:major": "npx tsx scripts/publish.ts major",
20
- "publish:prerelease": "npx tsx scripts/publish.ts prerelease",
21
- "docs:dev": "vitepress dev docs",
22
- "docs:build": "NODE_OPTIONS=--max-old-space-size=4096 vitepress build docs",
23
- "docs:preview": "vitepress preview docs",
24
- "deploy:cos:build": "NODE_OPTIONS=--max-old-space-size=4096 vitepress build docs",
25
- "deploy:tcb": "npx tsx scripts/deploy-tcb.ts",
26
- "deploy:cos": "npx tsx scripts/deploy-cos.ts"
27
- },
28
15
  "dependencies": {
29
16
  "zod": "^3.23.8"
30
17
  },
@@ -124,6 +111,7 @@
124
111
  "./functions/auth/parseJwtPayload": "./dist/functions/auth/parseJwtPayload.js",
125
112
  "./functions/browser/detectBrowser": "./dist/functions/browser/detectBrowser.js",
126
113
  "./functions/browser/detectOS": "./dist/functions/browser/detectOS.js",
114
+ "./functions/browser/isBelowMdViewport": "./dist/functions/browser/isBelowMdViewport.js",
127
115
  "./functions/browser/isElectron": "./dist/functions/browser/isElectron.js",
128
116
  "./functions/browser/isMobile": "./dist/functions/browser/isMobile.js",
129
117
  "./functions/browser/isWeChat": "./dist/functions/browser/isWeChat.js",
@@ -488,5 +476,18 @@
488
476
  "./types/video": "./types/video.d.ts",
489
477
  "./types/vue": "./types/vue.d.ts",
490
478
  "./types/worker": "./types/worker.d.ts"
479
+ },
480
+ "scripts": {
481
+ "build": "tsc -p tsconfig.build.json && tsx scripts/generate-exports.ts",
482
+ "publish:patch": "npx tsx scripts/publish.ts patch",
483
+ "publish:minor": "npx tsx scripts/publish.ts minor",
484
+ "publish:major": "npx tsx scripts/publish.ts major",
485
+ "publish:prerelease": "npx tsx scripts/publish.ts prerelease",
486
+ "docs:dev": "vitepress dev docs",
487
+ "docs:build": "NODE_OPTIONS=--max-old-space-size=4096 vitepress build docs",
488
+ "docs:preview": "vitepress preview docs",
489
+ "deploy:cos:build": "NODE_OPTIONS=--max-old-space-size=4096 vitepress build docs",
490
+ "deploy:tcb": "npx tsx scripts/deploy-tcb.ts",
491
+ "deploy:cos": "npx tsx scripts/deploy-cos.ts"
491
492
  }
492
493
  }
package/types/rbac.d.ts CHANGED
@@ -6,19 +6,34 @@ export interface Role {
6
6
  createdAt: string
7
7
  }
8
8
 
9
- export interface Permission {
10
- id: string
9
+ /** 权限目录项(来自 API 代码注册表,无 DB id) */
10
+ export interface PermissionCatalogItem {
11
11
  code: string
12
12
  name: string
13
13
  module: string
14
+ groupKey: string
15
+ groupLabel: string
14
16
  description?: string
15
17
  }
16
18
 
19
+ export interface PermissionGroupCatalog {
20
+ key: string
21
+ label: string
22
+ module: string
23
+ permissions: Array<{
24
+ code: string
25
+ name: string
26
+ description?: string
27
+ }>
28
+ }
29
+
17
30
  export interface AssignUserRolesPayload {
18
31
  roleIds: string[]
19
32
  }
20
33
 
21
34
  export interface AssignRolePermissionsPayload {
22
- permissionIds: string[]
35
+ permissionCodes: string[]
23
36
  }
24
37
 
38
+ /** @deprecated 使用 PermissionCatalogItem */
39
+ export type Permission = PermissionCatalogItem