@vef-framework/starter 1.0.99 → 1.0.100
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 +2 -14
- package/es/app.js +2 -24
- package/es/components/index.js +2 -8
- package/es/components/vef-access-denied-page/index.js +2 -22
- package/es/components/vef-app/index.js +2 -14
- package/es/components/vef-dev-assistant/index.js +5 -128
- package/es/components/vef-error-page/index.js +2 -19
- package/es/components/vef-login-page/index.js +2 -36
- package/es/components/vef-not-found-page/index.js +2 -21
- package/es/components/vef-router-provider/index.js +2 -17
- package/es/constants.js +2 -9
- package/es/helper.js +2 -19
- package/es/index.js +2 -20
- package/es/router.js +2 -69
- package/es/routes/access-denied.js +2 -11
- package/es/routes/index.js +2 -5
- package/es/routes/layout.js +2 -133
- package/es/routes/login.js +2 -28
- package/es/routes/root.js +2 -21
- package/es/store.js +2 -18
- package/lib/api.cjs +2 -18
- package/lib/app.cjs +2 -28
- package/lib/components/index.cjs +2 -22
- package/lib/components/vef-access-denied-page/index.cjs +2 -26
- package/lib/components/vef-access-denied-page/props.cjs +2 -4
- package/lib/components/vef-app/index.cjs +2 -18
- package/lib/components/vef-app/props.cjs +2 -4
- package/lib/components/vef-dev-assistant/index.cjs +5 -132
- package/lib/components/vef-dev-assistant/props.cjs +2 -4
- package/lib/components/vef-error-page/index.cjs +2 -23
- package/lib/components/vef-error-page/props.cjs +2 -4
- package/lib/components/vef-login-page/index.cjs +2 -40
- package/lib/components/vef-login-page/props.cjs +2 -4
- package/lib/components/vef-not-found-page/index.cjs +2 -25
- package/lib/components/vef-not-found-page/props.cjs +2 -4
- package/lib/components/vef-router-provider/index.cjs +2 -21
- package/lib/components/vef-router-provider/props.cjs +2 -4
- package/lib/constants.cjs +2 -18
- package/lib/helper.cjs +2 -23
- package/lib/index.cjs +2 -49
- package/lib/router.cjs +2 -73
- package/lib/routes/access-denied.cjs +2 -15
- package/lib/routes/index.cjs +2 -16
- package/lib/routes/layout.cjs +2 -137
- package/lib/routes/login.cjs +2 -32
- package/lib/routes/root.cjs +2 -25
- package/lib/store.cjs +2 -22
- package/package.json +5 -5
package/es/api.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{createApiClient as e}from"@vef-framework/core";import{useAppStore as t}from"./store.js";function createApiClient(r){return e({...r,getAccessToken:()=>t.getState().token?.accessToken})}export{createApiClient};
|
|
15
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/app.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import {
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{createElement as e}from"react";import{createRoot as t}from"react-dom/client";import"./components/index.js";import r from"./components/vef-app/index.js";function createApp(){const n=t(document.getElementById("root"),{identifierPrefix:"vef-"});return{render:t=>{n.render(e(r,t))},unmount:()=>n.unmount()}}export{createApp};
|
|
25
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/components/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export { default as
|
|
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';
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
export{default as VefAccessDeniedPage}from"./vef-access-denied-page/index.js";export{default as VefApp}from"./vef-app/index.js";export{default as VefDevAssistant}from"./vef-dev-assistant/index.js";export{default as VefErrorPage}from"./vef-error-page/index.js";export{default as VefLoginPage}from"./vef-login-page/index.js";export{default as VefNotFoundPage}from"./vef-not-found-page/index.js";export{default as VefRouterProvider}from"./vef-router-provider/index.js";
|
|
9
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as e}from"@emotion/react/jsx-runtime";import{useLocation as t,useRouterState as o,useNavigate as r}from"@tanstack/react-router";import{VefAccessDenied as a}from"@vef-framework/components";import{useCallback as m}from"react";import{INDEX_PAGE_PATH as n}from"../../constants.js";function VefAccessDeniedPage(c){const{pathname:i}=t(),{redirect:f}=o(),s=r(),p=m((()=>s({to:n,replace:!0})),[s]);return e(a,{uri:f?._fromLocation?.pathname??i,onNavigateHome:p,...c})}export{VefAccessDeniedPage as default};
|
|
23
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{VefConfigProvider as e}from"@vef-framework/components";import{StrictMode as o}from"react";import t from"../vef-router-provider/index.js";function VefApp({router:m,...f}){return r(o,{children:r(e,{...f,children:r(t,{router:m})})})}export{VefApp as default};
|
|
15
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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`
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsxs as e,jsx as t,Fragment as o}from"@emotion/react/jsx-runtime";import{css as r}from"@emotion/react";import{VefFloatButtonGroup as i,VefFloatButton as n,VefIcon as a,VefLoadingPlaceholder as l}from"@vef-framework/components";import{useKeyPress as s}from"@vef-framework/hooks";import{themeVariables as c,noop as d}from"@vef-framework/shared";import{CompassIcon as f,SendIcon as h}from"lucide-react";import{AnimatePresence as p,motion as u}from"motion/react";import{lazy as m,useState as v,useCallback as k,Suspense as y}from"react";const g=r`
|
|
12
3
|
position: fixed;
|
|
13
4
|
bottom: 0;
|
|
14
5
|
width: 100%;
|
|
@@ -31,125 +22,11 @@ const devtoolsContainerStyle = css`
|
|
|
31
22
|
}
|
|
32
23
|
|
|
33
24
|
> div {
|
|
34
|
-
padding: ${
|
|
25
|
+
padding: ${c.paddingSm};
|
|
35
26
|
scrollbar-width: thin;
|
|
36
27
|
scrollbar-color: #334155 transparent;
|
|
37
|
-
box-shadow: ${
|
|
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
|
|
28
|
+
box-shadow: ${c.boxShadowDrawerDown};
|
|
70
29
|
}
|
|
71
|
-
},
|
|
72
|
-
closed: {
|
|
73
|
-
opacity: 0,
|
|
74
|
-
y: "50%"
|
|
75
30
|
}
|
|
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\u8C03\u8BD5\u63A7\u5236\u53F0",
|
|
105
|
-
icon: /* @__PURE__ */ jsx(VefIcon, { children: /* @__PURE__ */ jsx(CompassIcon, {}) }),
|
|
106
|
-
onClick: handleShowQueryDevtools
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ jsx(
|
|
110
|
-
VefFloatButton,
|
|
111
|
-
{
|
|
112
|
-
tip: "\u8DEF\u7531\u8C03\u8BD5\u63A7\u5236\u53F0",
|
|
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 };
|
|
31
|
+
`;function IconCoffee(o){return e("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...o,children:[t("path",{d:"M17 14v4c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-4Z",fill:"currentColor",fillOpacity:0,children:t("animate",{attributeName:"fill-opacity",begin:"0.8s",dur:"0.5s",fill:"freeze",values:"0;1"})}),e("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,children:[t("path",{d:"M17 9v9c0 1.66 -1.34 3 -3 3h-6c-1.66 0 -3 -1.34 -3 -3v-9Z",strokeDasharray:48,strokeDashoffset:48,children:t("animate",{attributeName:"stroke-dashoffset",dur:"0.6s",fill:"freeze",values:"48;0"})}),t("path",{d:"M17 9h3c0.55 0 1 0.45 1 1v3c0 0.55 -0.45 1 -1 1h-3",strokeDasharray:14,strokeDashoffset:14,children:t("animate",{attributeName:"stroke-dashoffset",begin:"0.6s",dur:"0.2s",fill:"freeze",values:"14;0"})}),t("mask",{id:"lineMdCoffeeHalfEmptyFilledLoop0",children:t("path",{d:"M8 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M12 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4M16 0c0 2-2 2-2 4s2 2 2 4-2 2-2 4 2 2 2 4",stroke:"#fff",children:t("animateMotion",{calcMode:"linear",dur:"3s",path:"M0 0v-8",repeatCount:"indefinite"})})}),e("rect",{fill:"currentColor",height:0,mask:"url(#lineMdCoffeeHalfEmptyFilledLoop0)",width:24,y:7,children:[t("animate",{attributeName:"y",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"7;2"}),t("animate",{attributeName:"height",begin:"0.8s",dur:"0.6s",fill:"freeze",values:"0;5"})]})]})]})}const b="development"===process.env.NODE_ENV,w=b?m((()=>import("@tanstack/router-devtools").then((e=>({default:e.TanStackRouterDevtoolsPanel}))))):()=>null,x=b?m((()=>import("@tanstack/react-query-devtools").then((e=>({default:e.ReactQueryDevtoolsPanel}))))):()=>null,D={opened:{opacity:1,y:0,transition:{type:"spring",bounce:0,duration:.2}},closed:{opacity:0,y:"50%"}};function VefDevAssistant(){const[r,c]=v(null),m=k((e=>{e.stopPropagation(),c((e=>"query"===e?null:"query"))}),[]),b=k((e=>{e.stopPropagation(),c((e=>"router"===e?null:"router"))}),[]);return s("esc",(()=>{r&&c(null)})),e(o,{children:[e(i,{collapsable:!0,shape:"square",icon:t(a,{size:"huge",children:t(IconCoffee,{})}),onClick:e=>e.stopPropagation(),children:[t(n,{tip:"API调试控制台",icon:t(a,{children:t(f,{})}),onClick:m}),t(n,{tip:"路由调试控制台",icon:t(a,{children:t(h,{})}),onClick:b})]}),e(p,{mode:"wait",children:["query"===r&&t(u.div,{animate:"opened",css:g,exit:"closed",initial:"closed",variants:D,children:t(y,{fallback:t(l,{}),children:t(x,{style:{height:"100%"}})})}),"router"===r&&t(u.div,{animate:"opened",css:g,exit:"closed",initial:"closed",variants:D,children:t(y,{fallback:t(l,{}),children:t(w,{isOpen:"router"===r,setIsOpen:d,style:{height:"100%"}})})})]})]})}export{VefDevAssistant as default};
|
|
155
32
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{VefError as e}from"@vef-framework/components";import{useQueryErrorResetBoundary as o}from"@vef-framework/core";import{useEffect as t}from"react";function VefErrorPage({error:m,info:f,reset:n}){const{reset:a}=o();return t((()=>{a()}),[a]),r(e,{componentStack:f?.componentStack,error:m,reset:n})}export{VefErrorPage as default};
|
|
20
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as e}from"@emotion/react/jsx-runtime";import{useRouter as t,useNavigate as o,useSearch as r}from"@tanstack/react-router";import{VefLogin as n}from"@vef-framework/components";import{LOGIN_PAGE_ROUTE as a}from"../../constants.js";import{useAppStore as s}from"../../store.js";function VefLoginPage(c){const i=t(),f=o(),{redirect:m}=r({from:a});return e(n,{onLoginSuccess:async({accessToken:e,refreshToken:t})=>{s.setState({isAuthenticated:!0,token:Object.freeze({accessToken:e,refreshToken:t})}),await i.invalidate(),await f({to:m,replace:!0})},...c})}export{VefLoginPage as default};
|
|
37
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as o}from"@emotion/react/jsx-runtime";import{useNavigate as t,useLocation as r}from"@tanstack/react-router";import{VefNotFound as e}from"@vef-framework/components";import{useCallback as a}from"react";import{INDEX_PAGE_PATH as m}from"../../constants.js";function VefNotFoundPage(){const n=t(),f=a((()=>n({to:m,replace:!0})),[n]),{pathname:i}=r();return o(e,{uri:i,onNavigateHome:f})}export{VefNotFoundPage as default};
|
|
22
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{RouterProvider as t}from"@tanstack/react-router";import{useApiContext as e}from"@vef-framework/core";import{useMemo as o}from"react";function VefRouterProvider({router:i}){const{fetchAuthenticatedUserApi:c}=e(),f=o((()=>({fetchAuthenticatedUserApi:c})),[c]);return r(t,{context:f,router:i})}export{VefRouterProvider as default};
|
|
18
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/constants.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
const
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
const o="/login",c="/_common/login",e="/",n="/_layout",s="/access-denied",d="/_common/access-denied";export{s as ACCESS_DENIED_PAGE_PATH,d as ACCESS_DENIED_PAGE_ROUTE,e as INDEX_PAGE_PATH,n as INDEX_PAGE_ROUTE,o as LOGIN_PAGE_PATH,c as LOGIN_PAGE_ROUTE};
|
|
10
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/helper.js
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{LOGIN_PAGE_PATH as t}from"./constants.js";import{useAppStore as a}from"./store.js";async function handleClientLogout(i,e){await e.invalidateQueries(),a.setState({isAuthenticated:!1},!0),await i.invalidate(),await i.navigate({to:t})}export{handleClientLogout};
|
|
20
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/index.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export {
|
|
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';
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
export{createApiClient}from"./api.js";export{createApp}from"./app.js";import"./components/index.js";export{ACCESS_DENIED_PAGE_PATH,ACCESS_DENIED_PAGE_ROUTE,INDEX_PAGE_PATH,INDEX_PAGE_ROUTE,LOGIN_PAGE_PATH,LOGIN_PAGE_ROUTE}from"./constants.js";export{handleClientLogout}from"./helper.js";export{createRouter}from"./router.js";import"./routes/index.js";export{useAppStore}from"./store.js";export{default as VefAccessDeniedPage}from"./components/vef-access-denied-page/index.js";export{default as VefApp}from"./components/vef-app/index.js";export{default as VefDevAssistant}from"./components/vef-dev-assistant/index.js";export{default as VefErrorPage}from"./components/vef-error-page/index.js";export{default as VefLoginPage}from"./components/vef-login-page/index.js";export{default as VefNotFoundPage}from"./components/vef-not-found-page/index.js";export{default as VefRouterProvider}from"./components/vef-router-provider/index.js";export{createAccessDeniedRouteOptions}from"./routes/access-denied.js";export{createLayoutRouteOptions}from"./routes/layout.js";export{createLoginRouteOptions}from"./routes/login.js";export{createRootRoute}from"./routes/root.js";
|
|
21
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/router.js
CHANGED
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import{createRouter as e,createHashHistory as r,createBrowserHistory as t}from"@tanstack/react-router";import{VefText as o,VefLoadingPlaceholder as a}from"@vef-framework/components";import{showErrorNotification as n}from"@vef-framework/shared";import s from"nprogress";import{createElement as l}from"react";const i=6e5;function createRouter({routeTree:c,history:d}){const u=e({routeTree:c,trailingSlash:"never",caseSensitive:!0,history:"hash"===d?r():t(),search:{strict:!0},notFoundMode:"root",defaultPendingComponent:()=>l(a,{size:"large"}),defaultPendingMs:500,defaultPendingMinMs:300,defaultSsr:!1,defaultStructuralSharing:!0,defaultHashScrollIntoView:{behavior:"smooth",block:"start",inline:"center"},defaultPreload:"intent",defaultPreloadDelay:50,defaultPreloadGcTime:i,defaultGcTime:i,defaultOnCatch(e,r){n(e.message||e.name,l(o,{color:"error",children:l("pre",{style:{maxHeight:"480px",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:e.stack||r.componentStack||"No stack trace available"})}))}});return u.subscribe("onBeforeLoad",(({pathChanged:e})=>e&&s.start())),u.subscribe("onLoad",(()=>{s.done()})),u}export{createRouter};
|
|
70
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
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 };
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
import"../components/index.js";import e from"../components/vef-access-denied-page/index.js";function createAccessDeniedRouteOptions(){return{component:e}}export{createAccessDeniedRouteOptions};
|
|
12
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/routes/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
export
|
|
3
|
-
export { createLayoutRouteOptions } from './layout.js';
|
|
4
|
-
export { createLoginRouteOptions } from './login.js';
|
|
5
|
-
export { createRootRoute } from './root.js';
|
|
1
|
+
/*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.320Z, made by Venus. */
|
|
2
|
+
export{createAccessDeniedRouteOptions}from"./access-denied.js";export{createLayoutRouteOptions}from"./layout.js";export{createLoginRouteOptions}from"./login.js";export{createRootRoute}from"./root.js";
|
|
6
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|