@vef-framework/starter 1.0.100 → 1.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/api.js +14 -2
- package/es/app.js +24 -2
- package/es/components/index.js +8 -2
- package/es/components/vef-access-denied-page/index.js +22 -2
- package/es/components/vef-app/index.js +14 -2
- package/es/components/vef-dev-assistant/index.js +128 -5
- package/es/components/vef-error-page/index.js +19 -2
- package/es/components/vef-login-page/index.js +36 -2
- package/es/components/vef-not-found-page/index.js +21 -2
- package/es/components/vef-router-provider/index.js +17 -2
- package/es/constants.js +9 -2
- package/es/helper.js +19 -2
- package/es/index.js +20 -2
- package/es/router.js +69 -2
- package/es/routes/access-denied.js +11 -2
- package/es/routes/index.js +5 -2
- package/es/routes/layout.js +133 -2
- package/es/routes/login.js +28 -2
- package/es/routes/root.js +21 -2
- package/es/store.js +18 -2
- package/lib/api.cjs +18 -2
- package/lib/app.cjs +28 -2
- package/lib/components/index.cjs +22 -2
- package/lib/components/vef-access-denied-page/index.cjs +26 -2
- package/lib/components/vef-access-denied-page/props.cjs +4 -2
- package/lib/components/vef-app/index.cjs +18 -2
- package/lib/components/vef-app/props.cjs +4 -2
- package/lib/components/vef-dev-assistant/index.cjs +132 -5
- package/lib/components/vef-dev-assistant/props.cjs +4 -2
- package/lib/components/vef-error-page/index.cjs +23 -2
- package/lib/components/vef-error-page/props.cjs +4 -2
- package/lib/components/vef-login-page/index.cjs +40 -2
- package/lib/components/vef-login-page/props.cjs +4 -2
- package/lib/components/vef-not-found-page/index.cjs +25 -2
- package/lib/components/vef-not-found-page/props.cjs +4 -2
- package/lib/components/vef-router-provider/index.cjs +21 -2
- package/lib/components/vef-router-provider/props.cjs +4 -2
- package/lib/constants.cjs +18 -2
- package/lib/helper.cjs +23 -2
- package/lib/index.cjs +49 -2
- package/lib/router.cjs +73 -2
- package/lib/routes/access-denied.cjs +15 -2
- package/lib/routes/index.cjs +16 -2
- package/lib/routes/layout.cjs +137 -2
- package/lib/routes/login.cjs +32 -2
- package/lib/routes/root.cjs +25 -2
- package/lib/store.cjs +22 -2
- package/package.json +5 -5
package/es/api.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{createApiClient as
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { createApiClient as createApiClient$1 } from '@vef-framework/core';
|
|
3
|
+
import { useAppStore } from './store.js';
|
|
4
|
+
|
|
5
|
+
function createApiClient(options) {
|
|
6
|
+
return createApiClient$1({
|
|
7
|
+
...options,
|
|
8
|
+
getAccessToken() {
|
|
9
|
+
return useAppStore.getState().token?.accessToken;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { createApiClient };
|
|
3
15
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/app.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import './components/index.js';
|
|
5
|
+
import VefApp from './components/vef-app/index.js';
|
|
6
|
+
|
|
7
|
+
function createApp() {
|
|
8
|
+
const root = createRoot(
|
|
9
|
+
document.getElementById("root"),
|
|
10
|
+
{
|
|
11
|
+
identifierPrefix: "vef-"
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
return {
|
|
15
|
+
render: (props) => {
|
|
16
|
+
root.render(
|
|
17
|
+
createElement(VefApp, props)
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
unmount: () => root.unmount()
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { createApp };
|
|
3
25
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/components/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
export { default as VefAccessDeniedPage } from './vef-access-denied-page/index.js';
|
|
3
|
+
export { default as VefApp } from './vef-app/index.js';
|
|
4
|
+
export { default as VefDevAssistant } from './vef-dev-assistant/index.js';
|
|
5
|
+
export { default as VefErrorPage } from './vef-error-page/index.js';
|
|
6
|
+
export { default as VefLoginPage } from './vef-login-page/index.js';
|
|
7
|
+
export { default as VefNotFoundPage } from './vef-not-found-page/index.js';
|
|
8
|
+
export { default as VefRouterProvider } from './vef-router-provider/index.js';
|
|
3
9
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useLocation, useRouterState, useNavigate } from '@tanstack/react-router';
|
|
4
|
+
import { VefAccessDenied } from '@vef-framework/components';
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { INDEX_PAGE_PATH } from '../../constants.js';
|
|
7
|
+
|
|
8
|
+
function VefAccessDeniedPage(props) {
|
|
9
|
+
const { pathname } = useLocation();
|
|
10
|
+
const { redirect } = useRouterState();
|
|
11
|
+
const navigate = useNavigate();
|
|
12
|
+
const handleNavigateHome = useCallback(
|
|
13
|
+
() => navigate({
|
|
14
|
+
to: INDEX_PAGE_PATH,
|
|
15
|
+
replace: true
|
|
16
|
+
}),
|
|
17
|
+
[navigate]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ jsx(VefAccessDenied, { uri: redirect?._fromLocation?.pathname ?? pathname, onNavigateHome: handleNavigateHome, ...props });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { VefAccessDeniedPage as default };
|
|
3
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,3 +1,15 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { VefConfigProvider } from '@vef-framework/components';
|
|
4
|
+
import { StrictMode } from 'react';
|
|
5
|
+
import VefRouterProvider from '../vef-router-provider/index.js';
|
|
6
|
+
|
|
7
|
+
function VefApp({
|
|
8
|
+
router,
|
|
9
|
+
...configProviderProps
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(VefConfigProvider, { ...configProviderProps, children: /* @__PURE__ */ jsx(VefRouterProvider, { router }) }) });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { VefApp as default };
|
|
3
15
|
/*! 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,14 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsxs
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import { VefFloatButtonGroup, VefFloatButton, VefIcon, VefLoadingPlaceholder } from '@vef-framework/components';
|
|
5
|
+
import { useKeyPress } from '@vef-framework/hooks';
|
|
6
|
+
import { themeVariables, noop } from '@vef-framework/shared';
|
|
7
|
+
import { CompassIcon, SendIcon } from 'lucide-react';
|
|
8
|
+
import { AnimatePresence, motion } from 'motion/react';
|
|
9
|
+
import { lazy, useState, useCallback, Suspense } from 'react';
|
|
10
|
+
|
|
11
|
+
const devtoolsContainerStyle = css`
|
|
3
12
|
position: fixed;
|
|
4
13
|
bottom: 0;
|
|
5
14
|
width: 100%;
|
|
@@ -22,11 +31,125 @@ import{jsxs as e,jsx as t,Fragment as o}from"@emotion/react/jsx-runtime";import{
|
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
> div {
|
|
25
|
-
padding: ${
|
|
34
|
+
padding: ${themeVariables.paddingSm};
|
|
26
35
|
scrollbar-width: thin;
|
|
27
36
|
scrollbar-color: #334155 transparent;
|
|
28
|
-
box-shadow: ${
|
|
37
|
+
box-shadow: ${themeVariables.boxShadowDrawerDown};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
function IconCoffee(props) {
|
|
42
|
+
return /* @__PURE__ */ jsxs("svg", { height: 24, viewBox: "0 0 24 24", width: 24, xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
43
|
+
/* @__PURE__ */ 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: /* @__PURE__ */ jsx("animate", { attributeName: "fill-opacity", begin: "0.8s", dur: "0.5s", fill: "freeze", values: "0;1" }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, children: [
|
|
45
|
+
/* @__PURE__ */ 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: /* @__PURE__ */ jsx("animate", { attributeName: "stroke-dashoffset", dur: "0.6s", fill: "freeze", values: "48;0" }) }),
|
|
46
|
+
/* @__PURE__ */ 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: /* @__PURE__ */ jsx("animate", { attributeName: "stroke-dashoffset", begin: "0.6s", dur: "0.2s", fill: "freeze", values: "14;0" }) }),
|
|
47
|
+
/* @__PURE__ */ jsx("mask", { id: "lineMdCoffeeHalfEmptyFilledLoop0", children: /* @__PURE__ */ 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: /* @__PURE__ */ jsx("animateMotion", { calcMode: "linear", dur: "3s", path: "M0 0v-8", repeatCount: "indefinite" }) }) }),
|
|
48
|
+
/* @__PURE__ */ jsxs("rect", { fill: "currentColor", height: 0, mask: "url(#lineMdCoffeeHalfEmptyFilledLoop0)", width: 24, y: 7, children: [
|
|
49
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "y", begin: "0.8s", dur: "0.6s", fill: "freeze", values: "7;2" }),
|
|
50
|
+
/* @__PURE__ */ jsx("animate", { attributeName: "height", begin: "0.8s", dur: "0.6s", fill: "freeze", values: "0;5" })
|
|
51
|
+
] })
|
|
52
|
+
] })
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
56
|
+
const RouterDevtools = isDev ? lazy(() => import('@tanstack/router-devtools').then((mod) => ({
|
|
57
|
+
default: mod.TanStackRouterDevtoolsPanel
|
|
58
|
+
}))) : () => null;
|
|
59
|
+
const QueryDevtools = isDev ? lazy(() => import('@tanstack/react-query-devtools').then((mod) => ({
|
|
60
|
+
default: mod.ReactQueryDevtoolsPanel
|
|
61
|
+
}))) : () => null;
|
|
62
|
+
const variants = {
|
|
63
|
+
opened: {
|
|
64
|
+
opacity: 1,
|
|
65
|
+
y: 0,
|
|
66
|
+
transition: {
|
|
67
|
+
type: "spring",
|
|
68
|
+
bounce: 0,
|
|
69
|
+
duration: 0.2
|
|
29
70
|
}
|
|
71
|
+
},
|
|
72
|
+
closed: {
|
|
73
|
+
opacity: 0,
|
|
74
|
+
y: "50%"
|
|
30
75
|
}
|
|
31
|
-
|
|
76
|
+
};
|
|
77
|
+
function VefDevAssistant() {
|
|
78
|
+
const [visibleDevtools, setVisibleDevtools] = useState(null);
|
|
79
|
+
const handleShowQueryDevtools = useCallback((event) => {
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
setVisibleDevtools((visible) => visible === "query" ? null : "query");
|
|
82
|
+
}, []);
|
|
83
|
+
const handleShowRouterDevtools = useCallback((event) => {
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
setVisibleDevtools((visible) => visible === "router" ? null : "router");
|
|
86
|
+
}, []);
|
|
87
|
+
useKeyPress("esc", () => {
|
|
88
|
+
if (visibleDevtools) {
|
|
89
|
+
setVisibleDevtools(null);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ jsxs(
|
|
94
|
+
VefFloatButtonGroup,
|
|
95
|
+
{
|
|
96
|
+
collapsable: true,
|
|
97
|
+
shape: "square",
|
|
98
|
+
icon: /* @__PURE__ */ jsx(VefIcon, { size: "huge", children: /* @__PURE__ */ jsx(IconCoffee, {}) }),
|
|
99
|
+
onClick: (event) => event.stopPropagation(),
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
VefFloatButton,
|
|
103
|
+
{
|
|
104
|
+
tip: "API调试控制台",
|
|
105
|
+
icon: /* @__PURE__ */ jsx(VefIcon, { children: /* @__PURE__ */ jsx(CompassIcon, {}) }),
|
|
106
|
+
onClick: handleShowQueryDevtools
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
VefFloatButton,
|
|
111
|
+
{
|
|
112
|
+
tip: "路由调试控制台",
|
|
113
|
+
icon: /* @__PURE__ */ jsx(VefIcon, { children: /* @__PURE__ */ jsx(SendIcon, {}) }),
|
|
114
|
+
onClick: handleShowRouterDevtools
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
|
|
121
|
+
visibleDevtools === "query" && /* @__PURE__ */ jsx(
|
|
122
|
+
motion.div,
|
|
123
|
+
{
|
|
124
|
+
animate: "opened",
|
|
125
|
+
css: devtoolsContainerStyle,
|
|
126
|
+
exit: "closed",
|
|
127
|
+
initial: "closed",
|
|
128
|
+
variants,
|
|
129
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(VefLoadingPlaceholder, {}), children: /* @__PURE__ */ jsx(QueryDevtools, { style: { height: "100%" } }) })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
visibleDevtools === "router" && /* @__PURE__ */ jsx(
|
|
133
|
+
motion.div,
|
|
134
|
+
{
|
|
135
|
+
animate: "opened",
|
|
136
|
+
css: devtoolsContainerStyle,
|
|
137
|
+
exit: "closed",
|
|
138
|
+
initial: "closed",
|
|
139
|
+
variants,
|
|
140
|
+
children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(VefLoadingPlaceholder, {}), children: /* @__PURE__ */ jsx(
|
|
141
|
+
RouterDevtools,
|
|
142
|
+
{
|
|
143
|
+
isOpen: visibleDevtools === "router",
|
|
144
|
+
setIsOpen: noop,
|
|
145
|
+
style: { height: "100%" }
|
|
146
|
+
}
|
|
147
|
+
) })
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] })
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export { VefDevAssistant as default };
|
|
32
155
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { VefError } from '@vef-framework/components';
|
|
4
|
+
import { useQueryErrorResetBoundary } from '@vef-framework/core';
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
function VefErrorPage({
|
|
8
|
+
error,
|
|
9
|
+
info,
|
|
10
|
+
reset
|
|
11
|
+
}) {
|
|
12
|
+
const { reset: resetQueryError } = useQueryErrorResetBoundary();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
resetQueryError();
|
|
15
|
+
}, [resetQueryError]);
|
|
16
|
+
return /* @__PURE__ */ jsx(VefError, { componentStack: info?.componentStack, error, reset });
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { VefErrorPage as default };
|
|
3
20
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useRouter, useNavigate, useSearch } from '@tanstack/react-router';
|
|
4
|
+
import { VefLogin } from '@vef-framework/components';
|
|
5
|
+
import { LOGIN_PAGE_ROUTE } from '../../constants.js';
|
|
6
|
+
import { useAppStore } from '../../store.js';
|
|
7
|
+
|
|
8
|
+
function VefLoginPage(props) {
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
const { redirect } = useSearch({
|
|
12
|
+
from: LOGIN_PAGE_ROUTE
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
VefLogin,
|
|
16
|
+
{
|
|
17
|
+
onLoginSuccess: async ({ accessToken, refreshToken }) => {
|
|
18
|
+
useAppStore.setState({
|
|
19
|
+
isAuthenticated: true,
|
|
20
|
+
token: Object.freeze({
|
|
21
|
+
accessToken,
|
|
22
|
+
refreshToken
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
await router.invalidate();
|
|
26
|
+
await navigate({
|
|
27
|
+
to: redirect,
|
|
28
|
+
replace: true
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { VefLoginPage as default };
|
|
3
37
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { useNavigate, useLocation } from '@tanstack/react-router';
|
|
4
|
+
import { VefNotFound } from '@vef-framework/components';
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { INDEX_PAGE_PATH } from '../../constants.js';
|
|
7
|
+
|
|
8
|
+
function VefNotFoundPage() {
|
|
9
|
+
const navigate = useNavigate();
|
|
10
|
+
const handleNavigateHome = useCallback(
|
|
11
|
+
() => navigate({
|
|
12
|
+
to: INDEX_PAGE_PATH,
|
|
13
|
+
replace: true
|
|
14
|
+
}),
|
|
15
|
+
[navigate]
|
|
16
|
+
);
|
|
17
|
+
const { pathname } = useLocation();
|
|
18
|
+
return /* @__PURE__ */ jsx(VefNotFound, { uri: pathname, onNavigateHome: handleNavigateHome });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { VefNotFoundPage as default };
|
|
3
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,3 +1,18 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{jsx
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
3
|
+
import { RouterProvider } from '@tanstack/react-router';
|
|
4
|
+
import { useApiContext } from '@vef-framework/core';
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
function VefRouterProvider({
|
|
8
|
+
router
|
|
9
|
+
}) {
|
|
10
|
+
const { fetchAuthenticatedUserApi } = useApiContext();
|
|
11
|
+
const context = useMemo(() => ({
|
|
12
|
+
fetchAuthenticatedUserApi
|
|
13
|
+
}), [fetchAuthenticatedUserApi]);
|
|
14
|
+
return /* @__PURE__ */ jsx(RouterProvider, { context, router });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { VefRouterProvider as default };
|
|
3
18
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/constants.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
const
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
const LOGIN_PAGE_PATH = "/login";
|
|
3
|
+
const LOGIN_PAGE_ROUTE = "/_common/login";
|
|
4
|
+
const INDEX_PAGE_PATH = "/";
|
|
5
|
+
const INDEX_PAGE_ROUTE = "/_layout";
|
|
6
|
+
const ACCESS_DENIED_PAGE_PATH = "/access-denied";
|
|
7
|
+
const ACCESS_DENIED_PAGE_ROUTE = "/_common/access-denied";
|
|
8
|
+
|
|
9
|
+
export { ACCESS_DENIED_PAGE_PATH, ACCESS_DENIED_PAGE_ROUTE, INDEX_PAGE_PATH, INDEX_PAGE_ROUTE, LOGIN_PAGE_PATH, LOGIN_PAGE_ROUTE };
|
|
3
10
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/helper.js
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{LOGIN_PAGE_PATH
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import { LOGIN_PAGE_PATH } from './constants.js';
|
|
3
|
+
import { useAppStore } from './store.js';
|
|
4
|
+
|
|
5
|
+
async function handleClientLogout(router, fetchAuthenticatedUserApi) {
|
|
6
|
+
await fetchAuthenticatedUserApi.invalidateQueries();
|
|
7
|
+
useAppStore.setState(
|
|
8
|
+
{
|
|
9
|
+
isAuthenticated: false
|
|
10
|
+
},
|
|
11
|
+
true
|
|
12
|
+
);
|
|
13
|
+
await router.invalidate();
|
|
14
|
+
await router.navigate({
|
|
15
|
+
to: LOGIN_PAGE_PATH
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { handleClientLogout };
|
|
3
20
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
export { createApiClient } from './api.js';
|
|
3
|
+
export { createApp } from './app.js';
|
|
4
|
+
import './components/index.js';
|
|
5
|
+
export { ACCESS_DENIED_PAGE_PATH, ACCESS_DENIED_PAGE_ROUTE, INDEX_PAGE_PATH, INDEX_PAGE_ROUTE, LOGIN_PAGE_PATH, LOGIN_PAGE_ROUTE } from './constants.js';
|
|
6
|
+
export { handleClientLogout } from './helper.js';
|
|
7
|
+
export { createRouter } from './router.js';
|
|
8
|
+
import './routes/index.js';
|
|
9
|
+
export { useAppStore } from './store.js';
|
|
10
|
+
export { default as VefAccessDeniedPage } from './components/vef-access-denied-page/index.js';
|
|
11
|
+
export { default as VefApp } from './components/vef-app/index.js';
|
|
12
|
+
export { default as VefDevAssistant } from './components/vef-dev-assistant/index.js';
|
|
13
|
+
export { default as VefErrorPage } from './components/vef-error-page/index.js';
|
|
14
|
+
export { default as VefLoginPage } from './components/vef-login-page/index.js';
|
|
15
|
+
export { default as VefNotFoundPage } from './components/vef-not-found-page/index.js';
|
|
16
|
+
export { default as VefRouterProvider } from './components/vef-router-provider/index.js';
|
|
17
|
+
export { createAccessDeniedRouteOptions } from './routes/access-denied.js';
|
|
18
|
+
export { createLayoutRouteOptions } from './routes/layout.js';
|
|
19
|
+
export { createLoginRouteOptions } from './routes/login.js';
|
|
20
|
+
export { createRootRoute } from './routes/root.js';
|
|
3
21
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/router.js
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import{createRouter as
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
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
|
+
const defaultGcTime = 10 * 60 * 1e3;
|
|
9
|
+
function createRouter({
|
|
10
|
+
routeTree,
|
|
11
|
+
history
|
|
12
|
+
}) {
|
|
13
|
+
const router = createRouter$1({
|
|
14
|
+
routeTree,
|
|
15
|
+
trailingSlash: "never",
|
|
16
|
+
caseSensitive: true,
|
|
17
|
+
history: history === "hash" ? createHashHistory() : createBrowserHistory(),
|
|
18
|
+
search: {
|
|
19
|
+
strict: true
|
|
20
|
+
},
|
|
21
|
+
notFoundMode: "root",
|
|
22
|
+
defaultPendingComponent: () => createElement(
|
|
23
|
+
VefLoadingPlaceholder,
|
|
24
|
+
{
|
|
25
|
+
size: "large"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
defaultPendingMs: 500,
|
|
29
|
+
defaultPendingMinMs: 300,
|
|
30
|
+
defaultSsr: false,
|
|
31
|
+
defaultStructuralSharing: true,
|
|
32
|
+
defaultHashScrollIntoView: {
|
|
33
|
+
behavior: "smooth",
|
|
34
|
+
block: "start",
|
|
35
|
+
inline: "center"
|
|
36
|
+
},
|
|
37
|
+
defaultPreload: "intent",
|
|
38
|
+
defaultPreloadDelay: 50,
|
|
39
|
+
defaultPreloadGcTime: defaultGcTime,
|
|
40
|
+
defaultGcTime,
|
|
41
|
+
defaultOnCatch(error, errorInfo) {
|
|
42
|
+
showErrorNotification(
|
|
43
|
+
error.message || error.name,
|
|
44
|
+
createElement(
|
|
45
|
+
VefText,
|
|
46
|
+
{
|
|
47
|
+
color: "error",
|
|
48
|
+
children: createElement("pre", {
|
|
49
|
+
style: {
|
|
50
|
+
maxHeight: "480px",
|
|
51
|
+
overflowY: "auto",
|
|
52
|
+
scrollbarWidth: "thin",
|
|
53
|
+
scrollbarColor: "rgba(0, 0, 0, 0.2) transparent"
|
|
54
|
+
},
|
|
55
|
+
children: error.stack || errorInfo.componentStack || "No stack trace available"
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
router.subscribe("onBeforeLoad", ({ pathChanged }) => pathChanged && NProgress.start());
|
|
63
|
+
router.subscribe("onLoad", () => {
|
|
64
|
+
NProgress.done();
|
|
65
|
+
});
|
|
66
|
+
return router;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { createRouter };
|
|
3
70
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
2
|
+
import '../components/index.js';
|
|
3
|
+
import VefAccessDeniedPage from '../components/vef-access-denied-page/index.js';
|
|
4
|
+
|
|
5
|
+
function createAccessDeniedRouteOptions() {
|
|
6
|
+
return {
|
|
7
|
+
component: VefAccessDeniedPage
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { createAccessDeniedRouteOptions };
|
|
3
12
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/routes/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export{createAccessDeniedRouteOptions}from
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.197Z, made by Venus. */
|
|
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';
|
|
3
6
|
/*! 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 */
|