@vef-framework/starter 1.0.39 → 1.0.41
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/es/app.js +1 -1
- package/es/components/index.js +2 -2
- package/es/components/vef-access-denied-page/index.js +3 -0
- package/es/components/vef-app/index.js +1 -1
- package/es/components/vef-dev-assistant/index.js +23 -3
- package/es/components/vef-error-page/index.js +2 -2
- package/es/components/vef-login-page/index.js +3 -0
- package/es/components/vef-not-found-page/index.js +2 -2
- package/es/components/vef-router-provider/index.js +2 -2
- package/es/constants.js +3 -0
- package/es/index.js +2 -2
- package/es/router.js +2 -2
- package/es/routes/access-denied.js +3 -0
- package/es/routes/index.js +2 -2
- package/es/routes/layout.js +2 -2
- package/es/routes/login.js +3 -0
- package/es/routes/root.js +2 -2
- package/es/store.js +3 -0
- package/lib/app.cjs +1 -1
- package/lib/components/index.cjs +2 -2
- package/lib/components/vef-access-denied-page/index.cjs +3 -0
- package/lib/components/vef-access-denied-page/props.cjs +3 -0
- package/lib/components/vef-app/index.cjs +1 -1
- package/lib/components/vef-app/props.cjs +1 -1
- package/lib/components/vef-dev-assistant/index.cjs +23 -3
- package/lib/components/vef-dev-assistant/props.cjs +1 -1
- package/lib/components/vef-error-page/index.cjs +2 -2
- package/lib/components/vef-error-page/props.cjs +1 -1
- package/lib/components/vef-login-page/index.cjs +3 -0
- package/lib/components/vef-login-page/props.cjs +3 -0
- package/lib/components/vef-not-found-page/index.cjs +2 -2
- package/lib/components/vef-not-found-page/props.cjs +1 -1
- package/lib/components/vef-router-provider/index.cjs +2 -2
- package/lib/components/vef-router-provider/props.cjs +1 -1
- package/lib/constants.cjs +3 -0
- package/lib/index.cjs +2 -2
- package/lib/router.cjs +2 -2
- package/lib/routes/access-denied.cjs +3 -0
- package/lib/routes/index.cjs +2 -2
- package/lib/routes/layout.cjs +2 -2
- package/lib/routes/login.cjs +3 -0
- package/lib/routes/root.cjs +2 -2
- package/lib/store.cjs +3 -0
- package/lib/types.cjs +1 -1
- package/package.json +13 -12
- package/types/app.d.ts +5 -0
- package/types/components/index.d.ts +2 -0
- package/types/components/vef-access-denied-page/index.d.ts +5 -0
- package/types/components/vef-access-denied-page/props.d.ts +5 -0
- package/types/components/vef-error-page/index.d.ts +1 -1
- package/types/components/vef-login-page/index.d.ts +5 -0
- package/types/components/vef-login-page/props.d.ts +7 -0
- package/types/components/vef-router-provider/props.d.ts +3 -3
- package/types/constants.d.ts +24 -0
- package/types/index.d.ts +2 -1
- package/types/routes/access-denied.d.ts +8 -0
- package/types/routes/index.d.ts +2 -0
- package/types/routes/layout.d.ts +13 -1
- package/types/routes/login.d.ts +14 -0
- package/types/store.d.ts +34 -0
package/es/app.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
import{createElement as e}from"react";import{createRoot as n}from"react-dom/client";import"./components/index.js";import o from"./components/vef-app/index.js";function t(){const t=n(document.getElementById("root"),{identifierPrefix:"vef-"});return{render:n=>{t.render(e(o,n))},unmount:()=>t.unmount()}}export{t as createApp};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/components/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export{default as VefApp}from"./vef-app/index.js";export{default as VefDevAssistant}from"./vef-dev-assistant/index.js";export{default as VefErrorPage}from"./vef-error-page/index.js";export{default as VefNotFoundPage}from"./vef-not-found-page/index.js";export{default as VefRouterProvider}from"./vef-router-provider/index.js";
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
export{default as VefAccessDeniedPage}from"./vef-access-denied-page/index.js";export{default as VefApp}from"./vef-app/index.js";export{default as VefDevAssistant}from"./vef-dev-assistant/index.js";export{default as VefErrorPage}from"./vef-error-page/index.js";export{default as VefLoginPage}from"./vef-login-page/index.js";export{default as VefNotFoundPage}from"./vef-not-found-page/index.js";export{default as VefRouterProvider}from"./vef-router-provider/index.js";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as t}from"@emotion/react/jsx-runtime";import{useLocation as o,useRouterState as r,useNavigate as e}from"@tanstack/react-router";import{VefAccessDenied as m}from"@vef-framework/components";import{useCallback as a}from"react";import{INDEX_PAGE_PATH as n}from"../../constants.js";const c=()=>{const{pathname:c}=o(),{redirect:i}=r(),p=e(),f=a((()=>p({to:n,replace:!0})),[p]);return t(m,{uri:i?._fromLocation?.pathname??c,onNavigateHome:f})};export{c as default};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
import{jsx as r}from"@emotion/react/jsx-runtime";import{VefConfigProvider as o}from"@vef-framework/components";import{StrictMode as e}from"react";import t from"../vef-router-provider/index.js";const m=({router:m,...i})=>r(e,{children:r(o,{...i,children:r(t,{router:m})})});export{m as default};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsxs as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsxs as e,jsx as t,Fragment as o}from"@emotion/react/jsx-runtime";import{css as r}from"@emotion/react";import{VefFloatButtonGroup as i,VefIcon as a,VefFloatButton as n,VefLoadingPlaceholder as l}from"@vef-framework/components";import{useKeyPress as s}from"@vef-framework/hooks";import{themeVariables as d,noop as c}from"@vef-framework/shared";import{CompassIcon as h,SendIcon as f}from"lucide-react";import{AnimatePresence as p,motion as u}from"motion/react";import{lazy as m,useState as v,useCallback as k,Suspense as y}from"react";const g=r`
|
|
3
3
|
position: fixed;
|
|
4
4
|
bottom: 0;
|
|
5
5
|
width: 100%;
|
|
6
|
+
height: 600px;
|
|
6
7
|
z-index: 2;
|
|
7
8
|
|
|
8
9
|
.tsqd-text-logo-container {
|
|
9
10
|
display: none;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
.TanStackRouterDevtoolsPanel {
|
|
14
|
+
> button {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
> div:first-of-type {
|
|
19
|
+
> div:first-of-type {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> div {
|
|
25
|
+
padding: ${d.paddingSm};
|
|
26
|
+
scrollbar-width: thin;
|
|
27
|
+
scrollbar-color: #334155 transparent;
|
|
28
|
+
box-shadow: ${d.boxShadowDrawerDown};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;function b(o){return e("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...o,children:[t("path",{d:"M17 14v4c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-4Z",fill:"currentColor",fillOpacity:0,children:t("animate",{attributeName:"fill-opacity",begin:"0.8s",dur:"0.5s",fill:"freeze",values:"0;1"})}),e("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[t("path",{d:"M17 9v9c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-9Z",strokeDasharray:48,strokeDashoffset:48,children:t("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",fill:"freeze",values:"48;0"})}),t("path",{d:"M17 9h3c0.55 0 1 0.45 1 1v3c0 0.55 -0.45 1 -1 1h-3",strokeDasharray:14,strokeDashoffset:14,children:t("animate",{attributeName:"stroke-dashoffset",begin:"0.6s",dur:"0.2s",fill:"freeze",values:"14;0"})}),t("mask",{id:"lineMdCoffeeHalfEmptyFilledLoop0",children:t("path",{d:"M8 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M12 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M16 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4",stroke:"#fff",children:t("animateMotion",{calcMode:"linear",dur:"3s",path:"M0 0v-8",repeatCount:"indefinite"})})}),e("rect",{fill:"currentColor",height:0,mask:"url(#lineMdCoffeeHalfEmptyFilledLoop0)",width:24,y:7,children:[t("animate",{attributeName:"y",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"7;2"}),t("animate",{attributeName:"height",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"0;5"})]})]})]})}const w="development"===process.env.NODE_ENV,x=w?m((()=>import("@tanstack/router-devtools").then((e=>({default:e.TanStackRouterDevtoolsPanel}))))):()=>null,M=w?m((()=>import("@tanstack/react-query-devtools").then((e=>({default:e.ReactQueryDevtoolsPanel}))))):()=>null,D={opened:{opacity:1,y:0,transition:{type:"spring",bounce:0,duration:.2}},closed:{opacity:0,y:"50%"}},C=()=>{const[r,d]=v(null),m=k((e=>{e.stopPropagation(),d((e=>"query"===e?null:"query"))}),[]),w=k((e=>{e.stopPropagation(),d((e=>"router"===e?null:"router"))}),[]);return s("esc",(()=>{r&&d(null)})),e(o,{children:[e(i,{collapsable:!0,shape:"square",icon:t(a,{size:"huge",children:t(b,{})}),onClick:e=>e.stopPropagation(),children:[t(n,{tip:"API调试控制台",icon:t(a,{children:t(h,{})}),onClick:m}),t(n,{tip:"路由调试控制台",icon:t(a,{children:t(f,{})}),onClick:w})]}),e(p,{mode:"wait",children:["query"===r&&t(u.div,{animate:"opened",css:g,exit:"closed",initial:"closed",variants:D,children:t(y,{fallback:t(l,{}),children:t(M,{style:{height:"100%"}})})}),"router"===r&&t(u.div,{animate:"opened",css:g,exit:"closed",initial:"closed",variants:D,children:t(y,{fallback:t(l,{}),children:t(x,{isOpen:"router"===r,setIsOpen:c,style:{height:"100%"}})})})]})]})};export{C as default};
|
|
12
32
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{VefError as o}from"@vef-framework/components";import{useQueryErrorResetBoundary as e}from"@vef-framework/core";import{useEffect as t}from"react";const m=({error:m,info:n,reset:c})=>{const{reset:f}=e();return t((()=>{f()}),[f]),r(o,{componentStack:n?.componentStack,error:m,reset:c})};export{m as default};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as e}from"@emotion/react/jsx-runtime";import{useRouter as t,useNavigate as o,useSearch as r}from"@tanstack/react-router";import{VefLogin as s}from"@vef-framework/components";import{LOGIN_PAGE_ROUTE as a}from"../../constants.js";import{useAppStore as n}from"../../store.js";const c=c=>{const i=t(),m=o(),{redirect:f}=r({from:a});return e(s,{onLoginSuccess:async({accessToken:e,refreshToken:t})=>{n.setState({isAuthenticated:!0,token:Object.freeze({accessToken:e,refreshToken:t})}),await i.invalidate(),await m({to:f,replace:!0})},...c})};export{c as default};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx as t}from"@emotion/react/jsx-runtime";import{useNavigate as o,useLocation as r}from"@tanstack/react-router";import{VefNotFound as e}from"@vef-framework/components";import{useCallback as m}from"react";const
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as t}from"@emotion/react/jsx-runtime";import{useNavigate as o,useLocation as r}from"@tanstack/react-router";import{VefNotFound as e}from"@vef-framework/components";import{useCallback as m}from"react";import{INDEX_PAGE_PATH as a}from"../../constants.js";const n=()=>{const n=o(),c=m((()=>n({to:a,replace:!0})),[n]),{pathname:i}=r();return t(e,{uri:i,onNavigateHome:c})};export{n as default};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as t}from"@emotion/react/jsx-runtime";import{RouterProvider as r}from"@tanstack/react-router";import{useApiContext as e}from"@vef-framework/core";import{useMemo as o}from"react";const c=({router:c})=>{const{fetchAuthenticatedUserApi:m}=e(),a=o((()=>({fetchAuthenticatedUserApi:m})),[m]);return t(r,{context:a,router:c})};export{c as default};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/constants.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
const o="/login",c="/_common/login",e="/",n="/_layout",s="/access-denied",d="/_common/access-denied";export{s as ACCESS_DENIED_PAGE_PATH,d as ACCESS_DENIED_PAGE_ROUTE,e as INDEX_PAGE_PATH,n as INDEX_PAGE_ROUTE,o as LOGIN_PAGE_PATH,c as LOGIN_PAGE_ROUTE};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export{createApp}from"./app.js";import"./components/index.js";export{createRouter}from"./router.js";import"./routes/index.js";export{
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
export{createApp}from"./app.js";import"./components/index.js";export{ACCESS_DENIED_PAGE_PATH,ACCESS_DENIED_PAGE_ROUTE,INDEX_PAGE_PATH,INDEX_PAGE_ROUTE,LOGIN_PAGE_PATH,LOGIN_PAGE_ROUTE}from"./constants.js";export{createRouter}from"./router.js";import"./routes/index.js";export{useAppStore}from"./store.js";export{default as VefAccessDeniedPage}from"./components/vef-access-denied-page/index.js";export{default as VefApp}from"./components/vef-app/index.js";export{default as VefDevAssistant}from"./components/vef-dev-assistant/index.js";export{default as VefErrorPage}from"./components/vef-error-page/index.js";export{default as VefLoginPage}from"./components/vef-login-page/index.js";export{default as VefNotFoundPage}from"./components/vef-not-found-page/index.js";export{default as VefRouterProvider}from"./components/vef-router-provider/index.js";export{createAccessDeniedRouteOptions}from"./routes/access-denied.js";export{createLayoutRouteOptions}from"./routes/layout.js";export{createLoginRouteOptions}from"./routes/login.js";export{createRootRoute}from"./routes/root.js";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/router.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{createRouter as e,createBrowserHistory as r}from"@tanstack/react-router";import{VefText as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{createRouter as e,createBrowserHistory as r}from"@tanstack/react-router";import{VefLoadingPlaceholder as t,VefText as o}from"@vef-framework/components";import{showErrorNotification as a}from"@vef-framework/shared";import n from"nprogress";import{createElement as l}from"react";const s=6e5;function i({routeTree:i}){const c=e({routeTree:i,trailingSlash:"never",caseSensitive:!0,history:r(),search:{strict:!0},notFoundMode:"root",defaultPendingComponent:()=>l(t,{size:"large"}),defaultPendingMs:500,defaultPendingMinMs:300,defaultSsr:!1,defaultStructuralSharing:!0,defaultHashScrollIntoView:{behavior:"smooth",block:"start",inline:"center"},defaultPreload:"intent",defaultPreloadDelay:50,defaultPreloadGcTime:s,defaultGcTime:s,defaultOnCatch(e,r){a(e.message||e.name,l(o,{color:"error",children:l("pre",{style:{maxHeight:"480px",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:e.stack||r.componentStack||"No stack trace available"})}))}});return c.subscribe("onBeforeLoad",(({pathChanged:e})=>e&&n.start())),c.subscribe("onLoad",(()=>n.done())),c}export{i as createRouter};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import"../components/index.js";import e from"../components/vef-access-denied-page/index.js";function n(){return{component:e}}export{n as createAccessDeniedRouteOptions};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/routes/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export{createLayoutRouteOptions}from"./layout.js";export{createRootRoute}from"./root.js";
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
export{createAccessDeniedRouteOptions}from"./access-denied.js";export{createLayoutRouteOptions}from"./layout.js";export{createLoginRouteOptions}from"./login.js";export{createRootRoute}from"./root.js";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/routes/layout.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as e}from"@emotion/react/jsx-runtime";import{useRouter as t,useNavigate as r,useLocation as a,Outlet as o,redirect as n}from"@tanstack/react-router";import{VefIcon as i,VefLayout as s,VefLoadingPlaceholder as c}from"@vef-framework/components";import{useApiContext as m}from"@vef-framework/core";import{buildRouteParentMenusMappings as u}from"@vef-framework/shared";import{HomeIcon as l}from"lucide-react";import{useMemo as p,useCallback as f}from"react";import{INDEX_PAGE_PATH as d,LOGIN_PAGE_PATH as h,ACCESS_DENIED_PAGE_PATH as g}from"../constants.js";import{useAppStore as b}from"../store.js";const w={key:d,label:e(i,{children:e(l,{})})};function y({title:i,logo:l,getUserDescription:d}){return{beforeLoad:({location:e})=>{const{isAuthenticated:t,routeParentMenusMappings:r}=b.getState();if(!t)throw n({to:h,search:{redirect:e.href}});if(r&&!r.has(e.pathname))throw n({to:g,replace:!0})},loader:async({context:e,location:t})=>{const{fetchAuthenticatedUserApi:r}=e,{menus:a,permissions:o,...i}=await r.fetchQuery(null),s=Object.freeze(u(a));if(b.setState({user:Object.freeze(i),menus:Object.freeze(a),permissions:Object.freeze(new Set(o)),routeParentMenusMappings:s}),!s.has(t.pathname))throw n({to:g,replace:!0})},pendingComponent:()=>e(c,{size:"large",tip:"系统加载中,请稍后..."}),component:function(){const n=t(),c=r(),{pathname:u}=a(),[g,y,k]=b((e=>[e.menus,e.user,e.routeParentMenusMappings])),v=k?.get(u)?.[1].map((e=>e.key)),M=p((()=>{const e=k?.get(u);if(!e)return[];const[t,r]=e;return[w,...r.map((e=>({key:e.key,label:e.label,dropdownItems:e.children.filter((e=>"divider"!==e.type)).map((e=>({key:e.key,label:e.label})))}))),{label:t.label}]}),[u,k]),{logoutApi:A,fetchAuthenticatedUserApi:j}=m(),{mutate:z}=A.useMutation(),O=f((async()=>{await z(null),await j.invalidateQueries(),b.setState({isAuthenticated:!1},!0),await n.invalidate(),await c({to:h})}),[j,z,c,n]),S=f((e=>{c({to:e})}),[c]);return e(s,{activeMenuKey:u,breadcrumbItems:M,defaultOpenedMenuKeys:v,logo:l,menuItems:g,title:i,userAvatar:y?.avatar,userDescription:d?.(y),userGender:y?.gender,userName:y?.name,onActiveMenuKeyChange:S,onBreadcrumbClick:S,onLogout:O,children:e(o,{})})},staleTime:1/0,gcTime:0,shouldReload:!1}}export{y as createLayoutRouteOptions};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsx as t}from"@emotion/react/jsx-runtime";import{redirect as o}from"@tanstack/react-router";import{z as e}from"@vef-framework/shared";import"../components/index.js";import{INDEX_PAGE_PATH as r}from"../constants.js";import{useAppStore as i}from"../store.js";import n from"../components/vef-login-page/index.js";function a(a){return{validateSearch:e.object({redirect:e.string().optional().default(r).catch(r)}),beforeLoad:({search:t})=>{if(i.getState().isAuthenticated){const{redirect:e}=t;throw o({to:e,replace:!0})}},component:()=>t(n,{...a})}}export{a as createLoginRouteOptions};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/routes/root.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsxs as o,Fragment as
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{jsxs as o,Fragment as e,jsx as n}from"@emotion/react/jsx-runtime";import{createRootRouteWithContext as r,Outlet as t}from"@tanstack/react-router";import"../components/index.js";import m from"../components/vef-dev-assistant/index.js";import p from"../components/vef-error-page/index.js";import s from"../components/vef-not-found-page/index.js";function i(){return r()({component:()=>o(e,{children:[n(t,{}),"development"===process.env.NODE_ENV&&n(m,{})]}),errorComponent:p,notFoundComponent:s,ssr:!1})}export{i as createRootRoute};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/store.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
import{createStore as e}from"@vef-framework/shared";const t=e((()=>({isAuthenticated:!1,fetchUserApi:void 0})),{name:"APP",storage:"session",selector:e=>({isAuthenticated:e.isAuthenticated,token:e.token})});export{t as useAppStore};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/app.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom/client");require("./components/index.cjs");const r=require("./components/vef-app/index.cjs");exports.createApp=function(){const n=t.createRoot(document.getElementById("root"),{identifierPrefix:"vef-"});return{render:t=>{n.render(e.createElement(r.default,t))},unmount:()=>n.unmount()}};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/components/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vef-
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./vef-access-denied-page/index.cjs"),r=require("./vef-app/index.cjs"),t=require("./vef-dev-assistant/index.cjs"),s=require("./vef-error-page/index.cjs"),i=require("./vef-login-page/index.cjs"),o=require("./vef-not-found-page/index.cjs"),d=require("./vef-router-provider/index.cjs");exports.VefAccessDeniedPage=e.default,exports.VefApp=r.default,exports.VefDevAssistant=t.default,exports.VefErrorPage=s.default,exports.VefLoginPage=i.default,exports.VefNotFoundPage=o.default,exports.VefRouterProvider=d.default;
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components"),a=require("react"),o=require("../../constants.cjs");exports.default=()=>{const{pathname:s}=t.useLocation(),{redirect:u}=t.useRouterState(),c=t.useNavigate(),i=a.useCallback((()=>c({to:o.INDEX_PAGE_PATH,replace:!0})),[c]);return e.jsx(r.VefAccessDenied,{uri:u?._fromLocation?.pathname??s,onNavigateHome:i})};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),r=require("@vef-framework/components"),t=require("react"),o=require("../vef-router-provider/index.cjs");exports.default=({router:i,...u})=>e.jsx(t.StrictMode,{children:e.jsx(r.VefConfigProvider,{...u,children:e.jsx(o.default,{router:i})})});
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@emotion/react"),
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@emotion/react"),s=require("@vef-framework/components"),o=require("@vef-framework/hooks"),r=require("@vef-framework/shared"),i=require("lucide-react"),a=require("motion/react"),n=require("react"),l=t.css`
|
|
3
3
|
position: fixed;
|
|
4
4
|
bottom: 0;
|
|
5
5
|
width: 100%;
|
|
6
|
+
height: 600px;
|
|
6
7
|
z-index: 2;
|
|
7
8
|
|
|
8
9
|
.tsqd-text-logo-container {
|
|
9
10
|
display: none;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
.TanStackRouterDevtoolsPanel {
|
|
14
|
+
> button {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
> div:first-of-type {
|
|
19
|
+
> div:first-of-type {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> div {
|
|
25
|
+
padding: ${r.themeVariables.paddingSm};
|
|
26
|
+
scrollbar-width: thin;
|
|
27
|
+
scrollbar-color: #334155 transparent;
|
|
28
|
+
box-shadow: ${r.themeVariables.boxShadowDrawerDown};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;function c(t){return e.jsxs("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...t,children:[e.jsx("path",{d:"M17 14v4c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-4Z",fill:"currentColor",fillOpacity:0,children:e.jsx("animate",{attributeName:"fill-opacity",begin:"0.8s",dur:"0.5s",fill:"freeze",values:"0;1"})}),e.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[e.jsx("path",{d:"M17 9v9c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-9Z",strokeDasharray:48,strokeDashoffset:48,children:e.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",fill:"freeze",values:"48;0"})}),e.jsx("path",{d:"M17 9h3c0.55 0 1 0.45 1 1v3c0 0.55 -0.45 1 -1 1h-3",strokeDasharray:14,strokeDashoffset:14,children:e.jsx("animate",{attributeName:"stroke-dashoffset",begin:"0.6s",dur:"0.2s",fill:"freeze",values:"14;0"})}),e.jsx("mask",{id:"lineMdCoffeeHalfEmptyFilledLoop0",children:e.jsx("path",{d:"M8 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M12 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M16 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4",stroke:"#fff",children:e.jsx("animateMotion",{calcMode:"linear",dur:"3s",path:"M0 0v-8",repeatCount:"indefinite"})})}),e.jsxs("rect",{fill:"currentColor",height:0,mask:"url(#lineMdCoffeeHalfEmptyFilledLoop0)",width:24,y:7,children:[e.jsx("animate",{attributeName:"y",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"7;2"}),e.jsx("animate",{attributeName:"height",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"0;5"})]})]})]})}const d="development"===process.env.NODE_ENV,u=d?n.lazy((()=>import("@tanstack/router-devtools").then((e=>({default:e.TanStackRouterDevtoolsPanel}))))):()=>null,h=d?n.lazy((()=>import("@tanstack/react-query-devtools").then((e=>({default:e.ReactQueryDevtoolsPanel}))))):()=>null,f={opened:{opacity:1,y:0,transition:{type:"spring",bounce:0,duration:.2}},closed:{opacity:0,y:"50%"}};exports.default=()=>{const[t,d]=n.useState(null),p=n.useCallback((e=>{e.stopPropagation(),d((e=>"query"===e?null:"query"))}),[]),x=n.useCallback((e=>{e.stopPropagation(),d((e=>"router"===e?null:"router"))}),[]);return o.useKeyPress("esc",(()=>{t&&d(null)})),e.jsxs(e.Fragment,{children:[e.jsxs(s.VefFloatButtonGroup,{collapsable:!0,shape:"square",icon:e.jsx(s.VefIcon,{size:"huge",children:e.jsx(c,{})}),onClick:e=>e.stopPropagation(),children:[e.jsx(s.VefFloatButton,{tip:"API调试控制台",icon:e.jsx(s.VefIcon,{children:e.jsx(i.CompassIcon,{})}),onClick:p}),e.jsx(s.VefFloatButton,{tip:"路由调试控制台",icon:e.jsx(s.VefIcon,{children:e.jsx(i.SendIcon,{})}),onClick:x})]}),e.jsxs(a.AnimatePresence,{mode:"wait",children:["query"===t&&e.jsx(a.motion.div,{animate:"opened",css:l,exit:"closed",initial:"closed",variants:f,children:e.jsx(n.Suspense,{fallback:e.jsx(s.VefLoadingPlaceholder,{}),children:e.jsx(h,{style:{height:"100%"}})})}),"router"===t&&e.jsx(a.motion.div,{animate:"opened",css:l,exit:"closed",initial:"closed",variants:f,children:e.jsx(n.Suspense,{fallback:e.jsx(s.VefLoadingPlaceholder,{}),children:e.jsx(u,{isOpen:"router"===t,setIsOpen:r.noop,style:{height:"100%"}})})})]})]})};
|
|
12
32
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),r=require("@vef-framework/components");exports.default=({error:
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),r=require("@vef-framework/components"),o=require("@vef-framework/core"),t=require("react");exports.default=({error:s,info:u,reset:n})=>{const{reset:c}=o.useQueryErrorResetBoundary();return t.useEffect((()=>{c()}),[c]),e.jsx(r.VefError,{componentStack:u?.componentStack,error:s,reset:n})};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components"),s=require("../../constants.cjs"),o=require("../../store.cjs");exports.default=a=>{const c=t.useRouter(),n=t.useNavigate(),{redirect:i}=t.useSearch({from:s.LOGIN_PAGE_ROUTE});return e.jsx(r.VefLogin,{onLoginSuccess:async({accessToken:e,refreshToken:t})=>{o.useAppStore.setState({isAuthenticated:!0,token:Object.freeze({accessToken:e,refreshToken:t})}),await c.invalidate(),await n({to:i,replace:!0})},...a})};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components"),o=require("react");exports.default=()=>{const
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components"),o=require("react"),a=require("../../constants.cjs");exports.default=()=>{const u=t.useNavigate(),s=o.useCallback((()=>u({to:a.INDEX_PAGE_PATH,replace:!0})),[u]),{pathname:n}=t.useLocation();return e.jsx(r.VefNotFound,{uri:n,onNavigateHome:s})};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/core"),o=require("react");exports.default=({router:u})=>{const{fetchAuthenticatedUserApi:i}=r.useApiContext(),s=o.useMemo((()=>({fetchAuthenticatedUserApi:i})),[i]);return e.jsx(t.RouterProvider,{context:s,router:u})};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.ACCESS_DENIED_PAGE_PATH="/access-denied",exports.ACCESS_DENIED_PAGE_ROUTE="/_common/access-denied",exports.INDEX_PAGE_PATH="/",exports.INDEX_PAGE_ROUTE="/_layout",exports.LOGIN_PAGE_PATH="/login",exports.LOGIN_PAGE_ROUTE="/_common/login";
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./app.cjs");require("./components/index.cjs");const t=require("./router.cjs");require("./routes/index.cjs");const
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./app.cjs");require("./components/index.cjs");const t=require("./constants.cjs"),r=require("./router.cjs");require("./routes/index.cjs");const o=require("./store.cjs"),s=require("./components/vef-access-denied-page/index.cjs"),p=require("./components/vef-app/index.cjs"),c=require("./components/vef-dev-assistant/index.cjs"),n=require("./components/vef-error-page/index.cjs"),u=require("./components/vef-login-page/index.cjs"),i=require("./components/vef-not-found-page/index.cjs"),a=require("./components/vef-router-provider/index.cjs"),E=require("./routes/access-denied.cjs"),A=require("./routes/layout.cjs"),d=require("./routes/login.cjs"),x=require("./routes/root.cjs");exports.createApp=e.createApp,exports.ACCESS_DENIED_PAGE_PATH=t.ACCESS_DENIED_PAGE_PATH,exports.ACCESS_DENIED_PAGE_ROUTE=t.ACCESS_DENIED_PAGE_ROUTE,exports.INDEX_PAGE_PATH=t.INDEX_PAGE_PATH,exports.INDEX_PAGE_ROUTE=t.INDEX_PAGE_ROUTE,exports.LOGIN_PAGE_PATH=t.LOGIN_PAGE_PATH,exports.LOGIN_PAGE_ROUTE=t.LOGIN_PAGE_ROUTE,exports.createRouter=r.createRouter,exports.useAppStore=o.useAppStore,exports.VefAccessDeniedPage=s.default,exports.VefApp=p.default,exports.VefDevAssistant=c.default,exports.VefErrorPage=n.default,exports.VefLoginPage=u.default,exports.VefNotFoundPage=i.default,exports.VefRouterProvider=a.default,exports.createAccessDeniedRouteOptions=E.createAccessDeniedRouteOptions,exports.createLayoutRouteOptions=A.createLayoutRouteOptions,exports.createLoginRouteOptions=d.createLoginRouteOptions,exports.createRootRoute=x.createRootRoute;
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/router.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tanstack/react-router"),r=require("@vef-framework/components"),t=require("@vef-framework/shared"),a=require("
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@tanstack/react-router"),r=require("@vef-framework/components"),t=require("@vef-framework/shared"),a=require("nprogress"),o=require("react"),n=6e5;exports.createRouter=function({routeTree:l}){const i=e.createRouter({routeTree:l,trailingSlash:"never",caseSensitive:!0,history:e.createBrowserHistory(),search:{strict:!0},notFoundMode:"root",defaultPendingComponent:()=>o.createElement(r.VefLoadingPlaceholder,{size:"large"}),defaultPendingMs:500,defaultPendingMinMs:300,defaultSsr:!1,defaultStructuralSharing:!0,defaultHashScrollIntoView:{behavior:"smooth",block:"start",inline:"center"},defaultPreload:"intent",defaultPreloadDelay:50,defaultPreloadGcTime:n,defaultGcTime:n,defaultOnCatch(e,a){t.showErrorNotification(e.message||e.name,o.createElement(r.VefText,{color:"error",children:o.createElement("pre",{style:{maxHeight:"480px",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:e.stack||a.componentStack||"No stack trace available"})}))}});return i.subscribe("onBeforeLoad",(({pathChanged:e})=>e&&a.start())),i.subscribe("onLoad",(()=>a.done())),i};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("../components/index.cjs");const e=require("../components/vef-access-denied-page/index.cjs");exports.createAccessDeniedRouteOptions=function(){return{component:e.default}};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/routes/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./access-denied.cjs"),t=require("./layout.cjs"),o=require("./login.cjs"),r=require("./root.cjs");exports.createAccessDeniedRouteOptions=e.createAccessDeniedRouteOptions,exports.createLayoutRouteOptions=t.createLayoutRouteOptions,exports.createLoginRouteOptions=o.createLoginRouteOptions,exports.createRootRoute=r.createRootRoute;
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/routes/layout.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components");exports.createLayoutRouteOptions=function(){return{component:()=>e.jsx(r.VefLayout,{children:e.jsx(t.Outlet,{})})}};
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/components"),a=require("@vef-framework/core"),n=require("@vef-framework/shared"),o=require("lucide-react"),s=require("react"),i=require("../constants.cjs"),u=require("../store.cjs"),c={key:i.INDEX_PAGE_PATH,label:e.jsx(r.VefIcon,{children:e.jsx(o.HomeIcon,{})})};exports.createLayoutRouteOptions=function({title:o,logo:l,getUserDescription:p}){return{beforeLoad:({location:e})=>{const{isAuthenticated:r,routeParentMenusMappings:a}=u.useAppStore.getState();if(!r)throw t.redirect({to:i.LOGIN_PAGE_PATH,search:{redirect:e.href}});if(a&&!a.has(e.pathname))throw t.redirect({to:i.ACCESS_DENIED_PAGE_PATH,replace:!0})},loader:async({context:e,location:r})=>{const{fetchAuthenticatedUserApi:a}=e,{menus:o,permissions:s,...c}=await a.fetchQuery(null),l=Object.freeze(n.buildRouteParentMenusMappings(o));if(u.useAppStore.setState({user:Object.freeze(c),menus:Object.freeze(o),permissions:Object.freeze(new Set(s)),routeParentMenusMappings:l}),!l.has(r.pathname))throw t.redirect({to:i.ACCESS_DENIED_PAGE_PATH,replace:!0})},pendingComponent:()=>e.jsx(r.VefLoadingPlaceholder,{size:"large",tip:"系统加载中,请稍后..."}),component:function(){const n=t.useRouter(),d=t.useNavigate(),{pathname:m}=t.useLocation(),[f,A,h]=u.useAppStore((e=>[e.menus,e.user,e.routeParentMenusMappings])),g=h?.get(m)?.[1].map((e=>e.key)),b=s.useMemo((()=>{const e=h?.get(m);if(!e)return[];const[t,r]=e;return[c,...r.map((e=>({key:e.key,label:e.label,dropdownItems:e.children.filter((e=>"divider"!==e.type)).map((e=>({key:e.key,label:e.label})))}))),{label:t.label}]}),[m,h]),{logoutApi:y,fetchAuthenticatedUserApi:P}=a.useApiContext(),{mutate:M}=y.useMutation(),S=s.useCallback((async()=>{await M(null),await P.invalidateQueries(),u.useAppStore.setState({isAuthenticated:!1},!0),await n.invalidate(),await d({to:i.LOGIN_PAGE_PATH})}),[P,M,d,n]),j=s.useCallback((e=>{d({to:e})}),[d]);return e.jsx(r.VefLayout,{activeMenuKey:m,breadcrumbItems:b,defaultOpenedMenuKeys:g,logo:l,menuItems:f,title:o,userAvatar:A?.avatar,userDescription:p?.(A),userGender:A?.gender,userName:A?.name,onActiveMenuKeyChange:j,onBreadcrumbClick:j,onLogout:S,children:e.jsx(t.Outlet,{})})},staleTime:1/0,gcTime:0,shouldReload:!1}};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router"),r=require("@vef-framework/shared");require("../components/index.cjs");const o=require("../constants.cjs"),c=require("../store.cjs"),i=require("../components/vef-login-page/index.cjs");exports.createLoginRouteOptions=function(n){return{validateSearch:r.z.object({redirect:r.z.string().optional().default(o.INDEX_PAGE_PATH).catch(o.INDEX_PAGE_PATH)}),beforeLoad:({search:e})=>{if(c.useAppStore.getState().isAuthenticated){const{redirect:r}=e;throw t.redirect({to:r,replace:!0})}},component:()=>e.jsx(i.default,{...n})}};
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/routes/root.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@emotion/react/jsx-runtime"),t=require("@tanstack/react-router");require("../components/index.cjs");const o=require("../components/vef-dev-assistant/index.cjs"),n=require("../components/vef-error-page/index.cjs"),r=require("../components/vef-not-found-page/index.cjs");exports.createRootRoute=function(){return t.createRootRouteWithContext()({component:()=>e.jsxs(e.Fragment,{children:[e.jsx(t.Outlet,{}),"development"===process.env.NODE_ENV&&e.jsx(o.default,{})]}),errorComponent:n.default,notFoundComponent:r.default,ssr:!1})};
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/store.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@vef-framework/shared").createStore((()=>({isAuthenticated:!1,fetchUserApi:void 0})),{name:"APP",storage:"session",selector:e=>({isAuthenticated:e.isAuthenticated,token:e.token})});exports.useAppStore=e;
|
|
3
|
+
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/lib/types.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.41, build time: 2024-12-25T08:44:09.143Z, made by Venus. */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework/starter",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.41",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@9.15.0",
|
|
7
7
|
"description": "The starter of the VEF framework",
|
|
@@ -27,28 +27,29 @@
|
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=20"
|
|
29
29
|
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": "18.3.1",
|
|
32
|
+
"react-dom": "18.3.1",
|
|
33
|
+
"@tanstack/react-router": "1.92.1"
|
|
34
|
+
},
|
|
30
35
|
"dependencies": {
|
|
31
36
|
"@emotion/cache": "11.14.0",
|
|
32
37
|
"@emotion/react": "11.14.0",
|
|
33
38
|
"@emotion/styled": "11.14.0",
|
|
34
|
-
"antd": "5.22.
|
|
39
|
+
"antd": "5.22.5",
|
|
35
40
|
"tslib": "2.8.1",
|
|
36
41
|
"use-sync-external-store": "^1.4.0",
|
|
37
42
|
"@tanstack/react-query-devtools": "5.62.8",
|
|
38
|
-
"@tanstack/react-router": "1.92.1",
|
|
39
43
|
"@tanstack/router-devtools": "1.92.1",
|
|
40
|
-
"@vef-framework/components": "1.0.
|
|
41
|
-
"@vef-framework/core": "1.0.
|
|
42
|
-
"@vef-framework/hooks": "1.0.
|
|
43
|
-
"@vef-framework/shared": "1.0.
|
|
44
|
+
"@vef-framework/components": "1.0.41",
|
|
45
|
+
"@vef-framework/core": "1.0.41",
|
|
46
|
+
"@vef-framework/hooks": "1.0.41",
|
|
47
|
+
"@vef-framework/shared": "1.0.41",
|
|
44
48
|
"lucide-react": "0.469.0",
|
|
45
|
-
"motion": "11.
|
|
49
|
+
"motion": "11.15.0",
|
|
50
|
+
"nprogress": "^0.2.0"
|
|
46
51
|
},
|
|
47
52
|
"publishConfig": {
|
|
48
53
|
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"peerDependencies": {
|
|
51
|
-
"react": "18.3.1",
|
|
52
|
-
"react-dom": "18.3.1"
|
|
53
54
|
}
|
|
54
55
|
}
|
package/types/app.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { default as VefAccessDeniedPage, type VefAccessDeniedPageProps } from "./vef-access-denied-page";
|
|
1
2
|
export { default as VefApp, type VefAppProps } from "./vef-app";
|
|
2
3
|
export { default as VefDevAssistant, type VefDevAssistantProps } from "./vef-dev-assistant";
|
|
3
4
|
export { default as VefErrorPage, type VefErrorPageProps } from "./vef-error-page";
|
|
5
|
+
export { default as VefLoginPage, type VefLoginPageProps } from "./vef-login-page";
|
|
4
6
|
export { default as VefNotFoundPage, type VefNotFoundPageProps } from "./vef-not-found-page";
|
|
5
7
|
export { default as VefRouterProvider, type RouterContext, type VefRouterProviderProps } from "./vef-router-provider";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RouterProps } from "@tanstack/react-router";
|
|
2
|
-
import type {
|
|
2
|
+
import type { FetchAuthenticatedUserApi } from "@vef-framework/shared";
|
|
3
3
|
/**
|
|
4
4
|
* The context of the router.
|
|
5
5
|
*/
|
|
6
6
|
export interface RouterContext {
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The fetch authenticated user API.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
fetchAuthenticatedUserApi: FetchAuthenticatedUserApi;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* The props of the VefRouterProvider component.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path of the login page.
|
|
3
|
+
*/
|
|
4
|
+
export declare const LOGIN_PAGE_PATH = "/login";
|
|
5
|
+
/**
|
|
6
|
+
* The route id of the login page.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LOGIN_PAGE_ROUTE = "/_common/login";
|
|
9
|
+
/**
|
|
10
|
+
* The path of the index page.
|
|
11
|
+
*/
|
|
12
|
+
export declare const INDEX_PAGE_PATH = "/";
|
|
13
|
+
/**
|
|
14
|
+
* The route id of the index page.
|
|
15
|
+
*/
|
|
16
|
+
export declare const INDEX_PAGE_ROUTE = "/_layout";
|
|
17
|
+
/**
|
|
18
|
+
* The path of the access denied page.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ACCESS_DENIED_PAGE_PATH = "/access-denied";
|
|
21
|
+
/**
|
|
22
|
+
* The route id of the access denied page.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ACCESS_DENIED_PAGE_ROUTE = "/_common/access-denied";
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./app";
|
|
2
2
|
export * from "./components";
|
|
3
|
+
export * from "./constants";
|
|
3
4
|
export * from "./router";
|
|
4
5
|
export * from "./routes";
|
|
5
|
-
export
|
|
6
|
+
export * from "./store";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyRoute, FileRoutesByPath, RouteConstraints } from "@tanstack/react-router";
|
|
2
|
+
import type { RouteOptions } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* The options of the access denied route.
|
|
5
|
+
*
|
|
6
|
+
* @returns The options of the access denied route.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createAccessDeniedRouteOptions<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]["parentRoute"], TId extends RouteConstraints["TId"] = FileRoutesByPath[TFilePath]["id"], TPath extends RouteConstraints["TPath"] = FileRoutesByPath[TFilePath]["path"], TFullPath extends RouteConstraints["TFullPath"] = FileRoutesByPath[TFilePath]["fullPath"]>(): RouteOptions<TFilePath, TParentRoute, TId, TPath, TFullPath>;
|
package/types/routes/index.d.ts
CHANGED
package/types/routes/layout.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { type AnyRoute, type FileRoutesByPath, type RouteConstraints } from "@tanstack/react-router";
|
|
2
|
+
import { type VefLayoutProps } from "@vef-framework/components";
|
|
3
|
+
import { type Mapper } from "@vef-framework/shared";
|
|
2
4
|
import type { RouteOptions } from "../types";
|
|
5
|
+
import { type AppState } from "../store";
|
|
6
|
+
/**
|
|
7
|
+
* The options for the layout route.
|
|
8
|
+
*/
|
|
9
|
+
export interface LayoutOptions extends Pick<VefLayoutProps, "title" | "logo"> {
|
|
10
|
+
/**
|
|
11
|
+
* The user description mapper.
|
|
12
|
+
*/
|
|
13
|
+
getUserDescription?: Mapper<NonNullable<AppState["user"]>, string>;
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* Creates the options for the layout route.
|
|
5
17
|
*
|
|
6
18
|
* @returns The options for the layout route.
|
|
7
19
|
*/
|
|
8
|
-
export declare function createLayoutRouteOptions<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]["parentRoute"], TId extends RouteConstraints["TId"] = FileRoutesByPath[TFilePath]["id"], TPath extends RouteConstraints["TPath"] = FileRoutesByPath[TFilePath]["path"], TFullPath extends RouteConstraints["TFullPath"] = FileRoutesByPath[TFilePath]["fullPath"]>(): RouteOptions<TFilePath, TParentRoute, TId, TPath, TFullPath>;
|
|
20
|
+
export declare function createLayoutRouteOptions<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]["parentRoute"], TId extends RouteConstraints["TId"] = FileRoutesByPath[TFilePath]["id"], TPath extends RouteConstraints["TPath"] = FileRoutesByPath[TFilePath]["path"], TFullPath extends RouteConstraints["TFullPath"] = FileRoutesByPath[TFilePath]["fullPath"]>({ title, logo, getUserDescription, }: LayoutOptions): RouteOptions<TFilePath, TParentRoute, TId, TPath, TFullPath>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AnyRoute, type FileRoutesByPath, type RouteConstraints } from "@tanstack/react-router";
|
|
2
|
+
import type { RouteOptions } from "../types";
|
|
3
|
+
import { type VefLoginPageProps } from "../components";
|
|
4
|
+
/**
|
|
5
|
+
* The options for the login route.
|
|
6
|
+
*/
|
|
7
|
+
export interface LoginOptions extends VefLoginPageProps {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates the options for the login route.
|
|
11
|
+
*
|
|
12
|
+
* @returns The options for the login route.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createLoginRouteOptions<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]["parentRoute"], TId extends RouteConstraints["TId"] = FileRoutesByPath[TFilePath]["id"], TPath extends RouteConstraints["TPath"] = FileRoutesByPath[TFilePath]["path"], TFullPath extends RouteConstraints["TFullPath"] = FileRoutesByPath[TFilePath]["fullPath"]>(props: LoginOptions): RouteOptions<TFilePath, TParentRoute, TId, TPath, TFullPath>;
|
package/types/store.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type AuthenticatedToken, type AuthenticatedUser, type BasicMenuItem, type Except, type GroupMenuItem, type IdValue, type MenuItem, type SubmenuItem } from "@vef-framework/shared";
|
|
2
|
+
/**
|
|
3
|
+
* The state of the app.
|
|
4
|
+
*/
|
|
5
|
+
export interface AppState {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the user is authenticated.
|
|
8
|
+
*/
|
|
9
|
+
isAuthenticated: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The authenticated user.
|
|
12
|
+
*/
|
|
13
|
+
user?: Readonly<Except<AuthenticatedUser, "menus" | "permissions">>;
|
|
14
|
+
/**
|
|
15
|
+
* The authenticated token info.
|
|
16
|
+
*/
|
|
17
|
+
token?: Readonly<AuthenticatedToken>;
|
|
18
|
+
/**
|
|
19
|
+
* The menus of the user.
|
|
20
|
+
*/
|
|
21
|
+
menus?: readonly MenuItem[];
|
|
22
|
+
/**
|
|
23
|
+
* The route parent menus mappings.
|
|
24
|
+
*/
|
|
25
|
+
routeParentMenusMappings?: Readonly<Map<IdValue, [BasicMenuItem | SubmenuItem | GroupMenuItem, Array<SubmenuItem | GroupMenuItem>]>>;
|
|
26
|
+
/**
|
|
27
|
+
* The authorized permissions of the user.
|
|
28
|
+
*/
|
|
29
|
+
permissions?: Readonly<Set<string>>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create the app store.
|
|
33
|
+
*/
|
|
34
|
+
export declare const useAppStore: import("@vef-framework/shared").BoundStoreApi<AppState>;
|