@byline/host-tanstack-start 5.1.3 → 5.2.0

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.
@@ -1,7 +1,7 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { createFileRoute, notFound } from "@tanstack/react-router";
3
- import { AnalyticsDashboard } from "@byline/admin/analytics/components/dashboard";
4
- import { isAnalyticsDashboardPeriod } from "@byline/analytics/config";
3
+ import { ANALYTICS_PREVIEW_ROWS, AnalyticsDashboard } from "@byline/admin/analytics/components/dashboard";
4
+ import { ANALYTICS_MAX_TOP_LIMIT, isAnalyticsDashboardPeriod } from "@byline/analytics/config";
5
5
  import { useTranslation } from "@byline/i18n/react";
6
6
  import { z } from "zod";
7
7
  import { BreadcrumbsClient } from "../admin-shell/chrome/breadcrumbs/breadcrumbs-client.js";
@@ -36,20 +36,20 @@ function createAdminAnalyticsRoute(path) {
36
36
  data: {
37
37
  ...range,
38
38
  kind: 'page',
39
- limit: 20
39
+ limit: ANALYTICS_PREVIEW_ROWS
40
40
  }
41
41
  }),
42
42
  getAnalyticsTop({
43
43
  data: {
44
44
  ...range,
45
45
  kind: 'download',
46
- limit: 20
46
+ limit: ANALYTICS_PREVIEW_ROWS
47
47
  }
48
48
  }),
49
49
  getAnalyticsReferrers({
50
50
  data: {
51
51
  ...range,
52
- limit: 20
52
+ limit: ANALYTICS_PREVIEW_ROWS
53
53
  }
54
54
  }),
55
55
  getAnalyticsCountries({
@@ -90,6 +90,18 @@ function createAdminAnalyticsRoute(path) {
90
90
  /*#__PURE__*/ jsx(AnalyticsDashboard, {
91
91
  data: data,
92
92
  period: period,
93
+ loadFullList: (kind)=>'referrers' === kind ? getAnalyticsReferrers({
94
+ data: {
95
+ ...data.range,
96
+ limit: ANALYTICS_MAX_TOP_LIMIT
97
+ }
98
+ }) : getAnalyticsTop({
99
+ data: {
100
+ ...data.range,
101
+ kind: 'pages' === kind ? 'page' : 'download',
102
+ limit: ANALYTICS_MAX_TOP_LIMIT
103
+ }
104
+ }),
93
105
  onPeriodChange: (nextPeriod)=>{
94
106
  navigate({
95
107
  to: getAdminRoutePath('analytics'),
@@ -35,7 +35,9 @@ export declare const getCollectionDocumentHistory: import("@tanstack/react-start
35
35
  updatedAt: string;
36
36
  createdBy?: string | undefined;
37
37
  eventType?: string | undefined;
38
- fields: Record<string, any>;
38
+ fields: {
39
+ [x: string]: any;
40
+ };
39
41
  }[];
40
42
  meta: {
41
43
  page: number;
@@ -35,7 +35,9 @@ export declare const getCollectionDocuments: import("@tanstack/react-start").Req
35
35
  updatedAt: string;
36
36
  createdBy?: string | undefined;
37
37
  eventType?: string | undefined;
38
- fields: Record<string, any>;
38
+ fields: {
39
+ [x: string]: any;
40
+ };
39
41
  }[];
40
42
  meta: {
41
43
  page: number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "5.1.3",
6
+ "version": "5.2.0",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -124,16 +124,16 @@
124
124
  "clsx": "^2.1.1",
125
125
  "react-json-view-lite": "^2.5.0",
126
126
  "react-swipeable": "^7.0.2",
127
- "zod": "^4.5.4",
128
- "@byline/admin": "5.1.3",
129
- "@byline/analytics": "5.1.3",
130
- "@byline/auth": "5.1.3",
131
- "@byline/ui": "5.1.3",
132
- "@byline/ai": "5.1.3",
133
- "@byline/client": "5.1.3",
134
- "@byline/i18n": "5.1.3",
135
- "@byline/core": "5.1.3",
136
- "@byline/analytics-agent": "5.1.3"
127
+ "zod": "^4.6.2",
128
+ "@byline/admin": "5.2.0",
129
+ "@byline/analytics": "5.2.0",
130
+ "@byline/ai": "5.2.0",
131
+ "@byline/client": "5.2.0",
132
+ "@byline/auth": "5.2.0",
133
+ "@byline/i18n": "5.2.0",
134
+ "@byline/ui": "5.2.0",
135
+ "@byline/core": "5.2.0",
136
+ "@byline/analytics-agent": "5.2.0"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@tanstack/react-router": "^1.167.0",
@@ -143,22 +143,22 @@
143
143
  "vite": "^8.0.0"
144
144
  },
145
145
  "devDependencies": {
146
- "@biomejs/biome": "2.5.12",
146
+ "@biomejs/biome": "2.5.13",
147
147
  "@rsbuild/plugin-react": "^2.1.0",
148
148
  "@rslib/core": "^1.0.0",
149
- "@tanstack/react-router": "^1.170.33",
150
- "@tanstack/react-start": "^1.168.50",
151
- "@types/node": "^26.5.0",
152
- "@types/react": "19.2.18",
153
- "@types/react-dom": "19.2.7",
149
+ "@tanstack/react-router": "^1.170.35",
150
+ "@tanstack/react-start": "^1.168.52",
151
+ "@types/node": "^26.5.1",
152
+ "@types/react": "19.3.0",
153
+ "@types/react-dom": "19.3.0",
154
154
  "@vitejs/plugin-react": "^6.1.1",
155
155
  "jsdom": "^30.0.1",
156
156
  "npm-run-all": "^4.1.5",
157
- "react": "^19.2.8",
158
- "react-dom": "^19.2.8",
157
+ "react": "^19.3.0",
158
+ "react-dom": "^19.3.0",
159
159
  "typescript": "^7.0.2",
160
160
  "typescript-plugin-css-modules": "^5.2.0",
161
- "vite": "^8.2.2",
161
+ "vite": "^8.3.0",
162
162
  "vitest": "^5.0.0"
163
163
  },
164
164
  "publishConfig": {
@@ -9,8 +9,11 @@
9
9
  import { createFileRoute, notFound } from '@tanstack/react-router'
10
10
 
11
11
  import type { AnalyticsDashboardData, AnalyticsDashboardPeriod } from '@byline/admin/analytics'
12
- import { AnalyticsDashboard } from '@byline/admin/analytics/components/dashboard'
13
- import { isAnalyticsDashboardPeriod } from '@byline/analytics/config'
12
+ import {
13
+ ANALYTICS_PREVIEW_ROWS,
14
+ AnalyticsDashboard,
15
+ } from '@byline/admin/analytics/components/dashboard'
16
+ import { ANALYTICS_MAX_TOP_LIMIT, isAnalyticsDashboardPeriod } from '@byline/analytics/config'
14
17
  import { useTranslation } from '@byline/i18n/react'
15
18
  import { z } from 'zod'
16
19
 
@@ -55,9 +58,11 @@ export function createAdminAnalyticsRoute(path: string) {
55
58
  const range = buildAnalyticsDashboardRange(deps.period, new Date(), coverage.summaryFrom)
56
59
  const [summary, pages, downloads, referrers, countries] = await Promise.all([
57
60
  getAnalyticsSummary({ data: range }),
58
- getAnalyticsTop({ data: { ...range, kind: 'page', limit: 20 } }),
59
- getAnalyticsTop({ data: { ...range, kind: 'download', limit: 20 } }),
60
- getAnalyticsReferrers({ data: { ...range, limit: 20 } }),
61
+ // Fetch exactly the preview depth each card shows; the full list is
62
+ // fetched on demand through `loadFullList` below.
63
+ getAnalyticsTop({ data: { ...range, kind: 'page', limit: ANALYTICS_PREVIEW_ROWS } }),
64
+ getAnalyticsTop({ data: { ...range, kind: 'download', limit: ANALYTICS_PREVIEW_ROWS } }),
65
+ getAnalyticsReferrers({ data: { ...range, limit: ANALYTICS_PREVIEW_ROWS } }),
61
66
  getAnalyticsCountries({ data: range }),
62
67
  ])
63
68
 
@@ -93,6 +98,19 @@ export function createAdminAnalyticsRoute(path: string) {
93
98
  <AnalyticsDashboard
94
99
  data={data}
95
100
  period={period}
101
+ loadFullList={(kind) =>
102
+ kind === 'referrers'
103
+ ? getAnalyticsReferrers({
104
+ data: { ...data.range, limit: ANALYTICS_MAX_TOP_LIMIT },
105
+ })
106
+ : getAnalyticsTop({
107
+ data: {
108
+ ...data.range,
109
+ kind: kind === 'pages' ? 'page' : 'download',
110
+ limit: ANALYTICS_MAX_TOP_LIMIT,
111
+ },
112
+ })
113
+ }
96
114
  onPeriodChange={(nextPeriod) => {
97
115
  navigate({
98
116
  to: getAdminRoutePath('analytics'),