@vef-framework/starter 1.0.122 → 1.0.124

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 (102) hide show
  1. package/cjs/api.cjs +17 -0
  2. package/cjs/app.cjs +27 -0
  3. package/cjs/components/index.cjs +20 -0
  4. package/cjs/components/vef-access-denied-page/index.cjs +27 -0
  5. package/cjs/components/vef-access-denied-page/props.cjs +4 -0
  6. package/cjs/components/vef-app/index.cjs +19 -0
  7. package/cjs/components/vef-app/props.cjs +4 -0
  8. package/cjs/components/vef-dev-assistant/index.cjs +159 -0
  9. package/cjs/components/vef-dev-assistant/props.cjs +4 -0
  10. package/cjs/components/vef-error-page/index.cjs +24 -0
  11. package/cjs/components/vef-error-page/props.cjs +4 -0
  12. package/cjs/components/vef-login-page/index.cjs +41 -0
  13. package/cjs/components/vef-login-page/props.cjs +4 -0
  14. package/cjs/components/vef-not-found-page/index.cjs +26 -0
  15. package/cjs/components/vef-not-found-page/props.cjs +4 -0
  16. package/cjs/components/vef-router-provider/index.cjs +22 -0
  17. package/cjs/components/vef-router-provider/props.cjs +4 -0
  18. package/cjs/constants.cjs +17 -0
  19. package/cjs/helper.cjs +22 -0
  20. package/cjs/index.cjs +47 -0
  21. package/cjs/router.cjs +72 -0
  22. package/cjs/routes/access-denied.cjs +14 -0
  23. package/cjs/routes/index.cjs +14 -0
  24. package/cjs/routes/layout.cjs +136 -0
  25. package/cjs/routes/login.cjs +31 -0
  26. package/cjs/routes/root.cjs +24 -0
  27. package/cjs/store.cjs +21 -0
  28. package/esm/api.js +15 -0
  29. package/esm/app.js +25 -0
  30. package/esm/components/index.js +10 -0
  31. package/esm/components/vef-access-denied-page/index.js +23 -0
  32. package/esm/components/vef-access-denied-page/props.js +2 -0
  33. package/esm/components/vef-app/index.js +15 -0
  34. package/esm/components/vef-app/props.js +2 -0
  35. package/esm/components/vef-dev-assistant/index.js +155 -0
  36. package/esm/components/vef-dev-assistant/props.js +2 -0
  37. package/esm/components/vef-error-page/index.js +20 -0
  38. package/esm/components/vef-error-page/props.js +2 -0
  39. package/esm/components/vef-login-page/index.js +37 -0
  40. package/esm/components/vef-login-page/props.js +2 -0
  41. package/esm/components/vef-not-found-page/index.js +22 -0
  42. package/esm/components/vef-not-found-page/props.js +2 -0
  43. package/esm/components/vef-router-provider/index.js +18 -0
  44. package/esm/components/vef-router-provider/props.js +2 -0
  45. package/esm/constants.js +10 -0
  46. package/esm/helper.js +20 -0
  47. package/esm/index.js +22 -0
  48. package/esm/router.js +70 -0
  49. package/esm/routes/access-denied.js +12 -0
  50. package/esm/routes/index.js +7 -0
  51. package/esm/routes/layout.js +134 -0
  52. package/esm/routes/login.js +29 -0
  53. package/esm/routes/root.js +22 -0
  54. package/esm/store.js +19 -0
  55. package/package.json +17 -16
  56. package/es/api.js +0 -1
  57. package/es/app.js +0 -1
  58. package/es/components/index.js +0 -1
  59. package/es/components/vef-access-denied-page/index.js +0 -1
  60. package/es/components/vef-app/index.js +0 -1
  61. package/es/components/vef-dev-assistant/index.js +0 -30
  62. package/es/components/vef-error-page/index.js +0 -1
  63. package/es/components/vef-login-page/index.js +0 -1
  64. package/es/components/vef-not-found-page/index.js +0 -1
  65. package/es/components/vef-router-provider/index.js +0 -1
  66. package/es/constants.js +0 -1
  67. package/es/helper.js +0 -1
  68. package/es/index.js +0 -1
  69. package/es/router.js +0 -1
  70. package/es/routes/access-denied.js +0 -1
  71. package/es/routes/index.js +0 -1
  72. package/es/routes/layout.js +0 -1
  73. package/es/routes/login.js +0 -1
  74. package/es/routes/root.js +0 -1
  75. package/es/store.js +0 -1
  76. package/lib/api.cjs +0 -1
  77. package/lib/app.cjs +0 -1
  78. package/lib/components/index.cjs +0 -1
  79. package/lib/components/vef-access-denied-page/index.cjs +0 -1
  80. package/lib/components/vef-access-denied-page/props.cjs +0 -1
  81. package/lib/components/vef-app/index.cjs +0 -1
  82. package/lib/components/vef-app/props.cjs +0 -1
  83. package/lib/components/vef-dev-assistant/index.cjs +0 -30
  84. package/lib/components/vef-dev-assistant/props.cjs +0 -1
  85. package/lib/components/vef-error-page/index.cjs +0 -1
  86. package/lib/components/vef-error-page/props.cjs +0 -1
  87. package/lib/components/vef-login-page/index.cjs +0 -1
  88. package/lib/components/vef-login-page/props.cjs +0 -1
  89. package/lib/components/vef-not-found-page/index.cjs +0 -1
  90. package/lib/components/vef-not-found-page/props.cjs +0 -1
  91. package/lib/components/vef-router-provider/index.cjs +0 -1
  92. package/lib/components/vef-router-provider/props.cjs +0 -1
  93. package/lib/constants.cjs +0 -1
  94. package/lib/helper.cjs +0 -1
  95. package/lib/index.cjs +0 -1
  96. package/lib/router.cjs +0 -1
  97. package/lib/routes/access-denied.cjs +0 -1
  98. package/lib/routes/index.cjs +0 -1
  99. package/lib/routes/layout.cjs +0 -1
  100. package/lib/routes/login.cjs +0 -1
  101. package/lib/routes/root.cjs +0 -1
  102. package/lib/store.cjs +0 -1
package/esm/router.js ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ import { createRouter as createRouter$1, createHashHistory, createBrowserHistory } from '@tanstack/react-router';
3
+ import { VefText, VefLoadingPlaceholder } from '@vef-framework/components';
4
+ import { showErrorNotification } from '@vef-framework/shared';
5
+ import NProgress from 'nprogress';
6
+ import { createElement } from 'react';
7
+
8
+ "use strict";
9
+ const defaultGcTime = 10 * 60 * 1e3;
10
+ function createRouter({
11
+ routeTree,
12
+ history
13
+ }) {
14
+ const router = createRouter$1({
15
+ routeTree,
16
+ trailingSlash: "never",
17
+ caseSensitive: true,
18
+ history: history === "hash" ? createHashHistory() : createBrowserHistory(),
19
+ search: {
20
+ strict: true
21
+ },
22
+ notFoundMode: "root",
23
+ defaultPendingComponent: () => createElement(
24
+ VefLoadingPlaceholder,
25
+ {
26
+ size: "large"
27
+ }
28
+ ),
29
+ defaultPendingMs: 500,
30
+ defaultPendingMinMs: 300,
31
+ defaultSsr: false,
32
+ defaultStructuralSharing: true,
33
+ defaultHashScrollIntoView: {
34
+ behavior: "smooth",
35
+ block: "start",
36
+ inline: "center"
37
+ },
38
+ defaultPreload: "intent",
39
+ defaultPreloadDelay: 50,
40
+ defaultPreloadGcTime: defaultGcTime,
41
+ defaultGcTime,
42
+ defaultOnCatch(error, errorInfo) {
43
+ showErrorNotification(
44
+ error.message || error.name,
45
+ createElement(
46
+ VefText,
47
+ {
48
+ color: "error",
49
+ children: createElement("pre", {
50
+ style: {
51
+ maxHeight: "480px",
52
+ overflowY: "auto",
53
+ scrollbarWidth: "thin",
54
+ scrollbarColor: "rgba(0, 0, 0, 0.2) transparent"
55
+ },
56
+ children: error.stack || errorInfo.componentStack || "No stack trace available"
57
+ })
58
+ }
59
+ )
60
+ );
61
+ }
62
+ });
63
+ router.subscribe("onBeforeLoad", ({ pathChanged }) => pathChanged && NProgress.start());
64
+ router.subscribe("onLoad", () => {
65
+ NProgress.done();
66
+ });
67
+ return router;
68
+ }
69
+
70
+ export { createRouter };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ import '../components/index.js';
3
+ import VefAccessDeniedPage from '../components/vef-access-denied-page/index.js';
4
+
5
+ "use strict";
6
+ function createAccessDeniedRouteOptions() {
7
+ return {
8
+ component: VefAccessDeniedPage
9
+ };
10
+ }
11
+
12
+ export { createAccessDeniedRouteOptions };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ export { createAccessDeniedRouteOptions } from './access-denied.js';
3
+ export { createLayoutRouteOptions } from './layout.js';
4
+ export { createLoginRouteOptions } from './login.js';
5
+ export { createRootRoute } from './root.js';
6
+
7
+ "use strict";
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ import { jsx } from '@emotion/react/jsx-runtime';
3
+ import { useRouter, useNavigate, useLocation, Outlet, redirect } from '@tanstack/react-router';
4
+ import { VefIcon, VefLayout, VefLoadingPlaceholder } from '@vef-framework/components';
5
+ import { useApiContext } from '@vef-framework/core';
6
+ import { buildRouteParentMenusMappings } from '@vef-framework/shared';
7
+ import { HomeIcon } from 'lucide-react';
8
+ import { useMemo, useCallback } from 'react';
9
+ import { INDEX_PAGE_PATH, ACCESS_DENIED_PAGE_PATH, LOGIN_PAGE_PATH } from '../constants.js';
10
+ import { handleClientLogout } from '../helper.js';
11
+ import { useAppStore } from '../store.js';
12
+
13
+ "use strict";
14
+ const indexBreadcrumbItem = {
15
+ key: INDEX_PAGE_PATH,
16
+ label: /* @__PURE__ */ jsx(VefIcon, { children: /* @__PURE__ */ jsx(HomeIcon, {}) })
17
+ };
18
+ function createLayoutRouteOptions({
19
+ title,
20
+ logo,
21
+ getUserDescription
22
+ }) {
23
+ function LayoutComponent() {
24
+ const router = useRouter();
25
+ const navigate = useNavigate();
26
+ const { pathname } = useLocation();
27
+ const [menus, user, routeParentMenusMappings] = useAppStore((state) => [state.menus, state.user, state.routeParentMenusMappings]);
28
+ const defaultOpenedMenuKeys = routeParentMenusMappings?.get(pathname)?.[1].map((it) => it.key);
29
+ const breadcrumbItems = useMemo(() => {
30
+ const mapping = routeParentMenusMappings?.get(pathname);
31
+ if (!mapping) {
32
+ return [];
33
+ }
34
+ const [currentMenu, parentMenus] = mapping;
35
+ return [
36
+ indexBreadcrumbItem,
37
+ ...parentMenus.map((menu) => ({
38
+ key: menu.key,
39
+ label: menu.label,
40
+ dropdownItems: menu.children.filter((child) => child.type !== "divider").map((child) => ({
41
+ key: child.key,
42
+ label: child.label
43
+ }))
44
+ })),
45
+ {
46
+ label: currentMenu.label
47
+ }
48
+ ];
49
+ }, [pathname, routeParentMenusMappings]);
50
+ const { logoutApi, fetchAuthenticatedUserApi } = useApiContext();
51
+ const { mutate: logout } = logoutApi.useMutation();
52
+ const handleLogout = useCallback(async () => {
53
+ await logout();
54
+ await handleClientLogout(router, fetchAuthenticatedUserApi);
55
+ }, [logout, router, fetchAuthenticatedUserApi]);
56
+ const handleMenuSwitch = useCallback((menuKey) => {
57
+ navigate({
58
+ to: menuKey
59
+ });
60
+ }, [navigate]);
61
+ return /* @__PURE__ */ jsx(
62
+ VefLayout,
63
+ {
64
+ activeMenuKey: pathname,
65
+ breadcrumbItems,
66
+ defaultOpenedMenuKeys,
67
+ logo,
68
+ menuItems: menus,
69
+ title,
70
+ userAvatar: user?.avatar,
71
+ userDescription: getUserDescription?.(user),
72
+ userGender: user?.gender,
73
+ userName: user?.name,
74
+ onActiveMenuKeyChange: handleMenuSwitch,
75
+ onBreadcrumbClick: handleMenuSwitch,
76
+ onLogout: handleLogout,
77
+ children: /* @__PURE__ */ jsx(Outlet, {})
78
+ }
79
+ );
80
+ }
81
+ return {
82
+ beforeLoad: ({ location }) => {
83
+ const { isAuthenticated, routeParentMenusMappings } = useAppStore.getState();
84
+ if (!isAuthenticated) {
85
+ throw redirect({
86
+ to: LOGIN_PAGE_PATH,
87
+ search: {
88
+ redirect: location.href
89
+ }
90
+ });
91
+ }
92
+ if (routeParentMenusMappings && !routeParentMenusMappings.has(location.pathname)) {
93
+ throw redirect({
94
+ to: ACCESS_DENIED_PAGE_PATH,
95
+ replace: true
96
+ });
97
+ }
98
+ },
99
+ loader: async ({ context, location }) => {
100
+ const { fetchAuthenticatedUserApi } = context;
101
+ const {
102
+ menus,
103
+ permissions,
104
+ ...user
105
+ } = await fetchAuthenticatedUserApi.fetchQuery();
106
+ const routeParentMenusMappings = Object.freeze(buildRouteParentMenusMappings(menus));
107
+ useAppStore.setState({
108
+ user: Object.freeze(user),
109
+ menus: Object.freeze(menus),
110
+ permissions: Object.freeze(new Set(permissions)),
111
+ routeParentMenusMappings
112
+ });
113
+ if (!routeParentMenusMappings.has(location.pathname)) {
114
+ throw redirect({
115
+ to: ACCESS_DENIED_PAGE_PATH,
116
+ replace: true
117
+ });
118
+ }
119
+ },
120
+ pendingComponent: () => /* @__PURE__ */ jsx(
121
+ VefLoadingPlaceholder,
122
+ {
123
+ size: "large",
124
+ tip: "系统加载中,请稍后..."
125
+ }
126
+ ),
127
+ component: LayoutComponent,
128
+ staleTime: Infinity,
129
+ gcTime: 0,
130
+ shouldReload: false
131
+ };
132
+ }
133
+
134
+ export { createLayoutRouteOptions };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ import { jsx } from '@emotion/react/jsx-runtime';
3
+ import { redirect } from '@tanstack/react-router';
4
+ import { z } from '@vef-framework/shared';
5
+ import '../components/index.js';
6
+ import { INDEX_PAGE_PATH } from '../constants.js';
7
+ import { useAppStore } from '../store.js';
8
+ import VefLoginPage from '../components/vef-login-page/index.js';
9
+
10
+ "use strict";
11
+ function createLoginRouteOptions(props) {
12
+ return {
13
+ validateSearch: z.object({
14
+ redirect: z.string().optional().default(INDEX_PAGE_PATH).catch(INDEX_PAGE_PATH)
15
+ }),
16
+ beforeLoad: ({ search }) => {
17
+ if (useAppStore.getState().isAuthenticated) {
18
+ const { redirect: redirectPath } = search;
19
+ throw redirect({
20
+ to: redirectPath,
21
+ replace: true
22
+ });
23
+ }
24
+ },
25
+ component: () => /* @__PURE__ */ jsx(VefLoginPage, { ...props })
26
+ };
27
+ }
28
+
29
+ export { createLoginRouteOptions };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ import { jsxs, Fragment, jsx } from '@emotion/react/jsx-runtime';
3
+ import { createRootRouteWithContext, Outlet } from '@tanstack/react-router';
4
+ import '../components/index.js';
5
+ import VefNotFoundPage from '../components/vef-not-found-page/index.js';
6
+ import VefErrorPage from '../components/vef-error-page/index.js';
7
+ import VefDevAssistant from '../components/vef-dev-assistant/index.js';
8
+
9
+ "use strict";
10
+ function createRootRoute() {
11
+ return createRootRouteWithContext()({
12
+ component: () => /* @__PURE__ */ jsxs(Fragment, { children: [
13
+ /* @__PURE__ */ jsx(Outlet, {}),
14
+ process.env.NODE_ENV === "development" && /* @__PURE__ */ jsx(VefDevAssistant, {})
15
+ ] }),
16
+ errorComponent: VefErrorPage,
17
+ notFoundComponent: VefNotFoundPage,
18
+ ssr: false
19
+ });
20
+ }
21
+
22
+ export { createRootRoute };
package/esm/store.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ import { createStore } from '@vef-framework/shared';
3
+
4
+ "use strict";
5
+ const useAppStore = createStore(
6
+ () => ({
7
+ isAuthenticated: false
8
+ }),
9
+ {
10
+ name: "APP",
11
+ storage: "session",
12
+ selector: (state) => ({
13
+ isAuthenticated: state.isAuthenticated,
14
+ token: state.token
15
+ })
16
+ }
17
+ );
18
+
19
+ export { useAppStore };
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@vef-framework/starter",
3
3
  "type": "module",
4
- "version": "1.0.122",
4
+ "version": "1.0.124",
5
5
  "private": false,
6
- "packageManager": "pnpm@9.15.0",
7
6
  "description": "The starter of the VEF framework",
8
7
  "author": "Venus",
9
8
  "keywords": [
@@ -15,11 +14,11 @@
15
14
  "exports": {
16
15
  ".": {
17
16
  "types": "./types/index.d.ts",
18
- "import": "./es/index.js",
19
- "require": "./lib/index.cjs"
17
+ "import": "./esm/index.js",
18
+ "require": "./cjs/index.cjs"
20
19
  }
21
20
  },
22
- "main": "es/index.js",
21
+ "main": "cjs/index.cjs",
23
22
  "types": "types/index.d.ts",
24
23
  "files": [
25
24
  "*"
@@ -30,26 +29,28 @@
30
29
  "peerDependencies": {
31
30
  "react": "18.3.1",
32
31
  "react-dom": "18.3.1",
33
- "@tanstack/react-router": "^1.114.3"
32
+ "@tanstack/react-router": "^1.114.23"
34
33
  },
35
34
  "dependencies": {
36
35
  "@emotion/cache": "11.14.0",
37
36
  "@emotion/react": "11.14.0",
38
37
  "@emotion/styled": "11.14.0",
39
- "antd": "5.24.3",
38
+ "antd": "5.24.4",
40
39
  "tslib": "2.8.1",
41
40
  "use-sync-external-store": "^1.4.0",
42
- "@tanstack/react-query-devtools": "5.67.2",
43
- "@tanstack/router-devtools": "^1.114.3",
44
- "@vef-framework/components": "1.0.122",
45
- "@vef-framework/core": "1.0.122",
46
- "@vef-framework/hooks": "1.0.122",
47
- "@vef-framework/shared": "1.0.122",
48
- "lucide-react": "0.479.0",
49
- "motion": "12.4.10",
41
+ "@tanstack/react-query-devtools": "5.68.0",
42
+ "@tanstack/router-devtools": "^1.114.23",
43
+ "@vef-framework/components": "1.0.124",
44
+ "@vef-framework/core": "1.0.124",
45
+ "@vef-framework/hooks": "1.0.124",
46
+ "@vef-framework/shared": "1.0.124",
47
+ "lucide-react": "0.482.0",
48
+ "motion": "12.5.0",
50
49
  "nprogress": "^0.2.0"
51
50
  },
52
51
  "publishConfig": {
53
52
  "access": "public"
54
- }
53
+ },
54
+ "module": "esm/index.js",
55
+ "packageManager": "pnpm@10.6.3"
55
56
  }
package/es/api.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createApiClient as createApiClient$1}from"@vef-framework/core";import{useAppStore}from"./store.js";function createApiClient(options){return createApiClient$1({...options,getAccessToken(){return useAppStore.getState().token?.accessToken}})}/*! 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 */export{createApiClient};
package/es/app.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createElement}from"react";import{createRoot}from"react-dom/client";import"./components/index.js";import VefApp from"./components/vef-app/index.js";function createApp(){const root=createRoot(document.getElementById("root"),{identifierPrefix:"vef-"});return{render:props=>{root.render(createElement(VefApp,props))},unmount:()=>root.unmount()}}/*! 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 */export{createApp};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{default as default2}from"./vef-access-denied-page/index.js";import{default as default3}from"./vef-app/index.js";import{default as default4}from"./vef-dev-assistant/index.js";import{default as default5}from"./vef-error-page/index.js";import{default as default6}from"./vef-login-page/index.js";import{default as default7}from"./vef-not-found-page/index.js";import{default as default8}from"./vef-router-provider/index.js";/*! 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 */export{default2 as VefAccessDeniedPage,default3 as VefApp,default4 as VefDevAssistant,default5 as VefErrorPage,default6 as VefLoginPage,default7 as VefNotFoundPage,default8 as VefRouterProvider};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{useLocation,useRouterState,useNavigate}from"@tanstack/react-router";import{VefAccessDenied}from"@vef-framework/components";import{useCallback}from"react";import{INDEX_PAGE_PATH}from"../../constants.js";function VefAccessDeniedPage(props){const{pathname}=useLocation(),{redirect}=useRouterState(),navigate=useNavigate(),handleNavigateHome=useCallback(()=>navigate({to:INDEX_PAGE_PATH,replace:!0}),[navigate]);return jsx(VefAccessDenied,{uri:redirect?._fromLocation?.pathname??pathname,onNavigateHome:handleNavigateHome,...props})}/*! 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 */export{VefAccessDeniedPage as default};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{VefConfigProvider}from"@vef-framework/components";import{StrictMode}from"react";import VefRouterProvider from"../vef-router-provider/index.js";function VefApp({router,...configProviderProps}){return jsx(StrictMode,{children:jsx(VefConfigProvider,{...configProviderProps,children:jsx(VefRouterProvider,{router})})})}/*! 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 */export{VefApp as default};
@@ -1,30 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsxs,jsx,Fragment}from"@emotion/react/jsx-runtime";import{css}from"@emotion/react";import{VefFloatButtonGroup,VefFloatButton,VefIcon,VefLoadingPlaceholder}from"@vef-framework/components";import{useKeyPress}from"@vef-framework/hooks";import{themeVariables,noop}from"@vef-framework/shared";import{CompassIcon,SendIcon}from"lucide-react";import{AnimatePresence,motion}from"motion/react";import{lazy,useState,useCallback,Suspense}from"react";const devtoolsContainerStyle=css`
2
- position: fixed;
3
- bottom: 0;
4
- width: 100%;
5
- height: 600px;
6
- z-index: 2;
7
-
8
- .tsqd-text-logo-container {
9
- display: none;
10
- }
11
-
12
- .TanStackRouterDevtoolsPanel {
13
- > button {
14
- display: none;
15
- }
16
-
17
- > div:first-of-type {
18
- > div:first-of-type {
19
- display: none;
20
- }
21
- }
22
-
23
- > div {
24
- padding: ${themeVariables.paddingSm};
25
- scrollbar-width: thin;
26
- scrollbar-color: #334155 transparent;
27
- box-shadow: ${themeVariables.boxShadowDrawerDown};
28
- }
29
- }
30
- `;function IconCoffee(props){return jsxs("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...props,children:[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:jsx("animate",{attributeName:"fill-opacity",begin:"0.8s",dur:"0.5s",fill:"freeze",values:"0;1"})}),jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[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:jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",fill:"freeze",values:"48;0"})}),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:jsx("animate",{attributeName:"stroke-dashoffset",begin:"0.6s",dur:"0.2s",fill:"freeze",values:"14;0"})}),jsx("mask",{id:"lineMdCoffeeHalfEmptyFilledLoop0",children: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:jsx("animateMotion",{calcMode:"linear",dur:"3s",path:"M0 0v-8",repeatCount:"indefinite"})})}),jsxs("rect",{fill:"currentColor",height:0,mask:"url(#lineMdCoffeeHalfEmptyFilledLoop0)",width:24,y:7,children:[jsx("animate",{attributeName:"y",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"7;2"}),jsx("animate",{attributeName:"height",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"0;5"})]})]})]})}const isDev=process.env.NODE_ENV==="development",RouterDevtools=isDev?lazy(()=>import("@tanstack/router-devtools").then(mod=>({default:mod.TanStackRouterDevtoolsPanel}))):()=>null,QueryDevtools=isDev?lazy(()=>import("@tanstack/react-query-devtools").then(mod=>({default:mod.ReactQueryDevtoolsPanel}))):()=>null,variants={opened:{opacity:1,y:0,transition:{type:"spring",bounce:0,duration:.2}},closed:{opacity:0,y:"50%"}};function VefDevAssistant(){const[visibleDevtools,setVisibleDevtools]=useState(null),handleShowQueryDevtools=useCallback(event=>{event.stopPropagation(),setVisibleDevtools(visible=>visible==="query"?null:"query")},[]),handleShowRouterDevtools=useCallback(event=>{event.stopPropagation(),setVisibleDevtools(visible=>visible==="router"?null:"router")},[]);return useKeyPress("esc",()=>{visibleDevtools&&setVisibleDevtools(null)}),jsxs(Fragment,{children:[jsxs(VefFloatButtonGroup,{collapsable:!0,shape:"square",icon:jsx(VefIcon,{size:"huge",children:jsx(IconCoffee,{})}),onClick:event=>event.stopPropagation(),children:[jsx(VefFloatButton,{tip:"API调试控制台",icon:jsx(VefIcon,{children:jsx(CompassIcon,{})}),onClick:handleShowQueryDevtools}),jsx(VefFloatButton,{tip:"路由调试控制台",icon:jsx(VefIcon,{children:jsx(SendIcon,{})}),onClick:handleShowRouterDevtools})]}),jsxs(AnimatePresence,{mode:"wait",children:[visibleDevtools==="query"&&jsx(motion.div,{animate:"opened",css:devtoolsContainerStyle,exit:"closed",initial:"closed",variants,children:jsx(Suspense,{fallback:jsx(VefLoadingPlaceholder,{}),children:jsx(QueryDevtools,{style:{height:"100%"}})})}),visibleDevtools==="router"&&jsx(motion.div,{animate:"opened",css:devtoolsContainerStyle,exit:"closed",initial:"closed",variants,children:jsx(Suspense,{fallback:jsx(VefLoadingPlaceholder,{}),children:jsx(RouterDevtools,{isOpen:visibleDevtools==="router",setIsOpen:noop,style:{height:"100%"}})})})]})]})}/*! 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 */export{VefDevAssistant as default};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{VefError}from"@vef-framework/components";import{useQueryErrorResetBoundary}from"@vef-framework/core";import{useEffect}from"react";function VefErrorPage({error,info,reset}){const{reset:resetQueryError}=useQueryErrorResetBoundary();return useEffect(()=>{resetQueryError()},[resetQueryError]),jsx(VefError,{componentStack:info?.componentStack,error,reset})}/*! 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 */export{VefErrorPage as default};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{useRouter,useNavigate,useSearch}from"@tanstack/react-router";import{VefLogin}from"@vef-framework/components";import{LOGIN_PAGE_ROUTE}from"../../constants.js";import{useAppStore}from"../../store.js";function VefLoginPage(props){const router=useRouter(),navigate=useNavigate(),{redirect}=useSearch({from:LOGIN_PAGE_ROUTE});return jsx(VefLogin,{onLoginSuccess:async({accessToken,refreshToken})=>{useAppStore.setState({isAuthenticated:!0,token:Object.freeze({accessToken,refreshToken})}),await router.invalidate(),await navigate({to:redirect,replace:!0})},...props})}/*! 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 */export{VefLoginPage as default};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{useNavigate,useLocation}from"@tanstack/react-router";import{VefNotFound}from"@vef-framework/components";import{useCallback}from"react";import{INDEX_PAGE_PATH}from"../../constants.js";function VefNotFoundPage(){const navigate=useNavigate(),handleNavigateHome=useCallback(()=>navigate({to:INDEX_PAGE_PATH,replace:!0}),[navigate]),{pathname}=useLocation();return jsx(VefNotFound,{uri:pathname,onNavigateHome:handleNavigateHome})}/*! 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 */export{VefNotFoundPage as default};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{RouterProvider}from"@tanstack/react-router";import{useApiContext}from"@vef-framework/core";import{useMemo}from"react";function VefRouterProvider({router}){const{fetchAuthenticatedUserApi}=useApiContext(),context=useMemo(()=>({fetchAuthenticatedUserApi}),[fetchAuthenticatedUserApi]);return jsx(RouterProvider,{context,router})}/*! 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 */export{VefRouterProvider as default};
package/es/constants.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */const LOGIN_PAGE_PATH="/login",LOGIN_PAGE_ROUTE="/_common/login",INDEX_PAGE_PATH="/",INDEX_PAGE_ROUTE="/_layout",ACCESS_DENIED_PAGE_PATH="/access-denied",ACCESS_DENIED_PAGE_ROUTE="/_common/access-denied";/*! 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 */export{ACCESS_DENIED_PAGE_PATH,ACCESS_DENIED_PAGE_ROUTE,INDEX_PAGE_PATH,INDEX_PAGE_ROUTE,LOGIN_PAGE_PATH,LOGIN_PAGE_ROUTE};
package/es/helper.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{LOGIN_PAGE_PATH}from"./constants.js";import{useAppStore}from"./store.js";async function handleClientLogout(router,fetchAuthenticatedUserApi){await fetchAuthenticatedUserApi.invalidateQueries(),useAppStore.setState({isAuthenticated:!1},!0),await router.invalidate(),await router.navigate({to:LOGIN_PAGE_PATH})}/*! 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 */export{handleClientLogout};
package/es/index.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createApiClient}from"./api.js";import{createApp}from"./app.js";import"./components/index.js";import{ACCESS_DENIED_PAGE_PATH,ACCESS_DENIED_PAGE_ROUTE,INDEX_PAGE_PATH,INDEX_PAGE_ROUTE,LOGIN_PAGE_PATH,LOGIN_PAGE_ROUTE}from"./constants.js";import{handleClientLogout}from"./helper.js";import{createRouter}from"./router.js";import"./routes/index.js";import{useAppStore}from"./store.js";import{default as default2}from"./components/vef-access-denied-page/index.js";import{default as default3}from"./components/vef-app/index.js";import{default as default4}from"./components/vef-dev-assistant/index.js";import{default as default5}from"./components/vef-error-page/index.js";import{default as default6}from"./components/vef-login-page/index.js";import{default as default7}from"./components/vef-not-found-page/index.js";import{default as default8}from"./components/vef-router-provider/index.js";import{createAccessDeniedRouteOptions}from"./routes/access-denied.js";import{createLayoutRouteOptions}from"./routes/layout.js";import{createLoginRouteOptions}from"./routes/login.js";import{createRootRoute}from"./routes/root.js";/*! 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 */export{ACCESS_DENIED_PAGE_PATH,ACCESS_DENIED_PAGE_ROUTE,INDEX_PAGE_PATH,INDEX_PAGE_ROUTE,LOGIN_PAGE_PATH,LOGIN_PAGE_ROUTE,default2 as VefAccessDeniedPage,default3 as VefApp,default4 as VefDevAssistant,default5 as VefErrorPage,default6 as VefLoginPage,default7 as VefNotFoundPage,default8 as VefRouterProvider,createAccessDeniedRouteOptions,createApiClient,createApp,createLayoutRouteOptions,createLoginRouteOptions,createRootRoute,createRouter,handleClientLogout,useAppStore};
package/es/router.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createRouter as createRouter$1,createHashHistory,createBrowserHistory}from"@tanstack/react-router";import{VefText,VefLoadingPlaceholder}from"@vef-framework/components";import{showErrorNotification}from"@vef-framework/shared";import{createElement}from"react";const defaultGcTime=10*60*1e3;function createRouter({routeTree,history}){return createRouter$1({routeTree,trailingSlash:"never",caseSensitive:!0,history:history==="hash"?createHashHistory():createBrowserHistory(),search:{strict:!0},notFoundMode:"root",defaultPendingComponent:()=>createElement(VefLoadingPlaceholder,{size:"large"}),defaultPendingMs:500,defaultPendingMinMs:300,defaultSsr:!1,defaultStructuralSharing:!0,defaultHashScrollIntoView:{behavior:"smooth",block:"start",inline:"center"},defaultPreload:"intent",defaultPreloadDelay:50,defaultPreloadGcTime:defaultGcTime,defaultGcTime,defaultOnCatch(error,errorInfo){showErrorNotification(error.message||error.name,createElement(VefText,{color:"error",children:createElement("pre",{style:{maxHeight:"480px",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:error.stack||errorInfo.componentStack||"No stack trace available"})}))}})}/*! 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 */export{createRouter};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import"../components/index.js";import VefAccessDeniedPage from"../components/vef-access-denied-page/index.js";function createAccessDeniedRouteOptions(){return{component:VefAccessDeniedPage}}/*! 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 */export{createAccessDeniedRouteOptions};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createAccessDeniedRouteOptions}from"./access-denied.js";import{createLayoutRouteOptions}from"./layout.js";import{createLoginRouteOptions}from"./login.js";import{createRootRoute}from"./root.js";/*! 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 */export{createAccessDeniedRouteOptions,createLayoutRouteOptions,createLoginRouteOptions,createRootRoute};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{useRouter,useNavigate,useLocation,Outlet,redirect}from"@tanstack/react-router";import{VefIcon,VefLayout,VefLoadingPlaceholder}from"@vef-framework/components";import{useApiContext}from"@vef-framework/core";import{buildRouteParentMenusMappings}from"@vef-framework/shared";import{HomeIcon}from"lucide-react";import{useMemo,useCallback}from"react";import{INDEX_PAGE_PATH,ACCESS_DENIED_PAGE_PATH,LOGIN_PAGE_PATH}from"../constants.js";import{handleClientLogout}from"../helper.js";import{useAppStore}from"../store.js";const indexBreadcrumbItem={key:INDEX_PAGE_PATH,label:jsx(VefIcon,{children:jsx(HomeIcon,{})})};function createLayoutRouteOptions({title,logo,getUserDescription}){function LayoutComponent(){const router=useRouter(),navigate=useNavigate(),{pathname}=useLocation(),[menus,user,routeParentMenusMappings]=useAppStore(state=>[state.menus,state.user,state.routeParentMenusMappings]),defaultOpenedMenuKeys=routeParentMenusMappings?.get(pathname)?.[1].map(it=>it.key),breadcrumbItems=useMemo(()=>{const mapping=routeParentMenusMappings?.get(pathname);if(!mapping)return[];const[currentMenu,parentMenus]=mapping;return[indexBreadcrumbItem,...parentMenus.map(menu=>({key:menu.key,label:menu.label,dropdownItems:menu.children.filter(child=>child.type!=="divider").map(child=>({key:child.key,label:child.label}))})),{label:currentMenu.label}]},[pathname,routeParentMenusMappings]),{logoutApi,fetchAuthenticatedUserApi}=useApiContext(),{mutate:logout}=logoutApi.useMutation(),handleLogout=useCallback(async()=>{await logout(),await handleClientLogout(router,fetchAuthenticatedUserApi)},[logout,router,fetchAuthenticatedUserApi]),handleMenuSwitch=useCallback(menuKey=>{navigate({to:menuKey})},[navigate]);return jsx(VefLayout,{activeMenuKey:pathname,breadcrumbItems,defaultOpenedMenuKeys,logo,menuItems:menus,title,userAvatar:user?.avatar,userDescription:getUserDescription?.(user),userGender:user?.gender,userName:user?.name,onActiveMenuKeyChange:handleMenuSwitch,onBreadcrumbClick:handleMenuSwitch,onLogout:handleLogout,children:jsx(Outlet,{})})}return{beforeLoad:({location})=>{const{isAuthenticated,routeParentMenusMappings}=useAppStore.getState();if(!isAuthenticated)throw redirect({to:LOGIN_PAGE_PATH,search:{redirect:location.href}});if(routeParentMenusMappings&&!routeParentMenusMappings.has(location.pathname))throw redirect({to:ACCESS_DENIED_PAGE_PATH,replace:!0})},loader:async({context,location})=>{const{fetchAuthenticatedUserApi}=context,{menus,permissions,...user}=await fetchAuthenticatedUserApi.fetchQuery(),routeParentMenusMappings=Object.freeze(buildRouteParentMenusMappings(menus));if(useAppStore.setState({user:Object.freeze(user),menus:Object.freeze(menus),permissions:Object.freeze(new Set(permissions)),routeParentMenusMappings}),!routeParentMenusMappings.has(location.pathname))throw redirect({to:ACCESS_DENIED_PAGE_PATH,replace:!0})},pendingComponent:()=>jsx(VefLoadingPlaceholder,{size:"large",tip:"系统加载中,请稍后..."}),component:LayoutComponent,staleTime:1/0,gcTime:0,shouldReload:!1}}/*! 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 */export{createLayoutRouteOptions};
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsx}from"@emotion/react/jsx-runtime";import{redirect}from"@tanstack/react-router";import{z}from"@vef-framework/shared";import"../components/index.js";import{INDEX_PAGE_PATH}from"../constants.js";import{useAppStore}from"../store.js";import VefLoginPage from"../components/vef-login-page/index.js";function createLoginRouteOptions(props){return{validateSearch:z.object({redirect:z.string().optional().default(INDEX_PAGE_PATH).catch(INDEX_PAGE_PATH)}),beforeLoad:({search})=>{if(useAppStore.getState().isAuthenticated){const{redirect:redirectPath}=search;throw redirect({to:redirectPath,replace:!0})}},component:()=>jsx(VefLoginPage,{...props})}}/*! 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 */export{createLoginRouteOptions};
package/es/routes/root.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{jsxs,Fragment,jsx}from"@emotion/react/jsx-runtime";import{createRootRouteWithContext,Outlet}from"@tanstack/react-router";import"../components/index.js";import VefNotFoundPage from"../components/vef-not-found-page/index.js";import VefErrorPage from"../components/vef-error-page/index.js";import VefDevAssistant from"../components/vef-dev-assistant/index.js";function createRootRoute(){return createRootRouteWithContext()({component:()=>jsxs(Fragment,{children:[jsx(Outlet,{}),process.env.NODE_ENV==="development"&&jsx(VefDevAssistant,{})]}),errorComponent:VefErrorPage,notFoundComponent:VefNotFoundPage,ssr:!1})}/*! 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 */export{createRootRoute};
package/es/store.js DELETED
@@ -1 +0,0 @@
1
- /*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */import{createStore}from"@vef-framework/shared";const useAppStore=createStore(()=>({isAuthenticated:!1}),{name:"APP",storage:"session",selector:state=>({isAuthenticated:state.isAuthenticated,token:state.token})});/*! 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 */export{useAppStore};
package/lib/api.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@vef-framework/core"),store=require("./store.cjs");function createApiClient(options){return core.createApiClient({...options,getAccessToken(){return store.useAppStore.getState().token?.accessToken}})}exports.createApiClient=createApiClient;/*! 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 DELETED
@@ -1 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const react=require("react"),client=require("react-dom/client");require("./components/index.cjs");const index=require("./components/vef-app/index.cjs");function createApp(){const root=client.createRoot(document.getElementById("root"),{identifierPrefix:"vef-"});return{render:props=>{root.render(react.createElement(index.default,props))},unmount:()=>root.unmount()}}exports.createApp=createApp;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const index=require("./vef-access-denied-page/index.cjs"),index$1=require("./vef-app/index.cjs"),index$2=require("./vef-dev-assistant/index.cjs"),index$3=require("./vef-error-page/index.cjs"),index$4=require("./vef-login-page/index.cjs"),index$5=require("./vef-not-found-page/index.cjs"),index$6=require("./vef-router-provider/index.cjs");exports.VefAccessDeniedPage=index.default,exports.VefApp=index$1.default,exports.VefDevAssistant=index$2.default,exports.VefErrorPage=index$3.default,exports.VefLoginPage=index$4.default,exports.VefNotFoundPage=index$5.default,exports.VefRouterProvider=index$6.default;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),components=require("@vef-framework/components"),react=require("react"),constants=require("../../constants.cjs");function VefAccessDeniedPage(props){const{pathname}=reactRouter.useLocation(),{redirect}=reactRouter.useRouterState(),navigate=reactRouter.useNavigate(),handleNavigateHome=react.useCallback(()=>navigate({to:constants.INDEX_PAGE_PATH,replace:!0}),[navigate]);return jsxRuntime.jsx(components.VefAccessDenied,{uri:redirect?._fromLocation?.pathname??pathname,onNavigateHome:handleNavigateHome,...props})}exports.default=VefAccessDeniedPage;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),components=require("@vef-framework/components"),react=require("react"),index=require("../vef-router-provider/index.cjs");function VefApp({router,...configProviderProps}){return jsxRuntime.jsx(react.StrictMode,{children:jsxRuntime.jsx(components.VefConfigProvider,{...configProviderProps,children:jsxRuntime.jsx(index.default,{router})})})}exports.default=VefApp;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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,30 +0,0 @@
1
- "use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),react=require("@emotion/react"),components=require("@vef-framework/components"),hooks=require("@vef-framework/hooks"),shared=require("@vef-framework/shared"),lucideReact=require("lucide-react"),react$2=require("motion/react"),react$1=require("react"),devtoolsContainerStyle=react.css`
2
- position: fixed;
3
- bottom: 0;
4
- width: 100%;
5
- height: 600px;
6
- z-index: 2;
7
-
8
- .tsqd-text-logo-container {
9
- display: none;
10
- }
11
-
12
- .TanStackRouterDevtoolsPanel {
13
- > button {
14
- display: none;
15
- }
16
-
17
- > div:first-of-type {
18
- > div:first-of-type {
19
- display: none;
20
- }
21
- }
22
-
23
- > div {
24
- padding: ${shared.themeVariables.paddingSm};
25
- scrollbar-width: thin;
26
- scrollbar-color: #334155 transparent;
27
- box-shadow: ${shared.themeVariables.boxShadowDrawerDown};
28
- }
29
- }
30
- `;function IconCoffee(props){return jsxRuntime.jsxs("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...props,children:[jsxRuntime.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:jsxRuntime.jsx("animate",{attributeName:"fill-opacity",begin:"0.8s",dur:"0.5s",fill:"freeze",values:"0;1"})}),jsxRuntime.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[jsxRuntime.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:jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",fill:"freeze",values:"48;0"})}),jsxRuntime.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:jsxRuntime.jsx("animate",{attributeName:"stroke-dashoffset",begin:"0.6s",dur:"0.2s",fill:"freeze",values:"14;0"})}),jsxRuntime.jsx("mask",{id:"lineMdCoffeeHalfEmptyFilledLoop0",children:jsxRuntime.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:jsxRuntime.jsx("animateMotion",{calcMode:"linear",dur:"3s",path:"M0 0v-8",repeatCount:"indefinite"})})}),jsxRuntime.jsxs("rect",{fill:"currentColor",height:0,mask:"url(#lineMdCoffeeHalfEmptyFilledLoop0)",width:24,y:7,children:[jsxRuntime.jsx("animate",{attributeName:"y",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"7;2"}),jsxRuntime.jsx("animate",{attributeName:"height",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"0;5"})]})]})]})}const isDev=process.env.NODE_ENV==="development",RouterDevtools=isDev?react$1.lazy(()=>import("@tanstack/router-devtools").then(mod=>({default:mod.TanStackRouterDevtoolsPanel}))):()=>null,QueryDevtools=isDev?react$1.lazy(()=>import("@tanstack/react-query-devtools").then(mod=>({default:mod.ReactQueryDevtoolsPanel}))):()=>null,variants={opened:{opacity:1,y:0,transition:{type:"spring",bounce:0,duration:.2}},closed:{opacity:0,y:"50%"}};function VefDevAssistant(){const[visibleDevtools,setVisibleDevtools]=react$1.useState(null),handleShowQueryDevtools=react$1.useCallback(event=>{event.stopPropagation(),setVisibleDevtools(visible=>visible==="query"?null:"query")},[]),handleShowRouterDevtools=react$1.useCallback(event=>{event.stopPropagation(),setVisibleDevtools(visible=>visible==="router"?null:"router")},[]);return hooks.useKeyPress("esc",()=>{visibleDevtools&&setVisibleDevtools(null)}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(components.VefFloatButtonGroup,{collapsable:!0,shape:"square",icon:jsxRuntime.jsx(components.VefIcon,{size:"huge",children:jsxRuntime.jsx(IconCoffee,{})}),onClick:event=>event.stopPropagation(),children:[jsxRuntime.jsx(components.VefFloatButton,{tip:"API调试控制台",icon:jsxRuntime.jsx(components.VefIcon,{children:jsxRuntime.jsx(lucideReact.CompassIcon,{})}),onClick:handleShowQueryDevtools}),jsxRuntime.jsx(components.VefFloatButton,{tip:"路由调试控制台",icon:jsxRuntime.jsx(components.VefIcon,{children:jsxRuntime.jsx(lucideReact.SendIcon,{})}),onClick:handleShowRouterDevtools})]}),jsxRuntime.jsxs(react$2.AnimatePresence,{mode:"wait",children:[visibleDevtools==="query"&&jsxRuntime.jsx(react$2.motion.div,{animate:"opened",css:devtoolsContainerStyle,exit:"closed",initial:"closed",variants,children:jsxRuntime.jsx(react$1.Suspense,{fallback:jsxRuntime.jsx(components.VefLoadingPlaceholder,{}),children:jsxRuntime.jsx(QueryDevtools,{style:{height:"100%"}})})}),visibleDevtools==="router"&&jsxRuntime.jsx(react$2.motion.div,{animate:"opened",css:devtoolsContainerStyle,exit:"closed",initial:"closed",variants,children:jsxRuntime.jsx(react$1.Suspense,{fallback:jsxRuntime.jsx(components.VefLoadingPlaceholder,{}),children:jsxRuntime.jsx(RouterDevtools,{isOpen:visibleDevtools==="router",setIsOpen:shared.noop,style:{height:"100%"}})})})]})]})}exports.default=VefDevAssistant;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),components=require("@vef-framework/components"),core=require("@vef-framework/core"),react=require("react");function VefErrorPage({error,info,reset}){const{reset:resetQueryError}=core.useQueryErrorResetBoundary();return react.useEffect(()=>{resetQueryError()},[resetQueryError]),jsxRuntime.jsx(components.VefError,{componentStack:info?.componentStack,error,reset})}exports.default=VefErrorPage;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),components=require("@vef-framework/components"),constants=require("../../constants.cjs"),store=require("../../store.cjs");function VefLoginPage(props){const router=reactRouter.useRouter(),navigate=reactRouter.useNavigate(),{redirect}=reactRouter.useSearch({from:constants.LOGIN_PAGE_ROUTE});return jsxRuntime.jsx(components.VefLogin,{onLoginSuccess:async({accessToken,refreshToken})=>{store.useAppStore.setState({isAuthenticated:!0,token:Object.freeze({accessToken,refreshToken})}),await router.invalidate(),await navigate({to:redirect,replace:!0})},...props})}exports.default=VefLoginPage;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),components=require("@vef-framework/components"),react=require("react"),constants=require("../../constants.cjs");function VefNotFoundPage(){const navigate=reactRouter.useNavigate(),handleNavigateHome=react.useCallback(()=>navigate({to:constants.INDEX_PAGE_PATH,replace:!0}),[navigate]),{pathname}=reactRouter.useLocation();return jsxRuntime.jsx(components.VefNotFound,{uri:pathname,onNavigateHome:handleNavigateHome})}exports.default=VefNotFoundPage;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),core=require("@vef-framework/core"),react=require("react");function VefRouterProvider({router}){const{fetchAuthenticatedUserApi}=core.useApiContext(),context=react.useMemo(()=>({fetchAuthenticatedUserApi}),[fetchAuthenticatedUserApi]);return jsxRuntime.jsx(reactRouter.RouterProvider,{context,router})}exports.default=VefRouterProvider;/*! 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 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. *//*! 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/constants.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";/*! VefFramework version: 1.0.122, build time: 2025-03-11T09:32:18.827Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const LOGIN_PAGE_PATH="/login",LOGIN_PAGE_ROUTE="/_common/login",INDEX_PAGE_PATH="/",INDEX_PAGE_ROUTE="/_layout",ACCESS_DENIED_PAGE_PATH="/access-denied",ACCESS_DENIED_PAGE_ROUTE="/_common/access-denied";exports.ACCESS_DENIED_PAGE_PATH=ACCESS_DENIED_PAGE_PATH,exports.ACCESS_DENIED_PAGE_ROUTE=ACCESS_DENIED_PAGE_ROUTE,exports.INDEX_PAGE_PATH=INDEX_PAGE_PATH,exports.INDEX_PAGE_ROUTE=INDEX_PAGE_ROUTE,exports.LOGIN_PAGE_PATH=LOGIN_PAGE_PATH,exports.LOGIN_PAGE_ROUTE=LOGIN_PAGE_ROUTE;/*! 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 */