@djangocfg/layouts 2.1.560 → 2.1.561
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 +12 -12
- package/src/layouts/AppLayout/BaseApp.tsx +21 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.561",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -90,11 +90,11 @@
|
|
|
90
90
|
"check": "tsc --noEmit"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
|
-
"@djangocfg/analytics": "^2.1.
|
|
94
|
-
"@djangocfg/api": "^2.1.
|
|
95
|
-
"@djangocfg/devtools": "^2.1.
|
|
96
|
-
"@djangocfg/i18n": "^2.1.
|
|
97
|
-
"@djangocfg/ui-core": "^2.1.
|
|
93
|
+
"@djangocfg/analytics": "^2.1.561",
|
|
94
|
+
"@djangocfg/api": "^2.1.561",
|
|
95
|
+
"@djangocfg/devtools": "^2.1.561",
|
|
96
|
+
"@djangocfg/i18n": "^2.1.561",
|
|
97
|
+
"@djangocfg/ui-core": "^2.1.561",
|
|
98
98
|
"@hookform/resolvers": "^5.2.2",
|
|
99
99
|
"consola": "^3.4.2",
|
|
100
100
|
"lucide-react": "^0.545.0",
|
|
@@ -124,12 +124,12 @@
|
|
|
124
124
|
"uuid": "^11.1.1"
|
|
125
125
|
},
|
|
126
126
|
"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.
|
|
127
|
+
"@djangocfg/analytics": "^2.1.561",
|
|
128
|
+
"@djangocfg/api": "^2.1.561",
|
|
129
|
+
"@djangocfg/devtools": "^2.1.561",
|
|
130
|
+
"@djangocfg/i18n": "^2.1.561",
|
|
131
|
+
"@djangocfg/typescript-config": "^2.1.561",
|
|
132
|
+
"@djangocfg/ui-core": "^2.1.561",
|
|
133
133
|
"@storybook/react-vite": "^10.5.0",
|
|
134
134
|
"@types/node": "^25.9.5",
|
|
135
135
|
"@types/react": "19.2.15",
|
|
@@ -50,6 +50,7 @@ import { Devtools, devtools } from '@djangocfg/devtools';
|
|
|
50
50
|
import { errorDetailToDevtoolsEvent } from '../../components/errors/ErrorsTracker';
|
|
51
51
|
import { AuthProvider } from '@djangocfg/api/auth';
|
|
52
52
|
import { UiProviders } from '@djangocfg/ui-core/providers';
|
|
53
|
+
import { useScrollToTop } from '@djangocfg/ui-core/hooks';
|
|
53
54
|
import { NextRouterAdapter, NextLinkProvider } from '@djangocfg/ui-core/adapters/nextjs';
|
|
54
55
|
import { NextIntlLinkBridge } from './NextIntlLinkBridge';
|
|
55
56
|
import { ThemeProvider } from '@djangocfg/ui-core/theme';
|
|
@@ -112,6 +113,25 @@ function AppErrorFallback({
|
|
|
112
113
|
);
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Lands every forward navigation at the top of the page.
|
|
118
|
+
*
|
|
119
|
+
* Mounted here rather than left to each app because the gap it covers is in
|
|
120
|
+
* the ROUTER, not in any one project: Next's App Router abandons its scroll
|
|
121
|
+
* silently when a route's first DOM node has no box (a `display: contents`
|
|
122
|
+
* wrapper, a JSON-LD script, a component returning `null`) or when that node
|
|
123
|
+
* already sits in the viewport. Every app built on this stack hits it, and
|
|
124
|
+
* the symptom — a new page opening halfway down — reads as a broken link.
|
|
125
|
+
*
|
|
126
|
+
* Its own component so the hook subscribes below the router adapter and
|
|
127
|
+
* re-runs nothing above it. See `useScrollToTop` for what it leaves alone
|
|
128
|
+
* (back/forward, `#hash` targets, query-only writes).
|
|
129
|
+
*/
|
|
130
|
+
function ScrollToTop() {
|
|
131
|
+
useScrollToTop();
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
|
|
115
135
|
/**
|
|
116
136
|
* BaseApp - Core providers wrapper for any React/Next.js app
|
|
117
137
|
*
|
|
@@ -191,6 +211,7 @@ export function BaseApp({
|
|
|
191
211
|
onError={errorTracking?.onError}
|
|
192
212
|
onMonitorCapture={(d) => devtools.capture(errorDetailToDevtoolsEvent(d))}
|
|
193
213
|
>
|
|
214
|
+
<ScrollToTop />
|
|
194
215
|
<Devtools {...devtoolsProps} />
|
|
195
216
|
<LayoutI18nProvider value={i18n}>
|
|
196
217
|
{i18n?.routing ? (
|