@voltro/web 0.30.0 → 0.30.2
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/CHANGELOG.md +119 -0
- package/dist/{defaultFallbacks-Fik_Gcjh.js → defaultFallbacks-B4Ak-R6R.js} +87 -87
- package/dist/{frameworkBoot-BkBY6M2s.js → frameworkBoot-Dm6UaRP-.js} +95 -92
- package/dist/frameworkBoot.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +57 -57
- package/dist/{mount-fDzFaIuf.js → mount-CXlKierJ.js} +1 -1
- package/dist/mount.js +1 -1
- package/dist/{serverContext-CV1ieZKF.js → serverContext-3i6Dr4ev.js} +171 -163
- package/dist/ssr.d.ts +15 -1
- package/dist/ssr.js +56 -52
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { t as e } from "./globalContext-d4A-ugDg.js";
|
|
2
2
|
import { AppClientsContext as t, useAppClient as n } from "./hooks.js";
|
|
3
|
-
import { a as r, c as i, i as a, l as o, o as s, r as c, s as l, u } from "./frameworkBoot-
|
|
4
|
-
import { a as d, c as f, i as p, l as m, o as h,
|
|
5
|
-
import { i as _, n as ee, r as te, t as ne } from "./mount-
|
|
3
|
+
import { a as r, c as i, i as a, l as o, o as s, r as c, s as l, u } from "./frameworkBoot-Dm6UaRP-.js";
|
|
4
|
+
import { a as d, c as f, i as p, l as m, o as h, u as g } from "./defaultFallbacks-B4Ak-R6R.js";
|
|
5
|
+
import { i as _, n as ee, r as te, t as ne } from "./mount-CXlKierJ.js";
|
|
6
6
|
import { c as re, d as ie, h as ae, l as oe, p as se, u as ce } from "./routerState-DAT472IC.js";
|
|
7
|
-
import { A as le, B as ue, C as de, D as fe, E as pe, F as me, G as he, H as ge, I as _e, K as v, L as y, M as b, N as x, O as S, P as C, R as w, S as T, T as E, U as D, V as O, W as k, _ as A, a as j, b as M, c as N, d as P, f as F, g as I, h as ve, i as ye, j as be, k as xe, l as Se, m as Ce, n as we, o as Te, p as Ee,
|
|
8
|
-
import { Component as
|
|
9
|
-
import { Fragment as
|
|
7
|
+
import { A as le, B as ue, C as de, D as fe, E as pe, F as me, G as he, H as ge, I as _e, K as v, L as y, M as b, N as x, O as S, P as C, R as w, S as T, T as E, U as D, V as O, W as k, _ as A, a as j, b as M, c as N, d as P, f as F, g as I, h as ve, i as ye, j as be, k as xe, l as Se, m as Ce, n as we, o as Te, p as Ee, q as De, r as Oe, s as ke, t as Ae, u as je, v as Me, w as Ne, x as Pe, y as Fe, z as Ie } from "./serverContext-3i6Dr4ev.js";
|
|
8
|
+
import { Component as Le, Suspense as Re, createElement as L, use as ze, useCallback as Be, useContext as Ve, useSyncExternalStore as He } from "react";
|
|
9
|
+
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
10
10
|
export * from "@voltro/client";
|
|
11
11
|
export * from "@voltro/ui";
|
|
12
12
|
//#region src/await.tsx
|
|
13
|
-
var
|
|
13
|
+
var Ue = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PURE__ */ z(Re, {
|
|
14
14
|
fallback: t,
|
|
15
|
-
children: /* @__PURE__ */
|
|
15
|
+
children: /* @__PURE__ */ z(Ge, {
|
|
16
16
|
errorFallback: r,
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ z(We, {
|
|
18
18
|
value: e,
|
|
19
19
|
errorFallback: r ?? null,
|
|
20
20
|
children: n
|
|
21
21
|
})
|
|
22
22
|
})
|
|
23
|
-
}),
|
|
24
|
-
let r =
|
|
25
|
-
return a === void 0 ? /* @__PURE__ */
|
|
26
|
-
},
|
|
23
|
+
}), V = ({ body: e }) => /* @__PURE__ */ z("script", { dangerouslySetInnerHTML: { __html: e } }), We = ({ value: e, errorFallback: t, children: n }) => {
|
|
24
|
+
let r = ze(e), i = ce(e), a = ae(r);
|
|
25
|
+
return a === void 0 ? /* @__PURE__ */ B(R, { children: [i === void 0 ? null : /* @__PURE__ */ z(V, { body: ie(i, r) }), n(r)] }) : /* @__PURE__ */ B(R, { children: [i === void 0 ? null : /* @__PURE__ */ z(V, { body: oe(i, a) }), t] });
|
|
26
|
+
}, Ge = class extends Le {
|
|
27
27
|
state = { error: void 0 };
|
|
28
28
|
static getDerivedStateFromError(e) {
|
|
29
29
|
return { error: e };
|
|
@@ -31,7 +31,7 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
31
31
|
render() {
|
|
32
32
|
return this.state.error === void 0 ? this.props.children : this.props.errorFallback ?? null;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, H = ({ src: e }) => e, U = e("imageConfig", { loader: H }), Ke = ({ loader: e, children: t }) => L(U.Provider, { value: { loader: e } }, t), W = [
|
|
35
35
|
640,
|
|
36
36
|
750,
|
|
37
37
|
828,
|
|
@@ -40,8 +40,8 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
40
40
|
1920,
|
|
41
41
|
2048,
|
|
42
42
|
3840
|
|
43
|
-
],
|
|
44
|
-
let i = n !== void 0 && !r ? Array.from(new Set(
|
|
43
|
+
], qe = (e, t, n, r) => {
|
|
44
|
+
let i = n !== void 0 && !r ? Array.from(new Set(W.filter((e) => e <= n * 2).concat(n))).sort((e, t) => e - t) : [...W];
|
|
45
45
|
return {
|
|
46
46
|
srcSet: i.map((n) => `${e({
|
|
47
47
|
src: t,
|
|
@@ -52,10 +52,10 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
52
52
|
width: i[i.length - 1]
|
|
53
53
|
})
|
|
54
54
|
};
|
|
55
|
-
},
|
|
56
|
-
let f =
|
|
55
|
+
}, Je = ({ src: e, alt: t, width: n, height: r, fill: i = !1, sizes: a, priority: o = !1, loader: s, placeholder: c = "empty", blurDataURL: l, style: u, ...d }) => {
|
|
56
|
+
let f = Ve(U).loader, p = s ?? f;
|
|
57
57
|
!i && (n === void 0 || r === void 0) && typeof console < "u" && console.warn(`<Image src="${e}"> needs both width and height (or fill) to reserve layout space and avoid CLS.`);
|
|
58
|
-
let { srcSet: m, fallback: h } =
|
|
58
|
+
let { srcSet: m, fallback: h } = qe(p, e, n, i), g = c === "blur" && l ? {
|
|
59
59
|
backgroundImage: `url(${l})`,
|
|
60
60
|
backgroundSize: "cover",
|
|
61
61
|
backgroundPosition: "center"
|
|
@@ -66,7 +66,7 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
66
66
|
width: "100%",
|
|
67
67
|
objectFit: "cover"
|
|
68
68
|
} : {};
|
|
69
|
-
return
|
|
69
|
+
return L("img", {
|
|
70
70
|
src: h,
|
|
71
71
|
srcSet: m,
|
|
72
72
|
sizes: a ?? (i ? "100vw" : void 0),
|
|
@@ -85,10 +85,10 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
85
85
|
},
|
|
86
86
|
...d
|
|
87
87
|
});
|
|
88
|
-
},
|
|
88
|
+
}, Ye = ({ to: e, children: t, className: n }) => L("a", {
|
|
89
89
|
href: e,
|
|
90
90
|
className: n
|
|
91
|
-
}, t),
|
|
91
|
+
}, t), Xe = {
|
|
92
92
|
position: "sticky",
|
|
93
93
|
top: 0,
|
|
94
94
|
zIndex: 10,
|
|
@@ -99,13 +99,13 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
99
99
|
padding: "1rem 1.5rem",
|
|
100
100
|
borderBottom: "1px solid var(--voltro-blog-border, rgba(127,127,127,0.2))",
|
|
101
101
|
backdropFilter: "blur(8px)"
|
|
102
|
-
},
|
|
102
|
+
}, Ze = {
|
|
103
103
|
maxWidth: "48rem",
|
|
104
104
|
margin: "0 auto",
|
|
105
105
|
padding: "2rem 1.5rem",
|
|
106
106
|
width: "100%"
|
|
107
|
-
},
|
|
108
|
-
let { brand: t, topNav: n, children: r, pathname: i, footer: a, breadcrumbs: o, headerRight: s } = e, c = e.Link ??
|
|
107
|
+
}, Qe = (e) => {
|
|
108
|
+
let { brand: t, topNav: n, children: r, pathname: i, footer: a, breadcrumbs: o, headerRight: s } = e, c = e.Link ?? Ye, l = L("nav", {
|
|
109
109
|
className: "voltro-blog-nav",
|
|
110
110
|
style: {
|
|
111
111
|
display: "flex",
|
|
@@ -114,20 +114,20 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
114
114
|
}
|
|
115
115
|
}, ...n.map((e) => {
|
|
116
116
|
let t = i === e.href;
|
|
117
|
-
return
|
|
117
|
+
return L(c, {
|
|
118
118
|
key: e.href,
|
|
119
119
|
to: e.href,
|
|
120
120
|
className: t ? "voltro-blog-nav-link is-active" : "voltro-blog-nav-link",
|
|
121
121
|
children: e.label
|
|
122
122
|
});
|
|
123
|
-
})), u =
|
|
123
|
+
})), u = L("header", {
|
|
124
124
|
className: "voltro-blog-header",
|
|
125
|
-
style:
|
|
126
|
-
},
|
|
125
|
+
style: Xe
|
|
126
|
+
}, L("div", { className: "voltro-blog-brand" }, t), s ? L("div", { style: {
|
|
127
127
|
display: "flex",
|
|
128
128
|
gap: "1rem",
|
|
129
129
|
alignItems: "center"
|
|
130
|
-
} }, l, s) : l), d = o && o.length > 0 ?
|
|
130
|
+
} }, l, s) : l), d = o && o.length > 0 ? L("nav", {
|
|
131
131
|
className: "voltro-blog-breadcrumbs",
|
|
132
132
|
"aria-label": "Breadcrumb",
|
|
133
133
|
style: {
|
|
@@ -138,20 +138,20 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
138
138
|
gap: "0.5rem"
|
|
139
139
|
}
|
|
140
140
|
}, ...o.flatMap((e, t) => {
|
|
141
|
-
let n = t === o.length - 1, r = e.href && !n ?
|
|
141
|
+
let n = t === o.length - 1, r = e.href && !n ? L(c, {
|
|
142
142
|
key: `c${t}`,
|
|
143
143
|
to: e.href,
|
|
144
144
|
children: e.label
|
|
145
|
-
}) :
|
|
145
|
+
}) : L("span", {
|
|
146
146
|
key: `c${t}`,
|
|
147
147
|
"aria-current": n ? "page" : void 0
|
|
148
148
|
}, e.label);
|
|
149
|
-
return n ? [r] : [r,
|
|
149
|
+
return n ? [r] : [r, L("span", { key: `s${t}` }, "/")];
|
|
150
150
|
})) : null;
|
|
151
|
-
return
|
|
151
|
+
return L("div", { className: "voltro-blog-layout" }, u, L("main", {
|
|
152
152
|
className: "voltro-blog-main",
|
|
153
|
-
style:
|
|
154
|
-
}, d, r), a ?
|
|
153
|
+
style: Ze
|
|
154
|
+
}, d, r), a ? L("footer", {
|
|
155
155
|
className: "voltro-blog-footer",
|
|
156
156
|
style: {
|
|
157
157
|
maxWidth: "48rem",
|
|
@@ -160,31 +160,31 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
160
160
|
borderTop: "1px solid var(--voltro-blog-border, rgba(127,127,127,0.2))"
|
|
161
161
|
}
|
|
162
162
|
}, a) : null);
|
|
163
|
-
},
|
|
163
|
+
}, G = (e) => {
|
|
164
164
|
if (e === "" || e === "/") return "/";
|
|
165
165
|
let t = e.startsWith("/") ? e : `/${e}`;
|
|
166
166
|
return t.endsWith("/") ? t.slice(0, -1) : t;
|
|
167
|
-
},
|
|
168
|
-
let n = e.endsWith("/") ? e.slice(0, -1) : e, r =
|
|
167
|
+
}, K = (e, t) => {
|
|
168
|
+
let n = e.endsWith("/") ? e.slice(0, -1) : e, r = G(t);
|
|
169
169
|
return r === "/" ? `${n}/` : `${n}${r}`;
|
|
170
|
-
},
|
|
171
|
-
let r =
|
|
170
|
+
}, q = (e, t, n) => {
|
|
171
|
+
let r = G(e);
|
|
172
172
|
return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
|
|
173
|
-
},
|
|
174
|
-
let { siteUrl: t, path: n, locale: r, locales: i, defaultLocale: a, xDefault: o = !0 } = e, s =
|
|
173
|
+
}, $e = (e, t) => K(e, t), et = (e) => {
|
|
174
|
+
let { siteUrl: t, path: n, locale: r, locales: i, defaultLocale: a, xDefault: o = !0 } = e, s = K(t, q(n, r, a)), c = i.map((e) => ({
|
|
175
175
|
rel: "alternate",
|
|
176
176
|
hreflang: e,
|
|
177
|
-
href:
|
|
177
|
+
href: K(t, q(n, e, a))
|
|
178
178
|
}));
|
|
179
179
|
return o && c.push({
|
|
180
180
|
rel: "alternate",
|
|
181
181
|
hreflang: "x-default",
|
|
182
|
-
href:
|
|
182
|
+
href: K(t, q(n, a, a))
|
|
183
183
|
}), {
|
|
184
184
|
canonical: s,
|
|
185
185
|
links: c
|
|
186
186
|
};
|
|
187
|
-
},
|
|
187
|
+
}, J = "voltro:theme", tt = 31536e3, Y = () => {
|
|
188
188
|
if (typeof document > "u") return "system";
|
|
189
189
|
try {
|
|
190
190
|
let e = document.cookie.match(/(?:^|;\s*)voltro:theme=([^;]*)/), t = e?.[1] === void 0 ? "" : decodeURIComponent(e[1]);
|
|
@@ -192,17 +192,17 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
192
192
|
} catch {
|
|
193
193
|
return "system";
|
|
194
194
|
}
|
|
195
|
-
},
|
|
195
|
+
}, nt = () => {
|
|
196
196
|
if (typeof window > "u" || !window.matchMedia) return !1;
|
|
197
197
|
try {
|
|
198
198
|
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
199
199
|
} catch {
|
|
200
200
|
return !1;
|
|
201
201
|
}
|
|
202
|
-
}, X = (e) => e === "system" ?
|
|
202
|
+
}, X = (e) => e === "system" ? nt() ? "dark" : "light" : e, Z = 0, Q = /* @__PURE__ */ new Set(), $ = () => {
|
|
203
203
|
Z++;
|
|
204
204
|
for (let e of Q) e();
|
|
205
|
-
},
|
|
205
|
+
}, rt = (e) => {
|
|
206
206
|
Q.add(e);
|
|
207
207
|
let t, n = () => $();
|
|
208
208
|
if (typeof window < "u" && window.matchMedia) try {
|
|
@@ -214,21 +214,21 @@ var Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PUR
|
|
|
214
214
|
t?.removeEventListener("change", n);
|
|
215
215
|
} catch {}
|
|
216
216
|
};
|
|
217
|
-
},
|
|
218
|
-
let e =
|
|
217
|
+
}, it = () => {
|
|
218
|
+
let e = Y();
|
|
219
219
|
return `${Z}:${e}:${X(e)}`;
|
|
220
|
-
},
|
|
221
|
-
let [, e, t] =
|
|
220
|
+
}, at = () => "0:system:light", ot = () => {
|
|
221
|
+
let [, e, t] = He(rt, it, at).split(":");
|
|
222
222
|
return {
|
|
223
223
|
theme: e,
|
|
224
224
|
resolvedTheme: t,
|
|
225
|
-
setTheme:
|
|
225
|
+
setTheme: Be((e) => {
|
|
226
226
|
if (typeof document < "u") try {
|
|
227
|
-
document.cookie = e === "system" ? `${
|
|
227
|
+
document.cookie = e === "system" ? `${J}=; path=/; max-age=0; SameSite=Lax` : `${J}=${e}; path=/; max-age=${tt}; SameSite=Lax`, document.documentElement.classList.toggle("dark", X(e) === "dark");
|
|
228
228
|
} catch {}
|
|
229
229
|
$();
|
|
230
230
|
}, [])
|
|
231
231
|
};
|
|
232
|
-
},
|
|
232
|
+
}, st = "framework-web";
|
|
233
233
|
//#endregion
|
|
234
|
-
export { t as AppClientsContext,
|
|
234
|
+
export { t as AppClientsContext, Ue as Await, Qe as BlogLayout, p as FallbackStringsProvider, Je as Image, Ke as ImageConfigProvider, Te as Link, ke as LoaderCache, N as LoaderDataContext, Se as NO_LOADER_DATA, i as NavigationIndicator, Ie as NotFoundError, je as PAGE_SLOT_ATTR, P as PageSlot, F as PlainLink, Ee as RENDER_MODES, o as ReconnectContext, ue as RedirectError, Ce as Router, ve as RouterContext, Ae as ServerRequestContext, we as ServerRequestProvider, J as THEME_COOKIE, st as WEB_NAME, $e as canonicalUrl, I as compileRoute, d as defaultFallbackStrings, re as defer, A as externalUrl, Me as findNotFound, c as formatPrintf, ee as getIslandComponent, he as getRouteSnapshot, f as getStatuses, te as hydrateIslandsOnPage, a as installBrowserConsoleBridge, r as installServerLogRelay, se as isDeferredLoaderResult, O as isNotFound, ge as isRedirect, _ as island, K as joinUrl, Fe as lazyPageRoute, M as loaderCacheKey, q as localizedPath, Pe as matchRoute, ne as mount, G as normalizePath, D as notFound, T as pageRoute, Oe as parseCookieHeader, H as passthroughImageLoader, de as preloadRouteModule, m as pushStatus, k as redirect, s as registerClientTrace, Ne as renderRouterProviderTree, E as resolveAnchorNavigation, pe as resolveMeta, fe as segmentLoaderKey, et as seoAlternates, v as setRouteSnapshot, S as sortRoutesByPriority, De as subscribeRouteSnapshot, g as subscribeStatuses, l as subscribeTraceErrors, n as useAppClient, xe as useBlocker, h as useFallbackStrings, le as useLoaderData, be as useLocation, b as useNavigate, x as useOptionalLoaderData, C as useParams, me as usePrefetch, u as useReconnect, ye as useSearchParams, j as useServerRequest, _e as useSetSearchParams, ot as useTheme, y as withHash, w as withQuery };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./frameworkBoot-
|
|
1
|
+
import { t as e } from "./frameworkBoot-Dm6UaRP-.js";
|
|
2
2
|
import { o as t, r as n, t as r } from "./routerState-DAT472IC.js";
|
|
3
3
|
import { StrictMode as i, createElement as a } from "react";
|
|
4
4
|
import { createRoot as o, hydrateRoot as s } from "react-dom/client";
|
package/dist/mount.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./mount-
|
|
1
|
+
import { t as e } from "./mount-CXlKierJ.js";
|
|
2
2
|
export { e as mount };
|