@djangocfg/ui-core 2.1.574 → 2.1.575
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/ui-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.575",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"check:contrast": "node scripts/check-preset-contrast.mjs"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
133
|
-
"@djangocfg/i18n": "^2.1.
|
|
133
|
+
"@djangocfg/i18n": "^2.1.575",
|
|
134
134
|
"consola": "^3.4.2",
|
|
135
135
|
"lucide-react": "^0.545.0",
|
|
136
136
|
"moment": "^2.30.1",
|
|
@@ -206,9 +206,9 @@
|
|
|
206
206
|
"vaul": "1.1.2"
|
|
207
207
|
},
|
|
208
208
|
"devDependencies": {
|
|
209
|
-
"@djangocfg/eslint-config": "^2.1.
|
|
210
|
-
"@djangocfg/i18n": "^2.1.
|
|
211
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
209
|
+
"@djangocfg/eslint-config": "^2.1.575",
|
|
210
|
+
"@djangocfg/i18n": "^2.1.575",
|
|
211
|
+
"@djangocfg/typescript-config": "^2.1.575",
|
|
212
212
|
"@storybook/react-vite": "^10.5.0",
|
|
213
213
|
"@types/node": "^24.13.3",
|
|
214
214
|
"@types/react": "19.2.15",
|
|
@@ -64,16 +64,23 @@ export const SSRPagination: React.FC<SSRPaginationProps> = ({
|
|
|
64
64
|
const t = useAppT();
|
|
65
65
|
const { locale } = useI18n();
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
/* The URL wins when it carries a page, the prop otherwise.
|
|
68
|
+
*
|
|
69
|
+
* During the server render `useQueryParams()` is empty, so the old
|
|
70
|
+
* `getCurrentPageFromUrl() || currentPage` always resolved to 1 — the
|
|
71
|
+
* fallback to the prop could never run, because the function returned 1
|
|
72
|
+
* rather than a falsy value. Every server-rendered page built its number
|
|
73
|
+
* window around page 1: `/search?page=100` linked 2–6 and the last page,
|
|
74
|
+
* never 99 or 101. Pages 7..N-1 were linked from nowhere in the HTML a
|
|
75
|
+
* crawler reads, which is the only HTML a crawler reads. */
|
|
76
|
+
const getCurrentPageFromUrl = (): number | null => {
|
|
68
77
|
const pageParam = queryParams.get('page');
|
|
69
|
-
if (pageParam)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
return 1;
|
|
78
|
+
if (!pageParam) return null;
|
|
79
|
+
const pageNum = parseInt(pageParam, 10);
|
|
80
|
+
return isNaN(pageNum) || pageNum < 1 ? null : pageNum;
|
|
74
81
|
};
|
|
75
82
|
|
|
76
|
-
const actualCurrentPage = getCurrentPageFromUrl()
|
|
83
|
+
const actualCurrentPage = getCurrentPageFromUrl() ?? currentPage;
|
|
77
84
|
const actualHasPreviousPage = actualCurrentPage > 1;
|
|
78
85
|
|
|
79
86
|
const getPageUrl = (page: number): string => {
|