@djangocfg/layouts 2.1.615 → 2.1.617
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.617",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"test": "vitest run"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
|
-
"@djangocfg/analytics": "^2.1.
|
|
95
|
-
"@djangocfg/api": "^2.1.
|
|
96
|
-
"@djangocfg/devtools": "^2.1.
|
|
97
|
-
"@djangocfg/i18n": "^2.1.
|
|
98
|
-
"@djangocfg/ui-core": "^2.1.
|
|
94
|
+
"@djangocfg/analytics": "^2.1.617",
|
|
95
|
+
"@djangocfg/api": "^2.1.617",
|
|
96
|
+
"@djangocfg/devtools": "^2.1.617",
|
|
97
|
+
"@djangocfg/i18n": "^2.1.617",
|
|
98
|
+
"@djangocfg/ui-core": "^2.1.617",
|
|
99
99
|
"@hookform/resolvers": "^5.2.2 || ^7.0.2",
|
|
100
100
|
"consola": "^3.4.2",
|
|
101
101
|
"lucide-react": "^1.68.0",
|
|
@@ -120,16 +120,15 @@
|
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"libphonenumber-js": "^1.13.15",
|
|
123
|
-
"nextjs-toploader": "^3.9.17",
|
|
124
123
|
"qrcode.react": "^4.2.0"
|
|
125
124
|
},
|
|
126
125
|
"devDependencies": {
|
|
127
|
-
"@djangocfg/analytics": "^2.1.
|
|
128
|
-
"@djangocfg/api": "^2.1.
|
|
129
|
-
"@djangocfg/devtools": "^2.1.
|
|
130
|
-
"@djangocfg/i18n": "^2.1.
|
|
131
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
132
|
-
"@djangocfg/ui-core": "^2.1.
|
|
126
|
+
"@djangocfg/analytics": "^2.1.617",
|
|
127
|
+
"@djangocfg/api": "^2.1.617",
|
|
128
|
+
"@djangocfg/devtools": "^2.1.617",
|
|
129
|
+
"@djangocfg/i18n": "^2.1.617",
|
|
130
|
+
"@djangocfg/typescript-config": "^2.1.617",
|
|
131
|
+
"@djangocfg/ui-core": "^2.1.617",
|
|
133
132
|
"@storybook/react-vite": "^10.6.5",
|
|
134
133
|
"@types/node": "^25.9.5",
|
|
135
134
|
"@types/react": "19.3.0",
|
package/src/index.ts
CHANGED
|
@@ -35,10 +35,6 @@ export * from './layouts';
|
|
|
35
35
|
// Typed theme style bridge + presets (BaseApp `theme.style`)
|
|
36
36
|
export * from './theme';
|
|
37
37
|
|
|
38
|
-
// Re-export useRouter from nextjs-toploader for progress bar support
|
|
39
|
-
// Use this instead of 'next/navigation' useRouter for router.push() to trigger progress
|
|
40
|
-
export { useRouter } from 'nextjs-toploader/app';
|
|
41
|
-
|
|
42
38
|
// Snippets - Reusable UI components (includes Analytics)
|
|
43
39
|
export * from './snippets';
|
|
44
40
|
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
'use client';
|
|
44
44
|
|
|
45
45
|
import { nodeEnv } from "@djangocfg/ui-core/lib";
|
|
46
|
-
import NextTopLoader from 'nextjs-toploader';
|
|
47
46
|
import { SWRConfig } from 'swr';
|
|
48
47
|
|
|
49
48
|
import { Devtools, devtools } from '@djangocfg/devtools';
|
|
@@ -52,6 +51,7 @@ import { AuthProvider } from '@djangocfg/api/auth';
|
|
|
52
51
|
import { UiProviders } from '@djangocfg/ui-core/providers';
|
|
53
52
|
import { useScrollToTop } from '@djangocfg/ui-core/hooks';
|
|
54
53
|
import { NextRouterAdapter, NextLinkProvider } from '@djangocfg/ui-core/adapters/nextjs';
|
|
54
|
+
import { RouteProgressProvider } from '@djangocfg/ui-core/route-progress';
|
|
55
55
|
import { NextIntlLinkBridge } from './NextIntlLinkBridge';
|
|
56
56
|
import { ThemeProvider } from '@djangocfg/ui-core/theme';
|
|
57
57
|
import { AppErrorFallback } from '../../components/errors/AppErrorFallback';
|
|
@@ -107,6 +107,7 @@ export function BaseApp({
|
|
|
107
107
|
devtools: devtoolsConfig,
|
|
108
108
|
i18n,
|
|
109
109
|
pwaMeta = true,
|
|
110
|
+
progressBar = true,
|
|
110
111
|
}: BaseAppProps) {
|
|
111
112
|
// auth=false disables AuthProvider entirely (public apps with no login)
|
|
112
113
|
const authEnabled = auth !== false;
|
|
@@ -138,6 +139,10 @@ export function BaseApp({
|
|
|
138
139
|
* correctly. Placed near the top so every provider below
|
|
139
140
|
* (Auth, anything that may navigate) gets it.
|
|
140
141
|
*/}
|
|
142
|
+
<RouteProgressProvider
|
|
143
|
+
enabled={progressBar !== false}
|
|
144
|
+
{...(typeof progressBar === 'object' ? progressBar : {})}
|
|
145
|
+
>
|
|
141
146
|
<NextRouterAdapter>
|
|
142
147
|
<NextLinkProvider>
|
|
143
148
|
{/* Single top-level boundary lives inside UiProviders. We feed it the
|
|
@@ -180,13 +185,6 @@ export function BaseApp({
|
|
|
180
185
|
)}
|
|
181
186
|
</ProjectNameProvider>
|
|
182
187
|
</LayoutI18nProvider>
|
|
183
|
-
<NextTopLoader
|
|
184
|
-
color="var(--primary)"
|
|
185
|
-
height={3}
|
|
186
|
-
showSpinner={false}
|
|
187
|
-
shadow="0 0 10px var(--primary), 0 0 5px var(--primary)"
|
|
188
|
-
/>
|
|
189
|
-
|
|
190
188
|
{/* Auth Dialog - only when auth is enabled */}
|
|
191
189
|
{authEnabled && <AuthDialog authPath={authConfig?.routes?.auth} />}
|
|
192
190
|
</ErrorTrackingProvider>
|
|
@@ -196,6 +194,7 @@ export function BaseApp({
|
|
|
196
194
|
</UiProviders>
|
|
197
195
|
</NextLinkProvider>
|
|
198
196
|
</NextRouterAdapter>
|
|
197
|
+
</RouteProgressProvider>
|
|
199
198
|
</ThemeProvider>
|
|
200
199
|
</>
|
|
201
200
|
);
|
|
@@ -34,6 +34,13 @@ import type { DevtoolsProps } from '@djangocfg/devtools';
|
|
|
34
34
|
* Core configuration for BaseApp component.
|
|
35
35
|
* All provider configs are imported from their respective modules.
|
|
36
36
|
*/
|
|
37
|
+
/** Tuning for the top loading bar, see `BaseLayoutProps.progressBar`. */
|
|
38
|
+
export interface RouteProgressOptions {
|
|
39
|
+
color?: string;
|
|
40
|
+
height?: number;
|
|
41
|
+
shouldShow?: (from: URL, to: URL) => boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
export interface BaseLayoutProps {
|
|
38
45
|
children: ReactNode;
|
|
39
46
|
|
|
@@ -79,6 +86,15 @@ export interface BaseLayoutProps {
|
|
|
79
86
|
* pass `false` to opt out.
|
|
80
87
|
*/
|
|
81
88
|
pwaMeta?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The top loading bar shown while moving between pages (`@djangocfg/ui-core/route-progress`). On by default;
|
|
92
|
+
* `false` removes it for the whole app. An object tunes it: `color`, `height` (px) and `shouldShow(from, to)`,
|
|
93
|
+
* the app's route rule (default: the pathname changes, so `?tab=2` and `#hash` never show it). A page or
|
|
94
|
+
* section can silence the bar, and the jump to the top, while it is mounted:
|
|
95
|
+
* `useNavigationBehavior({ progress: false, scroll: false })`.
|
|
96
|
+
*/
|
|
97
|
+
progressBar?: boolean | RouteProgressOptions;
|
|
82
98
|
}
|
|
83
99
|
|
|
84
100
|
/** Devtools config for BaseApp — the `<Devtools>` props minus children. */
|