reroute-js 0.46.0 → 1.0.0-alpha.1
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/README.md +2 -4
- package/_/store/package.json +1 -3
- package/_/store/src/client/components/Header.tsx +8 -20
- package/_/store/src/client/components/ProductCard.tsx +9 -16
- package/_/store/src/client/index.css +1118 -0
- package/_/store/src/client/routes/[404].tsx +20 -31
- package/_/store/src/client/routes/categories/[category].tsx +23 -28
- package/_/store/src/client/routes/categories/index.tsx +19 -27
- package/_/store/src/client/routes/index.tsx +27 -37
- package/_/store/src/client/routes/products/[id].tsx +35 -48
- package/_/store/src/client/routes/products/index.tsx +20 -50
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +87 -185
- package/cli/bin.js.map +11 -11
- package/cli/index.d.ts +1 -1
- package/cli/index.js +19 -114
- package/cli/index.js.map +5 -5
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/gen.d.ts.map +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +2 -2
- package/cli/src/commands/lib/index.d.ts.map +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +20 -0
- package/cli/src/commands/lib/theme.d.ts.map +1 -0
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +16 -16
- package/core/index.js.map +6 -6
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +1 -1
- package/core/src/i18n/types.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/cleanup.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/content-path.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/route-match.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +2 -2
- package/core/src/ssr/lib/setup.d.ts.map +1 -1
- package/core/src/ssr/lib/styles.d.ts +3 -3
- package/core/src/ssr/lib/styles.d.ts.map +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +2 -2
- package/core/src/ssr/render.d.ts.map +1 -1
- package/core/src/ssr/stream.d.ts +2 -2
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +27 -27
- package/elysia/index.js.map +9 -9
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/i18n.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +2 -2
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +2 -5
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/index.js.map +1 -1
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +2 -2
- package/telemetry/server.js.map +4 -4
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
- package/_/store/src/client/theme.css +0 -306
- package/cli/src/commands/lib/tailwind.d.ts +0 -20
- package/cli/src/commands/lib/tailwind.d.ts.map +0 -1
|
@@ -54,7 +54,6 @@ function ProductsPage() {
|
|
|
54
54
|
const [loading, setLoading] = useState(!routeData);
|
|
55
55
|
const [error, setError] = useState<string | null>(routeData?.error || null);
|
|
56
56
|
|
|
57
|
-
// Load categories on mount (if not provided by SSR)
|
|
58
57
|
useEffect(() => {
|
|
59
58
|
if (categories.length > 0) return;
|
|
60
59
|
getCategories()
|
|
@@ -65,9 +64,7 @@ function ProductsPage() {
|
|
|
65
64
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
65
|
}, [categories.length]);
|
|
67
66
|
|
|
68
|
-
// Load products based on category (skip initial when SSR provided for 'all')
|
|
69
67
|
useEffect(() => {
|
|
70
|
-
// When SSR provided initial products just stop loading
|
|
71
68
|
if (products.length > 0) {
|
|
72
69
|
setFilteredProducts(products);
|
|
73
70
|
setLoading(false);
|
|
@@ -96,11 +93,9 @@ function ProductsPage() {
|
|
|
96
93
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
94
|
}, [selectedCategory, products]);
|
|
98
95
|
|
|
99
|
-
// Filter and sort products
|
|
100
96
|
useEffect(() => {
|
|
101
97
|
let result = [...products];
|
|
102
98
|
|
|
103
|
-
// Apply search filter
|
|
104
99
|
if (searchQuery.trim()) {
|
|
105
100
|
const query = searchQuery.toLowerCase();
|
|
106
101
|
result = result.filter(
|
|
@@ -111,7 +106,6 @@ function ProductsPage() {
|
|
|
111
106
|
);
|
|
112
107
|
}
|
|
113
108
|
|
|
114
|
-
// Apply sorting
|
|
115
109
|
switch (sortBy) {
|
|
116
110
|
case 'price-asc':
|
|
117
111
|
result.sort((a, b) => a.price - b.price);
|
|
@@ -123,7 +117,6 @@ function ProductsPage() {
|
|
|
123
117
|
result.sort((a, b) => a.title.localeCompare(b.title));
|
|
124
118
|
break;
|
|
125
119
|
default:
|
|
126
|
-
// Keep default order
|
|
127
120
|
break;
|
|
128
121
|
}
|
|
129
122
|
|
|
@@ -134,26 +127,22 @@ function ProductsPage() {
|
|
|
134
127
|
<>
|
|
135
128
|
<Header />
|
|
136
129
|
|
|
137
|
-
<main className='
|
|
138
|
-
<div className='
|
|
130
|
+
<main className='page-main'>
|
|
131
|
+
<div className='page-intro'>
|
|
139
132
|
<h1 className='section-heading'>All Products</h1>
|
|
140
133
|
<p className='section-subheading'>
|
|
141
134
|
Browse our complete collection of quality products
|
|
142
135
|
</p>
|
|
143
136
|
</div>
|
|
144
137
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<label
|
|
149
|
-
className='font-semibold text-gray-700'
|
|
150
|
-
htmlFor='category-filter'
|
|
151
|
-
>
|
|
138
|
+
<div className='filter-bar'>
|
|
139
|
+
<div className='filter-group'>
|
|
140
|
+
<label className='filter-label' htmlFor='category-filter'>
|
|
152
141
|
Category:
|
|
153
142
|
</label>
|
|
154
143
|
<select
|
|
155
144
|
id='category-filter'
|
|
156
|
-
className='select min
|
|
145
|
+
className='select select-min'
|
|
157
146
|
value={selectedCategory}
|
|
158
147
|
onChange={(e) => setSelectedCategory(e.target.value)}
|
|
159
148
|
>
|
|
@@ -169,54 +158,38 @@ function ProductsPage() {
|
|
|
169
158
|
<input
|
|
170
159
|
type='search'
|
|
171
160
|
placeholder='Search products...'
|
|
172
|
-
className='input
|
|
161
|
+
className='input input-grow'
|
|
173
162
|
value={searchQuery}
|
|
174
163
|
onChange={(e) => setSearchQuery(e.target.value)}
|
|
175
164
|
/>
|
|
176
165
|
|
|
177
|
-
<div className='
|
|
178
|
-
<span className='
|
|
179
|
-
<div className='
|
|
166
|
+
<div className='filter-group'>
|
|
167
|
+
<span className='filter-label'>Sort:</span>
|
|
168
|
+
<div className='filter-sort-group'>
|
|
180
169
|
<button
|
|
181
170
|
type='button'
|
|
182
|
-
className={`btn
|
|
183
|
-
sortBy === 'default'
|
|
184
|
-
? 'bg-primary-600 text-white border-primary-600'
|
|
185
|
-
: 'bg-white text-gray-700 border border-gray-300 hover:bg-gray-50'
|
|
186
|
-
}`}
|
|
171
|
+
className={`sort-btn${sortBy === 'default' ? ' is-active' : ''}`}
|
|
187
172
|
onClick={() => setSortBy('default')}
|
|
188
173
|
>
|
|
189
174
|
Default
|
|
190
175
|
</button>
|
|
191
176
|
<button
|
|
192
177
|
type='button'
|
|
193
|
-
className={`btn-
|
|
194
|
-
sortBy === 'price-asc'
|
|
195
|
-
? 'bg-primary-600 text-white border-primary-600'
|
|
196
|
-
: 'bg-white text-gray-700 border border-gray-300 hover:bg-gray-50'
|
|
197
|
-
}`}
|
|
178
|
+
className={`sort-btn${sortBy === 'price-asc' ? ' is-active' : ''}`}
|
|
198
179
|
onClick={() => setSortBy('price-asc')}
|
|
199
180
|
>
|
|
200
181
|
Price: Low to High
|
|
201
182
|
</button>
|
|
202
183
|
<button
|
|
203
184
|
type='button'
|
|
204
|
-
className={`btn-
|
|
205
|
-
sortBy === 'price-desc'
|
|
206
|
-
? 'bg-primary-600 text-white border-primary-600'
|
|
207
|
-
: 'bg-white text-gray-700 border border-gray-300 hover:bg-gray-50'
|
|
208
|
-
}`}
|
|
185
|
+
className={`sort-btn${sortBy === 'price-desc' ? ' is-active' : ''}`}
|
|
209
186
|
onClick={() => setSortBy('price-desc')}
|
|
210
187
|
>
|
|
211
188
|
Price: High to Low
|
|
212
189
|
</button>
|
|
213
190
|
<button
|
|
214
191
|
type='button'
|
|
215
|
-
className={`btn-
|
|
216
|
-
sortBy === 'name-asc'
|
|
217
|
-
? 'bg-primary-600 text-white border-primary-600'
|
|
218
|
-
: 'bg-white text-gray-700 border border-gray-300 hover:bg-gray-50'
|
|
219
|
-
}`}
|
|
192
|
+
className={`sort-btn${sortBy === 'name-asc' ? ' is-active' : ''}`}
|
|
220
193
|
onClick={() => setSortBy('name-asc')}
|
|
221
194
|
>
|
|
222
195
|
Name: A-Z
|
|
@@ -225,24 +198,21 @@ function ProductsPage() {
|
|
|
225
198
|
</div>
|
|
226
199
|
|
|
227
200
|
{!loading && (
|
|
228
|
-
<div className='
|
|
201
|
+
<div className='filter-count'>
|
|
229
202
|
Showing {filteredProducts.length} of {products.length} products
|
|
230
203
|
</div>
|
|
231
204
|
)}
|
|
232
205
|
</div>
|
|
233
206
|
|
|
234
|
-
{/* Products Grid */}
|
|
235
207
|
{loading ? (
|
|
236
|
-
<div className='
|
|
237
|
-
<div className='
|
|
208
|
+
<div className='state-loading'>
|
|
209
|
+
<div className='state-loading-pulse'>Loading products...</div>
|
|
238
210
|
</div>
|
|
239
211
|
) : error ? (
|
|
240
|
-
<div className='
|
|
241
|
-
{error}
|
|
242
|
-
</div>
|
|
212
|
+
<div className='state-error'>{error}</div>
|
|
243
213
|
) : filteredProducts.length === 0 ? (
|
|
244
|
-
<div className='
|
|
245
|
-
<div className='
|
|
214
|
+
<div className='state-empty'>
|
|
215
|
+
<div className='state-empty-icon'>🔍</div>
|
|
246
216
|
<div>No products found matching your criteria</div>
|
|
247
217
|
</div>
|
|
248
218
|
) : (
|
package/cli/bin.d.ts
CHANGED