@donotdev/ui 0.0.17 → 0.0.19
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 +10 -6
- 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/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +4 -1
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +24 -3
- package/dist/crud/components/EntityList.d.ts.map +1 -1
- package/dist/crud/components/EntityList.js +9 -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 +50 -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 +1510 -114
- package/dist/index.js +4 -4
- package/dist/internal/common/RouteErrorFallback.js +1 -1
- package/dist/internal/devtools/DebugTools.d.ts.map +1 -1
- package/dist/internal/devtools/DebugTools.js +7 -2
- package/dist/internal/initializers/NextJsStoresInitializer.d.ts.map +1 -1
- package/dist/internal/initializers/NextJsStoresInitializer.js +8 -1
- 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/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +14 -11
- package/dist/routing/DnDevNavigationMenu.d.ts.map +1 -1
- package/dist/routing/DnDevNavigationMenu.js +3 -2
- package/dist/routing/GoToWrapper.d.ts.map +1 -1
- package/dist/routing/GoToWrapper.js +7 -0
- package/dist/routing/Link.d.ts.map +1 -1
- package/dist/routing/Link.js +2 -1
- package/dist/routing/hooks/hooks.next.js +1 -1
- package/dist/routing/hooks/useLocation.next.d.ts +1 -1
- package/dist/routing/hooks/useLocation.next.d.ts.map +1 -1
- package/dist/routing/hooks/useLocation.next.js +2 -1
- package/dist/routing/hooks/useParams.next.d.ts.map +1 -1
- package/dist/routing/hooks/useParams.next.js +4 -1
- package/dist/routing/hooks/useRedirectGuard.next.js +3 -3
- package/dist/styles/index.css +1473 -132
- package/dist/utils/assetResolver.d.ts +6 -0
- package/dist/utils/assetResolver.d.ts.map +1 -1
- package/dist/utils/assetResolver.js +9 -3
- package/dist/vite-routing/AppRoutes.d.ts.map +1 -1
- package/dist/vite-routing/AppRoutes.js +31 -4
- package/package.json +9 -9
|
@@ -95,6 +95,12 @@ export declare class AssetResolver {
|
|
|
95
95
|
/**
|
|
96
96
|
* Direct asset existence check for development
|
|
97
97
|
* More reliable than the build-time detection
|
|
98
|
+
*
|
|
99
|
+
* **Limitation:** This is a synchronous heuristic that always returns true
|
|
100
|
+
* when `new Image()` doesn't throw. It does NOT wait for the image to load,
|
|
101
|
+
* so it cannot detect 404s. A proper async check would require returning a
|
|
102
|
+
* Promise<boolean> via Image.onload/onerror, but that would change the
|
|
103
|
+
* synchronous contract used by resolveLogo/resolveFaviconSet.
|
|
98
104
|
*/
|
|
99
105
|
private static directAssetCheck;
|
|
100
106
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assetResolver.d.ts","sourceRoot":"","sources":["../../src/utils/assetResolver.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;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B;;;OAGG;IACH,MAAM,CAAC,iBAAiB,IAAI,UAAU;IA6DtC;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,MAAM;IAuB/B;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI,IAAI;IASzB;;OAEG;IACH,MAAM,CAAC,YAAY;;;;;;;;CAQpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAE9C"}
|
|
@@ -135,6 +135,12 @@ export class AssetResolver {
|
|
|
135
135
|
/**
|
|
136
136
|
* Direct asset existence check for development
|
|
137
137
|
* More reliable than the build-time detection
|
|
138
|
+
*
|
|
139
|
+
* **Limitation:** This is a synchronous heuristic that always returns true
|
|
140
|
+
* when `new Image()` doesn't throw. It does NOT wait for the image to load,
|
|
141
|
+
* so it cannot detect 404s. A proper async check would require returning a
|
|
142
|
+
* Promise<boolean> via Image.onload/onerror, but that would change the
|
|
143
|
+
* synchronous contract used by resolveLogo/resolveFaviconSet.
|
|
138
144
|
*/
|
|
139
145
|
static directAssetCheck(path) {
|
|
140
146
|
if (!isClient())
|
|
@@ -143,9 +149,9 @@ export class AssetResolver {
|
|
|
143
149
|
// Create a temporary image element to test if the resource exists
|
|
144
150
|
const testImg = new Image();
|
|
145
151
|
testImg.src = path;
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
return true;
|
|
152
|
+
// Synchronous heuristic: assumes asset exists if Image() doesn't throw.
|
|
153
|
+
// Cannot validate actual load — see JSDoc limitation above.
|
|
154
|
+
return true;
|
|
149
155
|
}
|
|
150
156
|
catch {
|
|
151
157
|
return false;
|
|
@@ -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.19",
|
|
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,14 +57,13 @@
|
|
|
56
57
|
"react-hook-form": "^7.71.2"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"@donotdev/
|
|
60
|
-
"@donotdev/
|
|
61
|
-
"@donotdev/
|
|
62
|
-
"@donotdev/
|
|
63
|
-
"@donotdev/
|
|
64
|
-
"@donotdev/
|
|
65
|
-
"@donotdev/
|
|
66
|
-
"@donotdev/oauth": "^0.0.10",
|
|
60
|
+
"@donotdev/auth": "^0.0.13",
|
|
61
|
+
"@donotdev/billing": "^0.0.12",
|
|
62
|
+
"@donotdev/components": "^0.0.23",
|
|
63
|
+
"@donotdev/core": "^0.0.29",
|
|
64
|
+
"@donotdev/crud": "^0.0.20",
|
|
65
|
+
"@donotdev/firebase": "^0.0.15",
|
|
66
|
+
"@donotdev/oauth": "^0.0.12",
|
|
67
67
|
"firebase": "^12.9.0",
|
|
68
68
|
"lucide-react": "^0.574.0",
|
|
69
69
|
"react": "^19.2.4",
|