@vef-framework-react/starter 2.8.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/access-denied/index.cjs +1 -1
- package/dist/cjs/components/app/index.cjs +1 -1
- package/dist/cjs/components/base-layout/use-base-layout.cjs +1 -1
- package/dist/cjs/components/error/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/components/footer.cjs +1 -1
- package/dist/cjs/components/layout/components/header/app-switcher.cjs +1 -1
- package/dist/cjs/components/layout/components/header/color-scheme.cjs +1 -1
- package/dist/cjs/components/layout/components/header/fullscreen.cjs +1 -1
- package/dist/cjs/components/layout/components/header/index.cjs +1 -1
- package/dist/cjs/components/layout/components/header/menu-burger.cjs +1 -1
- package/dist/cjs/components/layout/components/header/search.cjs +1 -1
- package/dist/cjs/components/layout/components/header/theme-config.cjs +1 -1
- package/dist/cjs/components/layout/components/header/user-avatar.cjs +1 -1
- package/dist/cjs/components/layout/components/logo.cjs +1 -1
- package/dist/cjs/components/layout/components/menu.cjs +1 -1
- package/dist/cjs/components/layout/components/search/index.cjs +1 -1
- package/dist/cjs/components/layout/components/search/keyboard-help.cjs +1 -1
- package/dist/cjs/components/layout/components/search/keyboard.cjs +1 -1
- package/dist/cjs/components/layout/components/search/search-result-item.cjs +1 -1
- package/dist/cjs/components/layout/components/search/search-result.cjs +1 -1
- package/dist/cjs/components/layout/components/sidebar.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/context-menu.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/index.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/main-content-maximum.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/reload.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/tab-item.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/tab-list.cjs +1 -1
- package/dist/cjs/components/layout/components/tabs/tabs-container.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/color-scheme-switcher.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/color-scheme.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/config-item.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/index.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/menu-layout-card.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/menu-layout.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/operations.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/theme-color-picker.cjs +1 -1
- package/dist/cjs/components/layout/components/theme-config/theme-colors.cjs +1 -1
- package/dist/cjs/components/layout/hooks/use-menu-navigate.cjs +1 -1
- package/dist/cjs/components/layout/hooks/use-tab-navigate.cjs +1 -1
- package/dist/cjs/components/layout/index.cjs +1 -1
- package/dist/cjs/components/login/icon-login.cjs +1 -1
- package/dist/cjs/components/login/index.cjs +1 -1
- package/dist/cjs/components/login/password-change-challenge.cjs +1 -0
- package/dist/cjs/components/n-progress/components/bar.cjs +8 -8
- package/dist/cjs/components/n-progress/index.cjs +1 -1
- package/dist/cjs/components/not-found/index.cjs +1 -1
- package/dist/cjs/components/router-provider/index.cjs +1 -1
- package/dist/cjs/components/theme-config-provider/index.cjs +1 -1
- package/dist/cjs/helpers/app-version.cjs +1 -1
- package/dist/cjs/helpers/app.cjs +1 -1
- package/dist/cjs/helpers/index.cjs +1 -1
- package/dist/cjs/helpers/router.cjs +1 -1
- package/dist/cjs/hooks/use-active-menu-key.cjs +1 -1
- package/dist/cjs/hooks/use-route-full-path.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/routes/layout.cjs +1 -1
- package/dist/cjs/routes/login.cjs +1 -1
- package/dist/es/components/access-denied/access-denied-icon.js +1 -1
- package/dist/es/components/access-denied/index.js +18 -18
- package/dist/es/components/app/index.js +8 -8
- package/dist/es/components/base-layout/index.js +1 -1
- package/dist/es/components/base-layout/styles.js +1 -1
- package/dist/es/components/base-layout/use-base-layout.js +8 -8
- package/dist/es/components/error/error-icon.js +1 -1
- package/dist/es/components/error/index.js +27 -27
- package/dist/es/components/index.js +5 -4
- package/dist/es/components/layout/components/contour-pattern.js +1 -1
- package/dist/es/components/layout/components/footer.js +2 -2
- package/dist/es/components/layout/components/header/app-switcher.js +47 -47
- package/dist/es/components/layout/components/header/boy-icon.js +1 -1
- package/dist/es/components/layout/components/header/color-scheme.js +7 -7
- package/dist/es/components/layout/components/header/fullscreen.js +8 -8
- package/dist/es/components/layout/components/header/girl-icon.js +1 -1
- package/dist/es/components/layout/components/header/header-pattern.js +1 -1
- package/dist/es/components/layout/components/header/index.js +22 -22
- package/dist/es/components/layout/components/header/menu-burger.js +5 -5
- package/dist/es/components/layout/components/header/menu-fold-left-icon.js +1 -1
- package/dist/es/components/layout/components/header/menu-unfold-left-icon.js +1 -1
- package/dist/es/components/layout/components/header/mixed-menu.js +1 -1
- package/dist/es/components/layout/components/header/search.js +5 -5
- package/dist/es/components/layout/components/header/theme-config.js +5 -5
- package/dist/es/components/layout/components/header/user-avatar.js +29 -29
- package/dist/es/components/layout/components/index.js +1 -1
- package/dist/es/components/layout/components/logo.js +15 -15
- package/dist/es/components/layout/components/menu.js +10 -10
- package/dist/es/components/layout/components/search/index.js +22 -22
- package/dist/es/components/layout/components/search/keyboard-arrow-down-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard-arrow-up-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard-control-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard-esc-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard-help.js +19 -19
- package/dist/es/components/layout/components/search/keyboard-return-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard-shift-icon.js +1 -1
- package/dist/es/components/layout/components/search/keyboard.js +8 -8
- package/dist/es/components/layout/components/search/letter-s-icon.js +1 -1
- package/dist/es/components/layout/components/search/search-result-item.js +24 -24
- package/dist/es/components/layout/components/search/search-result.js +21 -21
- package/dist/es/components/layout/components/sidebar.js +8 -8
- package/dist/es/components/layout/components/tabs/context-menu.js +13 -13
- package/dist/es/components/layout/components/tabs/index.js +10 -10
- package/dist/es/components/layout/components/tabs/main-content-maximum.js +5 -5
- package/dist/es/components/layout/components/tabs/reload.js +6 -6
- package/dist/es/components/layout/components/tabs/tab-item.js +26 -26
- package/dist/es/components/layout/components/tabs/tab-list.js +13 -13
- package/dist/es/components/layout/components/tabs/tabs-container.js +18 -18
- package/dist/es/components/layout/components/theme-config/color-scheme-switcher.js +21 -21
- package/dist/es/components/layout/components/theme-config/color-scheme.js +15 -15
- package/dist/es/components/layout/components/theme-config/config-item.js +8 -8
- package/dist/es/components/layout/components/theme-config/index.js +18 -18
- package/dist/es/components/layout/components/theme-config/menu-layout-card.js +21 -21
- package/dist/es/components/layout/components/theme-config/menu-layout.js +24 -24
- package/dist/es/components/layout/components/theme-config/operations.js +6 -6
- package/dist/es/components/layout/components/theme-config/theme-color-picker.js +6 -6
- package/dist/es/components/layout/components/theme-config/theme-colors.js +9 -9
- package/dist/es/components/layout/hooks/index.js +1 -1
- package/dist/es/components/layout/hooks/use-color-scheme-updater.js +1 -1
- package/dist/es/components/layout/hooks/use-menu-navigate.js +9 -9
- package/dist/es/components/layout/hooks/use-mixed-menu.js +1 -1
- package/dist/es/components/layout/hooks/use-tab-navigate.js +11 -11
- package/dist/es/components/layout/index.js +14 -14
- package/dist/es/components/layout/store.js +1 -1
- package/dist/es/components/layout/styles.js +1 -1
- package/dist/es/components/login/icon-login.js +154 -154
- package/dist/es/components/login/index.js +119 -118
- package/dist/es/components/login/password-change-challenge.js +104 -0
- package/dist/es/components/login/styles.js +1 -1
- package/dist/es/components/login/welcome-messages.js +1 -1
- package/dist/es/components/n-progress/components/bar.js +15 -15
- package/dist/es/components/n-progress/components/container.js +1 -1
- package/dist/es/components/n-progress/components/index.js +1 -1
- package/dist/es/components/n-progress/event.js +1 -1
- package/dist/es/components/n-progress/index.js +6 -6
- package/dist/es/components/not-found/index.js +18 -18
- package/dist/es/components/not-found/not-found-icon.js +1 -1
- package/dist/es/components/router-provider/context.js +1 -1
- package/dist/es/components/router-provider/index.js +9 -9
- package/dist/es/components/theme-config-provider/global-style.js +1 -1
- package/dist/es/components/theme-config-provider/index.js +4 -4
- package/dist/es/components/theme-config-provider/use-color-mode-effect.js +1 -1
- package/dist/es/components/theme-config-provider/use-theme-config.js +1 -1
- package/dist/es/constants/event.js +1 -1
- package/dist/es/constants/index.js +1 -1
- package/dist/es/constants/router.js +1 -1
- package/dist/es/constants/storage.js +1 -1
- package/dist/es/helpers/api.js +1 -1
- package/dist/es/helpers/app-version.js +59 -59
- package/dist/es/helpers/app.js +10 -10
- package/dist/es/helpers/auth.js +1 -1
- package/dist/es/helpers/event.js +1 -1
- package/dist/es/helpers/index.js +5 -5
- package/dist/es/helpers/menu-key.js +1 -1
- package/dist/es/helpers/query.js +1 -1
- package/dist/es/helpers/router.js +34 -34
- package/dist/es/hooks/index.js +1 -1
- package/dist/es/hooks/use-active-menu-key.js +5 -5
- package/dist/es/hooks/use-route-full-path.js +5 -5
- package/dist/es/index.js +13 -12
- package/dist/es/routes/access-denied.js +1 -1
- package/dist/es/routes/index.js +1 -1
- package/dist/es/routes/layout.js +16 -16
- package/dist/es/routes/login.js +7 -7
- package/dist/es/routes/root.js +1 -1
- package/dist/es/stores/app.js +1 -1
- package/dist/es/stores/index.js +1 -1
- package/dist/es/stores/tab.js +1 -1
- package/dist/es/stores/theme.js +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/login/index.d.ts +1 -0
- package/dist/types/components/login/password-change-challenge.d.ts +72 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { ACCESS_DENIED_ROUTE_PATH as e } from "../constants/router.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
3
|
+
import { nProgressEventEmitter as t } from "../components/n-progress/event.js";
|
|
4
|
+
import { useAppStore as n } from "../stores/app.js";
|
|
5
|
+
import { useTabStore as r } from "../stores/tab.js";
|
|
6
|
+
import { Error as i } from "../components/error/index.js";
|
|
7
|
+
import { resolveActiveMenuKey as a } from "./menu-key.js";
|
|
8
|
+
import { onAccessDenied as o, onUnauthenticated as s } from "./event.js";
|
|
9
|
+
import { handleClientLogout as c } from "./auth.js";
|
|
10
|
+
import { NotFound as l } from "../components/not-found/index.js";
|
|
11
|
+
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { createBrowserHistory as d, createHashHistory as f, createRouter as p } from "@tanstack/react-router";
|
|
13
|
+
import { Loader as m, showErrorNotification as h } from "@vef-framework-react/components";
|
|
14
|
+
import { getSanitizedErrorStack as g, hashKey as _ } from "@vef-framework-react/shared";
|
|
15
15
|
//#region src/helpers/router.tsx
|
|
16
16
|
function v() {
|
|
17
17
|
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
@@ -25,21 +25,21 @@ var y = 600 * 1e3, b = process.env.NODE_ENV === "production" ? {
|
|
|
25
25
|
toString: v
|
|
26
26
|
};
|
|
27
27
|
function x({ history: v, routeTree: x, context: S }) {
|
|
28
|
-
let C =
|
|
28
|
+
let C = p({
|
|
29
29
|
routeTree: x,
|
|
30
30
|
context: S,
|
|
31
31
|
trailingSlash: "never",
|
|
32
32
|
caseSensitive: !0,
|
|
33
|
-
history: v === "hash" ?
|
|
33
|
+
history: v === "hash" ? f() : d(),
|
|
34
34
|
search: { strict: !0 },
|
|
35
35
|
notFoundMode: "root",
|
|
36
|
-
defaultPendingComponent: () => /* @__PURE__ */ m
|
|
36
|
+
defaultPendingComponent: () => /* @__PURE__ */ u(m, {
|
|
37
37
|
description: "玩命加载中, 请耐心等待...",
|
|
38
38
|
descriptionSize: 18,
|
|
39
39
|
size: 48
|
|
40
40
|
}),
|
|
41
|
-
defaultErrorComponent:
|
|
42
|
-
defaultNotFoundComponent:
|
|
41
|
+
defaultErrorComponent: i,
|
|
42
|
+
defaultNotFoundComponent: l,
|
|
43
43
|
defaultPendingMs: 500,
|
|
44
44
|
defaultPendingMinMs: 300,
|
|
45
45
|
defaultStructuralSharing: !0,
|
|
@@ -54,34 +54,34 @@ function x({ history: v, routeTree: x, context: S }) {
|
|
|
54
54
|
defaultGcTime: y,
|
|
55
55
|
defaultViewTransition: !1,
|
|
56
56
|
async defaultOnCatch(e) {
|
|
57
|
-
|
|
57
|
+
h(/* @__PURE__ */ u("pre", {
|
|
58
58
|
css: b,
|
|
59
|
-
children: await
|
|
59
|
+
children: await g(e)
|
|
60
60
|
}), { title: e.message || e.name });
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
return C.subscribe("onBeforeLoad", ({ pathChanged: e }) => {
|
|
64
|
-
e &&
|
|
65
|
-
}), C.subscribe("onLoad", () =>
|
|
66
|
-
let
|
|
64
|
+
e && t.emit("start");
|
|
65
|
+
}), C.subscribe("onLoad", () => t.emit("complete")), C.subscribe("onLoad", (e) => {
|
|
66
|
+
let t = e.toLocation, { fullPath: i, params: o, search: s, context: c } = C.matchRoutes(t.pathname, t.search, {
|
|
67
67
|
preload: !1,
|
|
68
68
|
throwOnError: !1
|
|
69
|
-
}).at(-1), { userMenuMap: l } =
|
|
69
|
+
}).at(-1), { userMenuMap: l } = n.getState(), { addTab: u, setActiveTabId: d } = r.getState(), f = `${i}|${_(s)}|${_(o)}`, p = l ? a(l.values(), {
|
|
70
70
|
fullPath: i,
|
|
71
|
-
params:
|
|
72
|
-
search:
|
|
73
|
-
}) : void 0,
|
|
74
|
-
|
|
71
|
+
params: o,
|
|
72
|
+
search: s
|
|
73
|
+
}) : void 0, m = p ? l?.get(p) : void 0;
|
|
74
|
+
m && (u({
|
|
75
75
|
id: f,
|
|
76
76
|
fullPath: i,
|
|
77
|
-
params:
|
|
78
|
-
search:
|
|
79
|
-
label: c.routeTitle ||
|
|
77
|
+
params: o,
|
|
78
|
+
search: s,
|
|
79
|
+
label: c.routeTitle || m.name
|
|
80
80
|
}), d(f));
|
|
81
|
-
}),
|
|
81
|
+
}), o(() => {
|
|
82
82
|
C.navigate({ to: e });
|
|
83
|
-
}),
|
|
84
|
-
|
|
83
|
+
}), s(() => {
|
|
84
|
+
c(C);
|
|
85
85
|
}), C;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
package/dist/es/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { useActiveMenuKey as e } from "./use-active-menu-key.js";
|
|
3
3
|
import { useRouteFullPath as t } from "./use-route-full-path.js";
|
|
4
4
|
export { e as useActiveMenuKey, t as useRouteFullPath };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { useAppStore as e } from "../stores/app.js";
|
|
3
3
|
import { resolveActiveMenuKey as t } from "../helpers/menu-key.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useLocation as n, useRouter as r } from "@tanstack/react-router";
|
|
5
|
+
import { useMemo as i } from "react";
|
|
6
6
|
//#region src/hooks/use-active-menu-key.ts
|
|
7
7
|
function a() {
|
|
8
|
-
let a =
|
|
9
|
-
return
|
|
8
|
+
let a = r(), o = n({ select: (e) => e.pathname }), s = n({ select: (e) => e.search }), c = e((e) => e.userMenuMap);
|
|
9
|
+
return i(() => {
|
|
10
10
|
if (!c) return;
|
|
11
11
|
let e = a.matchRoutes(o, s, {
|
|
12
12
|
preload: !1,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
|
+
import { useLocation as e, useRouter as t } from "@tanstack/react-router";
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
4
|
//#region src/hooks/use-route-full-path.ts
|
|
5
5
|
function r() {
|
|
6
|
-
let r =
|
|
7
|
-
return
|
|
6
|
+
let r = t(), i = e({ select: (e) => e.pathname }), a = e({ select: (e) => e.search });
|
|
7
|
+
return n(() => r.matchRoutes(i, a, {
|
|
8
8
|
preload: !1,
|
|
9
9
|
throwOnError: !1
|
|
10
10
|
}).at(-1).fullPath, [
|
package/dist/es/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { ACCESS_DENIED_ROUTE_ID as e, ACCESS_DENIED_ROUTE_PATH as t, INDEX_ROUTE_ID as n, INDEX_ROUTE_PATH as r, LOGIN_ROUTE_ID as i, LOGIN_ROUTE_PATH as a } from "./constants/router.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { setupAppVersionNotification as o } from "./helpers/app-version.js";
|
|
4
|
+
import { useAppStore as s } from "./stores/app.js";
|
|
5
|
+
import { useTabStore as c } from "./stores/tab.js";
|
|
6
|
+
import { useThemeStore as l } from "./stores/theme.js";
|
|
7
|
+
import { dispatchCustomEvent as u, emitAccessDenied as d, emitUnauthenticated as f } from "./helpers/event.js";
|
|
8
|
+
import { createApiClient as p } from "./helpers/api.js";
|
|
9
9
|
import { createApp as m } from "./helpers/app.js";
|
|
10
10
|
import { handleClientLogout as h } from "./helpers/auth.js";
|
|
11
11
|
import { extractQueryParams as g, noopMutationFn as _ } from "./helpers/query.js";
|
|
12
12
|
import { createRouter as v } from "./helpers/router.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
13
|
+
import { PASSWORD_CHANGE_CHALLENGE_TYPE as y, PasswordChangeChallenge as b } from "./components/login/password-change-challenge.js";
|
|
14
|
+
import { createAccessDeniedRouteOptions as x } from "./routes/access-denied.js";
|
|
15
|
+
import { createLayoutRouteOptions as S } from "./routes/layout.js";
|
|
16
|
+
import { createLoginRouteOptions as C } from "./routes/login.js";
|
|
17
|
+
import { createRootRouteOptions as w } from "./routes/root.js";
|
|
18
|
+
export { e as ACCESS_DENIED_ROUTE_ID, t as ACCESS_DENIED_ROUTE_PATH, n as INDEX_ROUTE_ID, r as INDEX_ROUTE_PATH, i as LOGIN_ROUTE_ID, a as LOGIN_ROUTE_PATH, y as PASSWORD_CHANGE_CHALLENGE_TYPE, b as PasswordChangeChallenge, x as createAccessDeniedRouteOptions, p as createApiClient, m as createApp, S as createLayoutRouteOptions, C as createLoginRouteOptions, w as createRootRouteOptions, v as createRouter, u as dispatchCustomEvent, d as emitAccessDenied, f as emitUnauthenticated, g as extractQueryParams, h as handleClientLogout, _ as noopMutationFn, o as setupAppVersionNotification, s as useAppStore, c as useTabStore, l as useThemeStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import "../constants/router.js";
|
|
3
3
|
import { AccessDenied as e } from "../components/access-denied/index.js";
|
|
4
4
|
//#region src/routes/access-denied.ts
|
package/dist/es/routes/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { createAccessDeniedRouteOptions as e } from "./access-denied.js";
|
|
3
3
|
import { createLayoutRouteOptions as t } from "./layout.js";
|
|
4
4
|
import { createLoginRouteOptions as n } from "./login.js";
|
package/dist/es/routes/layout.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { ACCESS_DENIED_ROUTE_PATH as e, LOGIN_ROUTE_PATH as t } from "../constants/router.js";
|
|
3
3
|
import { useAppStore as n } from "../stores/app.js";
|
|
4
4
|
import { Error as r } from "../components/error/index.js";
|
|
5
5
|
import { menuKeyOf as i } from "../helpers/menu-key.js";
|
|
6
6
|
import { Layout as a } from "../components/layout/index.js";
|
|
7
7
|
import { NotFound as o } from "../components/not-found/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { jsx as s } from "@emotion/react/jsx-runtime";
|
|
9
|
+
import { Outlet as c, redirect as l } from "@tanstack/react-router";
|
|
10
|
+
import { DynamicIcon as u, Loader as d } from "@vef-framework-react/components";
|
|
11
11
|
//#region src/routes/layout.tsx
|
|
12
12
|
function f(e, t = /* @__PURE__ */ new Map()) {
|
|
13
13
|
for (let n of e) n.children && f(n.children, t), t.set(i(n.path, n.meta), n);
|
|
@@ -25,7 +25,7 @@ function m(e, t = /* @__PURE__ */ new Set()) {
|
|
|
25
25
|
return t;
|
|
26
26
|
}
|
|
27
27
|
function h(e) {
|
|
28
|
-
let { path: t, type: n, name: r, icon: a } = e, o = a ? /* @__PURE__ */
|
|
28
|
+
let { path: t, type: n, name: r, icon: a } = e, o = a ? /* @__PURE__ */ s(u, { name: a }) : void 0;
|
|
29
29
|
return n === "directory" ? {
|
|
30
30
|
type: "submenu",
|
|
31
31
|
key: i(t, e.meta),
|
|
@@ -49,43 +49,43 @@ function _(e, t) {
|
|
|
49
49
|
throwOnError: !1
|
|
50
50
|
}).at(-1).fullPath;
|
|
51
51
|
}
|
|
52
|
-
function v({ fetchUserInfo: i, beforeLoad:
|
|
52
|
+
function v({ fetchUserInfo: i, beforeLoad: u, loader: h, ...v }) {
|
|
53
53
|
function y() {
|
|
54
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ s(a, {
|
|
55
55
|
...v,
|
|
56
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ s(c, {})
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
beforeLoad: async (r) => {
|
|
61
|
-
let i = r, { location: a, context: o } = i, { isAuthenticated:
|
|
62
|
-
if (!
|
|
61
|
+
let i = r, { location: a, context: o } = i, { isAuthenticated: s, menuPathSet: c } = n.getState();
|
|
62
|
+
if (!s) throw l({
|
|
63
63
|
to: t,
|
|
64
64
|
search: { redirect: a.href }
|
|
65
65
|
});
|
|
66
|
-
if (
|
|
66
|
+
if (c && !c.has(_(o, a))) throw l({
|
|
67
67
|
to: e,
|
|
68
68
|
replace: !0
|
|
69
69
|
});
|
|
70
|
-
return await
|
|
70
|
+
return await u?.(i) ?? {};
|
|
71
71
|
},
|
|
72
72
|
loader: async (t) => {
|
|
73
|
-
let r = t, { location: a, context: o } = r, { permissionTokens: s, ...c } = await i(), { menus:
|
|
73
|
+
let r = t, { location: a, context: o } = r, { permissionTokens: s, ...c } = await i(), { menus: u } = c, d = Object.freeze(f(u)), v = Object.freeze(p(u)), y = Object.freeze(m(u)), b = Object.freeze(g(u));
|
|
74
74
|
if (n.setState({
|
|
75
75
|
...n.getState(),
|
|
76
76
|
userInfo: Object.freeze(c),
|
|
77
|
-
userMenuMap:
|
|
77
|
+
userMenuMap: d,
|
|
78
78
|
menuPathMap: v,
|
|
79
79
|
menuPathSet: y,
|
|
80
80
|
menuItems: b,
|
|
81
81
|
permissionTokens: Object.freeze(new Set(s))
|
|
82
|
-
}), !y.has(_(o, a))) throw
|
|
82
|
+
}), !y.has(_(o, a))) throw l({
|
|
83
83
|
to: e,
|
|
84
84
|
replace: !0
|
|
85
85
|
});
|
|
86
86
|
if (h) return await h(r);
|
|
87
87
|
},
|
|
88
|
-
pendingComponent: () => /* @__PURE__ */
|
|
88
|
+
pendingComponent: () => /* @__PURE__ */ s(d, {
|
|
89
89
|
description: "页面玩命加载中, 请稍后...",
|
|
90
90
|
descriptionSize: 18,
|
|
91
91
|
size: 48
|
package/dist/es/routes/login.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import "../constants/router.js";
|
|
3
3
|
import { useAppStore as e } from "../stores/app.js";
|
|
4
4
|
import { Login as t } from "../components/login/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
6
|
+
import { redirect as r } from "@tanstack/react-router";
|
|
7
|
+
import { z as i } from "@vef-framework-react/shared";
|
|
8
8
|
//#region src/routes/login.tsx
|
|
9
9
|
function a(a) {
|
|
10
10
|
function o() {
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ n(t, { ...a });
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
validateSearch:
|
|
14
|
+
validateSearch: i.object({ redirect: i.string().optional().default("/").catch("/") }),
|
|
15
15
|
beforeLoad: ({ search: t }) => {
|
|
16
|
-
if (e.getState().isAuthenticated) throw
|
|
16
|
+
if (e.getState().isAuthenticated) throw r({
|
|
17
17
|
to: t.redirect,
|
|
18
18
|
replace: !0
|
|
19
19
|
});
|
package/dist/es/routes/root.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { useAppStore as e } from "../stores/app.js";
|
|
3
3
|
import { useActiveMenuKey as t } from "../hooks/use-active-menu-key.js";
|
|
4
4
|
import { jsx as n } from "@emotion/react/jsx-runtime";
|
package/dist/es/stores/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { createPersistedStore as e } from "@vef-framework-react/core";
|
|
3
3
|
//#region src/stores/app.ts
|
|
4
4
|
var t = e(() => ({
|
package/dist/es/stores/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { useAppStore as e } from "./app.js";
|
|
3
3
|
import { useTabStore as t } from "./tab.js";
|
|
4
4
|
import { useThemeStore as n } from "./theme.js";
|
package/dist/es/stores/tab.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import "../constants/router.js";
|
|
3
3
|
import { createPersistedStore as e, originalState as t } from "@vef-framework-react/core";
|
|
4
4
|
//#region src/stores/tab.ts
|
package/dist/es/stores/theme.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @vef-framework-react/starter v2.
|
|
1
|
+
/*! @vef-framework-react/starter v2.10.0 made by Venus | 2026-07-13T07:28:24.174Z */
|
|
2
2
|
import { createPersistedStore as e } from "@vef-framework-react/core";
|
|
3
3
|
import { omit as t } from "@vef-framework-react/shared";
|
|
4
4
|
//#region src/stores/theme.ts
|
|
@@ -3,7 +3,7 @@ export { App, type AppProps } from './app';
|
|
|
3
3
|
export { BaseLayout, type BaseLayoutProps } from './base-layout';
|
|
4
4
|
export { Error } from './error';
|
|
5
5
|
export { Layout, type AppItem, type LayoutProps, type UserMenuItem } from './layout';
|
|
6
|
-
export { Login, type LoginChallenge, type LoginChallengeRenderer, type LoginChallengeRendererProps, type LoginChallengeRenderers, type LoginParams, type LoginProps, type LoginResult, type PasswordLoginParams, type ResolveChallengeParams } from './login';
|
|
6
|
+
export { Login, PASSWORD_CHANGE_CHALLENGE_TYPE, PasswordChangeChallenge, type LoginChallenge, type LoginChallengeRenderer, type LoginChallengeRendererProps, type LoginChallengeRenderers, type LoginParams, type LoginProps, type LoginResult, type PasswordChangeChallengeData, type PasswordChangeChallengeProps, type PasswordChangeChallengeSpec, type PasswordChangeReason, type PasswordLoginParams, type ResolveChallengeParams } from './login';
|
|
7
7
|
export { NProgress, nProgressEventEmitter } from './n-progress';
|
|
8
8
|
export { NotFound } from './not-found';
|
|
9
9
|
export { RouterContextHookProvider, RouterProvider, type RouterProviderProps, type UseRouterContext } from './router-provider';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LoginProps } from './props';
|
|
2
2
|
export declare function Login({ logo, title, description, publicKey, onLogin, onResolveChallenge, challengeRenderers }: LoginProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
export { PASSWORD_CHANGE_CHALLENGE_TYPE, PasswordChangeChallenge, type PasswordChangeChallengeData, type PasswordChangeChallengeProps, type PasswordChangeChallengeSpec, type PasswordChangeReason } from './password-change-challenge';
|
|
3
4
|
export { type LoginChallenge, type LoginParams, type LoginResult, type PasswordLoginParams, type ResolveChallengeParams } from './payload';
|
|
4
5
|
export { type LoginChallengeRenderer, type LoginChallengeRendererProps, type LoginChallengeRenderers, type LoginProps } from './props';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { LiteralUnion } from '@vef-framework-react/shared';
|
|
2
|
+
/**
|
|
3
|
+
* The challenge type identifier for forced password change, aligned with the
|
|
4
|
+
* backend `security.ChallengeTypePasswordChange`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PASSWORD_CHANGE_CHALLENGE_TYPE = "password_change";
|
|
7
|
+
/**
|
|
8
|
+
* Why the server forces a password change. `first_login` and `expired` are the
|
|
9
|
+
* backend's predefined reasons; hosts may define additional ones.
|
|
10
|
+
*/
|
|
11
|
+
export type PasswordChangeReason = LiteralUnion<"first_login" | "expired", string>;
|
|
12
|
+
/**
|
|
13
|
+
* The challenge `data` payload for a forced password change, aligned with the
|
|
14
|
+
* backend `security.PasswordChangeChallengeData`.
|
|
15
|
+
*/
|
|
16
|
+
export interface PasswordChangeChallengeData {
|
|
17
|
+
reason: PasswordChangeReason;
|
|
18
|
+
meta?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The `Register['challenges']` entry for the built-in password-change
|
|
22
|
+
* renderer. Hosts wire it up via module augmentation:
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* declare module "@vef-framework-react/starter" {
|
|
26
|
+
* interface Register {
|
|
27
|
+
* challenges: {
|
|
28
|
+
* [PASSWORD_CHANGE_CHALLENGE_TYPE]: PasswordChangeChallengeSpec;
|
|
29
|
+
* };
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
export interface PasswordChangeChallengeSpec {
|
|
34
|
+
data: PasswordChangeChallengeData;
|
|
35
|
+
/**
|
|
36
|
+
* The new password — encrypted with the login `publicKey` when one is
|
|
37
|
+
* configured, plaintext otherwise.
|
|
38
|
+
*/
|
|
39
|
+
response: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Props shaped to stay assignable to `LoginChallengeRenderers` entries both
|
|
43
|
+
* with and without a `Register['challenges']` augmentation: `challenge.data`
|
|
44
|
+
* stays wide (`unknown`, narrowed internally) while `resolve` stays narrow
|
|
45
|
+
* (the renderer only ever submits a string).
|
|
46
|
+
*/
|
|
47
|
+
export interface PasswordChangeChallengeProps {
|
|
48
|
+
challenge: {
|
|
49
|
+
/**
|
|
50
|
+
* The server-provided {@link PasswordChangeChallengeData}; treated as
|
|
51
|
+
* untrusted wire data and read defensively.
|
|
52
|
+
*/
|
|
53
|
+
data?: unknown;
|
|
54
|
+
};
|
|
55
|
+
resolve: (response: string) => Promise<void>;
|
|
56
|
+
cancel: () => void;
|
|
57
|
+
pending: boolean;
|
|
58
|
+
error?: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Provided by the Login component when a `publicKey` is configured; the new
|
|
61
|
+
* password is encrypted before it is submitted.
|
|
62
|
+
*/
|
|
63
|
+
encrypt?: (plaintext: string) => string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Built-in renderer for the backend's forced password-change login challenge
|
|
67
|
+
* (`security.PasswordChangeChallengeProvider`). Collects and confirms the new
|
|
68
|
+
* password, encrypts it when the Login component provides `encrypt`, and
|
|
69
|
+
* surfaces both resolve failures (e.g. a password-policy violation) and local
|
|
70
|
+
* validation errors inline.
|
|
71
|
+
*/
|
|
72
|
+
export declare function PasswordChangeChallenge({ challenge, pending, error, encrypt, resolve, cancel }: PasswordChangeChallengeProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type AppItem, type LoginChallenge, type LoginChallengeRenderer, type LoginChallengeRendererProps, type LoginChallengeRenderers, type LoginParams, type LoginProps, type LoginResult, type PasswordLoginParams, type ResolveChallengeParams, type UserMenuItem } from './components';
|
|
1
|
+
export { PASSWORD_CHANGE_CHALLENGE_TYPE, PasswordChangeChallenge, type AppItem, type LoginChallenge, type LoginChallengeRenderer, type LoginChallengeRendererProps, type LoginChallengeRenderers, type LoginParams, type LoginProps, type LoginResult, type PasswordChangeChallengeData, type PasswordChangeChallengeProps, type PasswordChangeChallengeSpec, type PasswordChangeReason, type PasswordLoginParams, type ResolveChallengeParams, type UserMenuItem } from './components';
|
|
2
2
|
export { ACCESS_DENIED_ROUTE_ID, ACCESS_DENIED_ROUTE_PATH, INDEX_ROUTE_ID, INDEX_ROUTE_PATH, LOGIN_ROUTE_ID, LOGIN_ROUTE_PATH } from './constants';
|
|
3
3
|
export { createApiClient, createApp, createRouter, dispatchCustomEvent, emitAccessDenied, emitUnauthenticated, extractQueryParams, handleClientLogout, noopMutationFn, setupAppVersionNotification, type ApiClientOptions, type AppChangelog, type AppVersionNotificationOptions, type RouterOptions } from './helpers';
|
|
4
4
|
export { createAccessDeniedRouteOptions, createLayoutRouteOptions, createLoginRouteOptions, createRootRouteOptions, type LayoutBeforeLoadArgs, type LayoutLoaderArgs } from './routes';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework-react/starter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Starter for VEF framework",
|
|
6
6
|
"keywords": [
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"@tanstack/react-router": "^1.170.17",
|
|
50
50
|
"react": "^19.2.7",
|
|
51
51
|
"react-dom": "^19.2.7",
|
|
52
|
-
"@vef-framework-react/components": "2.
|
|
53
|
-
"@vef-framework-react/core": "2.
|
|
54
|
-
"@vef-framework-react/shared": "2.
|
|
55
|
-
"@vef-framework-react/hooks": "2.
|
|
52
|
+
"@vef-framework-react/components": "2.10.0",
|
|
53
|
+
"@vef-framework-react/core": "2.10.0",
|
|
54
|
+
"@vef-framework-react/shared": "2.10.0",
|
|
55
|
+
"@vef-framework-react/hooks": "2.10.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@tanstack/react-router": ">=1",
|