@donotdev/ui 0.0.17 → 0.0.18
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/components/auth/AuthHeader.d.ts.map +1 -1
- package/dist/components/auth/AuthHeader.js +2 -2
- package/dist/components/auth/AuthMenu.d.ts.map +1 -1
- package/dist/components/auth/AuthMenu.js +2 -3
- package/dist/components/common/FeatureDisabled.d.ts.map +1 -1
- package/dist/components/common/FeatureDisabled.js +2 -2
- package/dist/components/layout/components/Notifications.js +2 -2
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +22 -2
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +7 -2
- package/dist/crud/components/EntityWorkflow.d.ts +47 -0
- package/dist/crud/components/EntityWorkflow.d.ts.map +1 -0
- package/dist/crud/components/EntityWorkflow.js +47 -0
- package/dist/crud/components/index.d.ts +2 -0
- package/dist/crud/components/index.d.ts.map +1 -1
- package/dist/crud/components/index.js +1 -0
- package/dist/dndev.css +1452 -100
- package/dist/index.js +4 -4
- package/dist/internal/layout/DnDevLayout.d.ts.map +1 -1
- package/dist/internal/layout/DnDevLayout.js +4 -3
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +1 -1
- package/dist/internal/providers/NavigationProvider.js +1 -1
- package/dist/styles/index.css +1418 -121
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +31 -4
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/vite-routing/AppRoutes.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"AppRoutes.d.ts","sourceRoot":"","sources":["../../src/vite-routing/AppRoutes.tsx"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAO3E,OAAO,KAAK,EAAE,aAAa,EAAkC,MAAM,OAAO,CAAC;AAG3E,yEAAyE;AACzE,KAAK,oBAAoB,GACrB,CAAC,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC,GAC3C,MAAM,CAAC;AAiIX;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAChC;AAED,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B,4CAA4C;IAC5C,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,yCAoE9D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
// packages/ui/src/vite-routing/AppRoutes.tsx
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview AppRoutes - Professional Route Configuration System
|
|
@@ -46,8 +46,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
46
46
|
* <RouterProvider router={router} />
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
|
-
import { lazy, Suspense } from 'react';
|
|
49
|
+
import { lazy, Suspense, useLayoutEffect } from 'react';
|
|
50
50
|
import { createBrowserRouter } from 'react-router-dom';
|
|
51
|
+
import { useLayout } from '@donotdev/core';
|
|
51
52
|
import { RootLayout } from './RootLayout';
|
|
52
53
|
import Loader from '../components/common/Loader';
|
|
53
54
|
import { AuthGuard } from '../routing/AuthGuard';
|
|
@@ -88,6 +89,32 @@ const LazyRoute = ({ component, path, }) => {
|
|
|
88
89
|
const Component = lazyComponentCache.get(path);
|
|
89
90
|
return (_jsx(Suspense, { fallback: _jsx(Loader, {}), children: _jsx(Component, {}) }));
|
|
90
91
|
};
|
|
92
|
+
/** Extract preset from route meta (meta is unknown at the interface level) */
|
|
93
|
+
function getRoutePreset(meta) {
|
|
94
|
+
if (meta && typeof meta === 'object' && 'preset' in meta) {
|
|
95
|
+
const preset = meta.preset;
|
|
96
|
+
return typeof preset === 'string' ? preset : undefined;
|
|
97
|
+
}
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* LayoutRoute - Per-route preset switcher
|
|
102
|
+
*
|
|
103
|
+
* Wraps route elements to apply the route's `meta.preset` override.
|
|
104
|
+
* On mount, sets the route preset override in the theme store.
|
|
105
|
+
* On unmount (navigation away), the next route's LayoutRoute sets its own value.
|
|
106
|
+
* Routes without a preset pass null, falling back to the app's default.
|
|
107
|
+
*
|
|
108
|
+
* Uses useLayoutEffect to apply before paint, avoiding visual flash.
|
|
109
|
+
*/
|
|
110
|
+
const LayoutRoute = ({ preset, children, }) => {
|
|
111
|
+
const setRoutePresetOverride = useLayout('setRoutePresetOverride');
|
|
112
|
+
useLayoutEffect(() => {
|
|
113
|
+
// Set route override (or null to clear and use app default)
|
|
114
|
+
setRoutePresetOverride(preset ?? null);
|
|
115
|
+
}, [preset, setRoutePresetOverride]);
|
|
116
|
+
return _jsx(_Fragment, { children: children });
|
|
117
|
+
};
|
|
91
118
|
/**
|
|
92
119
|
* Parse auth configuration to PageAuth | false for AuthGuard
|
|
93
120
|
*
|
|
@@ -175,14 +202,14 @@ export function createAppRouter(options) {
|
|
|
175
202
|
{
|
|
176
203
|
/** HomePage route - lazy loaded, public (no AuthGuard) */
|
|
177
204
|
index: true,
|
|
178
|
-
element: (_jsx(LazyRoute, { component: homePageRoute.component, path: homePageRoute.path })),
|
|
205
|
+
element: (_jsx(LayoutRoute, { preset: getRoutePreset(homePageRoute.meta), children: _jsx(LazyRoute, { component: homePageRoute.component, path: homePageRoute.path }) })),
|
|
179
206
|
},
|
|
180
207
|
/** All other routes are discovered and rendered here */
|
|
181
208
|
...routesWithParsedAuth
|
|
182
209
|
.filter((route) => route.path !== '/')
|
|
183
210
|
.map((route) => ({
|
|
184
211
|
path: route.path.startsWith('/') ? route.path.slice(1) : route.path,
|
|
185
|
-
element: route.parsedAuth === false ? (_jsx(LazyRoute, { component: route.component, path: route.path })) : (_jsx(AuthGuard, { auth: route.parsedAuth, children: _jsx(LazyRoute, { component: route.component, path: route.path }) })),
|
|
212
|
+
element: route.parsedAuth === false ? (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), children: _jsx(LazyRoute, { component: route.component, path: route.path }) })) : (_jsx(LayoutRoute, { preset: getRoutePreset(route.meta), children: _jsx(AuthGuard, { auth: route.parsedAuth, children: _jsx(LazyRoute, { component: route.component, path: route.path }) }) })),
|
|
186
213
|
})),
|
|
187
214
|
// 404 catch-all route (must be last)
|
|
188
215
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@donotdev/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@fontsource/inter": "^5.2.8",
|
|
51
51
|
"@fontsource/playfair-display": "^5.2.8",
|
|
52
|
+
"@fontsource/press-start-2p": "^5.2.5",
|
|
52
53
|
"@fontsource/roboto": "^5.2.10",
|
|
53
54
|
"@fontsource/space-grotesk": "^5.2.10",
|
|
54
55
|
"@hookform/resolvers": "^5.2.2",
|
|
@@ -56,7 +57,6 @@
|
|
|
56
57
|
"react-hook-form": "^7.71.2"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"@donotdev/adv-comps": "^0.0.15",
|
|
60
60
|
"@donotdev/auth": "^0.0.11",
|
|
61
61
|
"@donotdev/billing": "^0.0.10",
|
|
62
62
|
"@donotdev/components": "^0.0.21",
|