efficient-storefront-blocks 0.125.11 → 0.125.13
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 +21 -0
- package/dist/chunks/{CustomHtmlCodeWindow-ZSVS5DI6.js → CustomHtmlCodeWindow-GU7XJD4P.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-NDZUORUC.js → EditorPreviewCheckout-YNOXGBF3.js} +1 -1
- package/dist/chunks/SiteEditorProvider-2DLGUDDP.js +1 -0
- package/dist/chunks/{chunk-ICWPUDN3.js → chunk-4HZIV5UO.js} +1 -1
- package/dist/chunks/chunk-4R75CGDP.js +9 -0
- package/dist/chunks/{chunk-R3WKYZOZ.js → chunk-AKQZ7SOP.js} +1 -1
- package/dist/chunks/{chunk-3LWDFU5Y.js → chunk-LHRUHC3R.js} +1 -1
- package/dist/chunks/{chunk-HOKKFWPX.js → chunk-NJMMRTE4.js} +1 -1
- package/dist/chunks/{chunk-YU4MIT6K.js → chunk-QZV32ZUO.js} +1 -1
- package/dist/chunks/chunk-RCG52BYQ.js +337 -0
- package/dist/chunks/{chunk-Y7DFVCVM.js → chunk-SVVQDQP3.js} +1 -1
- package/dist/chunks/{fitment-data-ANJWNG4T.js → fitment-data-4BSUUSAX.js} +1 -1
- package/dist/chunks/{section-css-style-7ROA6NKG.js → section-css-style-6XARTNKW.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +28 -28
- package/dist/render/app/globals.css +3 -2
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/card-pieces/CardPicture.d.ts +2 -1
- package/dist/render/components/card-pieces/CardPicture.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.d.ts +10 -0
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +6 -0
- package/dist/words.js +3 -3
- package/package.json +3 -3
- package/dist/chunks/SiteEditorProvider-CIZSA67M.js +0 -1
- package/dist/chunks/chunk-RCOLM57Z.js +0 -9
- package/dist/chunks/chunk-SPLS5ZLA.js +0 -337
- /package/dist/chunks/{chunk-3DDOV7FZ.js → chunk-DET7LVPH.js} +0 -0
- /package/dist/chunks/{chunk-SRHU2S3G.js → chunk-E4ZWGCLS.js} +0 -0
- /package/dist/chunks/{chunk-3LWDFU5Y.js.LEGAL.txt → chunk-LHRUHC3R.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-SPLS5ZLA.js.LEGAL.txt → chunk-RCG52BYQ.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-RJM55KDO.js → chunk-UIWK6VX2.js} +0 -0
|
@@ -4354,12 +4354,13 @@ em.text-accent {
|
|
|
4354
4354
|
smaller; they never draw over it. The wheel's width is the one value
|
|
4355
4355
|
below; a merchant cannot change it yet. It is not the design file's 77%:
|
|
4356
4356
|
the design's wheel pictures carry an empty margin, and this site's wheel
|
|
4357
|
-
pictures fill their frame
|
|
4357
|
+
pictures fill their frame: 97% of the picture box draws the wheel at about
|
|
4358
|
+
76% of the card's width at 1440, the design's wheel size.
|
|
4358
4359
|
The boxes are found by what they hold, not by their names: the picture box
|
|
4359
4360
|
holds the Picture part (`data-part="image-block"`), and the words box is
|
|
4360
4361
|
its sibling. */
|
|
4361
4362
|
.sf-card-words-over {
|
|
4362
|
-
--sf-card-wheel-width:
|
|
4363
|
+
--sf-card-wheel-width: 97%;
|
|
4363
4364
|
}
|
|
4364
4365
|
.sf-card-words-over :has(> [data-part="box"] > * > [data-part="image-block"]) {
|
|
4365
4366
|
justify-content: flex-end;
|
|
@@ -14,5 +14,6 @@ export interface CardPictureSettings {
|
|
|
14
14
|
wide?: boolean;
|
|
15
15
|
imageBackgroundFill?: string;
|
|
16
16
|
setGridGap?: string;
|
|
17
|
+
shadowed?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export default function CardPicture({ image, imageSecond, plate, wide, imageBackgroundFill, setGridGap, }: CardPictureSettings): import("react").JSX.Element;
|
|
19
|
+
export default function CardPicture({ image, imageSecond, plate, wide, imageBackgroundFill, setGridGap, shadowed, }: CardPictureSettings): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as P,Fragment as w,jsxs as o}from"react/jsx-runtime";import{CARD_IMAGE_BG_OFF as C,cardImageBackgroundPaints as g,THEME_CARD_IMAGE_BG as A}from"efficient-web-builder/format/lib/content/card-image-background";import{VIEW_LINE_PX as E}from"efficient-web-builder/format/lib/content/view-lines";import{useCatalogCard as j}from"./card-row.js";import{blockParts as $}from"../../lib/block-parts.js";const l=$("ProductCard"),h=e=>`calc((100% - ${typeof e=="number"?`${e}px`:e}) / 2)`,d=2,G=32,x=e=>d+2*G+(e?16:0),u=(e,s)=>s===void 0?`${x(e)}px`:`calc(${s} + ${x(e)-d}px)`,M=252,T=16,N=E["view-wide"];function X({image:e,imageSecond:s,plate:c,wide:r=!1,imageBackgroundFill:a=C,setGridGap:i,shadowed:n=!1}){const v=j(),t=g(a),m=t&&a===A,p=m?"bg-[var(--wheel-stage)] p-2":t?"p-2":"",f=t&&!m?{backgroundColor:a}:{},_=b=>P("figure",{className:"m-0 aspect-square [flex:0_0_auto] max-w-full w-[var(--sf-set-plate-w)] max-view-wide:w-full",style:{"--sf-set-plate-w":h(u(t,i))},...l("image-plate"),children:b});return v?o("div",{className:r?`relative mt-2 mb-5 flex items-center justify-center [&_img]:object-top max-view-wide:flex-col ${p}`:`relative mt-2 mb-5 flex aspect-square items-center justify-center ${n?"overflow-visible":"overflow-hidden"} [&_img]:object-top ${p}`,style:r?{...f,borderRadius:10,columnGap:u(t,i),rowGap:T}:{...f,borderRadius:"var(--sf-card-image-radius, 10px)"},...l("image-frame"),children:[r?o(w,{children:[_(e),_(s??e)]}):e,c]}):o("div",{className:`relative mb-5 aspect-square ${n?"overflow-visible":"overflow-hidden"} bg-bg p-8 [&_img]:object-top`,style:{borderRadius:"var(--sf-card-image-radius, 10px)"},...l("image-frame"),children:[e,c]})}export{G as CARD_PAD_X_PX,d as GRID_GAP_PX,M as SET_PLATE_PX,T as SET_STACK_GAP_PX,N as SET_STACK_MAX_PX,X as default,u as setBandGapCss,x as setBandGapPx,h as setPlateWidthCss};
|
|
@@ -10,7 +10,17 @@ export interface CardProductPictureSettings {
|
|
|
10
10
|
swatch?: unknown;
|
|
11
11
|
shadow?: unknown;
|
|
12
12
|
shadowColor?: unknown;
|
|
13
|
+
shadowOn?: unknown;
|
|
13
14
|
}
|
|
15
|
+
export declare const SHADOW_ON: readonly [{
|
|
16
|
+
readonly label: "Auto";
|
|
17
|
+
readonly value: "auto";
|
|
18
|
+
}, {
|
|
19
|
+
readonly label: "Always";
|
|
20
|
+
readonly value: "always";
|
|
21
|
+
}];
|
|
22
|
+
export type ShadowOn = (typeof SHADOW_ON)[number]["value"];
|
|
23
|
+
export declare const shadowOnOf: (v: unknown) => ShadowOn;
|
|
14
24
|
export declare const PICTURE_FRAMES: readonly ["well", "full"];
|
|
15
25
|
export type PictureFrame = (typeof PICTURE_FRAMES)[number];
|
|
16
26
|
export declare const DEFAULT_PICTURE_FRAME: PictureFrame;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as d,Fragment as v}from"react/jsx-runtime";import{parseOption as Z}from"efficient-shell/format";import I from"next/image";import{useState as ne}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as O,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as oe,cardImageBackgroundPaints as J,resolveCardImageBackground as se}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as A}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as ie,boxSwatchFill as ce}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as de}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as me}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as ue}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as fe,setSecondSrc as ge}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as pe,parseCoverIndex as he,resolvePaintedSrc as be}from"../../lib/wheels/cover-rendering.js";import Se from"../WheelPlaceholder.js";import we from"../BrandPlate.js";import ke from"../TyreImage.js";import{cardSpinOf as ye}from"../card-spin.js";import{useCardHoverLayer as Ce,useGridCard as j}from"../GridCardTemplate.js";import R from"./CardPicture.js";import D from"./CardProductBadge.js";import{useHeldCardPicture as Fe}from"./useHeldCardPicture.js";import{useProductCardState as xe}from"./ProductCardState.js";import{blockParts as Pe}from"../../lib/block-parts.js";const n=Pe("ProductCard"),ve=[{label:"Auto",value:"auto"},{label:"Always",value:"always"}],_e=a=>Z(ve.map(r=>r.value),"auto",a),Ae=["well","full"],Ne="well",G=a=>Z(Ae,Ne,a);function Be({children:a}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:a})}function T({fill:a,badge:r,children:o}){const m=J(a);return d("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${m?"":" bg-surface"}`,style:m?{backgroundColor:a}:void 0,...n("image-frame"),children:[o,r]})}function H(a,r){const o=de();return ce({[ie]:a},o?.row)??se(r,oe)}function $e(a){const r=xe();return r.kind==="bundle"?e(Ee,{state:r,...a}):r.kind==="tyre"?e(Ie,{state:r,...a}):r.kind!=="wheel"?null:e(ze,{state:r,...a})}function Ee({state:a,imageBackground:r,cardImage:o,showBadge:m,frame:w,swatch:p}){const{bundle:t}=a,{imageSizes:h}=j(),u=G(w)==="full",b=t.components.length,S=t.image?u?e(I,{alt:t.name,src:t.image,fill:!0,sizes:h,className:"object-cover",draggable:!1,...n("image")}):e(I,{alt:t.name,src:t.image,width:1e3,height:1e3,sizes:h,className:"block h-full w-full object-cover",draggable:!1,...n("image")}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:ue("{n} piece","{n} pieces",b,{})}),f=e(Be,{children:S}),g=H(p,r),i=m!==!1?e(D,{edge:u}):null;return e(_,{style:A(o),...n("image-block"),children:u?e(T,{fill:g,badge:i,children:f}):d(v,{children:[i,e(R,{image:f,imageBackgroundFill:g})]})})}function Ie({state:a,imageBackground:r,cardImage:o,indexBadge:m,frame:w,swatch:p}){const{tyre:t}=a,{imageSizes:h}=j(),u=H(p,r),b=q(m),S=b!=="off"?e("span",{"aria-hidden":!0,"data-format":b,className:`${O} ${z}`,...n("card-number")}):null,f=e(ke,{image:t.image,className:"h-full w-full",sizes:h,showBackground:!1}),g=e(we,{brand:t.brand,logo:t.brandLogo});return e(_,{style:A(o),...n("image-block"),children:G(w)==="full"?d(T,{fill:u,badge:S,children:[f,g]}):d(v,{children:[S,e(R,{image:f,imageBackgroundFill:u,plate:g})]})})}function ze({state:a,imageBackground:r,cardImage:o,coverIndex:m,indexBadge:w,showBadge:p,setFlags:t,frame:h,setPicture:u,swatch:b,shadow:S,shadowColor:f,shadowOn:g}){const{wheel:i,sel:c,isSet:N}=a,{hover:Q,imageSizes:L,fit:V,rules:y,setGridGap:Y}=j(),C=ye(Q),ee=pe(i,he(m),c.finish?.name,c.shownSrc,V?.holes),[W,ae]=ne(()=>new Set),M=l=>{c.pictureFailed(l),ae(k=>k.has(l)?k:new Set(k).add(l))},U=be({overrideSrc:ee,hookSrc:c.shownSrc,failed:W}),B=i.rendersHaveAlpha===!0||_e(g)==="always"?me(S,f):null,re=B?{...C.style,filter:B}:C.style,$=(l,k)=>e(I,{alt:k,src:l,width:1e3,height:1e3,sizes:L,className:`block h-full w-full object-contain ${C.className}`,style:re,draggable:!1,onError:()=>M(l),...n("image")},l),te=c.finish?`${i.name} — ${c.finish.name}`:i.name,F=N&&fe(u)==="pair",le=F?ge(i.finishes?.find(l=>l.name===c.finish?.name),U):null,s=Fe({src:U,second:le,alt:te,sizes:L,failed:W,onFailed:M,near:c.nearScreen,holdEmpty:c.awaitingProbe}),X=d(v,{children:[s.src?$(s.src,s.alt):e(Se,{imageLabel:i.name,spin:C}),s.trial]}),E=q(w),x=E!=="off",P=H(b,r),K=Ce("picture",J(P)?P:void 0);if(G(h)==="full"){const l=d(v,{children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1,edge:!0})]});return e(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:d(T,{fill:P,badge:l,children:[d("div",{className:"flex h-full w-full items-center justify-center",children:[X,s.second?$(s.second,`${s.alt} — right`):null]}),K]})})}return d(_,{style:A(o),"data-set-picture":N&&!F?"one":void 0,...n("image-block"),children:[x?e("span",{"aria-hidden":!0,"data-format":E,className:`${O} ${z}`,...n("card-number")}):null,e(D,{show:p!==!1,numbered:x,sale:y.sale,axleSets:y.axleSets,setFlags:t!==!1}),e(R,{image:X,imageSecond:s.second?$(s.second,`${s.alt} — right`):void 0,wide:F,imageBackgroundFill:P,setGridGap:Y,plate:K,shadowed:!!B})]})}export{Ne as DEFAULT_PICTURE_FRAME,Ae as PICTURE_FRAMES,ve as SHADOW_ON,$e as default,_e as shadowOnOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import t from"../../../../../components/card-pieces/CardProductPicture.js";import r from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import t from"../../../../../components/card-pieces/CardProductPicture.js";import r from"../../../../../components/card-pieces/HostPart.js";import{ProductPictureMeta as d}from"./meta.js";const g={...d,render:e=>a(r,{label:d.label??"",editing:!!e.editor?.isEditing,children:a(t,{imageBackground:e.imageBackground,cardImage:e.cardImage,coverIndex:e.coverIndex,indexBadge:e.indexBadge,showBadge:e.showBadge,setFlags:e.setFlags,frame:e.frame,setPicture:e.setPicture,swatch:e.swatch,shadow:e.shadow,shadowColor:e.shadowColor,shadowOn:e.shadowOn})})};export{g as ProductPictureRender};
|