@fayz-ai/storefront 0.12.0 → 0.13.0
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/router.d.ts.map +1 -1
- package/dist/blocks/page-data.d.ts +6 -0
- package/dist/blocks/page-data.d.ts.map +1 -1
- package/dist/{chunk-SDQHSUFC.js → chunk-YU5GO4R5.js} +56 -20
- package/dist/chunk-YU5GO4R5.js.map +1 -0
- package/dist/components/SmoothImage.d.ts +17 -1
- package/dist/components/SmoothImage.d.ts.map +1 -1
- package/dist/components/collection/CategoryShowcase.d.ts.map +1 -1
- package/dist/components/product/ProductCard.d.ts.map +1 -1
- package/dist/components/product/ProductGallery.d.ts.map +1 -1
- package/dist/document/config.d.ts +12 -0
- package/dist/document/config.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/seo.d.ts.map +1 -1
- package/dist/render.js +1 -1
- package/package.json +9 -8
- package/dist/chunk-SDQHSUFC.js.map +0 -1
package/dist/app/router.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAA;AACzF,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7F,eAAO,MAAM,wBAAwB,sCAAgC,CAAA;AAuBrE,wBAAgB,gBAAgB,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqE,MAAM,OAAO,CAAA;AACzF,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAwB7F,eAAO,MAAM,wBAAwB,sCAAgC,CAAA;AAuBrE,wBAAgB,gBAAgB,IAAI,aAAa,C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AC;;gBAgBhE"}
|
|
@@ -43,6 +43,12 @@ export interface PageDataScopeProps {
|
|
|
43
43
|
* seam (L4): `resolvePageData(collectDataNeeds(nodes))` ahead of render,
|
|
44
44
|
* then hand the results in. Keys already 'ready' here are never re-fetched;
|
|
45
45
|
* anything missing resolves client-side as usual.
|
|
46
|
+
*
|
|
47
|
+
* Live, not mount-only: a host whose shell outlives the page (every real
|
|
48
|
+
* one — the shell must not remount on navigation) hands in a NEW object
|
|
49
|
+
* for each page it loads, and a child scope mounting in that same commit
|
|
50
|
+
* sees it. Pass a stable reference per page (the loader's result), not a
|
|
51
|
+
* literal built in render.
|
|
46
52
|
*/
|
|
47
53
|
initial?: Record<string, PageDataEntry>;
|
|
48
54
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-data.d.ts","sourceRoot":"","sources":["../../src/blocks/page-data.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAA;AAUtF,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAqB7D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;AAEnE,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACrC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,qDAAqD;AACrD,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,E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AAE,CAAC,GAAG,IAAI,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,uEAAuE;IACvE,MAAM,EAAE,MAAM,IAAI,CAAA;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACrC,eAAe,CAAC,CAAC,CAAC,CA2CpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC5D,eAAe,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAiBzC;AAID;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,4BAiB9F"}
|
|
@@ -6,9 +6,9 @@ import { setShopCarrierQuotesResolver, setShopAccessTokenResolver, setShopShippi
|
|
|
6
6
|
import { normalizePostalCode, lookupPostalCode, defaultRouterAdapter, defineLoader, staticRouterAdapter, isLoaderParamRef, isLoaderPropRef, resolveLoader, dataNeedKey, getBlockMeta, defaultPropsFromSettings, getBlockErrorVisibility, isBlockEnabledOn, checkBlockConstraints, checkBlockContext, repairBlockTree, renderBlocks, clearExtensionPoints, defineExtensionPoint, runExtensionPoint, runEscapeValve, breadcrumbJsonLd, hasEntityDeclaration, resolveEntityDeclaration, defineBlock, formatPostalCode, defineEntity, listEntityDeclarations, resolveHandle, seoOrigin, RESERVED_ENTITY_FIELDS, ENTITY_FIELD_TYPES, handleNameFor, registerHandle, hasHandle, listHandles, blockRegistry, loaderRegistry, listLoaders } from '@fayz-ai/core';
|
|
7
7
|
import React4, { createContext, useContext, useEffect, useRef, useState, useSyncExternalStore, useMemo, useCallback } from 'react';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import { isStorageImageUrl, imageVariantUrl, imageSrcSet, IMAGE_SRCSET_WIDTHS, validateDiscount, documentDigits, isChargeableProvider, formatDocument, isValidDocument } from '@fayz-ai/shop';
|
|
9
10
|
import { ChevronLeft, ChevronRight, ShoppingBag, X, Minus, Plus, Send, MessageCircle, Mail, Truck, RefreshCcw, ShieldCheck, ChevronDown, Check, Search, Trash2, Lock, CreditCard, Star, MapPin, Phone, User, UserCircle, Package, LogOut, Menu, QrCode, Copy, XCircle, RotateCcw, Clock, PackageCheck, Info, AlertCircle } from 'lucide-react';
|
|
10
11
|
import { getLucideIcon } from '@fayz-ai/ui/icons';
|
|
11
|
-
import { validateDiscount, documentDigits, isChargeableProvider, formatDocument, isValidDocument } from '@fayz-ai/shop';
|
|
12
12
|
import { storefrontDiscountToPromotion, previewCouponPercent, discountToPromotion, PROMOTION_TYPES, PROMOTION_STATUSES, APPLICATION_METHOD_TYPES, APPLICATION_METHOD_TARGET_TYPES, APPLICATION_METHOD_ALLOCATIONS, hasRuleAttribute, listRuleAttributeKeys, RULE_OPERATORS, resolveRuleAttribute } from '@fayz-ai/shop/rules';
|
|
13
13
|
import { createMockShopProvider } from '@fayz-ai/shop/mock';
|
|
14
14
|
|
|
@@ -760,7 +760,8 @@ function resolveConfig(config) {
|
|
|
760
760
|
mode: config.imageLoading?.mode ?? "fade",
|
|
761
761
|
durationMs: config.imageLoading?.durationMs ?? 420,
|
|
762
762
|
easing: config.imageLoading?.easing ?? "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
763
|
-
blur: config.imageLoading?.blur ?? true
|
|
763
|
+
blur: config.imageLoading?.blur ?? true,
|
|
764
|
+
transform: config.imageLoading?.transform ?? "none"
|
|
764
765
|
},
|
|
765
766
|
catalogPath,
|
|
766
767
|
search: {
|
|
@@ -872,8 +873,8 @@ function useRouterAdapter() {
|
|
|
872
873
|
const injected = useContext(RouterAdapterContext);
|
|
873
874
|
const adapter = injected ?? fallbackAdapter();
|
|
874
875
|
useEffect(() => {
|
|
875
|
-
_activeAdapter =
|
|
876
|
-
}, [
|
|
876
|
+
if (injected) _activeAdapter = injected;
|
|
877
|
+
}, [injected]);
|
|
877
878
|
return adapter;
|
|
878
879
|
}
|
|
879
880
|
function useRoutePath() {
|
|
@@ -1107,10 +1108,14 @@ var TID = {
|
|
|
1107
1108
|
};
|
|
1108
1109
|
function SmoothImage({
|
|
1109
1110
|
imageLoading,
|
|
1111
|
+
variant,
|
|
1110
1112
|
loading = "lazy",
|
|
1111
1113
|
decoding = "async",
|
|
1112
1114
|
onLoad,
|
|
1113
1115
|
style,
|
|
1116
|
+
src,
|
|
1117
|
+
srcSet,
|
|
1118
|
+
sizes,
|
|
1114
1119
|
...props
|
|
1115
1120
|
}) {
|
|
1116
1121
|
const config = useStorefrontConfigOptional();
|
|
@@ -1122,15 +1127,34 @@ function SmoothImage({
|
|
|
1122
1127
|
const durationMs = resolved.durationMs ?? 420;
|
|
1123
1128
|
const easing = resolved.easing ?? "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
1124
1129
|
const blur = resolved.blur ?? true;
|
|
1130
|
+
const transform = resolved.transform ?? "none";
|
|
1125
1131
|
const ref = React4.useRef(null);
|
|
1126
1132
|
const [loaded, setLoaded] = React4.useState(mode === "none");
|
|
1133
|
+
const delivered = React4.useMemo(() => {
|
|
1134
|
+
if (transform !== "supabase" || !src || srcSet || !isStorageImageUrl(src)) return { src, srcSet, sizes };
|
|
1135
|
+
if (variant?.width) {
|
|
1136
|
+
const w = variant.width;
|
|
1137
|
+
const q = variant.quality;
|
|
1138
|
+
return {
|
|
1139
|
+
src: imageVariantUrl(src, { width: w, quality: q }),
|
|
1140
|
+
srcSet: `${imageVariantUrl(src, { width: w, quality: q })} 1x, ${imageVariantUrl(src, { width: w * 2, quality: q })} 2x`,
|
|
1141
|
+
sizes
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
return {
|
|
1145
|
+
// A middle rung as the fallback `src`, for a browser without srcset.
|
|
1146
|
+
src: imageVariantUrl(src, { width: 960, quality: variant?.quality }),
|
|
1147
|
+
srcSet: imageSrcSet(src, variant?.widths ?? IMAGE_SRCSET_WIDTHS, { quality: variant?.quality }),
|
|
1148
|
+
sizes: variant?.sizes ?? sizes ?? "100vw"
|
|
1149
|
+
};
|
|
1150
|
+
}, [transform, src, srcSet, sizes, variant?.width, variant?.sizes, variant?.widths, variant?.quality]);
|
|
1127
1151
|
React4.useEffect(() => {
|
|
1128
1152
|
if (mode === "none") {
|
|
1129
1153
|
setLoaded(true);
|
|
1130
1154
|
return;
|
|
1131
1155
|
}
|
|
1132
1156
|
if (ref.current?.complete && ref.current.naturalWidth > 0) setLoaded(true);
|
|
1133
|
-
}, [mode,
|
|
1157
|
+
}, [mode, delivered.src]);
|
|
1134
1158
|
const revealStyle = mode === "none" ? {} : {
|
|
1135
1159
|
opacity: loaded ? 1 : 0,
|
|
1136
1160
|
filter: blur && !loaded ? "blur(10px)" : "blur(0px)",
|
|
@@ -1140,6 +1164,9 @@ function SmoothImage({
|
|
|
1140
1164
|
"img",
|
|
1141
1165
|
{
|
|
1142
1166
|
...props,
|
|
1167
|
+
src: delivered.src,
|
|
1168
|
+
srcSet: delivered.srcSet,
|
|
1169
|
+
sizes: delivered.sizes,
|
|
1143
1170
|
ref,
|
|
1144
1171
|
loading,
|
|
1145
1172
|
decoding,
|
|
@@ -1539,8 +1566,8 @@ function PageDataScope({ nodes, params, initial: initial2, children }) {
|
|
|
1539
1566
|
};
|
|
1540
1567
|
}, [signature]);
|
|
1541
1568
|
const value = useMemo(
|
|
1542
|
-
() => ({ entries: { ...parent?.entries, ...entries }, params: routeParams }),
|
|
1543
|
-
[parent, entries, routeParams]
|
|
1569
|
+
() => ({ entries: { ...parent?.entries, ...entries, ...initial2 }, params: routeParams }),
|
|
1570
|
+
[parent, entries, initial2, routeParams]
|
|
1544
1571
|
);
|
|
1545
1572
|
return /* @__PURE__ */ jsx(PageDataContext.Provider, { value, children });
|
|
1546
1573
|
}
|
|
@@ -1641,7 +1668,8 @@ function CategoryShowcase({
|
|
|
1641
1668
|
{
|
|
1642
1669
|
src: c.imageUrl ?? bannerPlaceholder(c.name, 30 + i * 70, 70 + i * 70, 200, 200),
|
|
1643
1670
|
alt: c.name,
|
|
1644
|
-
className: "h-full w-full object-cover"
|
|
1671
|
+
className: "h-full w-full object-cover",
|
|
1672
|
+
variant: { width: 96 }
|
|
1645
1673
|
}
|
|
1646
1674
|
) }),
|
|
1647
1675
|
/* @__PURE__ */ jsx("span", { className: "text-center text-xs font-medium leading-tight", children: c.name })
|
|
@@ -1656,7 +1684,8 @@ function CategoryShowcase({
|
|
|
1656
1684
|
{
|
|
1657
1685
|
src: c.imageUrl ?? bannerPlaceholder(c.name, 30 + i * 70, 70 + i * 70, 480, 600),
|
|
1658
1686
|
alt: c.name,
|
|
1659
|
-
className: "h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110"
|
|
1687
|
+
className: "h-full w-full object-cover transition-transform duration-700 ease-out group-hover:scale-110",
|
|
1688
|
+
variant: { sizes: "(min-width: 1024px) 33vw, 100vw" }
|
|
1660
1689
|
}
|
|
1661
1690
|
),
|
|
1662
1691
|
/* @__PURE__ */ jsxs("span", { className: "absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 via-black/30 to-transparent p-5 pt-12 text-left", children: [
|
|
@@ -2444,7 +2473,8 @@ function ProductCard({ product, config: providedConfig, actions: providedActions
|
|
|
2444
2473
|
src: image?.url ?? productPlaceholder(product.name),
|
|
2445
2474
|
alt: image?.altText ?? product.name,
|
|
2446
2475
|
className: "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",
|
|
2447
|
-
loading: "lazy"
|
|
2476
|
+
loading: "lazy",
|
|
2477
|
+
variant: { sizes: "(min-width: 1024px) 25vw, (min-width: 640px) 33vw, 50vw" }
|
|
2448
2478
|
}
|
|
2449
2479
|
),
|
|
2450
2480
|
/* @__PURE__ */ jsxs("div", { className: "absolute left-3 top-3 flex gap-2", children: [
|
|
@@ -3408,9 +3438,14 @@ function absolute(ctx, path = ctx.path) {
|
|
|
3408
3438
|
function primaryImageUrl(product) {
|
|
3409
3439
|
return (product.images?.find((i) => i.isPrimary) ?? product.images?.[0])?.url;
|
|
3410
3440
|
}
|
|
3441
|
+
function shareImageUrl(product, ctx) {
|
|
3442
|
+
const url = primaryImageUrl(product);
|
|
3443
|
+
if (!url) return void 0;
|
|
3444
|
+
return ctx.config.imageLoading.transform === "supabase" ? imageVariantUrl(url, { width: 1200, quality: 82 }) : url;
|
|
3445
|
+
}
|
|
3411
3446
|
function productJsonLd(product, ctx) {
|
|
3412
3447
|
const url = absolute(ctx);
|
|
3413
|
-
const image =
|
|
3448
|
+
const image = shareImageUrl(product, ctx);
|
|
3414
3449
|
return {
|
|
3415
3450
|
"@context": "https://schema.org",
|
|
3416
3451
|
"@type": "Product",
|
|
@@ -3435,7 +3470,7 @@ function productSeo(product, ctx) {
|
|
|
3435
3470
|
title: `${product.name} \u2014 ${ctx.config.name}`,
|
|
3436
3471
|
description: product.description?.slice(0, 160),
|
|
3437
3472
|
canonical: url,
|
|
3438
|
-
image:
|
|
3473
|
+
image: shareImageUrl(product, ctx),
|
|
3439
3474
|
type: "product",
|
|
3440
3475
|
jsonLd: [
|
|
3441
3476
|
productJsonLd(product, ctx),
|
|
@@ -3926,7 +3961,8 @@ function ProductGallery({ product, images, primaryImage, order = "primary" }) {
|
|
|
3926
3961
|
src: current?.url ?? productPlaceholder(product.name),
|
|
3927
3962
|
alt: current?.altText ?? product.name,
|
|
3928
3963
|
"data-testid": TID.pdpGalleryImage,
|
|
3929
|
-
className: "h-full w-full object-cover"
|
|
3964
|
+
className: "h-full w-full object-cover",
|
|
3965
|
+
variant: { sizes: "(min-width: 1024px) 50vw, 100vw" }
|
|
3930
3966
|
},
|
|
3931
3967
|
current?.id ?? "placeholder"
|
|
3932
3968
|
)
|
|
@@ -3957,7 +3993,7 @@ function ProductGallery({ product, images, primaryImage, order = "primary" }) {
|
|
|
3957
3993
|
setZoom(null);
|
|
3958
3994
|
},
|
|
3959
3995
|
className: `h-16 w-16 shrink-0 overflow-hidden rounded-lg border transition ${position === index ? "border-primary ring-2 ring-primary/20" : "border-border opacity-70 hover:opacity-100"}`,
|
|
3960
|
-
children: /* @__PURE__ */ jsx(
|
|
3996
|
+
children: /* @__PURE__ */ jsx(SmoothImage, { src: image.url, alt: "", className: "h-full w-full object-cover", loading: "lazy", variant: { width: 64 } })
|
|
3961
3997
|
}
|
|
3962
3998
|
) }, image.id)) })
|
|
3963
3999
|
] });
|
|
@@ -7038,7 +7074,7 @@ function CartDrawer() {
|
|
|
7038
7074
|
"data-line-id": line.lineId ?? line.productId,
|
|
7039
7075
|
className: `flex animate-fade-up gap-3 rounded-lg p-1.5 transition-all hover:bg-muted/40 ${(line.lineId ?? line.productId) === cart.justAddedLineId ? "bg-primary/5 ring-1 ring-primary/30" : ""}`,
|
|
7040
7076
|
children: [
|
|
7041
|
-
line.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: line.imageUrl, alt: line.name, className: "h-20 w-20 shrink-0 rounded-lg border object-cover" }),
|
|
7077
|
+
line.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: line.imageUrl, alt: line.name, className: "h-20 w-20 shrink-0 rounded-lg border object-cover", variant: { width: 80 } }),
|
|
7042
7078
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col", children: [
|
|
7043
7079
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
7044
7080
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-snug", children: line.name }),
|
|
@@ -8524,7 +8560,7 @@ function CheckoutPage() {
|
|
|
8524
8560
|
/* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Resumo do pedido" }),
|
|
8525
8561
|
/* @__PURE__ */ jsx("ul", { className: "space-y-4", children: cart.lines.map((line) => /* @__PURE__ */ jsxs("li", { className: "flex gap-3 text-sm", children: [
|
|
8526
8562
|
/* @__PURE__ */ jsxs("div", { className: "relative h-16 w-16 flex-none overflow-hidden rounded-lg border bg-background", children: [
|
|
8527
|
-
line.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: line.imageUrl, alt: line.name, className: "h-full w-full object-cover" }),
|
|
8563
|
+
line.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: line.imageUrl, alt: line.name, className: "h-full w-full object-cover", variant: { width: 96 } }),
|
|
8528
8564
|
/* @__PURE__ */ jsx("span", { className: "absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-muted-foreground px-1.5 text-[10px] font-bold text-background", children: line.quantity })
|
|
8529
8565
|
] }),
|
|
8530
8566
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -9001,7 +9037,7 @@ function OrderConfirmationPage({ orderId }) {
|
|
|
9001
9037
|
))
|
|
9002
9038
|
] }),
|
|
9003
9039
|
/* @__PURE__ */ jsx("ul", { className: "mt-8 space-y-3 text-left", children: order.items.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-3 text-sm", children: [
|
|
9004
|
-
item.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: item.imageUrl, alt: item.name, className: "h-12 w-12 rounded-lg border object-cover" }),
|
|
9040
|
+
item.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: item.imageUrl, alt: item.name, className: "h-12 w-12 rounded-lg border object-cover", variant: { width: 48 } }),
|
|
9005
9041
|
/* @__PURE__ */ jsxs("span", { className: "flex-1", children: [
|
|
9006
9042
|
item.name,
|
|
9007
9043
|
" ",
|
|
@@ -9244,7 +9280,7 @@ function OrdersPanel() {
|
|
|
9244
9280
|
/* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: new Date(order.createdAt).toLocaleDateString(config.locale) }),
|
|
9245
9281
|
/* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(OrderTrackingTimeline, { order, compact: true }) }),
|
|
9246
9282
|
/* @__PURE__ */ jsx("ul", { className: "mt-3 flex flex-wrap gap-2", children: order.items.map((item) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 rounded-lg border px-2 py-1 text-xs", children: [
|
|
9247
|
-
item.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: item.imageUrl, alt: item.name, className: "h-6 w-6 rounded object-cover" }),
|
|
9283
|
+
item.imageUrl && /* @__PURE__ */ jsx(SmoothImage, { src: item.imageUrl, alt: item.name, className: "h-6 w-6 rounded object-cover", variant: { width: 24 } }),
|
|
9248
9284
|
item.name,
|
|
9249
9285
|
" \xD7 ",
|
|
9250
9286
|
item.quantity
|
|
@@ -11041,5 +11077,5 @@ ${formatErrors(report.errors)}`;
|
|
|
11041
11077
|
}
|
|
11042
11078
|
|
|
11043
11079
|
export { BEFORE_PLACE_ORDER_VALVE, BLOCK_STRUCTURAL_KEYS, BenefitsRow, BlockDataError, CART_LINE_ANNOTATION_POINT, CATALOG_BODY_BLOCK, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, CollectionCta, CollectionHero, ContentPage, CountdownBand, EmailConfirmationRequiredError, EntityListBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, Link, ManifestoBlock, MediaCarousel, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_BODY_BLOCK, PRODUCT_CARD_BADGE_POINT, PageDataScope, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_COMPONENT_KEYS, STOREFRONT_PAGE_KINDS, STOREFRONT_SLOTS, STORE_BACKEND_PROVIDERS, STORE_COMMERCE_MODES, STORE_DOCUMENT_KIND, STORE_PAYMENT_METHOD_KINDS, STORE_PAYMENT_MODES, STORE_ROUTE_CHROMES, STORE_ROUTE_KINDS, STORE_SECTIONS, STORE_SECTION_NAMES, SealsBand, SearchOverlay, Slot, SmoothImage, StepsSection, StorefrontConfigHost, StorefrontConfigProvider, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontRouterProvider, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyStoreSettings, bannerPlaceholder, blockInstanceId, buildEnquiryFromForm, checkPageBlocks, collectDataNeeds, collectOrderMetadata, contentPagePath, createStorefront, createStorefrontApp, currentStaticRenderPass, defaultPageBlocks, entityListBlockMeta, establishCustomerSession, exportStore, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydrateStoreDocument, hydratedEntriesFor, initStorefrontRuntime, isJsonValue, isKnownPath, isNestedBlockRef, isPublicPath, isRecord, listSlots, matchContentPage, matchPath, matchesFacets, mergeCollectionFacet, mergePageTheme, navigateTo, nextMilestone, normalizeProductOptionSelection, orderGalleryImages, overrideComponent, overrideProps, pageSeo, pageThemeSelector, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, primaryImageUrl, productCardComponentContract, productJsonLd, productOptionSelectionKey, productPlaceholder, productSeo, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveConfig, resolveDataParams, resolveOverride, resolvePageData, resolvePageDataNeed, resolvePaymentTerms, resolveStorefrontProvider, resolveStorefrontRoute, resolveVariantForSelection, roundCents, routePathParams, runBeforePlaceOrderValve, sectionToJsonSchema, sectionsToBlocks, selectCount, selectDiscountTotal, selectRequiresShipping, selectShipping, selectSubtotal, selectTotal, selectionPrice, serializePageData, shellRouterAdapter, signInByEmail, signOutCustomer, signUpCustomer, slugifyStoreName, storefrontComponentContracts, storefrontPaths, themeToCss, toBlockNodes, toFacetMap, useBlockData, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useHashPath, useInView, useLoader, useMyOrders, useNavigate, usePopOnChange, useProduct, useProducts, useRoutePath, useRouterAdapter, useScrollToTopOnNavigate, useScrolled, useSessionStore, useSlotContext, useStorefrontActions, useStorefrontConfig, useStorefrontConfigOptional, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, usedSlots, validateStore, withFacet, withStaticRenderPass };
|
|
11044
|
-
//# sourceMappingURL=chunk-
|
|
11045
|
-
//# sourceMappingURL=chunk-
|
|
11080
|
+
//# sourceMappingURL=chunk-YU5GO4R5.js.map
|
|
11081
|
+
//# sourceMappingURL=chunk-YU5GO4R5.js.map
|