@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/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-BkBY6M2s.js";
4
- import { a as d, c as f, i as p, l as m, o as h, s as g } from "./defaultFallbacks-Fik_Gcjh.js";
5
- import { i as _, n as ee, r as te, t as ne } from "./mount-fDzFaIuf.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-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, r as De, s as Oe, t as ke, u as L, v as Ae, w as je, x as Me, y as Ne, z as Pe } from "./serverContext-CV1ieZKF.js";
8
- import { Component as Fe, Suspense as Ie, createElement as R, use as Le, useCallback as Re, useContext as ze, useSyncExternalStore as Be } from "react";
9
- import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
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 Ve = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PURE__ */ B(Ie, {
13
+ var Ue = ({ value: e, fallback: t, children: n, errorFallback: r }) => /* @__PURE__ */ z(Re, {
14
14
  fallback: t,
15
- children: /* @__PURE__ */ B(Ue, {
15
+ children: /* @__PURE__ */ z(Ge, {
16
16
  errorFallback: r,
17
- children: /* @__PURE__ */ B(He, {
17
+ children: /* @__PURE__ */ z(We, {
18
18
  value: e,
19
19
  errorFallback: r ?? null,
20
20
  children: n
21
21
  })
22
22
  })
23
- }), H = ({ body: e }) => /* @__PURE__ */ B("script", { dangerouslySetInnerHTML: { __html: e } }), He = ({ value: e, errorFallback: t, children: n }) => {
24
- let r = Le(e), i = ce(e), a = ae(r);
25
- return a === void 0 ? /* @__PURE__ */ V(z, { children: [i === void 0 ? null : /* @__PURE__ */ B(H, { body: ie(i, r) }), n(r)] }) : /* @__PURE__ */ V(z, { children: [i === void 0 ? null : /* @__PURE__ */ B(H, { body: oe(i, a) }), t] });
26
- }, Ue = class extends Fe {
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
- }, U = ({ src: e }) => e, W = e("imageConfig", { loader: U }), We = ({ loader: e, children: t }) => R(W.Provider, { value: { loader: e } }, t), G = [
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
- ], Ge = (e, t, n, r) => {
44
- let i = n !== void 0 && !r ? Array.from(new Set(G.filter((e) => e <= n * 2).concat(n))).sort((e, t) => e - t) : [...G];
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
- }, Ke = ({ 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 = ze(W).loader, p = s ?? 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 } = Ge(p, e, n, i), g = c === "blur" && l ? {
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 R("img", {
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
- }, qe = ({ to: e, children: t, className: n }) => R("a", {
88
+ }, Ye = ({ to: e, children: t, className: n }) => L("a", {
89
89
  href: e,
90
90
  className: n
91
- }, t), Je = {
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
- }, Ye = {
102
+ }, Ze = {
103
103
  maxWidth: "48rem",
104
104
  margin: "0 auto",
105
105
  padding: "2rem 1.5rem",
106
106
  width: "100%"
107
- }, Xe = (e) => {
108
- let { brand: t, topNav: n, children: r, pathname: i, footer: a, breadcrumbs: o, headerRight: s } = e, c = e.Link ?? qe, l = R("nav", {
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 R(c, {
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 = R("header", {
123
+ })), u = L("header", {
124
124
  className: "voltro-blog-header",
125
- style: Je
126
- }, R("div", { className: "voltro-blog-brand" }, t), s ? R("div", { style: {
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 ? R("nav", {
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 ? R(c, {
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
- }) : R("span", {
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, R("span", { key: `s${t}` }, "/")];
149
+ return n ? [r] : [r, L("span", { key: `s${t}` }, "/")];
150
150
  })) : null;
151
- return R("div", { className: "voltro-blog-layout" }, u, R("main", {
151
+ return L("div", { className: "voltro-blog-layout" }, u, L("main", {
152
152
  className: "voltro-blog-main",
153
- style: Ye
154
- }, d, r), a ? R("footer", {
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
- }, K = (e) => {
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
- }, q = (e, t) => {
168
- let n = e.endsWith("/") ? e.slice(0, -1) : e, r = K(t);
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
- }, J = (e, t, n) => {
171
- let r = K(e);
170
+ }, q = (e, t, n) => {
171
+ let r = G(e);
172
172
  return t === n ? r : r === "/" ? `/${t}` : `/${t}${r}`;
173
- }, Ze = (e, t) => q(e, t), Qe = (e) => {
174
- let { siteUrl: t, path: n, locale: r, locales: i, defaultLocale: a, xDefault: o = !0 } = e, s = q(t, J(n, r, a)), c = i.map((e) => ({
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: q(t, J(n, e, a))
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: q(t, J(n, a, a))
182
+ href: K(t, q(n, a, a))
183
183
  }), {
184
184
  canonical: s,
185
185
  links: c
186
186
  };
187
- }, Y = "voltro:theme", $e = 31536e3, et = () => {
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
- }, tt = () => {
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" ? tt() ? "dark" : "light" : e, Z = 0, Q = /* @__PURE__ */ new Set(), $ = () => {
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
- }, nt = (e) => {
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
- }, rt = () => {
218
- let e = et();
217
+ }, it = () => {
218
+ let e = Y();
219
219
  return `${Z}:${e}:${X(e)}`;
220
- }, it = () => "0:system:light", at = () => {
221
- let [, e, t] = Be(nt, rt, it).split(":");
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: Re((e) => {
225
+ setTheme: Be((e) => {
226
226
  if (typeof document < "u") try {
227
- document.cookie = e === "system" ? `${Y}=; path=/; max-age=0; SameSite=Lax` : `${Y}=${e}; path=/; max-age=${$e}; SameSite=Lax`, document.documentElement.classList.toggle("dark", X(e) === "dark");
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
- }, ot = "framework-web";
232
+ }, st = "framework-web";
233
233
  //#endregion
234
- export { t as AppClientsContext, Ve as Await, Xe as BlogLayout, p as FallbackStringsProvider, Ke as Image, We as ImageConfigProvider, Te as Link, Oe as LoaderCache, N as LoaderDataContext, Se as NO_LOADER_DATA, i as NavigationIndicator, w as NotFoundError, L as PAGE_SLOT_ATTR, P as PageSlot, F as PlainLink, Ee as RENDER_MODES, o as ReconnectContext, Pe as RedirectError, Ce as Router, ve as RouterContext, ke as ServerRequestContext, we as ServerRequestProvider, Y as THEME_COOKIE, ot as WEB_NAME, Ze as canonicalUrl, I as compileRoute, d as defaultFallbackStrings, re as defer, A as externalUrl, Ae as findNotFound, c as formatPrintf, ee as getIslandComponent, k as getRouteSnapshot, g as getStatuses, te as hydrateIslandsOnPage, a as installBrowserConsoleBridge, r as installServerLogRelay, se as isDeferredLoaderResult, ue as isNotFound, O as isRedirect, _ as island, q as joinUrl, Ne as lazyPageRoute, M as loaderCacheKey, J as localizedPath, Me as matchRoute, ne as mount, K as normalizePath, ge as notFound, T as pageRoute, De as parseCookieHeader, U as passthroughImageLoader, de as preloadRouteModule, f as pushStatus, D as redirect, s as registerClientTrace, je as resolveAnchorNavigation, E as resolveMeta, pe as segmentLoaderKey, Qe as seoAlternates, he as setRouteSnapshot, fe as sortRoutesByPriority, v as subscribeRouteSnapshot, m as subscribeStatuses, l as subscribeTraceErrors, n as useAppClient, S as useBlocker, h as useFallbackStrings, xe as useLoaderData, le as useLocation, be as useNavigate, b as useOptionalLoaderData, x as useParams, C as usePrefetch, u as useReconnect, ye as useSearchParams, j as useServerRequest, me as useSetSearchParams, at as useTheme, _e as withHash, y as withQuery };
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-BkBY6M2s.js";
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-fDzFaIuf.js";
1
+ import { t as e } from "./mount-CXlKierJ.js";
2
2
  export { e as mount };