@getcronit/pylon 3.0.0-canary-20250328152343.40b45e7f1112cde4b3669206a81904062ae419cf → 3.0.0-canary-20250407115039.56009eb223a513a3bc338c169e69e23adc1bad96
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/dist/app/pylon-handler.d.ts +1 -1
- package/dist/components/global-error-page.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +283 -346
- package/dist/index.js.map +4 -4
- package/dist/pages/index.d.ts +2 -0
- package/dist/pages/index.js +109 -41
- package/dist/pages/index.js.map +4 -4
- package/dist/pages/internals.d.ts +6 -0
- package/dist/plugins/use-pages/build/app-utils.d.ts +7 -6
- package/package.json +1 -1
- package/dist/plugins/use-pages/setup/app-loader.d.ts +0 -13
package/dist/pages/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * as __PYLON_ROUTER_INTERNALS_DO_NOT_USE from 'react-router';
|
|
2
|
+
export * as __PYLON_INTERNALS_DO_NOT_USE from './internals';
|
|
2
3
|
export { Image } from './image';
|
|
3
4
|
export { Link } from './link';
|
|
4
5
|
export { type PageProps, type PageData } from '../plugins/use-pages';
|
|
5
6
|
export * from '../components/dev-overlay';
|
|
7
|
+
export { default as GlobalErrorPage } from '../components/global-error-page';
|
|
6
8
|
import '../globals.css';
|
package/dist/pages/index.js
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// src/pages/index.ts
|
|
2
8
|
import * as __PYLON_ROUTER_INTERNALS_DO_NOT_USE from "react-router";
|
|
3
9
|
|
|
10
|
+
// src/pages/internals.tsx
|
|
11
|
+
var internals_exports = {};
|
|
12
|
+
__export(internals_exports, {
|
|
13
|
+
DataClientProvider: () => DataClientProvider,
|
|
14
|
+
useDataClient: () => useDataClient
|
|
15
|
+
});
|
|
16
|
+
import { createContext, useContext } from "react";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
var dataClientContext = createContext(null);
|
|
19
|
+
var DataClientProvider = ({ children, client }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(dataClientContext.Provider, { value: { client }, children });
|
|
21
|
+
};
|
|
22
|
+
var useDataClient = () => {
|
|
23
|
+
const context = useContext(dataClientContext);
|
|
24
|
+
if (!context) {
|
|
25
|
+
throw new Error("useDataClient must be used within a DataClientProvider");
|
|
26
|
+
}
|
|
27
|
+
return context.client;
|
|
28
|
+
};
|
|
29
|
+
|
|
4
30
|
// src/pages/image.tsx
|
|
5
31
|
import { useMemo } from "react";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
32
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
7
33
|
var usePylonImageValues = (props) => {
|
|
8
34
|
return useMemo(() => {
|
|
9
35
|
const pylonMediaSearchParams = new URLSearchParams({});
|
|
@@ -49,8 +75,8 @@ var usePylonImageValues = (props) => {
|
|
|
49
75
|
var Image = (props) => {
|
|
50
76
|
const values = usePylonImageValues(props);
|
|
51
77
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
-
values.preloads.map((src, index) => /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
78
|
+
values.preloads.map((src, index) => /* @__PURE__ */ jsx2("link", { rel: "preload", as: "image", href: src }, index)),
|
|
79
|
+
/* @__PURE__ */ jsx2(
|
|
54
80
|
"img",
|
|
55
81
|
{
|
|
56
82
|
src: values.src,
|
|
@@ -72,10 +98,10 @@ var Image = (props) => {
|
|
|
72
98
|
|
|
73
99
|
// src/pages/link.tsx
|
|
74
100
|
import { Link as LinkComp } from "react-router";
|
|
75
|
-
import { jsx as
|
|
101
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
76
102
|
var Link = (props) => {
|
|
77
103
|
const { href, ...rest } = props;
|
|
78
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ jsx3(LinkComp, { to: href, ...rest });
|
|
79
105
|
};
|
|
80
106
|
|
|
81
107
|
// src/components/dev-overlay/report-error.ts
|
|
@@ -148,7 +174,7 @@ function cn(...inputs) {
|
|
|
148
174
|
}
|
|
149
175
|
|
|
150
176
|
// src/components/logo.tsx
|
|
151
|
-
import { jsx as
|
|
177
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
152
178
|
var Logo = (props) => {
|
|
153
179
|
return /* @__PURE__ */ jsxs2(
|
|
154
180
|
"svg",
|
|
@@ -162,15 +188,15 @@ var Logo = (props) => {
|
|
|
162
188
|
version: "1.0",
|
|
163
189
|
children: [
|
|
164
190
|
/* @__PURE__ */ jsxs2("defs", { children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ jsx4("g", {}),
|
|
192
|
+
/* @__PURE__ */ jsx4("clipPath", { id: "38f6fcde47", children: /* @__PURE__ */ jsx4(
|
|
167
193
|
"path",
|
|
168
194
|
{
|
|
169
195
|
d: "M 0.339844 42 L 10 42 L 10 79 L 0.339844 79 Z M 0.339844 42 ",
|
|
170
196
|
clipRule: "nonzero"
|
|
171
197
|
}
|
|
172
198
|
) }),
|
|
173
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ jsx4("clipPath", { id: "af000f7256", children: /* @__PURE__ */ jsx4(
|
|
174
200
|
"path",
|
|
175
201
|
{
|
|
176
202
|
d: "M 64 23.925781 L 72.789062 23.925781 L 72.789062 96.378906 L 64 96.378906 Z M 64 23.925781 ",
|
|
@@ -178,12 +204,12 @@ var Logo = (props) => {
|
|
|
178
204
|
}
|
|
179
205
|
) })
|
|
180
206
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ jsx4("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx4("g", { transform: "translate(107.11969, 78.49768)", children: /* @__PURE__ */ jsx4("g", { children: /* @__PURE__ */ jsx4("path", { d: "M 10.078125 -25.046875 C 11.109375 -26.398438 12.507812 -27.535156 14.28125 -28.453125 C 16.0625 -29.378906 18.070312 -29.84375 20.3125 -29.84375 C 22.863281 -29.84375 25.195312 -29.210938 27.3125 -27.953125 C 29.425781 -26.691406 31.085938 -24.921875 32.296875 -22.640625 C 33.503906 -20.367188 34.109375 -17.757812 34.109375 -14.8125 C 34.109375 -11.863281 33.503906 -9.222656 32.296875 -6.890625 C 31.085938 -4.566406 29.425781 -2.753906 27.3125 -1.453125 C 25.195312 -0.160156 22.863281 0.484375 20.3125 0.484375 C 18.070312 0.484375 16.078125 0.03125 14.328125 -0.875 C 12.585938 -1.78125 11.171875 -2.910156 10.078125 -4.265625 L 10.078125 13.96875 L 4 13.96875 L 4 -29.359375 L 10.078125 -29.359375 Z M 27.921875 -14.8125 C 27.921875 -16.84375 27.503906 -18.59375 26.671875 -20.0625 C 25.835938 -21.539062 24.734375 -22.660156 23.359375 -23.421875 C 21.992188 -24.179688 20.53125 -24.5625 18.96875 -24.5625 C 17.445312 -24.5625 16 -24.171875 14.625 -23.390625 C 13.257812 -22.609375 12.160156 -21.472656 11.328125 -19.984375 C 10.492188 -18.492188 10.078125 -16.734375 10.078125 -14.703125 C 10.078125 -12.679688 10.492188 -10.914062 11.328125 -9.40625 C 12.160156 -7.894531 13.257812 -6.75 14.625 -5.96875 C 16 -5.1875 17.445312 -4.796875 18.96875 -4.796875 C 20.53125 -4.796875 21.992188 -5.191406 23.359375 -5.984375 C 24.734375 -6.785156 25.835938 -7.953125 26.671875 -9.484375 C 27.503906 -11.015625 27.921875 -12.789062 27.921875 -14.8125 Z M 27.921875 -14.8125 " }) }) }) }),
|
|
208
|
+
/* @__PURE__ */ jsx4("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx4("g", { transform: "translate(143.259256, 78.49768)", children: /* @__PURE__ */ jsx4("g", { children: /* @__PURE__ */ jsx4("path", { d: "M 30.4375 -29.359375 L 12.421875 13.796875 L 6.125 13.796875 L 12.09375 -0.484375 L 0.53125 -29.359375 L 7.296875 -29.359375 L 15.5625 -6.984375 L 24.140625 -29.359375 Z M 30.4375 -29.359375 " }) }) }) }),
|
|
209
|
+
/* @__PURE__ */ jsx4("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx4("g", { transform: "translate(174.281707, 78.49768)", children: /* @__PURE__ */ jsx4("g", { children: /* @__PURE__ */ jsx4("path", { d: "M 10.078125 -39.4375 L 10.078125 0 L 4 0 L 4 -39.4375 Z M 10.078125 -39.4375 " }) }) }) }),
|
|
210
|
+
/* @__PURE__ */ jsx4("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx4("g", { transform: "translate(188.353752, 78.49768)", children: /* @__PURE__ */ jsx4("g", { children: /* @__PURE__ */ jsx4("path", { d: "M 16.734375 0.484375 C 13.960938 0.484375 11.457031 -0.144531 9.21875 -1.40625 C 6.976562 -2.664062 5.21875 -4.441406 3.9375 -6.734375 C 2.664062 -9.035156 2.03125 -11.691406 2.03125 -14.703125 C 2.03125 -17.691406 2.6875 -20.335938 4 -22.640625 C 5.3125 -24.953125 7.101562 -26.726562 9.375 -27.96875 C 11.65625 -29.21875 14.195312 -29.84375 17 -29.84375 C 19.8125 -29.84375 22.351562 -29.21875 24.625 -27.96875 C 26.894531 -26.726562 28.6875 -24.953125 30 -22.640625 C 31.320312 -20.335938 31.984375 -17.691406 31.984375 -14.703125 C 31.984375 -11.722656 31.304688 -9.078125 29.953125 -6.765625 C 28.597656 -4.453125 26.757812 -2.664062 24.4375 -1.40625 C 22.113281 -0.144531 19.546875 0.484375 16.734375 0.484375 Z M 16.734375 -4.796875 C 18.296875 -4.796875 19.757812 -5.164062 21.125 -5.90625 C 22.5 -6.65625 23.613281 -7.773438 24.46875 -9.265625 C 25.320312 -10.765625 25.75 -12.578125 25.75 -14.703125 C 25.75 -16.835938 25.335938 -18.640625 24.515625 -20.109375 C 23.703125 -21.585938 22.617188 -22.695312 21.265625 -23.4375 C 19.910156 -24.1875 18.453125 -24.5625 16.890625 -24.5625 C 15.328125 -24.5625 13.878906 -24.1875 12.546875 -23.4375 C 11.210938 -22.695312 10.15625 -21.585938 9.375 -20.109375 C 8.59375 -18.640625 8.203125 -16.835938 8.203125 -14.703125 C 8.203125 -11.546875 9.007812 -9.101562 10.625 -7.375 C 12.25 -5.65625 14.285156 -4.796875 16.734375 -4.796875 Z M 16.734375 -4.796875 " }) }) }) }),
|
|
211
|
+
/* @__PURE__ */ jsx4("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx4("g", { transform: "translate(222.361196, 78.49768)", children: /* @__PURE__ */ jsx4("g", { children: /* @__PURE__ */ jsx4("path", { d: "M 18.8125 -29.84375 C 21.125 -29.84375 23.191406 -29.363281 25.015625 -28.40625 C 26.847656 -27.445312 28.28125 -26.023438 29.3125 -24.140625 C 30.34375 -22.253906 30.859375 -19.984375 30.859375 -17.328125 L 30.859375 0 L 24.84375 0 L 24.84375 -16.421875 C 24.84375 -19.046875 24.179688 -21.054688 22.859375 -22.453125 C 21.546875 -23.859375 19.753906 -24.5625 17.484375 -24.5625 C 15.210938 -24.5625 13.410156 -23.859375 12.078125 -22.453125 C 10.742188 -21.054688 10.078125 -19.046875 10.078125 -16.421875 L 10.078125 0 L 4 0 L 4 -29.359375 L 10.078125 -29.359375 L 10.078125 -26.015625 C 11.066406 -27.222656 12.332031 -28.160156 13.875 -28.828125 C 15.425781 -29.503906 17.070312 -29.84375 18.8125 -29.84375 Z M 18.8125 -29.84375 " }) }) }) }),
|
|
212
|
+
/* @__PURE__ */ jsx4(
|
|
187
213
|
"path",
|
|
188
214
|
{
|
|
189
215
|
fill: "currentColor",
|
|
@@ -192,7 +218,7 @@ var Logo = (props) => {
|
|
|
192
218
|
fillRule: "nonzero"
|
|
193
219
|
}
|
|
194
220
|
),
|
|
195
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ jsx4("g", { clipPath: "url(#38f6fcde47)", children: /* @__PURE__ */ jsx4(
|
|
196
222
|
"path",
|
|
197
223
|
{
|
|
198
224
|
fill: "currentColor",
|
|
@@ -201,7 +227,7 @@ var Logo = (props) => {
|
|
|
201
227
|
fillRule: "nonzero"
|
|
202
228
|
}
|
|
203
229
|
) }),
|
|
204
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ jsx4("g", { clipPath: "url(#af000f7256)", children: /* @__PURE__ */ jsx4(
|
|
205
231
|
"path",
|
|
206
232
|
{
|
|
207
233
|
fill: "currentColor",
|
|
@@ -210,7 +236,7 @@ var Logo = (props) => {
|
|
|
210
236
|
fillRule: "nonzero"
|
|
211
237
|
}
|
|
212
238
|
) }),
|
|
213
|
-
/* @__PURE__ */
|
|
239
|
+
/* @__PURE__ */ jsx4(
|
|
214
240
|
"path",
|
|
215
241
|
{
|
|
216
242
|
fill: "currentColor",
|
|
@@ -219,7 +245,7 @@ var Logo = (props) => {
|
|
|
219
245
|
fillRule: "nonzero"
|
|
220
246
|
}
|
|
221
247
|
),
|
|
222
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ jsx4(
|
|
223
249
|
"path",
|
|
224
250
|
{
|
|
225
251
|
fill: "currentColor",
|
|
@@ -228,7 +254,7 @@ var Logo = (props) => {
|
|
|
228
254
|
fillRule: "nonzero"
|
|
229
255
|
}
|
|
230
256
|
),
|
|
231
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ jsx4(
|
|
232
258
|
"path",
|
|
233
259
|
{
|
|
234
260
|
fill: "currentColor",
|
|
@@ -250,7 +276,7 @@ import { createPortal } from "react-dom";
|
|
|
250
276
|
// src/components/dev-overlay/dev-error-overlay.tsx
|
|
251
277
|
import { useEffect, useState } from "react";
|
|
252
278
|
import { X } from "lucide-react";
|
|
253
|
-
import { jsx as
|
|
279
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
254
280
|
function DevErrorOverlay({
|
|
255
281
|
error,
|
|
256
282
|
errorInfo,
|
|
@@ -329,7 +355,7 @@ function DevErrorOverlay({
|
|
|
329
355
|
}
|
|
330
356
|
};
|
|
331
357
|
return /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 bg-black/80 backdrop-blur-sm z-50 overflow-y-auto p-4 flex items-start justify-center", children: [
|
|
332
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ jsx5(
|
|
333
359
|
"link",
|
|
334
360
|
{
|
|
335
361
|
rel: "stylesheet",
|
|
@@ -344,7 +370,7 @@ function DevErrorOverlay({
|
|
|
344
370
|
children: [
|
|
345
371
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between border-b border-neutral-800 p-4", children: [
|
|
346
372
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
347
|
-
logo && /* @__PURE__ */
|
|
373
|
+
logo && /* @__PURE__ */ jsx5("div", { className: "flex-shrink-0", children: typeof logo === "string" ? /* @__PURE__ */ jsx5(
|
|
348
374
|
"img",
|
|
349
375
|
{
|
|
350
376
|
src: logo || "/placeholder.svg",
|
|
@@ -352,38 +378,38 @@ function DevErrorOverlay({
|
|
|
352
378
|
className: "h-8 w-auto"
|
|
353
379
|
}
|
|
354
380
|
) : logo }),
|
|
355
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5("h1", { className: "text-xl font-medium text-red-500", children: getErrorTypeLabel() }) })
|
|
356
382
|
] }),
|
|
357
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ jsx5(
|
|
358
384
|
"button",
|
|
359
385
|
{
|
|
360
386
|
onClick: handleDismiss,
|
|
361
387
|
className: "p-2 rounded-full hover:bg-neutral-800 transition-colors",
|
|
362
388
|
"aria-label": "Dismiss error overlay",
|
|
363
|
-
children: /* @__PURE__ */
|
|
389
|
+
children: /* @__PURE__ */ jsx5(X, { className: "h-5 w-5 text-neutral-400" })
|
|
364
390
|
}
|
|
365
391
|
)
|
|
366
392
|
] }),
|
|
367
393
|
/* @__PURE__ */ jsxs3("div", { className: "p-4", children: [
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ jsx5("div", { className: "mb-4 text-neutral-400", children: getErrorTypeDescription() }),
|
|
395
|
+
/* @__PURE__ */ jsx5("h2", { className: "text-2xl font-bold mb-4 text-white", children: error.message || "An unexpected error has occurred" }),
|
|
370
396
|
!!error.cause && /* @__PURE__ */ jsxs3("div", { className: "mb-4", children: [
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ jsx5("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2", children: "Cause" }),
|
|
398
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-neutral-900 rounded-md p-3 text-neutral-300", children: String(error.cause) })
|
|
373
399
|
] })
|
|
374
400
|
] }),
|
|
375
401
|
errorInfo?.componentStack && /* @__PURE__ */ jsxs3("div", { className: "p-4 border-t border-neutral-800", children: [
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx5("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3", children: "Component Stack" }),
|
|
403
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-neutral-900 rounded-md p-4 overflow-x-auto", children: /* @__PURE__ */ jsx5("pre", { className: "font-mono text-sm text-neutral-300 whitespace-pre-wrap", children: errorInfo.componentStack }) })
|
|
378
404
|
] }),
|
|
379
405
|
/* @__PURE__ */ jsxs3("div", { className: "p-4 border-t border-neutral-800", children: [
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ jsx5("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3", children: "Call Stack" }),
|
|
407
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-neutral-900 rounded-md p-4 overflow-x-auto", children: /* @__PURE__ */ jsx5("pre", { className: "font-mono text-sm text-neutral-300 whitespace-pre-wrap", children: error.stack || "No stack trace available" }) })
|
|
382
408
|
] }),
|
|
383
409
|
/* @__PURE__ */ jsxs3("div", { className: "p-4 border-t border-neutral-800 flex justify-between", children: [
|
|
384
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ jsx5("div", { children: errorType === "recoverable" && /* @__PURE__ */ jsx5("span", { className: "text-blue-400 text-sm", children: "React automatically recovered from this error" }) }),
|
|
385
411
|
/* @__PURE__ */ jsxs3("div", { className: "flex gap-3", children: [
|
|
386
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ jsx5(
|
|
387
413
|
"button",
|
|
388
414
|
{
|
|
389
415
|
onClick: handleDismiss,
|
|
@@ -391,7 +417,7 @@ function DevErrorOverlay({
|
|
|
391
417
|
children: "Dismiss"
|
|
392
418
|
}
|
|
393
419
|
),
|
|
394
|
-
/* @__PURE__ */
|
|
420
|
+
/* @__PURE__ */ jsx5(
|
|
395
421
|
"button",
|
|
396
422
|
{
|
|
397
423
|
onClick: () => window.location.reload(),
|
|
@@ -433,7 +459,7 @@ var ErrorBoundary = class extends Component {
|
|
|
433
459
|
};
|
|
434
460
|
|
|
435
461
|
// src/components/dev-overlay/dev-overlay-provider.tsx
|
|
436
|
-
import { Fragment as Fragment2, jsx as
|
|
462
|
+
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
437
463
|
function DevOverlayProvider({
|
|
438
464
|
children,
|
|
439
465
|
identifierPrefix
|
|
@@ -472,12 +498,12 @@ function DevOverlayProvider({
|
|
|
472
498
|
setErrorType(null);
|
|
473
499
|
};
|
|
474
500
|
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
475
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ jsx6(ErrorBoundary, { children }),
|
|
476
502
|
overlayContainer && error && errorInfo && errorType && createPortal(
|
|
477
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ jsx6(
|
|
478
504
|
DevErrorOverlay,
|
|
479
505
|
{
|
|
480
|
-
logo: /* @__PURE__ */
|
|
506
|
+
logo: /* @__PURE__ */ jsx6(logo_default, {}),
|
|
481
507
|
error,
|
|
482
508
|
errorInfo,
|
|
483
509
|
errorType,
|
|
@@ -492,10 +518,52 @@ function DevOverlayProvider({
|
|
|
492
518
|
)
|
|
493
519
|
] });
|
|
494
520
|
}
|
|
521
|
+
|
|
522
|
+
// src/components/global-error-page.tsx
|
|
523
|
+
import { useEffect as useEffect3 } from "react";
|
|
524
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
525
|
+
function GlobalError({ error, ...rest }) {
|
|
526
|
+
useEffect3(() => {
|
|
527
|
+
console.error("Global error:", error);
|
|
528
|
+
}, [error]);
|
|
529
|
+
const reset = () => {
|
|
530
|
+
window.location.reload();
|
|
531
|
+
};
|
|
532
|
+
return /* @__PURE__ */ jsxs5("html", { lang: "en", children: [
|
|
533
|
+
/* @__PURE__ */ jsxs5("head", { children: [
|
|
534
|
+
/* @__PURE__ */ jsx7("meta", { charSet: "utf-8" }),
|
|
535
|
+
/* @__PURE__ */ jsx7("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }),
|
|
536
|
+
/* @__PURE__ */ jsx7(
|
|
537
|
+
"link",
|
|
538
|
+
{
|
|
539
|
+
rel: "stylesheet",
|
|
540
|
+
href: "/__pylon/static/pylon.css",
|
|
541
|
+
precedence: "high"
|
|
542
|
+
}
|
|
543
|
+
)
|
|
544
|
+
] }),
|
|
545
|
+
/* @__PURE__ */ jsx7("body", { children: /* @__PURE__ */ jsx7("div", { className: "fixed inset-0 bg-black/90 z-50 overflow-y-auto p-4 flex items-center justify-center", children: /* @__PURE__ */ jsxs5("div", { className: "w-full max-w-3xl bg-black border border-red-600 rounded-lg overflow-hidden text-white font-sans", children: [
|
|
546
|
+
/* @__PURE__ */ jsx7("div", { className: "flex items-center justify-between border-b border-neutral-800 p-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3", children: [
|
|
547
|
+
/* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx7(logo_default, { className: "h-8 w-auto text-white" }) }),
|
|
548
|
+
/* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7("h1", { className: "text-xl font-medium text-red-500", children: "Application Crashed" }) })
|
|
549
|
+
] }) }),
|
|
550
|
+
/* @__PURE__ */ jsxs5("div", { className: "p-4", children: [
|
|
551
|
+
/* @__PURE__ */ jsx7("div", { className: "mb-4 text-neutral-400", children: "The application encountered a critical error and could not continue." }),
|
|
552
|
+
/* @__PURE__ */ jsx7("h2", { className: "text-2xl font-bold mb-4 text-white", children: error.message || "A critical error occurred" }),
|
|
553
|
+
error.digest && /* @__PURE__ */ jsxs5("div", { className: "mb-4", children: [
|
|
554
|
+
/* @__PURE__ */ jsx7("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2", children: "Error ID" }),
|
|
555
|
+
/* @__PURE__ */ jsx7("div", { className: "bg-neutral-900 rounded-md p-3 text-neutral-300 font-mono", children: error.digest })
|
|
556
|
+
] })
|
|
557
|
+
] })
|
|
558
|
+
] }) }) })
|
|
559
|
+
] });
|
|
560
|
+
}
|
|
495
561
|
export {
|
|
496
562
|
DevOverlayProvider as DevOverlay,
|
|
563
|
+
GlobalError as GlobalErrorPage,
|
|
497
564
|
Image,
|
|
498
565
|
Link,
|
|
566
|
+
internals_exports as __PYLON_INTERNALS_DO_NOT_USE,
|
|
499
567
|
__PYLON_ROUTER_INTERNALS_DO_NOT_USE,
|
|
500
568
|
clearError,
|
|
501
569
|
getCurrentError,
|
package/dist/pages/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/pages/index.ts", "../../src/pages/image.tsx", "../../src/pages/link.tsx", "../../src/components/dev-overlay/report-error.ts", "../../src/lib/utils.ts", "../../src/components/logo.tsx", "../../src/components/dev-overlay/dev-overlay-provider.tsx", "../../src/components/dev-overlay/dev-error-overlay.tsx", "../../src/components/dev-overlay/error-boundary.tsx"],
|
|
4
|
-
"sourcesContent": ["export * as __PYLON_ROUTER_INTERNALS_DO_NOT_USE from 'react-router'\nexport {Image} from './image'\nexport {Link} from './link'\n\nexport {type PageProps, type PageData} from '@/plugins/use-pages'\nexport * from '@/components/dev-overlay'\n\nimport '../globals.css'\n", "import React, {useMemo} from 'react'\n\ninterface ImageValuesProps {\n src: string | PylonBuildSrc\n alt?: string\n className?: string\n width?: number\n height?: number\n blurDataURL?: string\n}\n\nexport interface ImageProps extends Omit<ImageValuesProps, 'src'> {\n src: string\n fill?: boolean\n}\n\ninterface PylonBuildSrc {\n url: string\n width?: number\n height?: number\n blurDataURL?: string\n}\n\n/**\n * Custom hook to process and extract image properties,\n * ensuring correct values for width, height, and blur data.\n * Generates a final image URL compatible with Pylon's media proxy.\n *\n * @param {ImageProps} props - The image properties including src, width, height, and blurDataURL.\n * @returns {Object} The processed image values: width, height, blurDataURL, and final image source.\n */\nconst usePylonImageValues = (\n props: ImageValuesProps\n): {\n src: string\n width?: number\n height?: number\n blurDataURL?: string\n preloads: string[]\n} => {\n return useMemo(() => {\n // // Parse the image source URL to extract query parameters\n // const isSrcAbsolute =\n // props.src.startsWith('http://') || props.src.startsWith('https://')\n // const url = new URL(props.src, 'http://localhost')\n // const searchParams = new URLSearchParams(url.search)\n\n // // Extract values, prioritizing props over query params\n // const getValue = (propValue, paramKey) =>\n // propValue ?? searchParams.get(paramKey)\n // const width = getValue(props.width, 'w')\n // const height = getValue(props.height, 'h')\n // const blurDataURL = getValue(props.blurDataURL, 'blurDataURL')\n\n // // Prepare Pylon-specific query params\n // const pylonMediaSearchParams = new URLSearchParams({\n // src:\n // ...(width && {w: width.toString()}),\n // ...(height && {h: height.toString()})\n // })\n\n const pylonMediaSearchParams = new URLSearchParams({})\n let blurDataURL: string | undefined\n\n if (typeof props.src === 'string') {\n pylonMediaSearchParams.set('src', props.src)\n } else {\n pylonMediaSearchParams.set('src', props.src.url)\n\n if (props.src.width) {\n pylonMediaSearchParams.set('w', props.src.width.toString())\n }\n\n if (props.src.height) {\n pylonMediaSearchParams.set('h', props.src.height.toString())\n }\n\n blurDataURL = props.src.blurDataURL\n }\n\n if (props.width) {\n pylonMediaSearchParams.set('w', props.width.toString())\n }\n\n if (props.height) {\n pylonMediaSearchParams.set('h', props.height.toString())\n }\n\n if (props.blurDataURL) {\n blurDataURL = props.blurDataURL\n }\n\n // Construct the final image source URL\n const finalSrc = `/__pylon/image?${pylonMediaSearchParams.toString()}`\n\n const width = pylonMediaSearchParams.has('w')\n ? parseInt(pylonMediaSearchParams.get('w')!)\n : undefined\n const height = pylonMediaSearchParams.has('h')\n ? parseInt(pylonMediaSearchParams.get('h')!)\n : undefined\n\n const preloads: string[] = []\n\n if (!blurDataURL) {\n // Use finalSrc with lqip=true to generate blurDataURL\n blurDataURL = finalSrc + '&lqip=true'\n\n // Preload the blurDataURL image\n preloads.push(blurDataURL)\n }\n\n return {\n width,\n height,\n blurDataURL,\n src: finalSrc,\n preloads\n }\n }, [props])\n}\n\nexport const Image: React.FC<ImageProps> = props => {\n const values = usePylonImageValues(props)\n\n return (\n <>\n {values.preloads.map((src, index) => (\n <link key={index} rel=\"preload\" as=\"image\" href={src} />\n ))}\n <img\n src={values.src}\n alt={props.alt}\n className={props.className}\n width={values.width}\n height={values.height}\n style={{\n backgroundImage: `url(${values.blurDataURL})`,\n backgroundSize: 'cover',\n height: props.fill ? '100%' : undefined,\n width: props.fill ? '100%' : undefined\n }}\n loading=\"lazy\"\n />\n </>\n )\n}\n", "import {Link as LinkComp, LinkProps as LinkCompProps} from 'react-router'\n\ninterface LinkProps extends Omit<LinkCompProps, 'to'> {\n href: LinkCompProps['to']\n}\n\nexport const Link: React.FC<LinkProps> = props => {\n const {href, ...rest} = props\n return <LinkComp to={href} {...rest} />\n}\n", "import type {ErrorInfo} from './types'\n\n// Define a global error store type\ntype ErrorStore = {\n error: Error | null\n errorInfo: ErrorInfo | null\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n listeners: Set<(data: ErrorStoreData) => void>\n}\n\n// Data passed to listeners\ntype ErrorStoreData = {\n error: Error | null\n errorInfo: ErrorInfo | null\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n}\n\n// Create a global error store\nconst errorStore: ErrorStore = {\n error: null,\n errorInfo: null,\n errorType: null,\n listeners: new Set()\n}\n\n// Function to report an error to the store\nexport function reportError(\n error: Error,\n errorInfo: ErrorInfo,\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier'\n) {\n // Update the store\n errorStore.error = error\n errorStore.errorInfo = errorInfo\n errorStore.errorType = errorType\n\n // Notify all listeners\n const data: ErrorStoreData = {\n error: errorStore.error,\n errorInfo: errorStore.errorInfo,\n errorType: errorStore.errorType\n }\n\n errorStore.listeners.forEach(listener => {\n listener(data)\n })\n\n // Also log to console in development\n if (process.env.NODE_ENV !== 'production') {\n console.error(`[${errorType} error]:`, error)\n if (errorInfo.componentStack) {\n console.error('Component stack:', errorInfo.componentStack)\n }\n }\n}\n\n// Clear the current error\nexport function clearError() {\n errorStore.error = null\n errorStore.errorInfo = null\n errorStore.errorType = null\n\n // Notify all listeners\n const data: ErrorStoreData = {\n error: null,\n errorInfo: null,\n errorType: null\n }\n\n errorStore.listeners.forEach(listener => {\n listener(data)\n })\n}\n\n// Subscribe to error changes\nexport function subscribeToErrors(\n callback: (data: ErrorStoreData) => void\n): () => void {\n errorStore.listeners.add(callback)\n\n // Return unsubscribe function\n return () => {\n errorStore.listeners.delete(callback)\n }\n}\n\n// Get current error state\nexport function getCurrentError(): ErrorStoreData {\n return {\n error: errorStore.error,\n errorInfo: errorStore.errorInfo,\n errorType: errorStore.errorType\n }\n}\n\n// Error handlers for React root\nexport const onCaughtErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'caught')\n}\n\nexport const onUncaughtErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'uncaught')\n}\n\nexport const onRecoverableErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'recoverable')\n}\n", "import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\n", "import {cn} from '@/lib/utils'\n\nconst Logo: React.FC<{className?: string}> = props => {\n return (\n <svg\n className={cn('h-12 w-auto', props.className)}\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n zoomAndPan=\"magnify\"\n viewBox=\"0 0 286.5 121.500001\"\n preserveAspectRatio=\"xMidYMid meet\"\n version=\"1.0\">\n <defs>\n <g />\n <clipPath id=\"38f6fcde47\">\n <path\n d=\"M 0.339844 42 L 10 42 L 10 79 L 0.339844 79 Z M 0.339844 42 \"\n clipRule=\"nonzero\"\n />\n </clipPath>\n <clipPath id=\"af000f7256\">\n <path\n d=\"M 64 23.925781 L 72.789062 23.925781 L 72.789062 96.378906 L 64 96.378906 Z M 64 23.925781 \"\n clipRule=\"nonzero\"\n />\n </clipPath>\n </defs>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(107.11969, 78.49768)\">\n <g>\n <path d=\"M 10.078125 -25.046875 C 11.109375 -26.398438 12.507812 -27.535156 14.28125 -28.453125 C 16.0625 -29.378906 18.070312 -29.84375 20.3125 -29.84375 C 22.863281 -29.84375 25.195312 -29.210938 27.3125 -27.953125 C 29.425781 -26.691406 31.085938 -24.921875 32.296875 -22.640625 C 33.503906 -20.367188 34.109375 -17.757812 34.109375 -14.8125 C 34.109375 -11.863281 33.503906 -9.222656 32.296875 -6.890625 C 31.085938 -4.566406 29.425781 -2.753906 27.3125 -1.453125 C 25.195312 -0.160156 22.863281 0.484375 20.3125 0.484375 C 18.070312 0.484375 16.078125 0.03125 14.328125 -0.875 C 12.585938 -1.78125 11.171875 -2.910156 10.078125 -4.265625 L 10.078125 13.96875 L 4 13.96875 L 4 -29.359375 L 10.078125 -29.359375 Z M 27.921875 -14.8125 C 27.921875 -16.84375 27.503906 -18.59375 26.671875 -20.0625 C 25.835938 -21.539062 24.734375 -22.660156 23.359375 -23.421875 C 21.992188 -24.179688 20.53125 -24.5625 18.96875 -24.5625 C 17.445312 -24.5625 16 -24.171875 14.625 -23.390625 C 13.257812 -22.609375 12.160156 -21.472656 11.328125 -19.984375 C 10.492188 -18.492188 10.078125 -16.734375 10.078125 -14.703125 C 10.078125 -12.679688 10.492188 -10.914062 11.328125 -9.40625 C 12.160156 -7.894531 13.257812 -6.75 14.625 -5.96875 C 16 -5.1875 17.445312 -4.796875 18.96875 -4.796875 C 20.53125 -4.796875 21.992188 -5.191406 23.359375 -5.984375 C 24.734375 -6.785156 25.835938 -7.953125 26.671875 -9.484375 C 27.503906 -11.015625 27.921875 -12.789062 27.921875 -14.8125 Z M 27.921875 -14.8125 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(143.259256, 78.49768)\">\n <g>\n <path d=\"M 30.4375 -29.359375 L 12.421875 13.796875 L 6.125 13.796875 L 12.09375 -0.484375 L 0.53125 -29.359375 L 7.296875 -29.359375 L 15.5625 -6.984375 L 24.140625 -29.359375 Z M 30.4375 -29.359375 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(174.281707, 78.49768)\">\n <g>\n <path d=\"M 10.078125 -39.4375 L 10.078125 0 L 4 0 L 4 -39.4375 Z M 10.078125 -39.4375 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(188.353752, 78.49768)\">\n <g>\n <path d=\"M 16.734375 0.484375 C 13.960938 0.484375 11.457031 -0.144531 9.21875 -1.40625 C 6.976562 -2.664062 5.21875 -4.441406 3.9375 -6.734375 C 2.664062 -9.035156 2.03125 -11.691406 2.03125 -14.703125 C 2.03125 -17.691406 2.6875 -20.335938 4 -22.640625 C 5.3125 -24.953125 7.101562 -26.726562 9.375 -27.96875 C 11.65625 -29.21875 14.195312 -29.84375 17 -29.84375 C 19.8125 -29.84375 22.351562 -29.21875 24.625 -27.96875 C 26.894531 -26.726562 28.6875 -24.953125 30 -22.640625 C 31.320312 -20.335938 31.984375 -17.691406 31.984375 -14.703125 C 31.984375 -11.722656 31.304688 -9.078125 29.953125 -6.765625 C 28.597656 -4.453125 26.757812 -2.664062 24.4375 -1.40625 C 22.113281 -0.144531 19.546875 0.484375 16.734375 0.484375 Z M 16.734375 -4.796875 C 18.296875 -4.796875 19.757812 -5.164062 21.125 -5.90625 C 22.5 -6.65625 23.613281 -7.773438 24.46875 -9.265625 C 25.320312 -10.765625 25.75 -12.578125 25.75 -14.703125 C 25.75 -16.835938 25.335938 -18.640625 24.515625 -20.109375 C 23.703125 -21.585938 22.617188 -22.695312 21.265625 -23.4375 C 19.910156 -24.1875 18.453125 -24.5625 16.890625 -24.5625 C 15.328125 -24.5625 13.878906 -24.1875 12.546875 -23.4375 C 11.210938 -22.695312 10.15625 -21.585938 9.375 -20.109375 C 8.59375 -18.640625 8.203125 -16.835938 8.203125 -14.703125 C 8.203125 -11.546875 9.007812 -9.101562 10.625 -7.375 C 12.25 -5.65625 14.285156 -4.796875 16.734375 -4.796875 Z M 16.734375 -4.796875 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(222.361196, 78.49768)\">\n <g>\n <path d=\"M 18.8125 -29.84375 C 21.125 -29.84375 23.191406 -29.363281 25.015625 -28.40625 C 26.847656 -27.445312 28.28125 -26.023438 29.3125 -24.140625 C 30.34375 -22.253906 30.859375 -19.984375 30.859375 -17.328125 L 30.859375 0 L 24.84375 0 L 24.84375 -16.421875 C 24.84375 -19.046875 24.179688 -21.054688 22.859375 -22.453125 C 21.546875 -23.859375 19.753906 -24.5625 17.484375 -24.5625 C 15.210938 -24.5625 13.410156 -23.859375 12.078125 -22.453125 C 10.742188 -21.054688 10.078125 -19.046875 10.078125 -16.421875 L 10.078125 0 L 4 0 L 4 -29.359375 L 10.078125 -29.359375 L 10.078125 -26.015625 C 11.066406 -27.222656 12.332031 -28.160156 13.875 -28.828125 C 15.425781 -29.503906 17.070312 -29.84375 18.8125 -29.84375 Z M 18.8125 -29.84375 \" />\n </g>\n </g>\n </g>\n <path\n fill=\"currentColor\"\n d=\"M 53.359375 31.652344 L 53.359375 88.6875 L 62.410156 90.859375 L 62.410156 29.484375 Z M 53.359375 31.652344 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <g clipPath=\"url(#38f6fcde47)\">\n <path\n fill=\"currentColor\"\n d=\"M 0.339844 47.433594 L 0.339844 72.910156 C 0.339844 73.34375 0.410156 73.769531 0.554688 74.179688 C 0.699219 74.59375 0.90625 74.96875 1.175781 75.3125 C 1.445312 75.65625 1.765625 75.945312 2.132812 76.179688 C 2.503906 76.414062 2.898438 76.582031 3.324219 76.683594 L 9.390625 78.140625 L 9.390625 42.195312 L 3.3125 43.660156 C 2.890625 43.761719 2.492188 43.929688 2.125 44.164062 C 1.761719 44.402344 1.441406 44.6875 1.171875 45.03125 C 0.902344 45.375 0.695312 45.75 0.554688 46.164062 C 0.410156 46.574219 0.339844 46.996094 0.339844 47.433594 Z M 0.339844 47.433594 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </g>\n <g clipPath=\"url(#af000f7256)\">\n <path\n fill=\"currentColor\"\n d=\"M 64.996094 95.085938 L 64.996094 25.253906 C 64.996094 25.082031 65.027344 24.917969 65.09375 24.761719 C 65.160156 24.601562 65.253906 24.460938 65.375 24.339844 C 65.496094 24.21875 65.636719 24.125 65.792969 24.0625 C 65.953125 23.996094 66.117188 23.960938 66.289062 23.960938 L 71.460938 23.960938 C 71.632812 23.960938 71.796875 23.996094 71.957031 24.0625 C 72.113281 24.125 72.253906 24.21875 72.375 24.339844 C 72.496094 24.460938 72.589844 24.601562 72.65625 24.761719 C 72.722656 24.917969 72.753906 25.082031 72.753906 25.253906 L 72.753906 95.085938 C 72.753906 95.257812 72.722656 95.421875 72.65625 95.582031 C 72.589844 95.738281 72.496094 95.878906 72.375 96 C 72.253906 96.121094 72.113281 96.214844 71.957031 96.28125 C 71.796875 96.347656 71.632812 96.378906 71.460938 96.378906 L 66.289062 96.378906 C 66.117188 96.378906 65.953125 96.347656 65.792969 96.28125 C 65.636719 96.214844 65.496094 96.121094 65.375 96 C 65.253906 95.878906 65.160156 95.738281 65.09375 95.582031 C 65.027344 95.421875 64.996094 95.257812 64.996094 95.085938 Z M 64.996094 95.085938 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </g>\n <path\n fill=\"currentColor\"\n d=\"M 22.320312 81.238281 L 22.320312 39.101562 L 11.976562 41.585938 L 11.976562 78.757812 Z M 22.320312 81.238281 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <path\n fill=\"currentColor\"\n d=\"M 50.769531 88.066406 L 50.769531 32.277344 L 37.839844 35.378906 L 37.839844 84.960938 Z M 50.769531 88.066406 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <path\n fill=\"currentColor\"\n d=\"M 24.90625 81.863281 L 35.253906 84.34375 L 35.253906 35.996094 L 24.90625 38.480469 Z M 24.90625 81.863281 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </svg>\n )\n}\n\nexport default Logo\n", "import Logo from '@/components/logo'\nimport type React from 'react'\nimport {useEffect, useState} from 'react'\nimport {createPortal} from 'react-dom'\nimport DevErrorOverlay from './dev-error-overlay'\nimport {ErrorBoundary} from './error-boundary'\nimport {clearError, getCurrentError, subscribeToErrors} from './report-error'\n\ninterface ErrorOverlayProviderProps {\n children: React.ReactNode\n identifierPrefix?: string\n}\n\nexport default function DevOverlayProvider({\n children,\n identifierPrefix\n}: ErrorOverlayProviderProps) {\n const [error, setError] = useState<Error | null>(null)\n const [errorInfo, setErrorInfo] = useState<any | null>(null)\n const [errorType, setErrorType] = useState<\n 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n >(null)\n const [overlayContainer, setOverlayContainer] = useState<HTMLElement | null>(\n null\n )\n\n useEffect(() => {\n // Check for existing errors on mount\n const currentError = getCurrentError()\n if (currentError.error) {\n setError(currentError.error)\n setErrorInfo(currentError.errorInfo)\n setErrorType(currentError.errorType)\n }\n\n // Create a container for the overlay that lives outside the React tree\n const container = document.createElement('div')\n container.id = 'dev-error-overlay-container'\n document.body.appendChild(container)\n setOverlayContainer(container)\n\n // Subscribe to future errors\n const unsubscribe = subscribeToErrors(data => {\n setError(data.error)\n setErrorInfo(data.errorInfo)\n setErrorType(data.errorType)\n })\n\n // Cleanup\n return () => {\n unsubscribe()\n document.body.removeChild(container)\n }\n }, [])\n\n const handleDismiss = () => {\n clearError()\n setError(null)\n setErrorInfo(null)\n setErrorType(null)\n }\n\n return (\n <>\n <ErrorBoundary>{children}</ErrorBoundary>\n\n {overlayContainer &&\n error &&\n errorInfo &&\n errorType &&\n createPortal(\n <DevErrorOverlay\n logo={<Logo />}\n error={error}\n errorInfo={errorInfo}\n errorType={errorType}\n onDismiss={handleDismiss}\n identifierPrefix={identifierPrefix}\n onCaughtError={(e, i) => console.log('Overlay caught error:', e, i)}\n onUncaughtError={(e, i) =>\n console.log('Overlay uncaught error:', e, i)\n }\n onRecoverableError={(e, i) =>\n console.log('Overlay recoverable error:', e, i)\n }\n />,\n overlayContainer\n )}\n </>\n )\n}\n", "'use client'\n\nimport type React from 'react'\n\nimport {useEffect, useState} from 'react'\nimport {X} from 'lucide-react'\n\ninterface ErrorInfo {\n componentStack?: string\n digest?: string\n}\n\ninterface DevErrorOverlayProps {\n error: Error\n errorInfo: ErrorInfo\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier'\n onCaughtError?: (error: Error, errorInfo: ErrorInfo) => void\n onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void\n onRecoverableError?: (error: Error, errorInfo: ErrorInfo) => void\n identifierPrefix?: string\n onDismiss?: () => void\n logo?: React.ReactNode | string\n}\n\nexport default function DevErrorOverlay({\n error,\n errorInfo,\n errorType,\n onCaughtError,\n onUncaughtError,\n onRecoverableError,\n identifierPrefix,\n onDismiss,\n logo\n}: DevErrorOverlayProps) {\n const [isVisible, setIsVisible] = useState(true)\n\n // Call the appropriate callback based on error type\n useEffect(() => {\n if (errorType === 'caught' && onCaughtError) {\n onCaughtError(error, errorInfo)\n } else if (errorType === 'uncaught' && onUncaughtError) {\n onUncaughtError(error, errorInfo)\n } else if (errorType === 'recoverable' && onRecoverableError) {\n onRecoverableError(error, errorInfo)\n }\n }, [\n error,\n errorInfo,\n errorType,\n onCaughtError,\n onUncaughtError,\n onRecoverableError\n ])\n\n const handleDismiss = () => {\n setIsVisible(false)\n if (onDismiss) onDismiss()\n }\n\n if (!isVisible || !error) {\n return null\n }\n\n const getErrorTypeLabel = () => {\n switch (errorType) {\n case 'caught':\n return 'Error Boundary Caught Error'\n case 'uncaught':\n return 'Uncaught Error'\n case 'recoverable':\n return 'Recoverable Error'\n case 'identifier':\n return 'Identifier Prefix Error'\n default:\n return 'Runtime Error'\n }\n }\n\n const getErrorTypeDescription = () => {\n switch (errorType) {\n case 'caught':\n return 'This error was caught by a React Error Boundary.'\n case 'uncaught':\n return 'This error was not caught by any Error Boundary and crashed your application.'\n case 'recoverable':\n return 'React automatically recovered from this error, but you should still fix it.'\n case 'identifier':\n return `Identifier prefix mismatch. Expected prefix: \"${identifierPrefix}\".`\n default:\n return 'An unexpected error occurred during runtime.'\n }\n }\n\n const getErrorBorderColor = () => {\n switch (errorType) {\n case 'caught':\n return 'border-yellow-600'\n case 'uncaught':\n return 'border-red-600'\n case 'recoverable':\n return 'border-blue-600'\n case 'identifier':\n return 'border-purple-600'\n default:\n return 'border-red-600'\n }\n }\n\n return (\n <div className=\"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 overflow-y-auto p-4 flex items-start justify-center\">\n <link\n rel=\"stylesheet\"\n href=\"/__pylon/static/pylon.css\"\n precedence=\"high\"\n />\n <div\n className={`w-full max-w-3xl bg-black border ${getErrorBorderColor()} rounded-lg mt-16 overflow-hidden text-white font-sans`}>\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-neutral-800 p-4\">\n <div className=\"flex items-center gap-3\">\n {logo && (\n <div className=\"flex-shrink-0\">\n {typeof logo === 'string' ? (\n <img\n src={logo || '/placeholder.svg'}\n alt=\"Error Overlay Logo\"\n className=\"h-8 w-auto\"\n />\n ) : (\n logo\n )}\n </div>\n )}\n <div>\n <h1 className=\"text-xl font-medium text-red-500\">\n {getErrorTypeLabel()}\n </h1>\n </div>\n </div>\n <button\n onClick={handleDismiss}\n className=\"p-2 rounded-full hover:bg-neutral-800 transition-colors\"\n aria-label=\"Dismiss error overlay\">\n <X className=\"h-5 w-5 text-neutral-400\" />\n </button>\n </div>\n\n {/* Error Message */}\n <div className=\"p-4\">\n <div className=\"mb-4 text-neutral-400\">\n {getErrorTypeDescription()}\n </div>\n\n <h2 className=\"text-2xl font-bold mb-4 text-white\">\n {error.message || 'An unexpected error has occurred'}\n </h2>\n\n {!!error.cause && (\n <div className=\"mb-4\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2\">\n Cause\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-3 text-neutral-300\">\n {String(error.cause)}\n </div>\n </div>\n )}\n </div>\n\n {/* Component Stack */}\n {errorInfo?.componentStack && (\n <div className=\"p-4 border-t border-neutral-800\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3\">\n Component Stack\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-4 overflow-x-auto\">\n <pre className=\"font-mono text-sm text-neutral-300 whitespace-pre-wrap\">\n {errorInfo.componentStack}\n </pre>\n </div>\n </div>\n )}\n\n {/* Call Stack */}\n <div className=\"p-4 border-t border-neutral-800\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3\">\n Call Stack\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-4 overflow-x-auto\">\n <pre className=\"font-mono text-sm text-neutral-300 whitespace-pre-wrap\">\n {error.stack || 'No stack trace available'}\n </pre>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"p-4 border-t border-neutral-800 flex justify-between\">\n <div>\n {errorType === 'recoverable' && (\n <span className=\"text-blue-400 text-sm\">\n React automatically recovered from this error\n </span>\n )}\n </div>\n <div className=\"flex gap-3\">\n <button\n onClick={handleDismiss}\n className=\"bg-neutral-800 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-700 transition-colors\">\n Dismiss\n </button>\n <button\n onClick={() => window.location.reload()}\n className=\"bg-white text-black px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-200 transition-colors\">\n Reload Page\n </button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n", "'use client'\n\nimport type React from 'react'\nimport {Component, type ErrorInfo as ReactErrorInfo} from 'react'\nimport {onCaughtErrorProd} from './report-error'\nimport type {ErrorInfo} from './types'\n\ninterface ErrorBoundaryProps {\n children: React.ReactNode\n fallback?: React.ReactNode\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = {hasError: false}\n }\n\n static getDerivedStateFromError(_: Error): ErrorBoundaryState {\n // Update state so the next render will show the fallback UI\n return {hasError: true}\n }\n\n componentDidCatch(error: Error, errorInfo: ReactErrorInfo): void {\n // Convert React's errorInfo to our ErrorInfo format\n const customErrorInfo: ErrorInfo = {\n componentStack: errorInfo.componentStack\n }\n\n // Report the error to our error reporting system\n onCaughtErrorProd(error, customErrorInfo)\n\n // You can also log the error to an error reporting service\n console.error('Error caught by boundary:', error, errorInfo)\n }\n\n render(): React.ReactNode {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return this.props.fallback || null\n }\n\n return this.props.children\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,YAAY,yCAAyC;;;ACArD,SAAe,eAAc;AA8HzB,mBAEI,KAFJ;AA/FJ,IAAM,sBAAsB,CAC1B,UAOG;AACH,SAAO,QAAQ,MAAM;AAqBnB,UAAM,yBAAyB,IAAI,gBAAgB,CAAC,CAAC;AACrD,QAAI;AAEJ,QAAI,OAAO,MAAM,QAAQ,UAAU;AACjC,6BAAuB,IAAI,OAAO,MAAM,GAAG;AAAA,IAC7C,OAAO;AACL,6BAAuB,IAAI,OAAO,MAAM,IAAI,GAAG;AAE/C,UAAI,MAAM,IAAI,OAAO;AACnB,+BAAuB,IAAI,KAAK,MAAM,IAAI,MAAM,SAAS,CAAC;AAAA,MAC5D;AAEA,UAAI,MAAM,IAAI,QAAQ;AACpB,+BAAuB,IAAI,KAAK,MAAM,IAAI,OAAO,SAAS,CAAC;AAAA,MAC7D;AAEA,oBAAc,MAAM,IAAI;AAAA,IAC1B;AAEA,QAAI,MAAM,OAAO;AACf,6BAAuB,IAAI,KAAK,MAAM,MAAM,SAAS,CAAC;AAAA,IACxD;AAEA,QAAI,MAAM,QAAQ;AAChB,6BAAuB,IAAI,KAAK,MAAM,OAAO,SAAS,CAAC;AAAA,IACzD;AAEA,QAAI,MAAM,aAAa;AACrB,oBAAc,MAAM;AAAA,IACtB;AAGA,UAAM,WAAW,kBAAkB,uBA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AA,UACA,WAAW;AAAA,UACX;AAAA,UACA,eAAe,CAAC,GAAG,MAAM,QAAQ,IAAI,yBAAyB,GAAG,CAAC;AAAA,UAClE,iBAAiB,CAAC,GAAG,MACnB,QAAQ,IAAI,2BAA2B,GAAG,CAAC;AAAA,UAE7C,oBAAoB,CAAC,GAAG,MACtB,QAAQ,IAAI,8BAA8B,GAAG,CAAC;AAAA;AAAA,MAElD;AAAA,MACA;AAAA,IACF;AAAA,KACJ;AAEJ;",
|
|
6
|
-
"names": ["jsx", "jsx", "jsxs", "useEffect", "useState", "jsx", "jsxs", "Fragment", "jsx", "jsxs", "useState", "useEffect"]
|
|
3
|
+
"sources": ["../../src/pages/index.ts", "../../src/pages/internals.tsx", "../../src/pages/image.tsx", "../../src/pages/link.tsx", "../../src/components/dev-overlay/report-error.ts", "../../src/lib/utils.ts", "../../src/components/logo.tsx", "../../src/components/dev-overlay/dev-overlay-provider.tsx", "../../src/components/dev-overlay/dev-error-overlay.tsx", "../../src/components/dev-overlay/error-boundary.tsx", "../../src/components/global-error-page.tsx"],
|
|
4
|
+
"sourcesContent": ["export * as __PYLON_ROUTER_INTERNALS_DO_NOT_USE from 'react-router'\nexport * as __PYLON_INTERNALS_DO_NOT_USE from './internals'\nexport {Image} from './image'\nexport {Link} from './link'\n\nexport {type PageProps, type PageData} from '@/plugins/use-pages'\nexport * from '@/components/dev-overlay'\nexport {default as GlobalErrorPage} from '@/components/global-error-page'\n\nimport '../globals.css'\n", "import {createContext, useContext} from 'react'\n\nconst dataClientContext = createContext<{\n client: any\n} | null>(null)\n\nconst DataClientProvider: React.FC<{\n client: any\n children: React.ReactNode\n}> = ({children, client}) => {\n return (\n <dataClientContext.Provider value={{client}}>\n {children}\n </dataClientContext.Provider>\n )\n}\n\nconst useDataClient = () => {\n const context = useContext(dataClientContext)\n\n if (!context) {\n throw new Error('useDataClient must be used within a DataClientProvider')\n }\n\n return context.client\n}\n\nexport {DataClientProvider, useDataClient}\n", "import React, {useMemo} from 'react'\n\ninterface ImageValuesProps {\n src: string | PylonBuildSrc\n alt?: string\n className?: string\n width?: number\n height?: number\n blurDataURL?: string\n}\n\nexport interface ImageProps extends Omit<ImageValuesProps, 'src'> {\n src: string\n fill?: boolean\n}\n\ninterface PylonBuildSrc {\n url: string\n width?: number\n height?: number\n blurDataURL?: string\n}\n\n/**\n * Custom hook to process and extract image properties,\n * ensuring correct values for width, height, and blur data.\n * Generates a final image URL compatible with Pylon's media proxy.\n *\n * @param {ImageProps} props - The image properties including src, width, height, and blurDataURL.\n * @returns {Object} The processed image values: width, height, blurDataURL, and final image source.\n */\nconst usePylonImageValues = (\n props: ImageValuesProps\n): {\n src: string\n width?: number\n height?: number\n blurDataURL?: string\n preloads: string[]\n} => {\n return useMemo(() => {\n // // Parse the image source URL to extract query parameters\n // const isSrcAbsolute =\n // props.src.startsWith('http://') || props.src.startsWith('https://')\n // const url = new URL(props.src, 'http://localhost')\n // const searchParams = new URLSearchParams(url.search)\n\n // // Extract values, prioritizing props over query params\n // const getValue = (propValue, paramKey) =>\n // propValue ?? searchParams.get(paramKey)\n // const width = getValue(props.width, 'w')\n // const height = getValue(props.height, 'h')\n // const blurDataURL = getValue(props.blurDataURL, 'blurDataURL')\n\n // // Prepare Pylon-specific query params\n // const pylonMediaSearchParams = new URLSearchParams({\n // src:\n // ...(width && {w: width.toString()}),\n // ...(height && {h: height.toString()})\n // })\n\n const pylonMediaSearchParams = new URLSearchParams({})\n let blurDataURL: string | undefined\n\n if (typeof props.src === 'string') {\n pylonMediaSearchParams.set('src', props.src)\n } else {\n pylonMediaSearchParams.set('src', props.src.url)\n\n if (props.src.width) {\n pylonMediaSearchParams.set('w', props.src.width.toString())\n }\n\n if (props.src.height) {\n pylonMediaSearchParams.set('h', props.src.height.toString())\n }\n\n blurDataURL = props.src.blurDataURL\n }\n\n if (props.width) {\n pylonMediaSearchParams.set('w', props.width.toString())\n }\n\n if (props.height) {\n pylonMediaSearchParams.set('h', props.height.toString())\n }\n\n if (props.blurDataURL) {\n blurDataURL = props.blurDataURL\n }\n\n // Construct the final image source URL\n const finalSrc = `/__pylon/image?${pylonMediaSearchParams.toString()}`\n\n const width = pylonMediaSearchParams.has('w')\n ? parseInt(pylonMediaSearchParams.get('w')!)\n : undefined\n const height = pylonMediaSearchParams.has('h')\n ? parseInt(pylonMediaSearchParams.get('h')!)\n : undefined\n\n const preloads: string[] = []\n\n if (!blurDataURL) {\n // Use finalSrc with lqip=true to generate blurDataURL\n blurDataURL = finalSrc + '&lqip=true'\n\n // Preload the blurDataURL image\n preloads.push(blurDataURL)\n }\n\n return {\n width,\n height,\n blurDataURL,\n src: finalSrc,\n preloads\n }\n }, [props])\n}\n\nexport const Image: React.FC<ImageProps> = props => {\n const values = usePylonImageValues(props)\n\n return (\n <>\n {values.preloads.map((src, index) => (\n <link key={index} rel=\"preload\" as=\"image\" href={src} />\n ))}\n <img\n src={values.src}\n alt={props.alt}\n className={props.className}\n width={values.width}\n height={values.height}\n style={{\n backgroundImage: `url(${values.blurDataURL})`,\n backgroundSize: 'cover',\n height: props.fill ? '100%' : undefined,\n width: props.fill ? '100%' : undefined\n }}\n loading=\"lazy\"\n />\n </>\n )\n}\n", "import {Link as LinkComp, LinkProps as LinkCompProps} from 'react-router'\n\ninterface LinkProps extends Omit<LinkCompProps, 'to'> {\n href: LinkCompProps['to']\n}\n\nexport const Link: React.FC<LinkProps> = props => {\n const {href, ...rest} = props\n return <LinkComp to={href} {...rest} />\n}\n", "import type {ErrorInfo} from './types'\n\n// Define a global error store type\ntype ErrorStore = {\n error: Error | null\n errorInfo: ErrorInfo | null\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n listeners: Set<(data: ErrorStoreData) => void>\n}\n\n// Data passed to listeners\ntype ErrorStoreData = {\n error: Error | null\n errorInfo: ErrorInfo | null\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n}\n\n// Create a global error store\nconst errorStore: ErrorStore = {\n error: null,\n errorInfo: null,\n errorType: null,\n listeners: new Set()\n}\n\n// Function to report an error to the store\nexport function reportError(\n error: Error,\n errorInfo: ErrorInfo,\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier'\n) {\n // Update the store\n errorStore.error = error\n errorStore.errorInfo = errorInfo\n errorStore.errorType = errorType\n\n // Notify all listeners\n const data: ErrorStoreData = {\n error: errorStore.error,\n errorInfo: errorStore.errorInfo,\n errorType: errorStore.errorType\n }\n\n errorStore.listeners.forEach(listener => {\n listener(data)\n })\n\n // Also log to console in development\n if (process.env.NODE_ENV !== 'production') {\n console.error(`[${errorType} error]:`, error)\n if (errorInfo.componentStack) {\n console.error('Component stack:', errorInfo.componentStack)\n }\n }\n}\n\n// Clear the current error\nexport function clearError() {\n errorStore.error = null\n errorStore.errorInfo = null\n errorStore.errorType = null\n\n // Notify all listeners\n const data: ErrorStoreData = {\n error: null,\n errorInfo: null,\n errorType: null\n }\n\n errorStore.listeners.forEach(listener => {\n listener(data)\n })\n}\n\n// Subscribe to error changes\nexport function subscribeToErrors(\n callback: (data: ErrorStoreData) => void\n): () => void {\n errorStore.listeners.add(callback)\n\n // Return unsubscribe function\n return () => {\n errorStore.listeners.delete(callback)\n }\n}\n\n// Get current error state\nexport function getCurrentError(): ErrorStoreData {\n return {\n error: errorStore.error,\n errorInfo: errorStore.errorInfo,\n errorType: errorStore.errorType\n }\n}\n\n// Error handlers for React root\nexport const onCaughtErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'caught')\n}\n\nexport const onUncaughtErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'uncaught')\n}\n\nexport const onRecoverableErrorProd = (error: Error, errorInfo: ErrorInfo) => {\n reportError(error, errorInfo, 'recoverable')\n}\n", "import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\n", "import {cn} from '@/lib/utils'\n\nconst Logo: React.FC<{className?: string}> = props => {\n return (\n <svg\n className={cn('h-12 w-auto', props.className)}\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n zoomAndPan=\"magnify\"\n viewBox=\"0 0 286.5 121.500001\"\n preserveAspectRatio=\"xMidYMid meet\"\n version=\"1.0\">\n <defs>\n <g />\n <clipPath id=\"38f6fcde47\">\n <path\n d=\"M 0.339844 42 L 10 42 L 10 79 L 0.339844 79 Z M 0.339844 42 \"\n clipRule=\"nonzero\"\n />\n </clipPath>\n <clipPath id=\"af000f7256\">\n <path\n d=\"M 64 23.925781 L 72.789062 23.925781 L 72.789062 96.378906 L 64 96.378906 Z M 64 23.925781 \"\n clipRule=\"nonzero\"\n />\n </clipPath>\n </defs>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(107.11969, 78.49768)\">\n <g>\n <path d=\"M 10.078125 -25.046875 C 11.109375 -26.398438 12.507812 -27.535156 14.28125 -28.453125 C 16.0625 -29.378906 18.070312 -29.84375 20.3125 -29.84375 C 22.863281 -29.84375 25.195312 -29.210938 27.3125 -27.953125 C 29.425781 -26.691406 31.085938 -24.921875 32.296875 -22.640625 C 33.503906 -20.367188 34.109375 -17.757812 34.109375 -14.8125 C 34.109375 -11.863281 33.503906 -9.222656 32.296875 -6.890625 C 31.085938 -4.566406 29.425781 -2.753906 27.3125 -1.453125 C 25.195312 -0.160156 22.863281 0.484375 20.3125 0.484375 C 18.070312 0.484375 16.078125 0.03125 14.328125 -0.875 C 12.585938 -1.78125 11.171875 -2.910156 10.078125 -4.265625 L 10.078125 13.96875 L 4 13.96875 L 4 -29.359375 L 10.078125 -29.359375 Z M 27.921875 -14.8125 C 27.921875 -16.84375 27.503906 -18.59375 26.671875 -20.0625 C 25.835938 -21.539062 24.734375 -22.660156 23.359375 -23.421875 C 21.992188 -24.179688 20.53125 -24.5625 18.96875 -24.5625 C 17.445312 -24.5625 16 -24.171875 14.625 -23.390625 C 13.257812 -22.609375 12.160156 -21.472656 11.328125 -19.984375 C 10.492188 -18.492188 10.078125 -16.734375 10.078125 -14.703125 C 10.078125 -12.679688 10.492188 -10.914062 11.328125 -9.40625 C 12.160156 -7.894531 13.257812 -6.75 14.625 -5.96875 C 16 -5.1875 17.445312 -4.796875 18.96875 -4.796875 C 20.53125 -4.796875 21.992188 -5.191406 23.359375 -5.984375 C 24.734375 -6.785156 25.835938 -7.953125 26.671875 -9.484375 C 27.503906 -11.015625 27.921875 -12.789062 27.921875 -14.8125 Z M 27.921875 -14.8125 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(143.259256, 78.49768)\">\n <g>\n <path d=\"M 30.4375 -29.359375 L 12.421875 13.796875 L 6.125 13.796875 L 12.09375 -0.484375 L 0.53125 -29.359375 L 7.296875 -29.359375 L 15.5625 -6.984375 L 24.140625 -29.359375 Z M 30.4375 -29.359375 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(174.281707, 78.49768)\">\n <g>\n <path d=\"M 10.078125 -39.4375 L 10.078125 0 L 4 0 L 4 -39.4375 Z M 10.078125 -39.4375 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(188.353752, 78.49768)\">\n <g>\n <path d=\"M 16.734375 0.484375 C 13.960938 0.484375 11.457031 -0.144531 9.21875 -1.40625 C 6.976562 -2.664062 5.21875 -4.441406 3.9375 -6.734375 C 2.664062 -9.035156 2.03125 -11.691406 2.03125 -14.703125 C 2.03125 -17.691406 2.6875 -20.335938 4 -22.640625 C 5.3125 -24.953125 7.101562 -26.726562 9.375 -27.96875 C 11.65625 -29.21875 14.195312 -29.84375 17 -29.84375 C 19.8125 -29.84375 22.351562 -29.21875 24.625 -27.96875 C 26.894531 -26.726562 28.6875 -24.953125 30 -22.640625 C 31.320312 -20.335938 31.984375 -17.691406 31.984375 -14.703125 C 31.984375 -11.722656 31.304688 -9.078125 29.953125 -6.765625 C 28.597656 -4.453125 26.757812 -2.664062 24.4375 -1.40625 C 22.113281 -0.144531 19.546875 0.484375 16.734375 0.484375 Z M 16.734375 -4.796875 C 18.296875 -4.796875 19.757812 -5.164062 21.125 -5.90625 C 22.5 -6.65625 23.613281 -7.773438 24.46875 -9.265625 C 25.320312 -10.765625 25.75 -12.578125 25.75 -14.703125 C 25.75 -16.835938 25.335938 -18.640625 24.515625 -20.109375 C 23.703125 -21.585938 22.617188 -22.695312 21.265625 -23.4375 C 19.910156 -24.1875 18.453125 -24.5625 16.890625 -24.5625 C 15.328125 -24.5625 13.878906 -24.1875 12.546875 -23.4375 C 11.210938 -22.695312 10.15625 -21.585938 9.375 -20.109375 C 8.59375 -18.640625 8.203125 -16.835938 8.203125 -14.703125 C 8.203125 -11.546875 9.007812 -9.101562 10.625 -7.375 C 12.25 -5.65625 14.285156 -4.796875 16.734375 -4.796875 Z M 16.734375 -4.796875 \" />\n </g>\n </g>\n </g>\n <g fill=\"currentColor\" fillOpacity=\"1\">\n <g transform=\"translate(222.361196, 78.49768)\">\n <g>\n <path d=\"M 18.8125 -29.84375 C 21.125 -29.84375 23.191406 -29.363281 25.015625 -28.40625 C 26.847656 -27.445312 28.28125 -26.023438 29.3125 -24.140625 C 30.34375 -22.253906 30.859375 -19.984375 30.859375 -17.328125 L 30.859375 0 L 24.84375 0 L 24.84375 -16.421875 C 24.84375 -19.046875 24.179688 -21.054688 22.859375 -22.453125 C 21.546875 -23.859375 19.753906 -24.5625 17.484375 -24.5625 C 15.210938 -24.5625 13.410156 -23.859375 12.078125 -22.453125 C 10.742188 -21.054688 10.078125 -19.046875 10.078125 -16.421875 L 10.078125 0 L 4 0 L 4 -29.359375 L 10.078125 -29.359375 L 10.078125 -26.015625 C 11.066406 -27.222656 12.332031 -28.160156 13.875 -28.828125 C 15.425781 -29.503906 17.070312 -29.84375 18.8125 -29.84375 Z M 18.8125 -29.84375 \" />\n </g>\n </g>\n </g>\n <path\n fill=\"currentColor\"\n d=\"M 53.359375 31.652344 L 53.359375 88.6875 L 62.410156 90.859375 L 62.410156 29.484375 Z M 53.359375 31.652344 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <g clipPath=\"url(#38f6fcde47)\">\n <path\n fill=\"currentColor\"\n d=\"M 0.339844 47.433594 L 0.339844 72.910156 C 0.339844 73.34375 0.410156 73.769531 0.554688 74.179688 C 0.699219 74.59375 0.90625 74.96875 1.175781 75.3125 C 1.445312 75.65625 1.765625 75.945312 2.132812 76.179688 C 2.503906 76.414062 2.898438 76.582031 3.324219 76.683594 L 9.390625 78.140625 L 9.390625 42.195312 L 3.3125 43.660156 C 2.890625 43.761719 2.492188 43.929688 2.125 44.164062 C 1.761719 44.402344 1.441406 44.6875 1.171875 45.03125 C 0.902344 45.375 0.695312 45.75 0.554688 46.164062 C 0.410156 46.574219 0.339844 46.996094 0.339844 47.433594 Z M 0.339844 47.433594 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </g>\n <g clipPath=\"url(#af000f7256)\">\n <path\n fill=\"currentColor\"\n d=\"M 64.996094 95.085938 L 64.996094 25.253906 C 64.996094 25.082031 65.027344 24.917969 65.09375 24.761719 C 65.160156 24.601562 65.253906 24.460938 65.375 24.339844 C 65.496094 24.21875 65.636719 24.125 65.792969 24.0625 C 65.953125 23.996094 66.117188 23.960938 66.289062 23.960938 L 71.460938 23.960938 C 71.632812 23.960938 71.796875 23.996094 71.957031 24.0625 C 72.113281 24.125 72.253906 24.21875 72.375 24.339844 C 72.496094 24.460938 72.589844 24.601562 72.65625 24.761719 C 72.722656 24.917969 72.753906 25.082031 72.753906 25.253906 L 72.753906 95.085938 C 72.753906 95.257812 72.722656 95.421875 72.65625 95.582031 C 72.589844 95.738281 72.496094 95.878906 72.375 96 C 72.253906 96.121094 72.113281 96.214844 71.957031 96.28125 C 71.796875 96.347656 71.632812 96.378906 71.460938 96.378906 L 66.289062 96.378906 C 66.117188 96.378906 65.953125 96.347656 65.792969 96.28125 C 65.636719 96.214844 65.496094 96.121094 65.375 96 C 65.253906 95.878906 65.160156 95.738281 65.09375 95.582031 C 65.027344 95.421875 64.996094 95.257812 64.996094 95.085938 Z M 64.996094 95.085938 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </g>\n <path\n fill=\"currentColor\"\n d=\"M 22.320312 81.238281 L 22.320312 39.101562 L 11.976562 41.585938 L 11.976562 78.757812 Z M 22.320312 81.238281 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <path\n fill=\"currentColor\"\n d=\"M 50.769531 88.066406 L 50.769531 32.277344 L 37.839844 35.378906 L 37.839844 84.960938 Z M 50.769531 88.066406 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n <path\n fill=\"currentColor\"\n d=\"M 24.90625 81.863281 L 35.253906 84.34375 L 35.253906 35.996094 L 24.90625 38.480469 Z M 24.90625 81.863281 \"\n fillOpacity=\"1\"\n fillRule=\"nonzero\"\n />\n </svg>\n )\n}\n\nexport default Logo\n", "import Logo from '@/components/logo'\nimport type React from 'react'\nimport {useEffect, useState} from 'react'\nimport {createPortal} from 'react-dom'\nimport DevErrorOverlay from './dev-error-overlay'\nimport {ErrorBoundary} from './error-boundary'\nimport {clearError, getCurrentError, subscribeToErrors} from './report-error'\n\ninterface ErrorOverlayProviderProps {\n children: React.ReactNode\n identifierPrefix?: string\n}\n\nexport default function DevOverlayProvider({\n children,\n identifierPrefix\n}: ErrorOverlayProviderProps) {\n const [error, setError] = useState<Error | null>(null)\n const [errorInfo, setErrorInfo] = useState<any | null>(null)\n const [errorType, setErrorType] = useState<\n 'caught' | 'uncaught' | 'recoverable' | 'identifier' | null\n >(null)\n const [overlayContainer, setOverlayContainer] = useState<HTMLElement | null>(\n null\n )\n\n useEffect(() => {\n // Check for existing errors on mount\n const currentError = getCurrentError()\n if (currentError.error) {\n setError(currentError.error)\n setErrorInfo(currentError.errorInfo)\n setErrorType(currentError.errorType)\n }\n\n // Create a container for the overlay that lives outside the React tree\n const container = document.createElement('div')\n container.id = 'dev-error-overlay-container'\n document.body.appendChild(container)\n setOverlayContainer(container)\n\n // Subscribe to future errors\n const unsubscribe = subscribeToErrors(data => {\n setError(data.error)\n setErrorInfo(data.errorInfo)\n setErrorType(data.errorType)\n })\n\n // Cleanup\n return () => {\n unsubscribe()\n document.body.removeChild(container)\n }\n }, [])\n\n const handleDismiss = () => {\n clearError()\n setError(null)\n setErrorInfo(null)\n setErrorType(null)\n }\n\n return (\n <>\n <ErrorBoundary>{children}</ErrorBoundary>\n\n {overlayContainer &&\n error &&\n errorInfo &&\n errorType &&\n createPortal(\n <DevErrorOverlay\n logo={<Logo />}\n error={error}\n errorInfo={errorInfo}\n errorType={errorType}\n onDismiss={handleDismiss}\n identifierPrefix={identifierPrefix}\n onCaughtError={(e, i) => console.log('Overlay caught error:', e, i)}\n onUncaughtError={(e, i) =>\n console.log('Overlay uncaught error:', e, i)\n }\n onRecoverableError={(e, i) =>\n console.log('Overlay recoverable error:', e, i)\n }\n />,\n overlayContainer\n )}\n </>\n )\n}\n", "'use client'\n\nimport type React from 'react'\n\nimport {useEffect, useState} from 'react'\nimport {X} from 'lucide-react'\n\ninterface ErrorInfo {\n componentStack?: string\n digest?: string\n}\n\ninterface DevErrorOverlayProps {\n error: Error\n errorInfo: ErrorInfo\n errorType: 'caught' | 'uncaught' | 'recoverable' | 'identifier'\n onCaughtError?: (error: Error, errorInfo: ErrorInfo) => void\n onUncaughtError?: (error: Error, errorInfo: ErrorInfo) => void\n onRecoverableError?: (error: Error, errorInfo: ErrorInfo) => void\n identifierPrefix?: string\n onDismiss?: () => void\n logo?: React.ReactNode | string\n}\n\nexport default function DevErrorOverlay({\n error,\n errorInfo,\n errorType,\n onCaughtError,\n onUncaughtError,\n onRecoverableError,\n identifierPrefix,\n onDismiss,\n logo\n}: DevErrorOverlayProps) {\n const [isVisible, setIsVisible] = useState(true)\n\n // Call the appropriate callback based on error type\n useEffect(() => {\n if (errorType === 'caught' && onCaughtError) {\n onCaughtError(error, errorInfo)\n } else if (errorType === 'uncaught' && onUncaughtError) {\n onUncaughtError(error, errorInfo)\n } else if (errorType === 'recoverable' && onRecoverableError) {\n onRecoverableError(error, errorInfo)\n }\n }, [\n error,\n errorInfo,\n errorType,\n onCaughtError,\n onUncaughtError,\n onRecoverableError\n ])\n\n const handleDismiss = () => {\n setIsVisible(false)\n if (onDismiss) onDismiss()\n }\n\n if (!isVisible || !error) {\n return null\n }\n\n const getErrorTypeLabel = () => {\n switch (errorType) {\n case 'caught':\n return 'Error Boundary Caught Error'\n case 'uncaught':\n return 'Uncaught Error'\n case 'recoverable':\n return 'Recoverable Error'\n case 'identifier':\n return 'Identifier Prefix Error'\n default:\n return 'Runtime Error'\n }\n }\n\n const getErrorTypeDescription = () => {\n switch (errorType) {\n case 'caught':\n return 'This error was caught by a React Error Boundary.'\n case 'uncaught':\n return 'This error was not caught by any Error Boundary and crashed your application.'\n case 'recoverable':\n return 'React automatically recovered from this error, but you should still fix it.'\n case 'identifier':\n return `Identifier prefix mismatch. Expected prefix: \"${identifierPrefix}\".`\n default:\n return 'An unexpected error occurred during runtime.'\n }\n }\n\n const getErrorBorderColor = () => {\n switch (errorType) {\n case 'caught':\n return 'border-yellow-600'\n case 'uncaught':\n return 'border-red-600'\n case 'recoverable':\n return 'border-blue-600'\n case 'identifier':\n return 'border-purple-600'\n default:\n return 'border-red-600'\n }\n }\n\n return (\n <div className=\"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 overflow-y-auto p-4 flex items-start justify-center\">\n <link\n rel=\"stylesheet\"\n href=\"/__pylon/static/pylon.css\"\n precedence=\"high\"\n />\n <div\n className={`w-full max-w-3xl bg-black border ${getErrorBorderColor()} rounded-lg mt-16 overflow-hidden text-white font-sans`}>\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-neutral-800 p-4\">\n <div className=\"flex items-center gap-3\">\n {logo && (\n <div className=\"flex-shrink-0\">\n {typeof logo === 'string' ? (\n <img\n src={logo || '/placeholder.svg'}\n alt=\"Error Overlay Logo\"\n className=\"h-8 w-auto\"\n />\n ) : (\n logo\n )}\n </div>\n )}\n <div>\n <h1 className=\"text-xl font-medium text-red-500\">\n {getErrorTypeLabel()}\n </h1>\n </div>\n </div>\n <button\n onClick={handleDismiss}\n className=\"p-2 rounded-full hover:bg-neutral-800 transition-colors\"\n aria-label=\"Dismiss error overlay\">\n <X className=\"h-5 w-5 text-neutral-400\" />\n </button>\n </div>\n\n {/* Error Message */}\n <div className=\"p-4\">\n <div className=\"mb-4 text-neutral-400\">\n {getErrorTypeDescription()}\n </div>\n\n <h2 className=\"text-2xl font-bold mb-4 text-white\">\n {error.message || 'An unexpected error has occurred'}\n </h2>\n\n {!!error.cause && (\n <div className=\"mb-4\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2\">\n Cause\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-3 text-neutral-300\">\n {String(error.cause)}\n </div>\n </div>\n )}\n </div>\n\n {/* Component Stack */}\n {errorInfo?.componentStack && (\n <div className=\"p-4 border-t border-neutral-800\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3\">\n Component Stack\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-4 overflow-x-auto\">\n <pre className=\"font-mono text-sm text-neutral-300 whitespace-pre-wrap\">\n {errorInfo.componentStack}\n </pre>\n </div>\n </div>\n )}\n\n {/* Call Stack */}\n <div className=\"p-4 border-t border-neutral-800\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3\">\n Call Stack\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-4 overflow-x-auto\">\n <pre className=\"font-mono text-sm text-neutral-300 whitespace-pre-wrap\">\n {error.stack || 'No stack trace available'}\n </pre>\n </div>\n </div>\n\n {/* Actions */}\n <div className=\"p-4 border-t border-neutral-800 flex justify-between\">\n <div>\n {errorType === 'recoverable' && (\n <span className=\"text-blue-400 text-sm\">\n React automatically recovered from this error\n </span>\n )}\n </div>\n <div className=\"flex gap-3\">\n <button\n onClick={handleDismiss}\n className=\"bg-neutral-800 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-700 transition-colors\">\n Dismiss\n </button>\n <button\n onClick={() => window.location.reload()}\n className=\"bg-white text-black px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-200 transition-colors\">\n Reload Page\n </button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n", "'use client'\n\nimport type React from 'react'\nimport {Component, type ErrorInfo as ReactErrorInfo} from 'react'\nimport {onCaughtErrorProd} from './report-error'\nimport type {ErrorInfo} from './types'\n\ninterface ErrorBoundaryProps {\n children: React.ReactNode\n fallback?: React.ReactNode\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean\n}\n\nexport class ErrorBoundary extends Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = {hasError: false}\n }\n\n static getDerivedStateFromError(_: Error): ErrorBoundaryState {\n // Update state so the next render will show the fallback UI\n return {hasError: true}\n }\n\n componentDidCatch(error: Error, errorInfo: ReactErrorInfo): void {\n // Convert React's errorInfo to our ErrorInfo format\n const customErrorInfo: ErrorInfo = {\n componentStack: errorInfo.componentStack\n }\n\n // Report the error to our error reporting system\n onCaughtErrorProd(error, customErrorInfo)\n\n // You can also log the error to an error reporting service\n console.error('Error caught by boundary:', error, errorInfo)\n }\n\n render(): React.ReactNode {\n if (this.state.hasError) {\n // You can render any custom fallback UI\n return this.props.fallback || null\n }\n\n return this.props.children\n }\n}\n", "import {useEffect} from 'react'\nimport Logo from '@/components/logo'\nimport {Button} from '@/components/ui/button'\n\ninterface GlobalErrorProps {\n error: Error & {digest?: string}\n}\n\nexport default function GlobalError({error, ...rest}: GlobalErrorProps) {\n useEffect(() => {\n // Log the error to an error reporting service\n console.error('Global error:', error)\n }, [error])\n\n const reset = () => {\n window.location.reload()\n }\n\n return (\n <html lang=\"en\">\n <head>\n <meta charSet=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link\n rel=\"stylesheet\"\n href=\"/__pylon/static/pylon.css\"\n precedence=\"high\"\n />\n </head>\n <body>\n <div className=\"fixed inset-0 bg-black/90 z-50 overflow-y-auto p-4 flex items-center justify-center\">\n <div className=\"w-full max-w-3xl bg-black border border-red-600 rounded-lg overflow-hidden text-white font-sans\">\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-neutral-800 p-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex-shrink-0\">\n <Logo className=\"h-8 w-auto text-white\" />\n </div>\n <div>\n <h1 className=\"text-xl font-medium text-red-500\">\n Application Crashed\n </h1>\n </div>\n </div>\n </div>\n\n {/* Error Message */}\n <div className=\"p-4\">\n <div className=\"mb-4 text-neutral-400\">\n The application encountered a critical error and could not\n continue.\n </div>\n\n <h2 className=\"text-2xl font-bold mb-4 text-white\">\n {error.message || 'A critical error occurred'}\n </h2>\n\n {error.digest && (\n <div className=\"mb-4\">\n <h3 className=\"text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2\">\n Error ID\n </h3>\n <div className=\"bg-neutral-900 rounded-md p-3 text-neutral-300 font-mono\">\n {error.digest}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </body>\n </html>\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA,YAAY,yCAAyC;;;ACArD;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,eAAe,kBAAiB;AAWpC;AATJ,IAAM,oBAAoB,cAEhB,IAAI;AAEd,IAAM,qBAGD,CAAC,EAAC,UAAU,OAAM,MAAM;AAC3B,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAC,OAAM,GACvC,UACH;AAEJ;AAEA,IAAM,gBAAgB,MAAM;AAC1B,QAAM,UAAU,WAAW,iBAAiB;AAE5C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,wDAAw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|
+
"names": ["jsx", "jsx", "jsx", "jsxs", "useEffect", "useState", "jsx", "jsxs", "Fragment", "jsx", "jsxs", "useState", "useEffect", "useEffect", "jsx", "jsxs", "useEffect"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Builds the route configuration and outputs the generated code.
|
|
3
|
+
* @returns The complete file content as a string.
|
|
4
|
+
*/
|
|
5
|
+
export declare function makeAppFiles(): {
|
|
6
|
+
routes: string;
|
|
7
|
+
slugs: string;
|
|
5
8
|
};
|
|
6
|
-
export declare function getPageRoutes(dir?: string): Promise<PageRoute[]>;
|
|
7
|
-
export declare const generateAppFile: (pageRoutes: PageRoute[]) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcronit/pylon",
|
|
3
|
-
"version": "3.0.0-canary-
|
|
3
|
+
"version": "3.0.0-canary-20250407115039.56009eb223a513a3bc338c169e69e23adc1bad96",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PageProps } from '..';
|
|
3
|
-
export declare const AppLoader: (props: {
|
|
4
|
-
client: any;
|
|
5
|
-
pylonData: {
|
|
6
|
-
cacheSnapshot?: any;
|
|
7
|
-
};
|
|
8
|
-
App: React.FC<{
|
|
9
|
-
data: PageProps["data"];
|
|
10
|
-
}>;
|
|
11
|
-
Router: React.FC<any>;
|
|
12
|
-
routerProps: any;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|