@vef-framework/starter 1.0.101 → 1.0.103

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 (48) hide show
  1. package/es/api.js +1 -15
  2. package/es/app.js +1 -25
  3. package/es/components/index.js +1 -9
  4. package/es/components/vef-access-denied-page/index.js +1 -23
  5. package/es/components/vef-app/index.js +1 -15
  6. package/es/components/vef-dev-assistant/index.js +2 -127
  7. package/es/components/vef-error-page/index.js +1 -20
  8. package/es/components/vef-login-page/index.js +1 -37
  9. package/es/components/vef-not-found-page/index.js +1 -22
  10. package/es/components/vef-router-provider/index.js +1 -18
  11. package/es/constants.js +1 -10
  12. package/es/helper.js +1 -20
  13. package/es/index.js +1 -21
  14. package/es/router.js +1 -70
  15. package/es/routes/access-denied.js +1 -12
  16. package/es/routes/index.js +1 -6
  17. package/es/routes/layout.js +1 -134
  18. package/es/routes/login.js +1 -29
  19. package/es/routes/root.js +1 -22
  20. package/es/store.js +1 -19
  21. package/lib/api.cjs +1 -19
  22. package/lib/app.cjs +1 -29
  23. package/lib/components/index.cjs +1 -23
  24. package/lib/components/vef-access-denied-page/index.cjs +1 -27
  25. package/lib/components/vef-access-denied-page/props.cjs +1 -5
  26. package/lib/components/vef-app/index.cjs +1 -19
  27. package/lib/components/vef-app/props.cjs +1 -5
  28. package/lib/components/vef-dev-assistant/index.cjs +2 -131
  29. package/lib/components/vef-dev-assistant/props.cjs +1 -5
  30. package/lib/components/vef-error-page/index.cjs +1 -24
  31. package/lib/components/vef-error-page/props.cjs +1 -5
  32. package/lib/components/vef-login-page/index.cjs +1 -41
  33. package/lib/components/vef-login-page/props.cjs +1 -5
  34. package/lib/components/vef-not-found-page/index.cjs +1 -26
  35. package/lib/components/vef-not-found-page/props.cjs +1 -5
  36. package/lib/components/vef-router-provider/index.cjs +1 -22
  37. package/lib/components/vef-router-provider/props.cjs +1 -5
  38. package/lib/constants.cjs +1 -19
  39. package/lib/helper.cjs +1 -24
  40. package/lib/index.cjs +1 -50
  41. package/lib/router.cjs +1 -74
  42. package/lib/routes/access-denied.cjs +1 -16
  43. package/lib/routes/index.cjs +1 -17
  44. package/lib/routes/layout.cjs +1 -138
  45. package/lib/routes/login.cjs +1 -33
  46. package/lib/routes/root.cjs +1 -26
  47. package/lib/store.cjs +1 -23
  48. package/package.json +5 -5
@@ -1,26 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
5
-
6
- const jsxRuntime = require('@emotion/react/jsx-runtime');
7
- const reactRouter = require('@tanstack/react-router');
8
- const components = require('@vef-framework/components');
9
- const react = require('react');
10
- const constants = require('../../constants.cjs');
11
-
12
- function VefNotFoundPage() {
13
- const navigate = reactRouter.useNavigate();
14
- const handleNavigateHome = react.useCallback(
15
- () => navigate({
16
- to: constants.INDEX_PAGE_PATH,
17
- replace: true
18
- }),
19
- [navigate]
20
- );
21
- const { pathname } = reactRouter.useLocation();
22
- return /* @__PURE__ */ jsxRuntime.jsx(components.VefNotFound, { uri: pathname, onNavigateHome: handleNavigateHome });
23
- }
24
-
25
- exports.default = VefNotFoundPage;
26
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, 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,5 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
-
5
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, 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,22 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
5
-
6
- const jsxRuntime = require('@emotion/react/jsx-runtime');
7
- const reactRouter = require('@tanstack/react-router');
8
- const core = require('@vef-framework/core');
9
- const react = require('react');
10
-
11
- function VefRouterProvider({
12
- router
13
- }) {
14
- const { fetchAuthenticatedUserApi } = core.useApiContext();
15
- const context = react.useMemo(() => ({
16
- fetchAuthenticatedUserApi
17
- }), [fetchAuthenticatedUserApi]);
18
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouter.RouterProvider, { context, router });
19
- }
20
-
21
- exports.default = VefRouterProvider;
22
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, 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,5 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
-
5
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, 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 CHANGED
@@ -1,19 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const LOGIN_PAGE_PATH = "/login";
7
- const LOGIN_PAGE_ROUTE = "/_common/login";
8
- const INDEX_PAGE_PATH = "/";
9
- const INDEX_PAGE_ROUTE = "/_layout";
10
- const ACCESS_DENIED_PAGE_PATH = "/access-denied";
11
- const ACCESS_DENIED_PAGE_ROUTE = "/_common/access-denied";
12
-
13
- exports.ACCESS_DENIED_PAGE_PATH = ACCESS_DENIED_PAGE_PATH;
14
- exports.ACCESS_DENIED_PAGE_ROUTE = ACCESS_DENIED_PAGE_ROUTE;
15
- exports.INDEX_PAGE_PATH = INDEX_PAGE_PATH;
16
- exports.INDEX_PAGE_ROUTE = INDEX_PAGE_ROUTE;
17
- exports.LOGIN_PAGE_PATH = LOGIN_PAGE_PATH;
18
- exports.LOGIN_PAGE_ROUTE = LOGIN_PAGE_ROUTE;
19
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, 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 */
package/lib/helper.cjs CHANGED
@@ -1,24 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const constants = require('./constants.cjs');
7
- const store = require('./store.cjs');
8
-
9
- async function handleClientLogout(router, fetchAuthenticatedUserApi) {
10
- await fetchAuthenticatedUserApi.invalidateQueries();
11
- store.useAppStore.setState(
12
- {
13
- isAuthenticated: false
14
- },
15
- true
16
- );
17
- await router.invalidate();
18
- await router.navigate({
19
- to: constants.LOGIN_PAGE_PATH
20
- });
21
- }
22
-
23
- exports.handleClientLogout = handleClientLogout;
24
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const constants=require("./constants.cjs"),store=require("./store.cjs");async function handleClientLogout(router,fetchAuthenticatedUserApi){await fetchAuthenticatedUserApi.invalidateQueries(),store.useAppStore.setState({isAuthenticated:!1},!0),await router.invalidate(),await router.navigate({to:constants.LOGIN_PAGE_PATH})}exports.handleClientLogout=handleClientLogout;/*! 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,50 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const api = require('./api.cjs');
7
- const app = require('./app.cjs');
8
- require('./components/index.cjs');
9
- const constants = require('./constants.cjs');
10
- const helper = require('./helper.cjs');
11
- const router = require('./router.cjs');
12
- require('./routes/index.cjs');
13
- const store = require('./store.cjs');
14
- const index = require('./components/vef-access-denied-page/index.cjs');
15
- const index$1 = require('./components/vef-app/index.cjs');
16
- const index$2 = require('./components/vef-dev-assistant/index.cjs');
17
- const index$3 = require('./components/vef-error-page/index.cjs');
18
- const index$4 = require('./components/vef-login-page/index.cjs');
19
- const index$5 = require('./components/vef-not-found-page/index.cjs');
20
- const index$6 = require('./components/vef-router-provider/index.cjs');
21
- const accessDenied = require('./routes/access-denied.cjs');
22
- const layout = require('./routes/layout.cjs');
23
- const login = require('./routes/login.cjs');
24
- const root = require('./routes/root.cjs');
25
-
26
-
27
-
28
- exports.createApiClient = api.createApiClient;
29
- exports.createApp = app.createApp;
30
- exports.ACCESS_DENIED_PAGE_PATH = constants.ACCESS_DENIED_PAGE_PATH;
31
- exports.ACCESS_DENIED_PAGE_ROUTE = constants.ACCESS_DENIED_PAGE_ROUTE;
32
- exports.INDEX_PAGE_PATH = constants.INDEX_PAGE_PATH;
33
- exports.INDEX_PAGE_ROUTE = constants.INDEX_PAGE_ROUTE;
34
- exports.LOGIN_PAGE_PATH = constants.LOGIN_PAGE_PATH;
35
- exports.LOGIN_PAGE_ROUTE = constants.LOGIN_PAGE_ROUTE;
36
- exports.handleClientLogout = helper.handleClientLogout;
37
- exports.createRouter = router.createRouter;
38
- exports.useAppStore = store.useAppStore;
39
- exports.VefAccessDeniedPage = index.default;
40
- exports.VefApp = index$1.default;
41
- exports.VefDevAssistant = index$2.default;
42
- exports.VefErrorPage = index$3.default;
43
- exports.VefLoginPage = index$4.default;
44
- exports.VefNotFoundPage = index$5.default;
45
- exports.VefRouterProvider = index$6.default;
46
- exports.createAccessDeniedRouteOptions = accessDenied.createAccessDeniedRouteOptions;
47
- exports.createLayoutRouteOptions = layout.createLayoutRouteOptions;
48
- exports.createLoginRouteOptions = login.createLoginRouteOptions;
49
- exports.createRootRoute = root.createRootRoute;
50
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const api=require("./api.cjs"),app=require("./app.cjs");require("./components/index.cjs");const constants=require("./constants.cjs"),helper=require("./helper.cjs"),router=require("./router.cjs");require("./routes/index.cjs");const store=require("./store.cjs"),index=require("./components/vef-access-denied-page/index.cjs"),index$1=require("./components/vef-app/index.cjs"),index$2=require("./components/vef-dev-assistant/index.cjs"),index$3=require("./components/vef-error-page/index.cjs"),index$4=require("./components/vef-login-page/index.cjs"),index$5=require("./components/vef-not-found-page/index.cjs"),index$6=require("./components/vef-router-provider/index.cjs"),accessDenied=require("./routes/access-denied.cjs"),layout=require("./routes/layout.cjs"),login=require("./routes/login.cjs"),root=require("./routes/root.cjs");exports.createApiClient=api.createApiClient,exports.createApp=app.createApp,exports.ACCESS_DENIED_PAGE_PATH=constants.ACCESS_DENIED_PAGE_PATH,exports.ACCESS_DENIED_PAGE_ROUTE=constants.ACCESS_DENIED_PAGE_ROUTE,exports.INDEX_PAGE_PATH=constants.INDEX_PAGE_PATH,exports.INDEX_PAGE_ROUTE=constants.INDEX_PAGE_ROUTE,exports.LOGIN_PAGE_PATH=constants.LOGIN_PAGE_PATH,exports.LOGIN_PAGE_ROUTE=constants.LOGIN_PAGE_ROUTE,exports.handleClientLogout=helper.handleClientLogout,exports.createRouter=router.createRouter,exports.useAppStore=store.useAppStore,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,exports.createAccessDeniedRouteOptions=accessDenied.createAccessDeniedRouteOptions,exports.createLayoutRouteOptions=layout.createLayoutRouteOptions,exports.createLoginRouteOptions=login.createLoginRouteOptions,exports.createRootRoute=root.createRootRoute;/*! 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,74 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const reactRouter = require('@tanstack/react-router');
7
- const components = require('@vef-framework/components');
8
- const shared = require('@vef-framework/shared');
9
- const NProgress = require('nprogress');
10
- const react = require('react');
11
-
12
- const defaultGcTime = 10 * 60 * 1e3;
13
- function createRouter({
14
- routeTree,
15
- history
16
- }) {
17
- const router = reactRouter.createRouter({
18
- routeTree,
19
- trailingSlash: "never",
20
- caseSensitive: true,
21
- history: history === "hash" ? reactRouter.createHashHistory() : reactRouter.createBrowserHistory(),
22
- search: {
23
- strict: true
24
- },
25
- notFoundMode: "root",
26
- defaultPendingComponent: () => react.createElement(
27
- components.VefLoadingPlaceholder,
28
- {
29
- size: "large"
30
- }
31
- ),
32
- defaultPendingMs: 500,
33
- defaultPendingMinMs: 300,
34
- defaultSsr: false,
35
- defaultStructuralSharing: true,
36
- defaultHashScrollIntoView: {
37
- behavior: "smooth",
38
- block: "start",
39
- inline: "center"
40
- },
41
- defaultPreload: "intent",
42
- defaultPreloadDelay: 50,
43
- defaultPreloadGcTime: defaultGcTime,
44
- defaultGcTime,
45
- defaultOnCatch(error, errorInfo) {
46
- shared.showErrorNotification(
47
- error.message || error.name,
48
- react.createElement(
49
- components.VefText,
50
- {
51
- color: "error",
52
- children: react.createElement("pre", {
53
- style: {
54
- maxHeight: "480px",
55
- overflowY: "auto",
56
- scrollbarWidth: "thin",
57
- scrollbarColor: "rgba(0, 0, 0, 0.2) transparent"
58
- },
59
- children: error.stack || errorInfo.componentStack || "No stack trace available"
60
- })
61
- }
62
- )
63
- );
64
- }
65
- });
66
- router.subscribe("onBeforeLoad", ({ pathChanged }) => pathChanged && NProgress.start());
67
- router.subscribe("onLoad", () => {
68
- NProgress.done();
69
- });
70
- return router;
71
- }
72
-
73
- exports.createRouter = createRouter;
74
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const reactRouter=require("@tanstack/react-router"),components=require("@vef-framework/components"),shared=require("@vef-framework/shared"),NProgress=require("nprogress"),react=require("react"),defaultGcTime=10*60*1e3;function createRouter({routeTree,history}){const router=reactRouter.createRouter({routeTree,trailingSlash:"never",caseSensitive:!0,history:history==="hash"?reactRouter.createHashHistory():reactRouter.createBrowserHistory(),search:{strict:!0},notFoundMode:"root",defaultPendingComponent:()=>react.createElement(components.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){shared.showErrorNotification(error.message||error.name,react.createElement(components.VefText,{color:"error",children:react.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"})}))}});return router.subscribe("onBeforeLoad",({pathChanged})=>pathChanged&&NProgress.start()),router.subscribe("onLoad",()=>{NProgress.done()}),router}exports.createRouter=createRouter;/*! 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,16 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- require('../components/index.cjs');
7
- const index = require('../components/vef-access-denied-page/index.cjs');
8
-
9
- function createAccessDeniedRouteOptions() {
10
- return {
11
- component: index.default
12
- };
13
- }
14
-
15
- exports.createAccessDeniedRouteOptions = createAccessDeniedRouteOptions;
16
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("../components/index.cjs");const index=require("../components/vef-access-denied-page/index.cjs");function createAccessDeniedRouteOptions(){return{component:index.default}}exports.createAccessDeniedRouteOptions=createAccessDeniedRouteOptions;/*! 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,17 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const accessDenied = require('./access-denied.cjs');
7
- const layout = require('./layout.cjs');
8
- const login = require('./login.cjs');
9
- const root = require('./root.cjs');
10
-
11
-
12
-
13
- exports.createAccessDeniedRouteOptions = accessDenied.createAccessDeniedRouteOptions;
14
- exports.createLayoutRouteOptions = layout.createLayoutRouteOptions;
15
- exports.createLoginRouteOptions = login.createLoginRouteOptions;
16
- exports.createRootRoute = root.createRootRoute;
17
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const accessDenied=require("./access-denied.cjs"),layout=require("./layout.cjs"),login=require("./login.cjs"),root=require("./root.cjs");exports.createAccessDeniedRouteOptions=accessDenied.createAccessDeniedRouteOptions,exports.createLayoutRouteOptions=layout.createLayoutRouteOptions,exports.createLoginRouteOptions=login.createLoginRouteOptions,exports.createRootRoute=root.createRootRoute;/*! 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,138 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('@emotion/react/jsx-runtime');
7
- const reactRouter = require('@tanstack/react-router');
8
- const components = require('@vef-framework/components');
9
- const core = require('@vef-framework/core');
10
- const shared = require('@vef-framework/shared');
11
- const lucideReact = require('lucide-react');
12
- const react = require('react');
13
- const constants = require('../constants.cjs');
14
- const helper = require('../helper.cjs');
15
- const store = require('../store.cjs');
16
-
17
- const indexBreadcrumbItem = {
18
- key: constants.INDEX_PAGE_PATH,
19
- label: /* @__PURE__ */ jsxRuntime.jsx(components.VefIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HomeIcon, {}) })
20
- };
21
- function createLayoutRouteOptions({
22
- title,
23
- logo,
24
- getUserDescription
25
- }) {
26
- function LayoutComponent() {
27
- const router = reactRouter.useRouter();
28
- const navigate = reactRouter.useNavigate();
29
- const { pathname } = reactRouter.useLocation();
30
- const [menus, user, routeParentMenusMappings] = store.useAppStore((state) => [state.menus, state.user, state.routeParentMenusMappings]);
31
- const defaultOpenedMenuKeys = routeParentMenusMappings?.get(pathname)?.[1].map((it) => it.key);
32
- const breadcrumbItems = react.useMemo(() => {
33
- const mapping = routeParentMenusMappings?.get(pathname);
34
- if (!mapping) {
35
- return [];
36
- }
37
- const [currentMenu, parentMenus] = mapping;
38
- return [
39
- indexBreadcrumbItem,
40
- ...parentMenus.map((menu) => ({
41
- key: menu.key,
42
- label: menu.label,
43
- dropdownItems: menu.children.filter((child) => child.type !== "divider").map((child) => ({
44
- key: child.key,
45
- label: child.label
46
- }))
47
- })),
48
- {
49
- label: currentMenu.label
50
- }
51
- ];
52
- }, [pathname, routeParentMenusMappings]);
53
- const { logoutApi, fetchAuthenticatedUserApi } = core.useApiContext();
54
- const { mutate: logout } = logoutApi.useMutation();
55
- const handleLogout = react.useCallback(async () => {
56
- await logout();
57
- await helper.handleClientLogout(router, fetchAuthenticatedUserApi);
58
- }, [logout, router, fetchAuthenticatedUserApi]);
59
- const handleMenuSwitch = react.useCallback((menuKey) => {
60
- navigate({
61
- to: menuKey
62
- });
63
- }, [navigate]);
64
- return /* @__PURE__ */ jsxRuntime.jsx(
65
- components.VefLayout,
66
- {
67
- activeMenuKey: pathname,
68
- breadcrumbItems,
69
- defaultOpenedMenuKeys,
70
- logo,
71
- menuItems: menus,
72
- title,
73
- userAvatar: user?.avatar,
74
- userDescription: getUserDescription?.(user),
75
- userGender: user?.gender,
76
- userName: user?.name,
77
- onActiveMenuKeyChange: handleMenuSwitch,
78
- onBreadcrumbClick: handleMenuSwitch,
79
- onLogout: handleLogout,
80
- children: /* @__PURE__ */ jsxRuntime.jsx(reactRouter.Outlet, {})
81
- }
82
- );
83
- }
84
- return {
85
- beforeLoad: ({ location }) => {
86
- const { isAuthenticated, routeParentMenusMappings } = store.useAppStore.getState();
87
- if (!isAuthenticated) {
88
- throw reactRouter.redirect({
89
- to: constants.LOGIN_PAGE_PATH,
90
- search: {
91
- redirect: location.href
92
- }
93
- });
94
- }
95
- if (routeParentMenusMappings && !routeParentMenusMappings.has(location.pathname)) {
96
- throw reactRouter.redirect({
97
- to: constants.ACCESS_DENIED_PAGE_PATH,
98
- replace: true
99
- });
100
- }
101
- },
102
- loader: async ({ context, location }) => {
103
- const { fetchAuthenticatedUserApi } = context;
104
- const {
105
- menus,
106
- permissions,
107
- ...user
108
- } = await fetchAuthenticatedUserApi.fetchQuery();
109
- const routeParentMenusMappings = Object.freeze(shared.buildRouteParentMenusMappings(menus));
110
- store.useAppStore.setState({
111
- user: Object.freeze(user),
112
- menus: Object.freeze(menus),
113
- permissions: Object.freeze(new Set(permissions)),
114
- routeParentMenusMappings
115
- });
116
- if (!routeParentMenusMappings.has(location.pathname)) {
117
- throw reactRouter.redirect({
118
- to: constants.ACCESS_DENIED_PAGE_PATH,
119
- replace: true
120
- });
121
- }
122
- },
123
- pendingComponent: () => /* @__PURE__ */ jsxRuntime.jsx(
124
- components.VefLoadingPlaceholder,
125
- {
126
- size: "large",
127
- tip: "系统加载中,请稍后..."
128
- }
129
- ),
130
- component: LayoutComponent,
131
- staleTime: Infinity,
132
- gcTime: 0,
133
- shouldReload: false
134
- };
135
- }
136
-
137
- exports.createLayoutRouteOptions = createLayoutRouteOptions;
138
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),components=require("@vef-framework/components"),core=require("@vef-framework/core"),shared=require("@vef-framework/shared"),lucideReact=require("lucide-react"),react=require("react"),constants=require("../constants.cjs"),helper=require("../helper.cjs"),store=require("../store.cjs"),indexBreadcrumbItem={key:constants.INDEX_PAGE_PATH,label:jsxRuntime.jsx(components.VefIcon,{children:jsxRuntime.jsx(lucideReact.HomeIcon,{})})};function createLayoutRouteOptions({title,logo,getUserDescription}){function LayoutComponent(){const router=reactRouter.useRouter(),navigate=reactRouter.useNavigate(),{pathname}=reactRouter.useLocation(),[menus,user,routeParentMenusMappings]=store.useAppStore(state=>[state.menus,state.user,state.routeParentMenusMappings]),defaultOpenedMenuKeys=routeParentMenusMappings?.get(pathname)?.[1].map(it=>it.key),breadcrumbItems=react.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}=core.useApiContext(),{mutate:logout}=logoutApi.useMutation(),handleLogout=react.useCallback(async()=>{await logout(),await helper.handleClientLogout(router,fetchAuthenticatedUserApi)},[logout,router,fetchAuthenticatedUserApi]),handleMenuSwitch=react.useCallback(menuKey=>{navigate({to:menuKey})},[navigate]);return jsxRuntime.jsx(components.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:jsxRuntime.jsx(reactRouter.Outlet,{})})}return{beforeLoad:({location})=>{const{isAuthenticated,routeParentMenusMappings}=store.useAppStore.getState();if(!isAuthenticated)throw reactRouter.redirect({to:constants.LOGIN_PAGE_PATH,search:{redirect:location.href}});if(routeParentMenusMappings&&!routeParentMenusMappings.has(location.pathname))throw reactRouter.redirect({to:constants.ACCESS_DENIED_PAGE_PATH,replace:!0})},loader:async({context,location})=>{const{fetchAuthenticatedUserApi}=context,{menus,permissions,...user}=await fetchAuthenticatedUserApi.fetchQuery(),routeParentMenusMappings=Object.freeze(shared.buildRouteParentMenusMappings(menus));if(store.useAppStore.setState({user:Object.freeze(user),menus:Object.freeze(menus),permissions:Object.freeze(new Set(permissions)),routeParentMenusMappings}),!routeParentMenusMappings.has(location.pathname))throw reactRouter.redirect({to:constants.ACCESS_DENIED_PAGE_PATH,replace:!0})},pendingComponent:()=>jsxRuntime.jsx(components.VefLoadingPlaceholder,{size:"large",tip:"系统加载中,请稍后..."}),component:LayoutComponent,staleTime:1/0,gcTime:0,shouldReload:!1}}exports.createLayoutRouteOptions=createLayoutRouteOptions;/*! 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,33 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('@emotion/react/jsx-runtime');
7
- const reactRouter = require('@tanstack/react-router');
8
- const shared = require('@vef-framework/shared');
9
- require('../components/index.cjs');
10
- const constants = require('../constants.cjs');
11
- const store = require('../store.cjs');
12
- const index = require('../components/vef-login-page/index.cjs');
13
-
14
- function createLoginRouteOptions(props) {
15
- return {
16
- validateSearch: shared.z.object({
17
- redirect: shared.z.string().optional().default(constants.INDEX_PAGE_PATH).catch(constants.INDEX_PAGE_PATH)
18
- }),
19
- beforeLoad: ({ search }) => {
20
- if (store.useAppStore.getState().isAuthenticated) {
21
- const { redirect: redirectPath } = search;
22
- throw reactRouter.redirect({
23
- to: redirectPath,
24
- replace: true
25
- });
26
- }
27
- },
28
- component: () => /* @__PURE__ */ jsxRuntime.jsx(index.default, { ...props })
29
- };
30
- }
31
-
32
- exports.createLoginRouteOptions = createLoginRouteOptions;
33
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router"),shared=require("@vef-framework/shared");require("../components/index.cjs");const constants=require("../constants.cjs"),store=require("../store.cjs"),index=require("../components/vef-login-page/index.cjs");function createLoginRouteOptions(props){return{validateSearch:shared.z.object({redirect:shared.z.string().optional().default(constants.INDEX_PAGE_PATH).catch(constants.INDEX_PAGE_PATH)}),beforeLoad:({search})=>{if(store.useAppStore.getState().isAuthenticated){const{redirect:redirectPath}=search;throw reactRouter.redirect({to:redirectPath,replace:!0})}},component:()=>jsxRuntime.jsx(index.default,{...props})}}exports.createLoginRouteOptions=createLoginRouteOptions;/*! 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,26 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const jsxRuntime = require('@emotion/react/jsx-runtime');
7
- const reactRouter = require('@tanstack/react-router');
8
- require('../components/index.cjs');
9
- const index = require('../components/vef-not-found-page/index.cjs');
10
- const index$1 = require('../components/vef-error-page/index.cjs');
11
- const index$2 = require('../components/vef-dev-assistant/index.cjs');
12
-
13
- function createRootRoute() {
14
- return reactRouter.createRootRouteWithContext()({
15
- component: () => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
16
- /* @__PURE__ */ jsxRuntime.jsx(reactRouter.Outlet, {}),
17
- process.env.NODE_ENV === "development" && /* @__PURE__ */ jsxRuntime.jsx(index$2.default, {})
18
- ] }),
19
- errorComponent: index$1.default,
20
- notFoundComponent: index.default,
21
- ssr: false
22
- });
23
- }
24
-
25
- exports.createRootRoute = createRootRoute;
26
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("@emotion/react/jsx-runtime"),reactRouter=require("@tanstack/react-router");require("../components/index.cjs");const index=require("../components/vef-not-found-page/index.cjs"),index$1=require("../components/vef-error-page/index.cjs"),index$2=require("../components/vef-dev-assistant/index.cjs");function createRootRoute(){return reactRouter.createRootRouteWithContext()({component:()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactRouter.Outlet,{}),process.env.NODE_ENV==="development"&&jsxRuntime.jsx(index$2.default,{})]}),errorComponent:index$1.default,notFoundComponent:index.default,ssr:!1})}exports.createRootRoute=createRootRoute;/*! 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 CHANGED
@@ -1,23 +1 @@
1
- /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const shared = require('@vef-framework/shared');
7
-
8
- const useAppStore = shared.createStore(
9
- () => ({
10
- isAuthenticated: false
11
- }),
12
- {
13
- name: "APP",
14
- storage: "session",
15
- selector: (state) => ({
16
- isAuthenticated: state.isAuthenticated,
17
- token: state.token
18
- })
19
- }
20
- );
21
-
22
- exports.useAppStore = useAppStore;
23
- /*! 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
+ "use strict";/*! VefFramework version: 1.0.103, build time: 2025-03-07T17:03:52.076Z, made by Venus. */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const shared=require("@vef-framework/shared"),useAppStore=shared.createStore(()=>({isAuthenticated:!1}),{name:"APP",storage:"session",selector:state=>({isAuthenticated:state.isAuthenticated,token:state.token})});exports.useAppStore=useAppStore;/*! 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.101",
4
+ "version": "1.0.103",
5
5
  "private": false,
6
6
  "packageManager": "pnpm@9.15.0",
7
7
  "description": "The starter of the VEF framework",
@@ -41,10 +41,10 @@
41
41
  "use-sync-external-store": "^1.4.0",
42
42
  "@tanstack/react-query-devtools": "5.67.1",
43
43
  "@tanstack/router-devtools": "^1.112.18",
44
- "@vef-framework/components": "1.0.101",
45
- "@vef-framework/core": "1.0.101",
46
- "@vef-framework/hooks": "1.0.101",
47
- "@vef-framework/shared": "1.0.101",
44
+ "@vef-framework/components": "1.0.103",
45
+ "@vef-framework/core": "1.0.103",
46
+ "@vef-framework/hooks": "1.0.103",
47
+ "@vef-framework/shared": "1.0.103",
48
48
  "lucide-react": "0.477.0",
49
49
  "motion": "12.4.10",
50
50
  "nprogress": "^0.2.0"