@getcronit/pylon 3.0.0-canary-20250312165655.826d17474bf64dfdbd9e31dd76e4f3898d48a6d1 → 3.0.0-canary-20250313071016.ae6b1c56cc44cc99648aaee747ea420a05ed0f84
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/components/dev-overlay/dev-error-overlay.d.ts +18 -0
- package/dist/components/dev-overlay/dev-overlay-provider.d.ts +7 -0
- package/dist/components/dev-overlay/error-boundary.d.ts +16 -0
- package/dist/components/dev-overlay/index.d.ts +2 -0
- package/dist/components/dev-overlay/report-error.d.ts +14 -0
- package/dist/components/dev-overlay/types.d.ts +10 -0
- package/dist/components/global-error-page.d.ts +7 -0
- package/dist/components/logo.d.ts +4 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +985 -1
- package/dist/index.js.map +4 -4
- package/dist/lib/utils.d.ts +2 -0
- package/dist/pages/image.d.ts +10 -0
- package/dist/pages/index.css +1400 -0
- package/dist/pages/index.css.map +7 -0
- package/dist/pages/index.d.ts +5 -1
- package/dist/pages/index.js +483 -1
- package/dist/pages/index.js.map +4 -4
- package/dist/plugins/use-pages/build/app-utils.d.ts +7 -0
- package/dist/plugins/use-pages/build/index.d.ts +2 -0
- package/dist/plugins/use-pages/build/plugins/image-plugin.d.ts +2 -0
- package/dist/plugins/use-pages/build/plugins/inject-app-hydration.d.ts +2 -0
- package/dist/plugins/use-pages/build/plugins/postcss-plugin.d.ts +2 -0
- package/dist/plugins/use-pages/index.d.ts +4 -0
- package/dist/plugins/use-pages/setup/app-loader.d.ts +14 -0
- package/dist/plugins/use-pages/setup/index.d.ts +10 -0
- package/package.json +38 -3
package/dist/pages/index.js
CHANGED
|
@@ -1,3 +1,485 @@
|
|
|
1
1
|
// src/pages/index.ts
|
|
2
|
-
|
|
2
|
+
import * as __PYLON_ROUTER_INTERNALS_DO_NOT_USE from "react-router";
|
|
3
|
+
|
|
4
|
+
// src/pages/image.tsx
|
|
5
|
+
import { useState, useEffect, useMemo, useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var usePylonImageValues = (props) => {
|
|
8
|
+
return useMemo(() => {
|
|
9
|
+
const url = new URL(props.src, "http://localhost");
|
|
10
|
+
const searchParams = new URLSearchParams(url.search);
|
|
11
|
+
const getValue = (propValue, paramKey) => propValue ?? searchParams.get(paramKey);
|
|
12
|
+
const width = getValue(props.width, "w");
|
|
13
|
+
const height = getValue(props.height, "h");
|
|
14
|
+
const blurDataURL = getValue(props.blurDataURL, "blurDataURL");
|
|
15
|
+
const pylonMediaSearchParams = new URLSearchParams({
|
|
16
|
+
src: url.pathname,
|
|
17
|
+
...width && { w: width.toString() },
|
|
18
|
+
...height && { h: height.toString() }
|
|
19
|
+
});
|
|
20
|
+
const finalSrc = `/__pylon/image?${pylonMediaSearchParams.toString()}`;
|
|
21
|
+
return {
|
|
22
|
+
width: width ? parseInt(width) : void 0,
|
|
23
|
+
height: height ? parseInt(height) : void 0,
|
|
24
|
+
blurDataURL,
|
|
25
|
+
src: finalSrc
|
|
26
|
+
};
|
|
27
|
+
}, [props]);
|
|
28
|
+
};
|
|
29
|
+
var Image = (props) => {
|
|
30
|
+
const values = usePylonImageValues(props);
|
|
31
|
+
const [isLoaded, setIsLoaded] = useState(false);
|
|
32
|
+
const imgRef = useRef(null);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (imgRef.current?.complete) {
|
|
35
|
+
setIsLoaded(true);
|
|
36
|
+
}
|
|
37
|
+
}, [imgRef.current]);
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"img",
|
|
40
|
+
{
|
|
41
|
+
ref: imgRef,
|
|
42
|
+
src: values.src,
|
|
43
|
+
alt: props.alt,
|
|
44
|
+
className: props.className,
|
|
45
|
+
width: values.width,
|
|
46
|
+
height: values.height,
|
|
47
|
+
onLoad: () => setIsLoaded(true),
|
|
48
|
+
style: {
|
|
49
|
+
backgroundImage: `url(${values.blurDataURL})`,
|
|
50
|
+
backgroundSize: "cover",
|
|
51
|
+
filter: !isLoaded ? "blur(5px)" : "none",
|
|
52
|
+
transition: "filter 0.3s ease-out, opacity 0.3s ease-out"
|
|
53
|
+
},
|
|
54
|
+
loading: "lazy"
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/components/dev-overlay/report-error.ts
|
|
60
|
+
var errorStore = {
|
|
61
|
+
error: null,
|
|
62
|
+
errorInfo: null,
|
|
63
|
+
errorType: null,
|
|
64
|
+
listeners: /* @__PURE__ */ new Set()
|
|
65
|
+
};
|
|
66
|
+
function reportError(error, errorInfo, errorType) {
|
|
67
|
+
errorStore.error = error;
|
|
68
|
+
errorStore.errorInfo = errorInfo;
|
|
69
|
+
errorStore.errorType = errorType;
|
|
70
|
+
const data = {
|
|
71
|
+
error: errorStore.error,
|
|
72
|
+
errorInfo: errorStore.errorInfo,
|
|
73
|
+
errorType: errorStore.errorType
|
|
74
|
+
};
|
|
75
|
+
errorStore.listeners.forEach((listener) => {
|
|
76
|
+
listener(data);
|
|
77
|
+
});
|
|
78
|
+
if (true) {
|
|
79
|
+
console.error(`[${errorType} error]:`, error);
|
|
80
|
+
if (errorInfo.componentStack) {
|
|
81
|
+
console.error("Component stack:", errorInfo.componentStack);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function clearError() {
|
|
86
|
+
errorStore.error = null;
|
|
87
|
+
errorStore.errorInfo = null;
|
|
88
|
+
errorStore.errorType = null;
|
|
89
|
+
const data = {
|
|
90
|
+
error: null,
|
|
91
|
+
errorInfo: null,
|
|
92
|
+
errorType: null
|
|
93
|
+
};
|
|
94
|
+
errorStore.listeners.forEach((listener) => {
|
|
95
|
+
listener(data);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function subscribeToErrors(callback) {
|
|
99
|
+
errorStore.listeners.add(callback);
|
|
100
|
+
return () => {
|
|
101
|
+
errorStore.listeners.delete(callback);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function getCurrentError() {
|
|
105
|
+
return {
|
|
106
|
+
error: errorStore.error,
|
|
107
|
+
errorInfo: errorStore.errorInfo,
|
|
108
|
+
errorType: errorStore.errorType
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
var onCaughtErrorProd = (error, errorInfo) => {
|
|
112
|
+
reportError(error, errorInfo, "caught");
|
|
113
|
+
};
|
|
114
|
+
var onUncaughtErrorProd = (error, errorInfo) => {
|
|
115
|
+
reportError(error, errorInfo, "uncaught");
|
|
116
|
+
};
|
|
117
|
+
var onRecoverableErrorProd = (error, errorInfo) => {
|
|
118
|
+
reportError(error, errorInfo, "recoverable");
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// src/lib/utils.ts
|
|
122
|
+
import { clsx } from "clsx";
|
|
123
|
+
import { twMerge } from "tailwind-merge";
|
|
124
|
+
function cn(...inputs) {
|
|
125
|
+
return twMerge(clsx(inputs));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/components/logo.tsx
|
|
129
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
130
|
+
var Logo = (props) => {
|
|
131
|
+
return /* @__PURE__ */ jsxs(
|
|
132
|
+
"svg",
|
|
133
|
+
{
|
|
134
|
+
className: cn("h-12 w-auto", props.className),
|
|
135
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
136
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
137
|
+
zoomAndPan: "magnify",
|
|
138
|
+
viewBox: "0 0 286.5 121.500001",
|
|
139
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
140
|
+
version: "1.0",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
143
|
+
/* @__PURE__ */ jsx2("g", {}),
|
|
144
|
+
/* @__PURE__ */ jsx2("clipPath", { id: "38f6fcde47", children: /* @__PURE__ */ jsx2(
|
|
145
|
+
"path",
|
|
146
|
+
{
|
|
147
|
+
d: "M 0.339844 42 L 10 42 L 10 79 L 0.339844 79 Z M 0.339844 42 ",
|
|
148
|
+
clipRule: "nonzero"
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
/* @__PURE__ */ jsx2("clipPath", { id: "af000f7256", children: /* @__PURE__ */ jsx2(
|
|
152
|
+
"path",
|
|
153
|
+
{
|
|
154
|
+
d: "M 64 23.925781 L 72.789062 23.925781 L 72.789062 96.378906 L 64 96.378906 Z M 64 23.925781 ",
|
|
155
|
+
clipRule: "nonzero"
|
|
156
|
+
}
|
|
157
|
+
) })
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx2("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx2("g", { transform: "translate(107.11969, 78.49768)", children: /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("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 " }) }) }) }),
|
|
160
|
+
/* @__PURE__ */ jsx2("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx2("g", { transform: "translate(143.259256, 78.49768)", children: /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("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 " }) }) }) }),
|
|
161
|
+
/* @__PURE__ */ jsx2("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx2("g", { transform: "translate(174.281707, 78.49768)", children: /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("path", { d: "M 10.078125 -39.4375 L 10.078125 0 L 4 0 L 4 -39.4375 Z M 10.078125 -39.4375 " }) }) }) }),
|
|
162
|
+
/* @__PURE__ */ jsx2("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx2("g", { transform: "translate(188.353752, 78.49768)", children: /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("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 " }) }) }) }),
|
|
163
|
+
/* @__PURE__ */ jsx2("g", { fill: "currentColor", fillOpacity: "1", children: /* @__PURE__ */ jsx2("g", { transform: "translate(222.361196, 78.49768)", children: /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("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 " }) }) }) }),
|
|
164
|
+
/* @__PURE__ */ jsx2(
|
|
165
|
+
"path",
|
|
166
|
+
{
|
|
167
|
+
fill: "currentColor",
|
|
168
|
+
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 ",
|
|
169
|
+
fillOpacity: "1",
|
|
170
|
+
fillRule: "nonzero"
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ jsx2("g", { clipPath: "url(#38f6fcde47)", children: /* @__PURE__ */ jsx2(
|
|
174
|
+
"path",
|
|
175
|
+
{
|
|
176
|
+
fill: "currentColor",
|
|
177
|
+
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 ",
|
|
178
|
+
fillOpacity: "1",
|
|
179
|
+
fillRule: "nonzero"
|
|
180
|
+
}
|
|
181
|
+
) }),
|
|
182
|
+
/* @__PURE__ */ jsx2("g", { clipPath: "url(#af000f7256)", children: /* @__PURE__ */ jsx2(
|
|
183
|
+
"path",
|
|
184
|
+
{
|
|
185
|
+
fill: "currentColor",
|
|
186
|
+
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 ",
|
|
187
|
+
fillOpacity: "1",
|
|
188
|
+
fillRule: "nonzero"
|
|
189
|
+
}
|
|
190
|
+
) }),
|
|
191
|
+
/* @__PURE__ */ jsx2(
|
|
192
|
+
"path",
|
|
193
|
+
{
|
|
194
|
+
fill: "currentColor",
|
|
195
|
+
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 ",
|
|
196
|
+
fillOpacity: "1",
|
|
197
|
+
fillRule: "nonzero"
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ jsx2(
|
|
201
|
+
"path",
|
|
202
|
+
{
|
|
203
|
+
fill: "currentColor",
|
|
204
|
+
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 ",
|
|
205
|
+
fillOpacity: "1",
|
|
206
|
+
fillRule: "nonzero"
|
|
207
|
+
}
|
|
208
|
+
),
|
|
209
|
+
/* @__PURE__ */ jsx2(
|
|
210
|
+
"path",
|
|
211
|
+
{
|
|
212
|
+
fill: "currentColor",
|
|
213
|
+
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 ",
|
|
214
|
+
fillOpacity: "1",
|
|
215
|
+
fillRule: "nonzero"
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
var logo_default = Logo;
|
|
223
|
+
|
|
224
|
+
// src/components/dev-overlay/dev-overlay-provider.tsx
|
|
225
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
226
|
+
import { createPortal } from "react-dom";
|
|
227
|
+
|
|
228
|
+
// src/components/dev-overlay/dev-error-overlay.tsx
|
|
229
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
230
|
+
import { X } from "lucide-react";
|
|
231
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
232
|
+
function DevErrorOverlay({
|
|
233
|
+
error,
|
|
234
|
+
errorInfo,
|
|
235
|
+
errorType,
|
|
236
|
+
onCaughtError,
|
|
237
|
+
onUncaughtError,
|
|
238
|
+
onRecoverableError,
|
|
239
|
+
identifierPrefix,
|
|
240
|
+
onDismiss,
|
|
241
|
+
logo
|
|
242
|
+
}) {
|
|
243
|
+
const [isVisible, setIsVisible] = useState2(true);
|
|
244
|
+
useEffect2(() => {
|
|
245
|
+
if (errorType === "caught" && onCaughtError) {
|
|
246
|
+
onCaughtError(error, errorInfo);
|
|
247
|
+
} else if (errorType === "uncaught" && onUncaughtError) {
|
|
248
|
+
onUncaughtError(error, errorInfo);
|
|
249
|
+
} else if (errorType === "recoverable" && onRecoverableError) {
|
|
250
|
+
onRecoverableError(error, errorInfo);
|
|
251
|
+
}
|
|
252
|
+
}, [
|
|
253
|
+
error,
|
|
254
|
+
errorInfo,
|
|
255
|
+
errorType,
|
|
256
|
+
onCaughtError,
|
|
257
|
+
onUncaughtError,
|
|
258
|
+
onRecoverableError
|
|
259
|
+
]);
|
|
260
|
+
const handleDismiss = () => {
|
|
261
|
+
setIsVisible(false);
|
|
262
|
+
if (onDismiss) onDismiss();
|
|
263
|
+
};
|
|
264
|
+
if (!isVisible || !error) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
const getErrorTypeLabel = () => {
|
|
268
|
+
switch (errorType) {
|
|
269
|
+
case "caught":
|
|
270
|
+
return "Error Boundary Caught Error";
|
|
271
|
+
case "uncaught":
|
|
272
|
+
return "Uncaught Error";
|
|
273
|
+
case "recoverable":
|
|
274
|
+
return "Recoverable Error";
|
|
275
|
+
case "identifier":
|
|
276
|
+
return "Identifier Prefix Error";
|
|
277
|
+
default:
|
|
278
|
+
return "Runtime Error";
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const getErrorTypeDescription = () => {
|
|
282
|
+
switch (errorType) {
|
|
283
|
+
case "caught":
|
|
284
|
+
return "This error was caught by a React Error Boundary.";
|
|
285
|
+
case "uncaught":
|
|
286
|
+
return "This error was not caught by any Error Boundary and crashed your application.";
|
|
287
|
+
case "recoverable":
|
|
288
|
+
return "React automatically recovered from this error, but you should still fix it.";
|
|
289
|
+
case "identifier":
|
|
290
|
+
return `Identifier prefix mismatch. Expected prefix: "${identifierPrefix}".`;
|
|
291
|
+
default:
|
|
292
|
+
return "An unexpected error occurred during runtime.";
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const getErrorBorderColor = () => {
|
|
296
|
+
switch (errorType) {
|
|
297
|
+
case "caught":
|
|
298
|
+
return "border-yellow-600";
|
|
299
|
+
case "uncaught":
|
|
300
|
+
return "border-red-600";
|
|
301
|
+
case "recoverable":
|
|
302
|
+
return "border-blue-600";
|
|
303
|
+
case "identifier":
|
|
304
|
+
return "border-purple-600";
|
|
305
|
+
default:
|
|
306
|
+
return "border-red-600";
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
return /* @__PURE__ */ jsxs2("div", { className: "fixed inset-0 bg-black/80 backdrop-blur-sm z-50 overflow-y-auto p-4 flex items-start justify-center", children: [
|
|
310
|
+
/* @__PURE__ */ jsx3(
|
|
311
|
+
"link",
|
|
312
|
+
{
|
|
313
|
+
rel: "stylesheet",
|
|
314
|
+
href: "/__pylon/static/pylon.css",
|
|
315
|
+
precedence: "high"
|
|
316
|
+
}
|
|
317
|
+
),
|
|
318
|
+
/* @__PURE__ */ jsxs2(
|
|
319
|
+
"div",
|
|
320
|
+
{
|
|
321
|
+
className: `w-full max-w-3xl bg-black border ${getErrorBorderColor()} rounded-lg mt-16 overflow-hidden text-white font-sans`,
|
|
322
|
+
children: [
|
|
323
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between border-b border-neutral-800 p-4", children: [
|
|
324
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-3", children: [
|
|
325
|
+
logo && /* @__PURE__ */ jsx3("div", { className: "flex-shrink-0", children: typeof logo === "string" ? /* @__PURE__ */ jsx3(
|
|
326
|
+
"img",
|
|
327
|
+
{
|
|
328
|
+
src: logo || "/placeholder.svg",
|
|
329
|
+
alt: "Error Overlay Logo",
|
|
330
|
+
className: "h-8 w-auto"
|
|
331
|
+
}
|
|
332
|
+
) : logo }),
|
|
333
|
+
/* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3("h1", { className: "text-xl font-medium text-red-500", children: getErrorTypeLabel() }) })
|
|
334
|
+
] }),
|
|
335
|
+
/* @__PURE__ */ jsx3(
|
|
336
|
+
"button",
|
|
337
|
+
{
|
|
338
|
+
onClick: handleDismiss,
|
|
339
|
+
className: "p-2 rounded-full hover:bg-neutral-800 transition-colors",
|
|
340
|
+
"aria-label": "Dismiss error overlay",
|
|
341
|
+
children: /* @__PURE__ */ jsx3(X, { className: "h-5 w-5 text-neutral-400" })
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] }),
|
|
345
|
+
/* @__PURE__ */ jsxs2("div", { className: "p-4", children: [
|
|
346
|
+
/* @__PURE__ */ jsx3("div", { className: "mb-4 text-neutral-400", children: getErrorTypeDescription() }),
|
|
347
|
+
/* @__PURE__ */ jsx3("h2", { className: "text-2xl font-bold mb-4 text-white", children: error.message || "An unexpected error has occurred" }),
|
|
348
|
+
!!error.cause && /* @__PURE__ */ jsxs2("div", { className: "mb-4", children: [
|
|
349
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-2", children: "Cause" }),
|
|
350
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-neutral-900 rounded-md p-3 text-neutral-300", children: String(error.cause) })
|
|
351
|
+
] })
|
|
352
|
+
] }),
|
|
353
|
+
errorInfo?.componentStack && /* @__PURE__ */ jsxs2("div", { className: "p-4 border-t border-neutral-800", children: [
|
|
354
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3", children: "Component Stack" }),
|
|
355
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-neutral-900 rounded-md p-4 overflow-x-auto", children: /* @__PURE__ */ jsx3("pre", { className: "font-mono text-sm text-neutral-300 whitespace-pre-wrap", children: errorInfo.componentStack }) })
|
|
356
|
+
] }),
|
|
357
|
+
/* @__PURE__ */ jsxs2("div", { className: "p-4 border-t border-neutral-800", children: [
|
|
358
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-sm uppercase tracking-wider text-neutral-500 font-medium mb-3", children: "Call Stack" }),
|
|
359
|
+
/* @__PURE__ */ jsx3("div", { className: "bg-neutral-900 rounded-md p-4 overflow-x-auto", children: /* @__PURE__ */ jsx3("pre", { className: "font-mono text-sm text-neutral-300 whitespace-pre-wrap", children: error.stack || "No stack trace available" }) })
|
|
360
|
+
] }),
|
|
361
|
+
/* @__PURE__ */ jsxs2("div", { className: "p-4 border-t border-neutral-800 flex justify-between", children: [
|
|
362
|
+
/* @__PURE__ */ jsx3("div", { children: errorType === "recoverable" && /* @__PURE__ */ jsx3("span", { className: "text-blue-400 text-sm", children: "React automatically recovered from this error" }) }),
|
|
363
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex gap-3", children: [
|
|
364
|
+
/* @__PURE__ */ jsx3(
|
|
365
|
+
"button",
|
|
366
|
+
{
|
|
367
|
+
onClick: handleDismiss,
|
|
368
|
+
className: "bg-neutral-800 text-white px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-700 transition-colors",
|
|
369
|
+
children: "Dismiss"
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsx3(
|
|
373
|
+
"button",
|
|
374
|
+
{
|
|
375
|
+
onClick: () => window.location.reload(),
|
|
376
|
+
className: "bg-white text-black px-4 py-2 rounded-md text-sm font-medium hover:bg-neutral-200 transition-colors",
|
|
377
|
+
children: "Reload Page"
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
] })
|
|
381
|
+
] })
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
] });
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// src/components/dev-overlay/error-boundary.tsx
|
|
389
|
+
import { Component } from "react";
|
|
390
|
+
var ErrorBoundary = class extends Component {
|
|
391
|
+
constructor(props) {
|
|
392
|
+
super(props);
|
|
393
|
+
this.state = { hasError: false };
|
|
394
|
+
}
|
|
395
|
+
static getDerivedStateFromError(_) {
|
|
396
|
+
return { hasError: true };
|
|
397
|
+
}
|
|
398
|
+
componentDidCatch(error, errorInfo) {
|
|
399
|
+
const customErrorInfo = {
|
|
400
|
+
componentStack: errorInfo.componentStack
|
|
401
|
+
};
|
|
402
|
+
onCaughtErrorProd(error, customErrorInfo);
|
|
403
|
+
console.error("Error caught by boundary:", error, errorInfo);
|
|
404
|
+
}
|
|
405
|
+
render() {
|
|
406
|
+
if (this.state.hasError) {
|
|
407
|
+
return this.props.fallback || null;
|
|
408
|
+
}
|
|
409
|
+
return this.props.children;
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
// src/components/dev-overlay/dev-overlay-provider.tsx
|
|
414
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
415
|
+
function DevOverlayProvider({
|
|
416
|
+
children,
|
|
417
|
+
identifierPrefix
|
|
418
|
+
}) {
|
|
419
|
+
const [error, setError] = useState3(null);
|
|
420
|
+
const [errorInfo, setErrorInfo] = useState3(null);
|
|
421
|
+
const [errorType, setErrorType] = useState3(null);
|
|
422
|
+
const [overlayContainer, setOverlayContainer] = useState3(
|
|
423
|
+
null
|
|
424
|
+
);
|
|
425
|
+
useEffect3(() => {
|
|
426
|
+
const currentError = getCurrentError();
|
|
427
|
+
if (currentError.error) {
|
|
428
|
+
setError(currentError.error);
|
|
429
|
+
setErrorInfo(currentError.errorInfo);
|
|
430
|
+
setErrorType(currentError.errorType);
|
|
431
|
+
}
|
|
432
|
+
const container = document.createElement("div");
|
|
433
|
+
container.id = "dev-error-overlay-container";
|
|
434
|
+
document.body.appendChild(container);
|
|
435
|
+
setOverlayContainer(container);
|
|
436
|
+
const unsubscribe = subscribeToErrors((data) => {
|
|
437
|
+
setError(data.error);
|
|
438
|
+
setErrorInfo(data.errorInfo);
|
|
439
|
+
setErrorType(data.errorType);
|
|
440
|
+
});
|
|
441
|
+
return () => {
|
|
442
|
+
unsubscribe();
|
|
443
|
+
document.body.removeChild(container);
|
|
444
|
+
};
|
|
445
|
+
}, []);
|
|
446
|
+
const handleDismiss = () => {
|
|
447
|
+
clearError();
|
|
448
|
+
setError(null);
|
|
449
|
+
setErrorInfo(null);
|
|
450
|
+
setErrorType(null);
|
|
451
|
+
};
|
|
452
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
453
|
+
/* @__PURE__ */ jsx4(ErrorBoundary, { children }),
|
|
454
|
+
overlayContainer && error && errorInfo && errorType && createPortal(
|
|
455
|
+
/* @__PURE__ */ jsx4(
|
|
456
|
+
DevErrorOverlay,
|
|
457
|
+
{
|
|
458
|
+
logo: /* @__PURE__ */ jsx4(logo_default, {}),
|
|
459
|
+
error,
|
|
460
|
+
errorInfo,
|
|
461
|
+
errorType,
|
|
462
|
+
onDismiss: handleDismiss,
|
|
463
|
+
identifierPrefix,
|
|
464
|
+
onCaughtError: (e, i) => console.log("Overlay caught error:", e, i),
|
|
465
|
+
onUncaughtError: (e, i) => console.log("Overlay uncaught error:", e, i),
|
|
466
|
+
onRecoverableError: (e, i) => console.log("Overlay recoverable error:", e, i)
|
|
467
|
+
}
|
|
468
|
+
),
|
|
469
|
+
overlayContainer
|
|
470
|
+
)
|
|
471
|
+
] });
|
|
472
|
+
}
|
|
473
|
+
export {
|
|
474
|
+
DevOverlayProvider as DevOverlay,
|
|
475
|
+
Image,
|
|
476
|
+
__PYLON_ROUTER_INTERNALS_DO_NOT_USE,
|
|
477
|
+
clearError,
|
|
478
|
+
getCurrentError,
|
|
479
|
+
onCaughtErrorProd,
|
|
480
|
+
onRecoverableErrorProd,
|
|
481
|
+
onUncaughtErrorProd,
|
|
482
|
+
reportError,
|
|
483
|
+
subscribeToErrors
|
|
484
|
+
};
|
|
3
485
|
//# sourceMappingURL=index.js.map
|
package/dist/pages/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/pages/index.ts"],
|
|
4
|
-
"sourcesContent": ["// @ts-ignore\nexport * from '@getcronit/pylon-pages/browser'\n"],
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/pages/index.ts", "../../src/pages/image.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'\n\nexport {type PageProps, type PageData} from '@/plugins/use-pages'\nexport * from '@/components/dev-overlay'\n\nimport '../globals.css'\n", "import React, {useState, useEffect, useMemo, useRef} from 'react'\n\nexport interface ImageProps {\n src: string\n alt?: string\n className?: 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: ImageProps\n): {\n src: string\n width?: number\n height?: number\n blurDataURL?: string\n} => {\n return useMemo(() => {\n // Parse the image source URL to extract query parameters\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: url.pathname,\n ...(width && {w: width.toString()}),\n ...(height && {h: height.toString()})\n })\n\n // Construct the final image source URL\n const finalSrc = `/__pylon/image?${pylonMediaSearchParams.toString()}`\n\n return {\n width: width ? parseInt(width) : undefined,\n height: height ? parseInt(height) : undefined,\n blurDataURL,\n src: finalSrc\n }\n }, [props])\n}\n\nexport const Image: React.FC<ImageProps> = props => {\n const values = usePylonImageValues(props)\n const [isLoaded, setIsLoaded] = useState(false)\n const imgRef = useRef<HTMLImageElement | null>(null)\n\n useEffect(() => {\n if (imgRef.current?.complete) {\n setIsLoaded(true)\n }\n }, [imgRef.current])\n\n return (\n <img\n ref={imgRef}\n src={values.src}\n alt={props.alt}\n className={props.className}\n width={values.width}\n height={values.height}\n onLoad={() => setIsLoaded(true)}\n style={{\n backgroundImage: `url(${values.blurDataURL})`,\n backgroundSize: 'cover',\n filter: !isLoaded ? 'blur(5px)' : 'none',\n transition: 'filter 0.3s ease-out, opacity 0.3s ease-out'\n }}\n loading=\"lazy\"\n />\n )\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,UAAU,WAAW,SAAS,cAAa;AAsEtD;AAnDJ,IAAM,sBAAsB,CAC1B,UAMG;AACH,SAAO,QAAQ,MAAM;AAEnB,UAAM,MAAM,IAAI,IAAI,MAAM,KAAK,kBAAkB;AACjD,UAAM,eAAe,IAAI,gBAAgB,IAAI,MAAM;AAGnD,UAAM,WAAW,CAAC,WAAW,aAC3B,aAAa,aAAa,IAAI,QAAQ;AACxC,UAAM,QAAQ,SAAS,MAAM,OAAO,GAAG;AACvC,UAAM,SAAS,SAAS,MAAM,QAAQ,GAAG;AACzC,UAAM,cAAc,SAAS,MAAM,aAAa,aAAa;AAG7D,UAAM,yBAAyB,IAAI,gBAAgB;AAAA,MACjD,KAAK,IAAI;AAAA,MACT,GAAI,SAAS,EAAC,GAAG,MAAM,SAAS,EAAC;AAAA,MACjC,GAAI,UAAU,EAAC,GAAG,OAAO,SAAS,EAAC;AAAA,IACrC,CAAC;AAGD,UAAM,WAAW,kBAAkB,uBAAuB,SAAS,CAAC;AAEpE,WAAO;AAAA,MACL,OAAO,QAA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useState", "useEffect"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PageProps } from '..';
|
|
3
|
+
export declare const AppLoader: (props: {
|
|
4
|
+
client: any;
|
|
5
|
+
pylonData: {
|
|
6
|
+
pageProps: Omit<PageProps, "data">;
|
|
7
|
+
cacheSnapshot?: any;
|
|
8
|
+
};
|
|
9
|
+
App: React.FC<{
|
|
10
|
+
pageProps: PageProps;
|
|
11
|
+
}>;
|
|
12
|
+
Router: React.FC<any>;
|
|
13
|
+
routerProps: any;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Plugin } from '@/index';
|
|
2
|
+
export interface PageData {
|
|
3
|
+
}
|
|
4
|
+
export type PageProps = {
|
|
5
|
+
data: PageData;
|
|
6
|
+
params: Record<string, string>;
|
|
7
|
+
searchParams: Record<string, string>;
|
|
8
|
+
path: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const setup: Plugin['setup'];
|