react-toolkits 2.24.20 → 2.26.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +10 -5
  2. package/README.md +5 -19
  3. package/lib/chunk-24U2EF5M.js +2 -0
  4. package/lib/chunk-24U2EF5M.js.map +1 -0
  5. package/lib/chunk-5QAEUAZE.js +2 -0
  6. package/lib/chunk-5QAEUAZE.js.map +1 -0
  7. package/lib/chunk-D5YXBSTI.js +2 -0
  8. package/lib/chunk-D5YXBSTI.js.map +1 -0
  9. package/lib/chunk-F2GDEOP4.js +3 -0
  10. package/lib/chunk-F2GDEOP4.js.map +1 -0
  11. package/lib/chunk-FIT6S4UM.js +2 -0
  12. package/lib/{chunk-F3OT6ENF.js.map → chunk-FIT6S4UM.js.map} +1 -1
  13. package/lib/chunk-IKGXKB6T.js +2 -0
  14. package/lib/chunk-IKGXKB6T.js.map +1 -0
  15. package/lib/chunk-JDCSIJL7.js +2 -0
  16. package/lib/chunk-JDCSIJL7.js.map +1 -0
  17. package/lib/chunk-KZHYK554.js +2 -0
  18. package/lib/chunk-KZHYK554.js.map +1 -0
  19. package/lib/chunk-MVG7YFPB.js +2 -0
  20. package/lib/chunk-MVG7YFPB.js.map +1 -0
  21. package/lib/createMenuItem-Q5TJGFKZ.js +2 -0
  22. package/lib/createMenuItem-Q5TJGFKZ.js.map +1 -0
  23. package/lib/index.css +1 -1
  24. package/lib/index.d.ts +88 -60
  25. package/lib/index.js +2 -2
  26. package/lib/index.js.map +1 -1
  27. package/lib/menuItemList-2QZXJVWZ.js +2 -0
  28. package/lib/menuItemList-2QZXJVWZ.js.map +1 -0
  29. package/lib/roleDetail-ODJVDVB4.js +2 -0
  30. package/lib/roleDetail-ODJVDVB4.js.map +1 -0
  31. package/lib/roleList-MQOFJ3LH.js +2 -0
  32. package/lib/roleList-MQOFJ3LH.js.map +1 -0
  33. package/lib/updateMenuItem-4HDRJAY7.js +2 -0
  34. package/lib/updateMenuItem-4HDRJAY7.js.map +1 -0
  35. package/lib/userDetail-B5H4A4X2.js +2 -0
  36. package/lib/userDetail-B5H4A4X2.js.map +1 -0
  37. package/lib/userList-QHQHRPSV.js +2 -0
  38. package/lib/userList-QHQHRPSV.js.map +1 -0
  39. package/locale/hooks.js +1 -1
  40. package/locale/hooks.js.map +1 -1
  41. package/package.json +9 -9
  42. package/lib/chunk-3VI7KSDA.js +0 -2
  43. package/lib/chunk-3VI7KSDA.js.map +0 -1
  44. package/lib/chunk-3ZT3BOPJ.js +0 -3
  45. package/lib/chunk-3ZT3BOPJ.js.map +0 -1
  46. package/lib/chunk-D5OM3OZU.js +0 -2
  47. package/lib/chunk-D5OM3OZU.js.map +0 -1
  48. package/lib/chunk-F3OT6ENF.js +0 -2
  49. package/lib/chunk-FD52RBG7.js +0 -2
  50. package/lib/chunk-FD52RBG7.js.map +0 -1
  51. package/lib/chunk-IWPBGSXS.js +0 -2
  52. package/lib/chunk-IWPBGSXS.js.map +0 -1
  53. package/lib/chunk-S4LUEDFA.js +0 -2
  54. package/lib/chunk-S4LUEDFA.js.map +0 -1
  55. package/lib/chunk-SMBHLRAO.js +0 -2
  56. package/lib/chunk-SMBHLRAO.js.map +0 -1
  57. package/lib/chunk-XX2BCZJU.js +0 -2
  58. package/lib/chunk-XX2BCZJU.js.map +0 -1
  59. package/lib/createMenuItem-5DDIEELO.js +0 -2
  60. package/lib/createMenuItem-5DDIEELO.js.map +0 -1
  61. package/lib/menuItemList-4ZLZ7HSG.js +0 -2
  62. package/lib/menuItemList-4ZLZ7HSG.js.map +0 -1
  63. package/lib/roleDetail-42BOHDFS.js +0 -2
  64. package/lib/roleDetail-42BOHDFS.js.map +0 -1
  65. package/lib/roleList-KWWO3IFL.js +0 -2
  66. package/lib/roleList-KWWO3IFL.js.map +0 -1
  67. package/lib/updateMenuItem-E5QMBR2S.js +0 -2
  68. package/lib/updateMenuItem-E5QMBR2S.js.map +0 -1
  69. package/lib/userDetail-L7Q3C67K.js +0 -2
  70. package/lib/userDetail-L7Q3C67K.js.map +0 -1
  71. package/lib/userList-IU4L5YRJ.js +0 -2
  72. package/lib/userList-IU4L5YRJ.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/modules/permission/services/index.ts"],"names":["useAllRoles","ky","useKy","useQuery","queryKeys","useRole","name","permissionMode","useToolkitsStore","useCreateRole","queryClient","useQueryClient","useMutation","permissions","useUpdateRole","id","useRemoveRole","useCreateUser","arg","hasPermissions","obj","requestData","transformedPermissions","item","useUpdateUser","state","useRemoveUser","useAllPermissions","useAllPermissionsV2"],"mappings":"gHASO,SAASA,CAAAA,EAAc,CAC5B,IAAMC,CAAAA,CAAKC,GAAM,CACjB,OAAOC,QAAAA,CAAS,CACd,QAAA,CAAUC,CAAAA,CAAU,KAAA,CAAM,GAAA,CAC1B,OAAA,CAAS,IAAMH,CAAAA,CAAG,GAAA,CAAoB,uBAAuB,CAC/D,CAAC,CACH,CAEO,SAASI,CAAAA,CAAQC,CAAAA,CAAc,CACpC,IAAML,GAAAA,CAAKC,CAAAA,EAAM,CACX,CACJ,OAAA,CAAS,CAAE,cAAA,CAAAK,CAAe,CAC5B,CAAA,CAAIC,CAAAA,GAEJ,OAAOL,QAAAA,CAAS,CACd,QAAA,CAAUC,CAAAA,CAAU,KAAA,CAAM,MAAA,CAAOE,CAAAA,CAAMC,CAAc,CAAA,CACrD,OAAA,CAAS,IACPN,GAAAA,CAAG,GAAA,CACD,CAAA,kBAAA,EAAqBM,CAAAA,GAAmB,cAA6B,MAAA,CAAS,QAAQ,CAAA,MAAA,EAASD,CAAI,CAAA,CACrG,CACJ,CAAC,CACH,CAEO,SAASG,CAAAA,EAAgB,CAC9B,IAAMR,CAAAA,CAAKC,CAAAA,EAAM,CACXQ,IAAcC,cAAAA,EAAe,CAC7B,CACJ,OAAA,CAAS,CAAE,cAAA,CAAAJ,CAAe,CAC5B,CAAA,CAAIC,CAAAA,EAAiB,CAErB,OA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B,WAAA,CAAaR,CAAAA,CAAU,KAAA,CAAM,MAAA,CAC7B,UAAA,CAAY,CAAC,CAAE,EAAA,CAAAW,CAAAA,CAAI,IAAA,CAAAT,CAAK,CAAA,GAAoCL,EAAG,IAAA,CAAK,0BAAA,CAA4B,CAAE,EAAA,CAAAc,CAAAA,CAAI,IAAA,CAAAT,CAAK,CAAC,CAAA,CAC5G,SAAA,CAAW,IAAM,CACfI,CAAAA,CAAY,iBAAA,CAAkB,CAAE,QAAA,CAAUN,EAAU,KAAA,CAAM,GAAI,CAAC,EACjE,CACF,CAAC,CACH,CAEO,SAASuB,CAAAA,EAAoB,CAClC,IAAM1B,CAAAA,CAAKC,CAAAA,EAAM,CAEjB,OAAOC,SAAS,CACd,QAAA,CAAUC,CAAAA,CAAU,WAAA,CAAY,cAAA,CAChC,OAAA,CAAS,IAAMH,CAAAA,CAAG,GAAA,CAA0B,iCAAiC,CAC/E,CAAC,CACH,CAEO,SAAS2B,CAAAA,EAAsB,CACpC,IAAM3B,CAAAA,CAAKC,CAAAA,EAAM,CAEjB,OAAOC,QAAAA,CAAS,CACd,QAAA,CAAUC,EAAU,WAAA,CAAY,gBAAA,CAChC,OAAA,CAAS,IAAMH,CAAAA,CAAG,GAAA,CAA0B,mCAAmC,CACjF,CAAC,CACH","file":"chunk-KZHYK554.js","sourcesContent":["import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\n\nimport { useToolkitsStore } from '@/components/toolkitsProvider'\nimport { PermissionMode, WILDCARD } from '@/constants'\nimport { useKy } from '@/libs'\nimport { queryKeys } from '@/queryKeys'\n\nimport type { PermissionEnumItem, RoleEnumItem, RoleV1, RoleV2 } from '../types'\n\nexport function useAllRoles() {\n const ky = useKy()\n return useQuery({\n queryKey: queryKeys.roles.all,\n queryFn: () => ky.get<RoleEnumItem[]>('/api/usystem/role/all'),\n })\n}\n\nexport function useRole(name: string) {\n const ky = useKy()\n const {\n context: { permissionMode },\n } = useToolkitsStore()\n\n return useQuery({\n queryKey: queryKeys.roles.detail(name, permissionMode),\n queryFn: () =>\n ky.get<RoleV1 | RoleV2>(\n `/api/usystem/role/${permissionMode === PermissionMode.GAME_SCOPED ? 'info' : 'infoV2'}?name=${name}`,\n ),\n })\n}\n\nexport function useCreateRole() {\n const ky = useKy()\n const queryClient = useQueryClient()\n const {\n context: { permissionMode },\n } = useToolkitsStore()\n\n return useMutation({\n mutationKey: queryKeys.roles.create(permissionMode),\n mutationFn: ({ name, permissions }: { name: string; permissions: RoleV1['permissions'] | RoleV2['permissions'] }) =>\n ky.post(`/api/usystem/role/${permissionMode === PermissionMode.GAME_SCOPED ? 'create' : 'createV2'}`, {\n name,\n permissions,\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.roles.all })\n },\n })\n}\n\nexport function useUpdateRole() {\n const ky = useKy()\n const queryClient = useQueryClient()\n const {\n context: { permissionMode },\n } = useToolkitsStore()\n\n return useMutation({\n mutationKey: queryKeys.roles.update(permissionMode),\n mutationFn: ({\n id,\n name,\n permissions,\n }: {\n id: number\n name: string\n permissions: RoleV1['permissions'] | RoleV2['permissions']\n }) =>\n ky.post(`/api/usystem/role/${permissionMode === PermissionMode.GAME_SCOPED ? 'update' : 'updateV2'}`, {\n id,\n name,\n permissions,\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.roles.all })\n },\n })\n}\n\nexport function useRemoveRole() {\n const ky = useKy()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationKey: queryKeys.roles.delete,\n mutationFn: ({ id, name }: { id: number; name: string }) => ky.post('/api/usystem/role/delete', { id, name }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.roles.all })\n },\n })\n}\n\ntype CreateUserWithRoles = { name: string; roles: string[] }\n\ntype CreateUserPermission = {\n game_group?: string[]\n game_ids: string[]\n role: string\n}\n\ntype CreateUserWithPermissions = {\n name: string\n permissions: CreateUserPermission[]\n}\n\nexport function useCreateUser() {\n const ky = useKy()\n const queryClient = useQueryClient()\n const {\n context: { permissionMode },\n } = useToolkitsStore()\n\n return useMutation({\n mutationKey: queryKeys.users.create,\n mutationFn: (arg: CreateUserWithRoles | CreateUserWithPermissions) => {\n // 使用类型守卫判断是否包含 permissions\n const hasPermissions = (obj: typeof arg): obj is CreateUserWithPermissions => 'permissions' in obj\n\n let requestData: CreateUserWithRoles | CreateUserWithPermissions = arg\n\n if (hasPermissions(arg) && permissionMode === PermissionMode.DIRECT_GAME) {\n const transformedPermissions = arg.permissions?.map(item => ({\n game_group: [WILDCARD],\n game_ids: item.game_ids,\n role: item.role,\n }))\n requestData = { ...arg, permissions: transformedPermissions }\n }\n\n return ky.post('/api/usystem/user/create', requestData)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.users.all })\n },\n })\n}\n\ntype UpdateUserWithRoles = { id: string; name: string; roles: string[] }\n\ntype UpdateUserPermission = {\n game_group?: string[]\n game_ids: string[]\n role: string\n}\n\ntype UpdateUserWithPermissions = {\n id: string\n name: string\n permissions: UpdateUserPermission[]\n}\n\nexport function useUpdateUser() {\n const ky = useKy()\n const queryClient = useQueryClient()\n const permissionMode = useToolkitsStore(state => state.context.permissionMode)\n\n return useMutation({\n mutationKey: queryKeys.users.update,\n mutationFn: (arg: UpdateUserWithRoles | UpdateUserWithPermissions) => {\n // 使用类型守卫判断是否包含 permissions\n const hasPermissions = (obj: typeof arg): obj is UpdateUserWithPermissions => 'permissions' in obj\n\n let requestData: UpdateUserWithRoles | UpdateUserWithPermissions = arg\n\n if (hasPermissions(arg) && permissionMode === PermissionMode.DIRECT_GAME) {\n const transformedPermissions = arg.permissions?.map(item => ({\n game_group: [WILDCARD],\n game_ids: item.game_ids,\n role: item.role,\n }))\n requestData = { ...arg, permissions: transformedPermissions }\n }\n\n return ky.post('/api/usystem/user/update', requestData)\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.users.all })\n },\n })\n}\n\nexport function useRemoveUser() {\n const ky = useKy()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationKey: queryKeys.users.delete,\n mutationFn: ({ id, name }: { id: string; name: string }) => ky.post('/api/usystem/user/delete', { id, name }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: queryKeys.users.all })\n },\n })\n}\n\nexport function useAllPermissions() {\n const ky = useKy()\n\n return useQuery({\n queryKey: queryKeys.permissions.allPermissions,\n queryFn: () => ky.get<PermissionEnumItem[]>('/api/usystem/user/allPermssions'),\n })\n}\n\nexport function useAllPermissionsV2() {\n const ky = useKy()\n\n return useQuery({\n queryKey: queryKeys.permissions.allPermissionsV2,\n queryFn: () => ky.get<PermissionEnumItem[]>('/api/usystem/user/allPermssionsV2'),\n })\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {c,d,i as i$1,j}from'./chunk-KZHYK554.js';import {d as d$1}from'./chunk-5QAEUAZE.js';import {a}from'./chunk-D5YXBSTI.js';import {c as c$1}from'./chunk-JDCSIJL7.js';import {i}from'./chunk-F2GDEOP4.js';import {Typography,Select,App,Form,Input,Skeleton,Divider,Card,Empty,Button,Space,Checkbox,Row,Col,Collapse}from'antd';import {useState,useEffect,useTransition,useCallback}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var oe=m=>{let{permissions:r,readonly:t,expand:n,value:l,onChange:f}=m,[c,g]=useState([]),[P,R]=useState({}),[a$1,d]=useState(l??[]),{t:y}=a(),[,C]=useTransition(),x=useCallback(e=>{g(e);},[]),p=(e,s)=>{let o=[];return e?o=[...new Set(a$1.concat(s))]:(o=a$1.slice(),s.forEach(u=>{let b=o.findIndex(X=>X===u);b>-1&&o.splice(b,1);})),o},L=(e,s)=>{let o=p(e.target.checked,s);d(o),f?.(o);};useEffect(()=>{d(l??[]);},[l]),useEffect(()=>{n&&C(()=>{g((r??[]).map(({category:e})=>e));});},[n,r]),useEffect(()=>{let e=(r??[]).reduce((s,o)=>(s[o.category]=o.permissions.every(u=>a$1?.includes(u.value)),s),{});R(e);},[a$1,r]);let I=(r??[]).map(e=>({key:e.category,label:e.category,extra:!t&&jsx(Checkbox,{checked:P[e.category],onChange:s=>{L(s,e.permissions?.map(o=>o.value));},children:y("global.selectAll")}),children:jsx(Checkbox.Group,{className:"w-full",value:a$1,disabled:t,children:jsx(Row,{gutter:[10,10],className:"w-full",children:e.permissions?.map(s=>jsx(Col,{span:6,children:jsx(Checkbox,{value:s.value,onChange:o=>{L(o,[s.value]);},children:s.label})},s.value))})})}));return jsx(Collapse,{className:"w-full",collapsible:"header",activeKey:c,items:I,onChange:x})},k=oe;var{Text:w}=Typography,{Option:le}=Select,pe=m=>{let{expand:r=true,value:t,readonly:n,onChange:l}=m,{data:f,isLoading:c,error:g}=j(),{data:P,isLoading:R}=c$1(),[a$1,d]=useState([]),y=f?.filter(e=>e.is_common),C=f?.filter(e=>!e.is_common),x=c||R,{t:p}=a();if(useEffect(()=>{let e=[];Object.keys(t??{}).forEach(s=>{s!=="global"&&e.push({gameId:s,permissions:t?.[s]??[]});}),d(e);},[t]),g)return jsx("div",{className:"flex justify-center",children:jsx(w,{type:"danger",children:p("PermissionList.failedDescription")})});let L=()=>{d(e=>[...e,{gameId:"",permissions:[]}]);},I=e=>{d(s=>s.filter((o,u)=>u!==e));};return jsxs("div",{className:"flex flex-col w-full",children:[jsx("div",{className:"mb-12",children:jsx(Divider,{dashed:true,children:p("PermissionList.baseSectionTitle")})}),jsx(Skeleton,{active:true,loading:x,children:jsx(k,{value:t?.global,readonly:n,permissions:y,expand:r,onChange:e=>{l?.({...t,global:e});}})}),jsx("div",{className:"my-12",children:jsx(Divider,{dashed:true,children:p("PermissionList.gameSectionTitle")})}),a$1.map((e,s)=>jsx(Card,{title:jsxs(Space,{children:[jsx(w,{children:p("global.game")}),n?jsx(w,{children:P?.find(o=>String(o.id)===e.gameId)?.name}):jsx(Select,{disabled:n,value:a$1[s].gameId||void 0,className:"w-40",placeholder:p("PermissionList.gameSelectPlaceholder"),onChange:o=>{d(u=>{let b=u.slice();return b[s].gameId=o,b});},children:P?.map(o=>jsx(le,{value:o.id,disabled:a$1.some(({gameId:u})=>u===String(o.id)),children:o.name},o.id))})]}),className:"mb-6",extra:!n&&jsx(Button,{type:"link",onClick:()=>{I(s);},children:p("PermissionList.removeText")}),children:a$1[s].gameId?jsx(Skeleton,{active:true,loading:x,children:jsx(k,{value:t?.[a$1[s].gameId],readonly:n,expand:r,permissions:C,onChange:o=>{l?.({...t,[a$1[s].gameId]:o});}})}):jsx(Empty,{description:p("PermissionList.gameSectionDescription")})},s)),!n&&jsx(Button,{block:true,type:"dashed",onClick:L,children:p("PermissionList.addText")})]})},$=pe;var{Text:ue}=Typography,fe=m=>{let{expand:r=true,value:t,readonly:n,onChange:l}=m,{data:f,isLoading:c,error:g}=i$1(),{t:P}=a();return g?jsx("div",{className:"flex justify-center",children:jsx(ue,{type:"danger",children:P("PermissionList.failedDescription")})}):jsx(Skeleton,{active:true,loading:c,children:jsx(k,{value:t,permissions:f,readonly:n,expand:r,onChange:l})})},z=fe;var ge=m=>{let{value:r}=m,{context:{permissionMode:t}}=i();return t==="game_scoped"?jsx(z,{...m,value:r}):jsx($,{...m,value:r})},J=ge;var Qe=({mode:m,onSuccess:r})=>{let{message:t}=App.useApp(),{t:n}=a(),l=c(),f=d(),c$1=m==="create",g=n(c$1?"Role.createTitle":"Role.updateTitle"),P=jsxs(Fragment,{children:[jsx(Form.Item,{label:n("global.name"),name:"name",rules:[{required:true}],children:jsx(Input,{disabled:!c$1})}),jsx(Form.Item,{name:"permissions",children:jsx(J,{})})]});return d$1({title:g,width:"1000px",formProps:{layout:"vertical"},content:P,onConfirm:async(a,d)=>{let y=`role_${a.name}`,C=a.permissions;c$1?(await l.mutateAsync({name:y,permissions:C}),t.success(n("Role.createSuccessfully"))):(await f.mutateAsync({id:d?.id,name:y,permissions:C}),t.success(n("Role.updateSuccessfully"))),r?.();}})};export{J as a,Qe as b};//# sourceMappingURL=chunk-MVG7YFPB.js.map
2
+ //# sourceMappingURL=chunk-MVG7YFPB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/modules/permission/components/permissionCollapse/index.tsx","../src/modules/permission/components/permissionList/PermissionWithGame.tsx","../src/modules/permission/components/permissionList/PermissionWithoutGame.tsx","../src/modules/permission/components/permissionList/index.tsx","../src/modules/permission/hooks/role-hooks.tsx"],"names":["PermissionCollapse","props","permissions","readonly","expand","value","onChange","activeKey","setActiveKey","useState","checkedMap","setCheckedMap","internalValue","setInternalValue","t","useTranslation","startTransition","useTransition","onCollapseChange","useCallback","key","getCheckedValue","checkedValue","codes","tempValue","code","index","item","onCheckChange","useEffect","category","acc","curr","items","jsx","Checkbox","e","permission","Row","Col","Collapse","permissionCollapse_default","Text","Typography","Option","Select","PermissionWithGame","isPermissionLoading","error","useAllPermissionsV2","games","isGamesLoading","useGames","gameList","setGameList","globalPermissions","gamePermissions","isLoading","list","addGame","prev","removeGame","_","i","jsxs","Divider","Skeleton","newValue","Card","Space","game","selectedValue","pev","temp","gameId","Button","Empty","PermissionWithGame_default","PermissionWithoutGame","useAllPermissions","PermissionWithoutGame_default","PermissionList","permissionMode","useToolkitsStore","permissionList_default","useRoleModal","mode","onSuccess","message","App","create","useCreateRole","update","useUpdateRole","isCreateMode","title","content","Fragment","Form","Input","useFormModal","values","extraValues","name"],"mappings":"ybAiBA,IAAMA,EAAAA,CAAkDC,GAAS,CAC/D,GAAM,CAAE,WAAA,CAAAC,CAAAA,CAAa,QAAA,CAAAC,CAAAA,CAAU,MAAA,CAAAC,EAAQ,KAAA,CAAAC,CAAAA,CAAO,QAAA,CAAAC,CAAS,CAAA,CAAIL,CAAAA,CACrD,CAACM,CAAAA,CAAWC,CAAY,CAAA,CAAIC,QAAAA,CAAmB,EAAE,CAAA,CACjD,CAACC,CAAAA,CAAYC,CAAa,EAAIF,QAAAA,CAAkC,EAAE,CAAA,CAClE,CAACG,GAAAA,CAAeC,CAAgB,CAAA,CAAIJ,SAAmBJ,CAAAA,EAAS,EAAE,CAAA,CAClE,CAAE,CAA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,EAAG,IAAA,CAAK,MAAA,CAAO,KAAA,CAAO,CAAC,CAAE,QAAA,CAAU,IAAK,CAAC,EACxE,QAAA,CAAAoB,GAAAA,CAACiE,KAAAA,CAAA,CAAM,QAAA,CAAU,CAACL,GAAAA,CAAc,CAAA,CAClC,EACA5D,GAAAA,CAACgE,IAAAA,CAAK,IAAA,CAAL,CAAU,IAAA,CAAK,aAAA,CACd,QAAA,CAAAhE,GAAAA,CAACkD,EAAA,EAAe,CAAA,CAClB,CAAA,CAAA,CACF,CAAA,CAoBF,OAAOgB,GAAAA,CAML,CACA,KAAA,CAAAL,EACA,KAAA,CAAO,QAAA,CACP,SAAA,CAAW,CACT,MAAA,CAAQ,UACV,CAAA,CACA,OAAA,CAAAC,EACA,SAAA,CA9BgB,MAChBK,CAAAA,CACAC,CAAAA,GACG,CACH,IAAMC,CAAAA,CAAO,CAAA,KAAA,EAAQF,EAAO,IAAI,CAAA,CAAA,CAC1BnG,CAAAA,CAAcmG,CAAAA,CAAO,WAAA,CAEvBP,GAAAA,EACF,MAAMJ,CAAAA,CAAO,YAAY,CAAE,IAAA,CAAAa,CAAAA,CAAM,WAAA,CAAArG,CAAY,CAAC,CAAA,CAC9CsF,CAAAA,CAAQ,QAAQ1E,CAAAA,CAAE,yBAAyB,CAAC,CAAA,GAE5C,MAAM8E,CAAAA,CAAO,WAAA,CAAY,CAAE,GAAIU,CAAAA,EAAa,EAAA,CAAI,IAAA,CAAAC,CAAAA,CAAM,WAAA,CAAArG,CAAY,CAAC,CAAA,CACnEsF,EAAQ,OAAA,CAAQ1E,CAAAA,CAAE,yBAAyB,CAAC,CAAA,CAAA,CAE9CyE,CAAAA,KACF,CAgBA,CAAC,CACH","file":"chunk-MVG7YFPB.js","sourcesContent":["import { Checkbox, Col, Collapse, Row } from 'antd'\nimport type { CheckboxChangeEvent } from 'antd/es/checkbox'\nimport type { FC } from 'react'\nimport { useCallback, useEffect, useState, useTransition } from 'react'\n\nimport { useTranslation } from '@/locale'\n\nimport type { PermissionEnumItem } from '../../types'\n\ninterface PermissionCollapseProps {\n expand?: boolean\n permissions?: PermissionEnumItem[]\n readonly?: boolean\n value?: string[]\n onChange?: (value: string[]) => void\n}\n\nconst PermissionCollapse: FC<PermissionCollapseProps> = props => {\n const { permissions, readonly, expand, value, onChange } = props\n const [activeKey, setActiveKey] = useState<string[]>([])\n const [checkedMap, setCheckedMap] = useState<Record<string, boolean>>({})\n const [internalValue, setInternalValue] = useState<string[]>(value ?? [])\n const { t } = useTranslation()\n const [, startTransition] = useTransition()\n\n const onCollapseChange = useCallback((key: string | string[]) => {\n setActiveKey(key as string[])\n }, [])\n\n const getCheckedValue = (checkedValue: boolean, codes: string[]) => {\n let tempValue: string[] = []\n\n if (checkedValue) {\n tempValue = [...new Set(internalValue.concat(codes))]\n } else {\n tempValue = internalValue.slice()\n\n codes.forEach(code => {\n const index = tempValue.findIndex(item => item === code)\n if (index > -1) {\n tempValue.splice(index, 1)\n }\n })\n }\n\n return tempValue\n }\n\n const onCheckChange = (e: CheckboxChangeEvent, codes: string[]) => {\n const checkedValue = getCheckedValue(e.target.checked, codes)\n setInternalValue(checkedValue)\n onChange?.(checkedValue)\n }\n\n useEffect(() => {\n setInternalValue(value ?? [])\n }, [value])\n\n useEffect(() => {\n if (expand) {\n startTransition(() => {\n // 改变展开状态\n setActiveKey((permissions ?? []).map(({ category }) => category))\n })\n }\n }, [expand, permissions])\n\n useEffect(() => {\n const checkedValue = (permissions ?? []).reduce(\n (acc, curr) => {\n acc[curr.category] = curr.permissions.every(item => internalValue?.includes(item.value))\n return acc\n },\n {} as Record<string, boolean>,\n )\n\n setCheckedMap(checkedValue)\n }, [internalValue, permissions])\n\n const items = (permissions ?? []).map(item => ({\n key: item.category,\n label: item.category,\n extra: !readonly && (\n <Checkbox\n checked={checkedMap[item.category]}\n onChange={e => {\n onCheckChange(\n e,\n item.permissions?.map(permission => permission.value),\n )\n }}\n >\n {t('global.selectAll')}\n </Checkbox>\n ),\n children: (\n <Checkbox.Group className=\"w-full\" value={internalValue} disabled={readonly}>\n <Row gutter={[10, 10]} className=\"w-full\">\n {item.permissions?.map(permission => (\n <Col key={permission.value} span={6}>\n <Checkbox\n value={permission.value}\n onChange={e => {\n onCheckChange(e, [permission.value])\n }}\n >\n {permission.label}\n </Checkbox>\n </Col>\n ))}\n </Row>\n </Checkbox.Group>\n ),\n }))\n\n return (\n <Collapse className=\"w-full\" collapsible=\"header\" activeKey={activeKey} items={items} onChange={onCollapseChange} />\n )\n}\n\nexport default PermissionCollapse\n","import { Button, Card, Divider, Empty, Select, Skeleton, Space, Typography } from 'antd'\nimport type { FC } from 'react'\nimport { useEffect, useState } from 'react'\n\nimport { useTranslation } from '@/locale'\nimport { useGames } from '@/services'\n\nimport { useAllPermissionsV2 } from '../../services'\nimport type { RoleV2 } from '../../types'\nimport PermissionCollapse from '../permissionCollapse'\nimport type { PermissionListPropsBase } from './types'\n\nconst { Text } = Typography\nconst { Option } = Select\n\ninterface PermissionWithGameProps extends PermissionListPropsBase {\n value?: RoleV2['permissions']\n onChange?: (checkedValue: RoleV2['permissions']) => void\n}\n\nconst PermissionWithGame: FC<PermissionWithGameProps> = props => {\n const { expand = true, value, readonly, onChange } = props\n const { data: permission, isLoading: isPermissionLoading, error } = useAllPermissionsV2()\n const { data: games, isLoading: isGamesLoading } = useGames()\n const [gameList, setGameList] = useState<{ gameId: string; permissions: string[] }[]>([])\n const globalPermissions = permission?.filter(item => item.is_common)\n const gamePermissions = permission?.filter(item => !item.is_common)\n const isLoading = isPermissionLoading || isGamesLoading\n const { t } = useTranslation()\n\n useEffect(() => {\n const list: { gameId: string; permissions: string[] }[] = []\n\n Object.keys(value ?? {}).forEach(key => {\n if (key !== 'global') {\n list.push({ gameId: key, permissions: value?.[key] ?? [] })\n }\n })\n\n setGameList(list)\n }, [value])\n\n if (error) {\n return (\n <div className=\"flex justify-center\">\n <Text type=\"danger\">{t('PermissionList.failedDescription')}</Text>\n </div>\n )\n }\n\n const addGame = () => {\n setGameList(prev => [...prev, { gameId: '', permissions: [] }])\n }\n\n const removeGame = (index: number) => {\n setGameList(prev => prev.filter((_, i) => i !== index))\n }\n\n return (\n <div className=\"flex flex-col w-full\">\n <div className=\"mb-12\">\n <Divider dashed>{t('PermissionList.baseSectionTitle')}</Divider>\n </div>\n <Skeleton active loading={isLoading}>\n <PermissionCollapse\n value={value?.global}\n readonly={readonly}\n permissions={globalPermissions}\n expand={expand}\n onChange={newValue => {\n onChange?.({\n ...value,\n global: newValue,\n })\n }}\n />\n </Skeleton>\n <div className=\"my-12\">\n <Divider dashed>{t('PermissionList.gameSectionTitle')}</Divider>\n </div>\n {gameList.map((item, index) => (\n <Card\n title={\n <Space>\n <Text>{t('global.game')}</Text>\n {readonly ? (\n <Text>{games?.find(game => String(game.id) === item.gameId)?.name}</Text>\n ) : (\n <Select\n disabled={readonly}\n value={gameList[index].gameId || undefined}\n className=\"w-40\"\n placeholder={t('PermissionList.gameSelectPlaceholder')}\n onChange={selectedValue => {\n setGameList(pev => {\n const temp = pev.slice()\n temp[index].gameId = selectedValue\n return temp\n })\n }}\n >\n {games?.map(game => (\n <Option\n key={game.id}\n value={game.id}\n disabled={gameList.some(({ gameId }) => gameId === String(game.id))}\n >\n {game.name}\n </Option>\n ))}\n </Select>\n )}\n </Space>\n }\n key={index}\n className=\"mb-6\"\n extra={\n !readonly && (\n <Button\n type=\"link\"\n onClick={() => {\n removeGame(index)\n }}\n >\n {t('PermissionList.removeText')}\n </Button>\n )\n }\n >\n {gameList[index].gameId ? (\n <Skeleton active loading={isLoading}>\n <PermissionCollapse\n value={value?.[gameList[index].gameId]}\n readonly={readonly}\n expand={expand}\n permissions={gamePermissions}\n onChange={newValue => {\n onChange?.({\n ...value,\n [gameList[index].gameId]: newValue,\n })\n }}\n />\n </Skeleton>\n ) : (\n <Empty description={t('PermissionList.gameSectionDescription')} />\n )}\n </Card>\n ))}\n {!readonly && (\n <Button block type=\"dashed\" onClick={addGame}>\n {t('PermissionList.addText')}\n </Button>\n )}\n </div>\n )\n}\n\nexport default PermissionWithGame\n","import { Skeleton, Typography } from 'antd'\nimport type { FC } from 'react'\n\nimport { useTranslation } from '@/locale'\n\nimport { useAllPermissions } from '../../services'\nimport type { RoleV1 } from '../../types'\nimport PermissionCollapse from '../permissionCollapse'\nimport type { PermissionListPropsBase } from './types'\n\nconst { Text } = Typography\n\ninterface PermissionWithoutGameProps extends PermissionListPropsBase {\n value?: RoleV1['permissions']\n onChange?: (checkedValue: RoleV1['permissions']) => void\n}\n\nconst PermissionWithoutGame: FC<PermissionWithoutGameProps> = props => {\n const { expand = true, value, readonly, onChange } = props\n const { data: permissions, isLoading, error } = useAllPermissions()\n const { t } = useTranslation()\n\n if (error) {\n return (\n <div className=\"flex justify-center\">\n <Text type=\"danger\">{t('PermissionList.failedDescription')}</Text>\n </div>\n )\n }\n\n return (\n <Skeleton active loading={isLoading}>\n <PermissionCollapse\n value={value}\n permissions={permissions}\n readonly={readonly}\n expand={expand}\n onChange={onChange}\n />\n </Skeleton>\n )\n}\n\nexport default PermissionWithoutGame\n","import type { FC } from 'react'\n\nimport { useToolkitsStore } from '@/components/toolkitsProvider'\nimport { PermissionMode } from '@/constants'\n\nimport type { RoleV1, RoleV2 } from '../../types'\nimport PermissionWithGame from './PermissionWithGame'\nimport PermissionWithoutGame from './PermissionWithoutGame'\nimport type { PermissionListPropsBase } from './types'\n\ninterface PermissionListProps extends PermissionListPropsBase {\n value?: RoleV1['permissions'] | RoleV2['permissions']\n onChange?: (checkedValue: RoleV1['permissions'] | RoleV2['permissions']) => void\n}\n\nconst PermissionList: FC<PermissionListProps> = (props: PermissionListProps) => {\n const { value } = props\n const {\n context: { permissionMode },\n } = useToolkitsStore()\n\n if (permissionMode === PermissionMode.GAME_SCOPED) {\n return <PermissionWithoutGame {...props} value={value as RoleV1['permissions']} />\n }\n\n return <PermissionWithGame {...props} value={value as RoleV2['permissions']} />\n}\n\nexport default PermissionList\n","import { App, Form, Input } from 'antd'\n\nimport { useFormModal } from '@/hooks/modal'\nimport { useTranslation } from '@/locale'\n\nimport PermissionList from '../components/permissionList'\nimport { useCreateRole, useUpdateRole } from '../services'\nimport type { RoleListItem, RoleV1, RoleV2 } from '../types'\n\nexport const useRoleModal = ({ mode, onSuccess }: { mode: 'create' | 'update'; onSuccess?: () => void }) => {\n const { message } = App.useApp()\n const { t } = useTranslation()\n const create = useCreateRole()\n const update = useUpdateRole()\n\n const isCreateMode = mode === 'create'\n\n const title = isCreateMode ? t('Role.createTitle') : t('Role.updateTitle')\n\n const content = (\n <>\n <Form.Item label={t('global.name')} name=\"name\" rules={[{ required: true }]}>\n <Input disabled={!isCreateMode} />\n </Form.Item>\n <Form.Item name=\"permissions\">\n <PermissionList />\n </Form.Item>\n </>\n )\n\n const onConfirm = async (\n values: { name: string; permissions: RoleListItem['permissions'] },\n extraValues: { id: number },\n ) => {\n const name = `role_${values.name}`\n const permissions = values.permissions\n\n if (isCreateMode) {\n await create.mutateAsync({ name, permissions })\n message.success(t('Role.createSuccessfully'))\n } else {\n await update.mutateAsync({ id: extraValues?.id, name, permissions })\n message.success(t('Role.updateSuccessfully'))\n }\n onSuccess?.()\n }\n\n return useFormModal<\n {\n name: string\n permissions: RoleV1['permissions'] | RoleV2['permissions']\n },\n { id: number }\n >({\n title,\n width: '1000px',\n formProps: {\n layout: 'vertical',\n },\n content,\n onConfirm,\n })\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-FIT6S4UM.js';import {f}from'./chunk-F2GDEOP4.js';import {Editor}from'@monaco-editor/react';import {App,Form,Card,Input,Switch,InputNumber,Button}from'antd';import {useNavigate}from'react-router-dom';import {jsx,jsxs}from'react/jsx-runtime';var v=()=>{let{message:u}=App.useApp(),[p]=Form.useForm(),o=useNavigate(),{mutateAsync:c}=a();return jsx(Card,{title:"\u521B\u5EFA\u83DC\u5355\u9879",children:jsxs(Form,{scrollToFirstError:true,form:p,labelCol:{flex:"120px"},initialValues:{is_common:false,is_model:false,order:0},onFinish:async I=>{let{permissions:s,front_route:d,...f$1}=I;await c({...f$1,front_route:f+d,permissions:s?JSON.parse(s):void 0}),u.success("\u521B\u5EFA\u6210\u529F",.8,()=>o("..",{relative:"route"}));},children:[jsx(Form.Item,{label:"\u83DC\u5355\u9879\u540D\u79F0",name:"category",rules:[{required:true}],children:jsx(Input,{})}),jsx(Form.Item,{label:"\u524D\u7AEF\u8DEF\u7531",name:"front_route",rules:[{required:true}],children:jsx(Input,{prefix:f})}),jsx(Form.Item,{label:"\u6A21\u677F\u540D\u79F0",name:"model_name",rules:[{required:true}],children:jsx(Input,{})}),jsx(Form.Item,{label:"Is Common",name:"is_common",rules:[{required:true}],valuePropName:"checked",children:jsx(Switch,{})}),jsx(Form.Item,{label:"Order",name:"order",children:jsx(InputNumber,{className:"w-full"})}),jsx(Form.Item,{label:"\u63A5\u53E3\u89C4\u5219",name:"permissions",children:jsx(Editor,{theme:"vs-dark",height:"300px",language:"json",options:{minimap:{enabled:false}}})}),jsx(Form.Item,{label:"Schema",name:"scheme",rules:[{required:true}],children:jsx(Editor,{theme:"vs-dark",height:"600px",language:"json",options:{minimap:{enabled:false}}})}),jsx(Form.Item,{label:"Ext",name:"ext",children:jsx(Input.TextArea,{rows:5})}),jsx(Form.Item,{children:jsxs("div",{className:"flex justify-center gap-8",children:[jsx(Button,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),jsx(Button,{onClick:()=>{o("..",{relative:"path"});},children:"\u53D6\u6D88"})]})})]})})},q=v;export{q as default};//# sourceMappingURL=createMenuItem-Q5TJGFKZ.js.map
2
+ //# sourceMappingURL=createMenuItem-Q5TJGFKZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/modules/menu/pages/createMenuItem/index.tsx"],"names":["CreateMenuItem","message","App","form","Form","navigate","useNavigate","createMenu","useCreateMenu","jsx","Card","jsxs","values","permissions","front_route","rest","FRONTEND_ROUTE_PREFIX","Input","Switch","InputNumber","Editor","Button","createMenuItem_default"],"mappings":"2Q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AA,CAAS,KACX,CACF,CAAA,CACF,CAAA,CACF,EACAX,GAAAA,CAACL,IAAAA,CAAK,KAAL,CAAU,KAAA,CAAM,MAAM,IAAA,CAAK,KAAA,CAC1B,SAAAK,GAAAA,CAACQ,KAAAA,CAAM,SAAN,CAAe,IAAA,CAAM,CAAA,CAAG,CAAA,CAC3B,EACAR,GAAAA,CAACL,IAAAA,CAAK,KAAL,CACC,QAAA,CAAAO,KAAC,KAAA,CAAA,CAAI,SAAA,CAAU,2BAAA,CACb,QAAA,CAAA,CAAAF,IAACY,MAAAA,CAAA,CAAO,KAAK,SAAA,CAAU,QAAA,CAAS,SAAS,QAAA,CAAA,cAAA,CAEzC,CAAA,CACAZ,GAAAA,CAACY,MAAAA,CAAA,CACC,OAAA,CAAS,IAAM,CACbhB,CAAAA,CAAS,IAAA,CAAM,CAAE,QAAA,CAAU,MAAO,CAAC,EACrC,CAAA,CACD,wBAED,CAAA,CAAA,CACF,CAAA,CACF,GACF,CAAA,CACF,CAEN,EAEOiB,CAAAA,CAAQtB","file":"createMenuItem-Q5TJGFKZ.js","sourcesContent":["import { Editor } from '@monaco-editor/react'\nimport { App, Button, Card, Form, Input, InputNumber, Switch } from 'antd'\nimport { useNavigate } from 'react-router-dom'\n\nimport { FRONTEND_ROUTE_PREFIX } from '@/constants'\nimport type { MenuListItem } from '@/types'\n\nimport { useCreateMenu } from '../../services'\n\ntype FormSchema = Omit<MenuListItem, 'id' | 'permissions'> & { permissions: string }\n\nconst CreateMenuItem = () => {\n const { message } = App.useApp()\n const [form] = Form.useForm<FormSchema>()\n const navigate = useNavigate()\n const { mutateAsync: createMenu } = useCreateMenu()\n\n const onFinish = async (values: FormSchema) => {\n const { permissions, front_route, ...rest } = values\n await createMenu({\n ...rest,\n front_route: FRONTEND_ROUTE_PREFIX + front_route,\n permissions: permissions ? JSON.parse(permissions) : undefined,\n })\n message.success('创建成功', 0.8, () => navigate('..', { relative: 'route' }))\n }\n\n return (\n <Card title=\"创建菜单项\">\n <Form\n scrollToFirstError\n form={form}\n labelCol={{ flex: '120px' }}\n initialValues={{ is_common: false, is_model: false, order: 0 }}\n onFinish={onFinish}\n >\n <Form.Item label=\"菜单项名称\" name=\"category\" rules={[{ required: true }]}>\n <Input />\n </Form.Item>\n <Form.Item label=\"前端路由\" name=\"front_route\" rules={[{ required: true }]}>\n <Input prefix={FRONTEND_ROUTE_PREFIX} />\n </Form.Item>\n <Form.Item label=\"模板名称\" name=\"model_name\" rules={[{ required: true }]}>\n <Input />\n </Form.Item>\n <Form.Item label=\"Is Common\" name=\"is_common\" rules={[{ required: true }]} valuePropName=\"checked\">\n <Switch />\n </Form.Item>\n <Form.Item label=\"Order\" name=\"order\">\n <InputNumber className=\"w-full\" />\n </Form.Item>\n <Form.Item label=\"接口规则\" name=\"permissions\">\n <Editor\n theme=\"vs-dark\"\n height=\"300px\"\n language=\"json\"\n options={{\n minimap: {\n enabled: false,\n },\n }}\n />\n </Form.Item>\n <Form.Item label=\"Schema\" name=\"scheme\" rules={[{ required: true }]}>\n <Editor\n theme=\"vs-dark\"\n height=\"600px\"\n language=\"json\"\n options={{\n minimap: {\n enabled: false,\n },\n }}\n />\n </Form.Item>\n <Form.Item label=\"Ext\" name=\"ext\">\n <Input.TextArea rows={5} />\n </Form.Item>\n <Form.Item>\n <div className=\"flex justify-center gap-8\">\n <Button type=\"primary\" htmlType=\"submit\">\n 提交\n </Button>\n <Button\n onClick={() => {\n navigate('..', { relative: 'path' })\n }}\n >\n 取消\n </Button>\n </div>\n </Form.Item>\n </Form>\n </Card>\n )\n}\n\nexport default CreateMenuItem\n"]}
package/lib/index.css CHANGED
@@ -1 +1 @@
1
- @layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-inset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root{--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-xl:1.25rem;--text-xl--line-height:1.4;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--font-weight-medium:500;--font-weight-bold:700;--leading-tight:1.25;--radius-lg:.5rem;--ease-out:cubic-bezier(0,0,.2,1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}h3{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}table{border-collapse:collapse;border-color:inherit;text-indent:0}menu{list-style:none}img,object,svg{display:block;vertical-align:middle}img{height:auto;max-width:100%}button,select{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-6{top:calc(var(--spacing)*6)}.top-16{top:calc(var(--spacing)*16)}.right-0{right:calc(var(--spacing)*0)}.right-16{right:calc(var(--spacing)*16)}.left-14{left:calc(var(--spacing)*14)}.z-10{z-index:10}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing)*4)}.my-12{margin-block:calc(var(--spacing)*12)}.mt-2{margin-top:calc(var(--spacing)*2)}.mr-6{margin-right:calc(var(--spacing)*6)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-12{margin-bottom:calc(var(--spacing)*12)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-10{height:calc(var(--spacing)*10)}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.w-8{width:calc(var(--spacing)*8)}.w-full{width:100%}.w-screen{width:100vw}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-grow-0{flex-grow:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-4{gap:calc(var(--spacing)*4)}.gap-8{gap:calc(var(--spacing)*8)}.overflow-hidden{overflow:hidden}.rounded-lg{border-radius:var(--radius-lg)}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.bg-linear-to-br{--tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-br{--tw-gradient-position:to bottom right in oklab}}.bg-gradient-to-r,.bg-linear-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab}.from-gray-800{--tw-gradient-from:var(--color-gray-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-gray-600{--tw-gradient-to:var(--color-gray-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:calc(var(--spacing)*1)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-36{padding-inline:calc(var(--spacing)*36)}.py-2{padding-block:calc(var(--spacing)*2)}.text-center{text-align:center}.text-end{text-align:end}.text-start{text-align:start}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{font-weight:var(--font-weight-bold)}.font-medium{font-weight:var(--font-weight-medium)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-gray-500{color:var(--color-gray-500)}.text-transparent{color:#0000}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (hover:hover){.hover\:bg-white\/50:hover{background-color:#ffffff80}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/50:hover{background-color:color-mix(in oklab,var(--color-white)50%,transparent)}}.hover\:from-blue-600:hover{--tw-gradient-from:var(--color-blue-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:to-blue-500:hover{--tw-gradient-to:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}
1
+ @layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,::backdrop,:after,:before{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-inset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root{--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-50:oklch(97% .014 254.604);--color-purple-50:oklch(97.7% .014 308.299);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-base:1rem;--text-base--line-height:1.5;--text-xl:1.25rem;--text-xl--line-height:1.4;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--radius-lg:.5rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-mono-font-family:var(--font-mono)}}@layer base{*,::backdrop,:after,:before{border:0 solid;box-sizing:border-box;margin:0;padding:0}::file-selector-button{border:0 solid;box-sizing:border-box;margin:0;padding:0}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}strong{font-weight:bolder}code{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-size:1em;font-variation-settings:var(--default-mono-font-variation-settings,normal)}small{font-size:80%}table{border-collapse:collapse;border-color:inherit;text-indent:0}menu{list-style:none}img,object,svg{display:block;vertical-align:middle}img{height:auto;max-width:100%}button,select{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{background-color:#0000;border-radius:0;color:inherit;font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;opacity:1}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}}@layer antd,components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.top-0{top:calc(var(--spacing)*0)}.top-6{top:calc(var(--spacing)*6)}.right-6{right:calc(var(--spacing)*6)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-6{left:calc(var(--spacing)*6)}.z-10{z-index:10}.z-20{z-index:20}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-4{margin-inline:calc(var(--spacing)*4)}.my-6{margin-block:calc(var(--spacing)*6)}.my-12{margin-block:calc(var(--spacing)*12)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-6{margin-right:calc(var(--spacing)*6)}.mb-0{margin-bottom:calc(var(--spacing)*0)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.mb-12{margin-bottom:calc(var(--spacing)*12)}.ml-4{margin-left:calc(var(--spacing)*4)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-12{height:calc(var(--spacing)*12)}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.w-8{width:calc(var(--spacing)*8)}.w-40{width:calc(var(--spacing)*40)}.w-full{width:100%}.w-screen{width:100vw}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.grow-0{flex-grow:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-4{gap:calc(var(--spacing)*4)}.gap-8{gap:calc(var(--spacing)*8)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-gray-200{border-color:var(--color-gray-200)}.bg-linear-to-br{--tw-gradient-position:to bottom right}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-br{--tw-gradient-position:to bottom right in oklab}}.bg-linear-to-br{background-image:linear-gradient(var(--tw-gradient-stops))}.bg-linear-to-r{--tw-gradient-position:to right}@supports (background-image:linear-gradient(in lab,red,red)){.bg-linear-to-r{--tw-gradient-position:to right in oklab}}.bg-linear-to-r{background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:var(--color-blue-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-gray-800{--tw-gradient-from:var(--color-gray-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-white{--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.via-gray-700{--tw-gradient-via:var(--color-gray-700);--tw-gradient-via-stops:var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-via)var(--tw-gradient-via-position),var(--tw-gradient-to)var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-gray-600{--tw-gradient-to:var(--color-gray-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-50{--tw-gradient-to:var(--color-purple-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:calc(var(--spacing)*1)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-6{padding-block:calc(var(--spacing)*6)}.text-center{text-align:center}.text-end{text-align:end}.text-start{text-align:start}.align-top{vertical-align:top}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{font-weight:var(--font-weight-bold)}.font-medium{font-weight:var(--font-weight-medium)}.font-semibold{font-weight:var(--font-weight-semibold)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-gray-500{color:var(--color-gray-500)}.text-transparent{color:#0000}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040)}.shadow-2xl,.shadow-md{box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.transition-all{transition-duration:var(--tw-duration,var(--default-transition-duration));transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}
package/lib/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { ButtonProps, FormInstance, MenuProps, SelectProps, DrawerProps, Button, FormProps, ModalProps } from 'antd';
1
+ import { ButtonProps, FormInstance, SelectProps, MenuProps, DrawerProps, Button, FormProps, ModalProps } from 'antd';
2
2
  import { Options } from 'ky';
3
3
  import * as react from 'react';
4
- import { FC, PropsWithChildren, Key, ReactNode, ReactElement, Ref, DetailedHTMLProps, ImgHTMLAttributes, ComponentType, ComponentProps } from 'react';
4
+ import { FC, PropsWithChildren, Key, ReactNode, ReactElement, Ref, DetailedHTMLProps, ImgHTMLAttributes, ComponentProps } from 'react';
5
5
  import { ParagraphProps } from 'antd/es/typography/Paragraph';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import { AnyObject } from 'antd/es/_util/type';
@@ -157,24 +157,6 @@ declare const useInfiniteListStore: zustand.UseBoundStore<Omit<Omit<zustand.Stor
157
157
  };
158
158
  }>;
159
159
 
160
- type NavMenuItemType = Merge<MenuItemType, {
161
- route?: string;
162
- }>;
163
- interface NavSubMenuType extends Omit<SubMenuType, 'children'> {
164
- children?: NavItem[];
165
- }
166
- interface NavMenuItemGroupType extends Omit<MenuItemGroupType, 'children'> {
167
- children?: NavItem[];
168
- }
169
- type NavItem = Exclude<ItemType, SubMenuType | MenuItemGroupType | MenuItemType> | NavMenuItemType | NavSubMenuType | NavMenuItemGroupType;
170
-
171
- interface NavProps {
172
- items?: NavItem[];
173
- theme?: MenuProps['theme'];
174
- loading?: boolean;
175
- }
176
- declare const Nav: (props: NavProps) => react_jsx_runtime.JSX.Element;
177
-
178
160
  type Area = 'all' | 'cn' | 'global';
179
161
  type ScreenOrientation = 0 | 1;
180
162
  interface Game {
@@ -197,23 +179,68 @@ interface GameSelectProps<T extends Game = Game> {
197
179
  filter?: (game: T) => boolean;
198
180
  options?: (data?: T[]) => SelectProps['options'];
199
181
  }
182
+ declare const GameSelect: <T extends Game = Game>(props: GameSelectProps<T>) => react_jsx_runtime.JSX.Element;
200
183
 
184
+ type NavMenuItemType = Merge<MenuItemType, {
185
+ route?: string;
186
+ }>;
187
+ interface NavSubMenuType extends Omit<SubMenuType, 'children'> {
188
+ children?: NavItem[];
189
+ }
190
+ interface NavMenuItemGroupType extends Omit<MenuItemGroupType, 'children'> {
191
+ children?: NavItem[];
192
+ }
193
+ type NavItem = Exclude<ItemType, SubMenuType | MenuItemGroupType | MenuItemType> | NavMenuItemType | NavSubMenuType | NavMenuItemGroupType;
194
+
195
+ interface NavProps {
196
+ items?: NavItem[];
197
+ theme?: MenuProps['theme'];
198
+ loading?: boolean;
199
+ }
200
+ declare const Nav: (props: NavProps) => react_jsx_runtime.JSX.Element;
201
+
202
+ /** Header 扩展项配置 */
201
203
  type HeaderExtra = {
202
204
  key: Key;
203
205
  children: ReactNode;
204
206
  };
207
+ /** Header 扩展区域配置 */
208
+ interface HeaderExtraConfig {
209
+ /** 左侧扩展项 */
210
+ left?: HeaderExtra[];
211
+ /** 右侧扩展项 */
212
+ right?: HeaderExtra[];
213
+ }
214
+ /** 导航配置 */
215
+ interface NavigationConfig {
216
+ /** 导航菜单项 */
217
+ items?: NavItem[];
218
+ /** 菜单加载状态 */
219
+ loading?: boolean;
220
+ }
221
+ /** 路由匹配规则类型 */
222
+ type RouteMatchRule = string | RegExp;
223
+ /** 游戏选择器配置 */
224
+ interface GameSelectConfig<T extends Game = Game> {
225
+ /** 游戏过滤函数 */
226
+ filter?: GameSelectProps<T>['filter'];
227
+ /** 选项自定义函数 */
228
+ options?: GameSelectProps<T>['options'];
229
+ /** 在这些路由路径下隐藏游戏选择器(支持字符串路径或正则表达式) */
230
+ hideOnRoutes?: RouteMatchRule[];
231
+ }
232
+ /** Layout 组件属性 */
205
233
  interface LayoutProps<T extends Game = Game> {
234
+ /** 应用标题(显示在侧边栏顶部) */
206
235
  title?: string;
236
+ /** 应用副标题(显示在标题下方) */
207
237
  subtitle?: string;
208
- isMenuLoading?: boolean;
209
- items?: NavItem[];
210
- gameSelectFilter?: GameSelectProps<T>['filter'];
211
- gameSelectOptions?: GameSelectProps<T>['options'];
212
- hideGameSelect?: boolean;
213
- headerExtra?: {
214
- left?: HeaderExtra[];
215
- right?: HeaderExtra[];
216
- };
238
+ /** 导航配置 */
239
+ navigation?: NavigationConfig;
240
+ /** 游戏选择器配置 */
241
+ gameSelect?: GameSelectConfig<T>;
242
+ /** Header 扩展区域配置 */
243
+ headerExtra?: HeaderExtraConfig;
217
244
  }
218
245
  declare const Layout: <T extends Game = Game>(props: PropsWithChildren<LayoutProps<T>>) => react_jsx_runtime.JSX.Element;
219
246
 
@@ -335,23 +362,28 @@ interface RequireAuthProps {
335
362
  */
336
363
  declare const RequireAuth: FC<PropsWithChildren<RequireAuthProps>>;
337
364
 
338
- declare const _default$3: react.NamedExoticComponent<{
365
+ declare const _default$2: react.NamedExoticComponent<{
339
366
  children?: react.ReactNode | undefined;
340
367
  }>;
341
368
 
342
369
  declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
343
370
  declare const APP_ID_HEADER = "App-ID";
344
371
  declare const FRONTEND_ROUTE_PREFIX = "/console/";
345
- declare enum PermissionVersion {
346
- V1 = "v1",
347
- V2 = "v2",
348
- V3 = "v3",
349
- V4 = "v4"
372
+ /**
373
+ * 权限系统模式枚举
374
+ * - GAME_SCOPED: 游戏范围权限(角色权限包含游戏信息)
375
+ * - GROUP_BASED: 基于项目组的权限(需要先选择项目组才能选择游戏)
376
+ * - DIRECT_GAME: 直接游戏权限(不需要项目组,直接选择游戏)
377
+ */
378
+ declare enum PermissionMode {
379
+ /** 游戏范围权限:角色权限包含游戏范围信息 */
380
+ GAME_SCOPED = "game_scoped",
381
+ /** 基于项目组的权限:权限依赖项目组,需要先选择项目组才能选择游戏 */
382
+ GROUP_BASED = "group_based",
383
+ /** 直接游戏权限:权限直接选择游戏,不需要项目组作为中间层 */
384
+ DIRECT_GAME = "direct_game"
350
385
  }
351
386
  declare const WILDCARD = "*";
352
- declare const TRUE = "true";
353
- declare const FALSE = "false";
354
- declare const UNREGISTERED_FLAG = "unregistered";
355
387
 
356
388
  type Locale = {
357
389
  global: {
@@ -446,16 +478,15 @@ type Locale = {
446
478
 
447
479
  interface ContextSlice {
448
480
  locale: Locale;
449
- permissionVersion: PermissionVersion;
450
- gameApiV2: boolean;
481
+ permissionMode: PermissionMode;
482
+ useGameApiV2: boolean;
451
483
  loginPath: string;
452
- isGlobal: boolean;
453
- requireGame?: boolean;
454
- navWidth?: number;
455
- collapsible?: boolean;
456
- mainPagePath: string;
457
- apiBase?: string;
458
- setContext(state: Partial<Omit<ContextSlice, 'setContext'>>): void;
484
+ isGlobalMode: boolean;
485
+ gameScoped?: boolean;
486
+ sidebarWidth?: number;
487
+ sidebarCollapsible?: boolean;
488
+ homePath: string;
489
+ apiBaseUrl?: string;
459
490
  }
460
491
 
461
492
  interface GameSlice {
@@ -483,18 +514,18 @@ interface TokenSlice {
483
514
  clearToken: () => void;
484
515
  }
485
516
 
486
- type ToolkitsState = TokenSlice & GameSlice & ContextSlice & LayoutSlice & {
517
+ type ToolkitsState = {
518
+ context: ContextSlice;
519
+ token: TokenSlice;
520
+ game: GameSlice;
521
+ layout: LayoutSlice;
487
522
  clear: () => void;
488
523
  };
489
524
 
490
525
  declare function useToolkitsStore(): ToolkitsState;
491
526
  declare function useToolkitsStore<T>(selector: (state: ToolkitsState) => T): T;
492
- type ToolkitsProviderProps = PropsWithChildren<Partial<Omit<ContextSlice, 'setContext'>>>;
527
+ type ToolkitsProviderProps = PropsWithChildren<Partial<ContextSlice>>;
493
528
  declare const ToolkitsProvider: FC<ToolkitsProviderProps>;
494
- declare const withContext: (Component: ComponentType, providerProps: Omit<ToolkitsProviderProps, "children">) => {
495
- (props: any): react_jsx_runtime.JSX.Element;
496
- displayName: string;
497
- };
498
529
 
499
530
  declare const UserDropdown: FC;
500
531
 
@@ -630,19 +661,16 @@ declare function useFormModal<Values extends AnyObject = AnyObject, ExtraValues
630
661
 
631
662
  declare const useModalStore: zustand.UseBoundStore<zustand.StoreApi<VisibilityState>>;
632
663
 
633
- declare const _default$2: react_jsx_runtime.JSX.Element;
634
-
635
664
  declare const _default$1: react_jsx_runtime.JSX.Element;
636
665
 
666
+ declare const _default: react_jsx_runtime.JSX.Element;
667
+
637
668
  interface NotFoundProps {
638
669
  redirectUrl?: string;
639
670
  }
640
671
  declare const NotFound: FC<NotFoundProps>;
641
672
 
642
- declare const _default: {
643
- (props: any): react_jsx_runtime.JSX.Element;
644
- displayName: string;
645
- };
673
+ declare const OperationLogList: FC;
646
674
 
647
675
  interface SignInProps {
648
676
  extra?: ReactNode;
@@ -840,4 +868,4 @@ declare function useAuth(code?: string | string[], config?: Options): {
840
868
  declare function useMenuList(): _tanstack_react_query.UseQueryResult<MenuListItem[], Error>;
841
869
  declare const useGames: () => _tanstack_react_query.UseQueryResult<Game[], Error>;
842
870
 
843
- export { APP_ID_HEADER, AuthButton, type AuthButtonProps, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FALSE, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, Highlight, type HighlightProps, InfiniteList, InfiniteListAction, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, Nav, type NavItem, NotFound, _default as OperationLogList, type Permission, PermissionVersion, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireAuth, type RequireAuthProps, _default$3 as RequireGame, SSO_URL, SignIn, TRUE, ToolkitsProvider, type ToolkitsProviderProps, UNREGISTERED_FLAG, type UseFormDrawerProps, type UseFormModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStore, generateId, _default$2 as menu, mixedStorage, _default$1 as permission, useAuth, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitsStore, withContext };
871
+ export { APP_ID_HEADER, AuthButton, type AuthButtonProps, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, GameSelect, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, InfiniteList, InfiniteListAction, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, Nav, type NavItem, type NavigationConfig, NotFound, OperationLogList, type Permission, PermissionMode, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, RequireAuth, type RequireAuthProps, _default$2 as RequireGame, type RouteMatchRule, SSO_URL, SignIn, ToolkitsProvider, type ToolkitsProviderProps, type UseFormDrawerProps, type UseFormModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStore, generateId, _default$1 as menu, mixedStorage, _default as permission, useAuth, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitsStore };