@anker-in/headless-ui 1.0.19-temp-101022 → 1.0.19-temp-101024
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/cjs/biz-components/CollectionShelves/CollectionShelvesItem.js +1 -1
- package/dist/cjs/biz-components/CollectionShelves/CollectionShelvesItem.js.map +2 -2
- package/dist/cjs/biz-components/CollectionShelves/index.js +1 -1
- package/dist/cjs/biz-components/CollectionShelves/index.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +2 -2
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/CollectionShelves/CollectionShelvesItem.js +1 -1
- package/dist/esm/biz-components/CollectionShelves/CollectionShelvesItem.js.map +2 -2
- package/dist/esm/biz-components/CollectionShelves/index.js +1 -1
- package/dist/esm/biz-components/CollectionShelves/index.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +2 -2
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as W,jsx as o,jsxs as r}from"react/jsx-runtime";import{cn as p}from"../../helpers/utils.js";import I from"../../components/badge.js";import{Text as E}from"../../components/text.js";import g from"../../components/button.js";import{gaTrack as j}from"../../shared/track.js";import{useState as
|
|
1
|
+
import{Fragment as W,jsx as o,jsxs as r}from"react/jsx-runtime";import{cn as p}from"../../helpers/utils.js";import I from"../../components/badge.js";import{Text as E}from"../../components/text.js";import g from"../../components/button.js";import{gaTrack as j}from"../../shared/track.js";import{useState as h,useEffect as k}from"react";import w from"../../components/picture.js";import{Heading as A}from"../../components/heading.js";import{useAiuiContext as L}from"../AiuiProvider/index.js";import{trackUrlRef as U}from"../../shared/trackUrlRef.js";import{formatVariantPrice as H}from"../ShelfDisplay/shelfDisplay.js";const R="image",z="collectio_shelves",M=999999999e-2,se=({data:e,configuration:t})=>{const{itemShape:S}=t||{},{locale:a="us"}=L(),[_,N]=h(""),T=(s,i,n)=>t?.event?.primaryButton?.(s,i+1,n),B=(s,i,n)=>t?.event?.secondaryButton?.(s,i+1,n),l=e?.variants?.find(s=>s?.sku===e?.sku)||e?.variants?.[0]||{},f=!l?.availableForSale||l?.price?.amount===M,C=t?.isShowTag,x=t?.isShowOriginalPrice,[v,D]=h([]),[$,b]=h(!1),d=l?.coupons?.[0],{price:F,basePrice:O,discount:c}=H({locale:a,amount:x&&d?d.variant_price4wscode:l.price,baseAmount:x&&d?l.price:0,currencyCode:e?.price?.currencyCode||"USD"}),P=()=>{const s=e?.sku,i=e?.variants;return i?.find(u=>u?.sku===s)?.image?.url||i?.[0]?.image?.url||""},m=e?.custom_name||e?.title||e?.name,y=e?.custom_description||e?.description;return k(()=>{let s=[];if(c){const n=`${c}${t?.metafields?.discounts?.off||""}`;s.push(n)}const i=e?.tags?.filter?.(n=>n?.startsWith?.("CLtag"))?.map?.(n=>n?.replace?.("CLtag:",""))?.slice?.(0,c?1:2);D(s.concat(i))},[c,t?.metafields?.discounts,e?.tags]),k(()=>{const{infos:s}=l?.metafields||{},{productInfos:i,preRender:n}=e?.metafields||{},{shopCommon:u}=t?.metafields||{};N(s?.comingSoon||i?.comingSoon||n?.soldOut||u?.soldOut||"")},[e,l]),o("div",{className:p(S==="rounded"?"rounded-2xl":"rounded-none","lg-desktop:aspect-h-[560] lg-desktop:aspect-w-[544] lg-desktop:max-h-[560px] desktop:aspect-h-[468] desktop:aspect-w-[427] desktop:max-h-[468px] laptop:aspect-h-[400] laptop:aspect-w-[288] tablet:aspect-h-[400] tablet:aspect-w-[296] tablet:max-h-[400px]","relative bg-[#EAEAEC] tablet:hover:bg-[#FFFFFF] box-border w-full cursor-pointer overflow-hidden duration-300","md-tablet:h-[400px] collection-shelves-item",{"aiui-dark":e?.custom_theme==="dark"}),children:r("div",{className:"absolute inset-0 box-border flex flex-col justify-between overflow-hidden",children:[o("div",{onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),className:p("desktop:p-6 p-4 relative inline-block w-full lg-desktop:h-[288px] desktop:h-[234px] h-[150px] overflow-hidden cursor-pointer"),children:r("a",{"aria-label":m,target:t?.target,href:U(`${a==="us"||!a?"":`/${a}`}/products/${e?.handle}`,`${R}_${z}`),onClick:()=>{j({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||l?.sku,item_name:e?.name,item_variant:l?.name,price:l?.price,index:t?.index+1}]}})},children:[o(w,{alt:"",source:P(),className:"flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto"}),o(w,{alt:"",source:e?.custom_image,className:p($?"opacity-100":"opacity-0","absolute inset-x-0 top-0 h-full object-cover [&_img]:size-full transition-all duration-300")})]})}),r("div",{className:"overflow-hidden flex flex-col justify-end desktop:pb-6 desktop:px-6 p-4 pt-4 flex-1 box-border collection-shelves-product-content",children:[C&&v?.length?o("div",{className:"box-border flex flex-wrap gap-1 overflow-hidden",children:v?.map?.((s,i)=>o(I,{children:s},i))}):null,m?o(A,{as:"h3",title:m||"",html:m||"",className:"lg-desktop:text-2xl text-xl collection-shelves-product-title mb-1 line-clamp-2 text-info-primary font-semibold"}):null,y?o(E,{size:2,html:y||"",className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 collection-shelves-product-description line-clamp-1 h-5 text-sm font-semibold text-info-primary"}):null,o("div",{className:"mb-2 mt-4 flex items-center",children:f?o("div",{className:"tablet:text-2xl text-info-primary text-xl font-semibold",children:_||""}):r(W,{children:[o("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-semibold",children:l?.availableForSale&&F||""}),o("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-semibold line-through",children:l?.availableForSale&&O||""})]})}),r("div",{className:p("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?o(g,{variant:"secondary",onClick:()=>B(e,t?.index,t),className:`overflow-hidden font-semibold ${t.direction==="vertical"?"w-full":""} ${t?.shape==="rounded"?"rounded-2xl":""}`,children:t?.secondaryButton||""}):null,t?.primaryButton?o(g,{variant:"primary",disabled:f,onClick:()=>T(e,t?.index,t),className:`overflow-hidden font-semibold ${t.direction==="vertical"?"w-full":""} ${t?.shape==="rounded"?"rounded-2xl":""}`,children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{se as CollectionShelvesWrapItem};
|
|
2
2
|
//# sourceMappingURL=CollectionShelvesItem.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionShelves/CollectionShelvesItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useState, useEffect } from 'react'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from '../ShelfDisplay/shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'collectio_shelves'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport const CollectionShelvesWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape } = configuration || {}\n const { locale = 'us' } = useAiuiContext()\n\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n const [showTags, setShowTags] = useState<string[]>([])\n const [showImage, setShowImage] = useState<boolean>(false)\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice, discount } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description\n\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${configuration?.metafields?.discounts?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [discount, configuration?.metafields?.discounts, data?.tags])\n\n useEffect(() => {\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n const { shopCommon } = configuration?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n }, [data, variant])\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'rounded' 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CAAClC,EAAMU,CAAO,CAAC,EAGhB5B,EAAC,OAEC,UAAWE,EACTkB,IAAc,UAAY,cAAgB,eAC1C,
|
|
4
|
+
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useState, useEffect } from 'react'\nimport Picture from '../../components/picture.js'\nimport { Heading } from '../../components/heading.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from '../ShelfDisplay/shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'collectio_shelves'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport const CollectionShelvesWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape } = configuration || {}\n const { locale = 'us' } = useAiuiContext()\n\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n const [showTags, setShowTags] = useState<string[]>([])\n const [showImage, setShowImage] = useState<boolean>(false)\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice, discount } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description\n\n useEffect(() => {\n let handleTags: string[] = []\n if (discount) {\n const discountTag = `${discount}${configuration?.metafields?.discounts?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [discount, configuration?.metafields?.discounts, data?.tags])\n\n useEffect(() => {\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n const { shopCommon } = configuration?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n }, [data, variant])\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-h-[560] lg-desktop:aspect-w-[544] lg-desktop:max-h-[560px] desktop:aspect-h-[468] desktop:aspect-w-[427] desktop:max-h-[468px] laptop:aspect-h-[400] laptop:aspect-w-[288] tablet:aspect-h-[400] tablet:aspect-w-[296] tablet:max-h-[400px]',\n 'relative bg-[#EAEAEC] tablet:hover:bg-[#FFFFFF] box-border w-full cursor-pointer overflow-hidden duration-300',\n 'md-tablet:h-[400px] collection-shelves-item',\n {\n 'aiui-dark': data?.custom_theme === 'dark',\n }\n )}\n >\n <div className=\"absolute inset-0 box-border flex flex-col justify-between overflow-hidden\">\n <div\n onMouseEnter={() => setShowImage(true)}\n onMouseLeave={() => setShowImage(false)}\n className={cn(\n 'desktop:p-6 p-4 relative inline-block w-full lg-desktop:h-[288px] desktop:h-[234px] h-[150px] overflow-hidden cursor-pointer'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n alt=\"\"\n source={handleUrl()}\n className=\"flex h-full justify-center object-cover [&_img]:h-full [&_img]:w-auto\"\n />\n <Picture\n alt=\"\"\n source={data?.custom_image}\n className={cn(\n showImage ? 'opacity-100' : 'opacity-0',\n 'absolute inset-x-0 top-0 h-full object-cover [&_img]:size-full transition-all duration-300'\n )}\n />\n </a>\n </div>\n <div className=\"overflow-hidden flex flex-col justify-end desktop:pb-6 desktop:px-6 p-4 pt-4 flex-1 box-border collection-shelves-product-content\">\n {isShowTag && showTags?.length ? (\n <div className=\"box-border flex flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n html={displayTitle || ''}\n className=\"lg-desktop:text-2xl text-xl collection-shelves-product-title mb-1 line-clamp-2 text-info-primary font-semibold\"\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription || ''}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 collection-shelves-product-description line-clamp-1 h-5 text-sm font-semibold text-info-primary\"\n />\n ) : null}\n <div className=\"mb-2 mt-4 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-semibold\">{soldOutText || ''}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-semibold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-semibold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`overflow-hidden font-semibold ${configuration.direction === 'vertical' ? 'w-full' : ''} ${configuration?.shape === 'rounded' ? 'rounded-2xl' : ''}`}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n disabled={isSoldOut}\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`overflow-hidden font-semibold ${configuration.direction === 'vertical' ? 'w-full' : ''} ${configuration?.shape === 'rounded' ? 'rounded-2xl' : ''}`}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAoGU,OAmEI,YAAAA,EAxCF,OAAAC,EA3BF,QAAAC,MAAA,oBApGV,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAW,4BAClB,OAAS,QAAAC,MAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAS,WAAAC,MAAe,wBACxB,OAAS,YAAAC,EAAU,aAAAC,MAAiB,QACpC,OAAOC,MAAa,8BACpB,OAAS,WAAAC,MAAe,8BACxB,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,sBAAAC,MAA0B,kCAGnC,MAAMC,EAAgB,QAChBC,EAAgB,oBAEhBC,EA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MAAOA,CAAa,EAC1E,UAAW,iCAAiCA,EAAc,YAAc,WAAa,SAAW,EAAE,IAAIA,GAAe,QAAU,UAAY,cAAgB,EAAE,GAE5J,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,cACdnB,EAACK,EAAA,CACC,QAAQ,UACR,SAAUyB,EACV,QAAS,IAAMN,EAAgBN,EAAMC,GAAe,MAAOA,CAAa,EACxE,UAAW,iCAAiCA,EAAc,YAAc,WAAa,SAAW,EAAE,IAAIA,GAAe,QAAU,UAAY,cAAgB,EAAE,GAE5J,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GA7HKD,GAAM,IAAMA,GAAM,MA8HzB,CAEJ",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "cn", "Badge", "Text", "Button", "gaTrack", "useState", "useEffect", "Picture", "Heading", "useAiuiContext", "trackUrlRef", "formatVariantPrice", "componentType", "componentName", "SOLD_OUT_PRICE", "CollectionShelvesWrapItem", "data", "configuration", "itemShape", "locale", "soldOutText", "setSoldOutText", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "showTags", "setShowTags", "showImage", "setShowImage", "coupon", "price", "basePrice", "discount", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "handleTags", "discountTag", "newTags", "infos", "productInfos", "preRender", "shopCommon"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as o}from"react/jsx-runtime";import{cn as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{cn as g}from"../../helpers/utils.js";import T from"../SwiperBox/index.js";import"../../shared/track.js";import{withLayout as k}from"../../shared/Styles.js";import{useExposure as M}from"../../hooks/useExposure.js";import{useRollout as P}from"../../hooks/useRollout.js";import{CollectionShelvesWrapItem as E}from"./CollectionShelvesItem.js";import{forwardRef as I,useEffect as L,useRef as B,useImperativeHandle as C,useState as H}from"react";const R="image",V="collectio_shelves",N=I(({key:n,data:t,event:a,buildData:m,breakpoints:c,className:f="",target:p="_self",metafields:u},d)=>{const{productsCard:h=[],title:b,isShowTag:w=!1,isShowOriginalPrice:v=!0,...D}=t,s=B(null),[S,x]=P({threshold:0}),[i,y]=H([]);return C(d,()=>s.current),M(s,{componentType:R,componentName:V,componentTitle:t?.title}),L(()=>{const l=h?.map?.(e=>{const r=m?.products?.find(_=>_?.handle===e?.handle);if(r)return{sku:e.sku,custom_name:e.custom_name,custom_image:e.custom_image,custom_link:e.custom_link,custom_theme:e.custom_theme,custom_description:e.custom_description,...r}})?.filter(e=>e);y(l?.length?l||[]:[])},[]),o("div",{ref:s,className:g("collection-shelves-wrap w-full",f,{"aiui-dark":t?.theme==="dark"}),children:o("div",{ref:S,children:o(T,{data:{list:i,configuration:{...D,isShowTag:w,event:a,target:p,isShowOriginalPrice:v,metafields:u||{},itemLength:i?.length}},id:`CollectionShelves${n}`,className:"!overflow-visible",Slide:E,breakpoints:c||{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3}}})})})});var J=k(N);export{J as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionShelves/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { CollectionShelvesWrapItem } from './CollectionShelvesItem.js'\nimport { forwardRef, useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from '../ShelfDisplay/shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'collectio_shelves'\n\nconst ShelfDisplay = forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n target = '_self',\n metafields,\n },\n ref\n ) => {\n const {\n productsCard = [],\n title,\n isShowTag = false,\n isShowOriginalPrice = true,\n ...other\n } = data\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const newCurrentData = productsCard\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n custom_name: item.custom_name,\n custom_image: item.custom_image,\n custom_theme: item.custom_theme,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn('collection-shelves-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n <div ref={viewRef as any}>\n <SwiperBox\n data={{\n list: currentItems,\n configuration: {\n ...other,\n isShowTag,\n event: event,\n target: target,\n isShowOriginalPrice,\n metafields: metafields || {},\n itemLength: currentItems?.length,\n },\n }}\n id={`CollectionShelves${key}`}\n className={`!overflow-visible`}\n Slide={CollectionShelvesWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { CollectionShelvesWrapItem } from './CollectionShelvesItem.js'\nimport { forwardRef, useEffect, useRef, useImperativeHandle, useState } from 'react'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from '../ShelfDisplay/shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'collectio_shelves'\n\nconst ShelfDisplay = forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n target = '_self',\n metafields,\n },\n ref\n ) => {\n const {\n productsCard = [],\n title,\n isShowTag = false,\n isShowOriginalPrice = true,\n ...other\n } = data\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const newCurrentData = productsCard\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n custom_name: item.custom_name,\n custom_image: item.custom_image,\n custom_link: item.custom_link,\n custom_theme: item.custom_theme,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn('collection-shelves-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n <div ref={viewRef as any}>\n <SwiperBox\n data={{\n list: currentItems,\n configuration: {\n ...other,\n isShowTag,\n event: event,\n target: target,\n isShowOriginalPrice,\n metafields: metafields || {},\n itemLength: currentItems?.length,\n },\n }}\n id={`CollectionShelves${key}`}\n className={`!overflow-visible`}\n Slide={CollectionShelvesWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
|
|
5
|
+
"mappings": "aA4EU,cAAAA,MAAA,oBA3EV,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAe,wBACtB,MAAwB,wBACxB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,cAAAC,MAAkB,4BAC3B,OAAS,6BAAAC,MAAiC,6BAC1C,OAAS,cAAAC,EAAY,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,EAAqB,YAAAC,MAAgB,QAG7E,MAAMC,EAAgB,QAChBC,EAAgB,oBAEhBC,EAAeP,EACnB,CACE,CACE,IAAAQ,EACA,KAAAC,EACA,MAAAC,EACA,UAAAC,EACA,YAAAC,EACA,UAAAC,EAAY,GACZ,OAAAC,EAAS,QACT,WAAAC,CACF,EACAC,IACG,CACH,KAAM,CACJ,aAAAC,EAAe,CAAC,EAChB,MAAAC,EACA,UAAAC,EAAY,GACZ,oBAAAC,EAAsB,GACtB,GAAGC,CACL,EAAIZ,EAEEa,EAAWpB,EAAuB,IAAI,EAEtC,CAACqB,EAASC,CAAM,EAAI1B,EAA2B,CAAE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AEJ,CACF,EAEA,IAAOmB,EAAQnC,EAAWW,CAAY",
|
|
6
6
|
"names": ["jsx", "cn", "SwiperBox", "withLayout", "useExposure", "useRollout", "CollectionShelvesWrapItem", "forwardRef", "useEffect", "useRef", "useImperativeHandle", "useState", "componentType", "componentName", "ShelfDisplay", "key", "data", "event", "buildData", "breakpoints", "className", "target", "metafields", "ref", "productsCard", "title", "isShowTag", "isShowOriginalPrice", "other", "innerRef", "viewRef", "inView", "currentItems", "setCurrentItems", "newCurrentData", "item", "findData", "params", "CollectionShelves_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as ye,jsx as s,jsxs as a}from"react/jsx-runtime";import{cn as b}from"../../helpers/utils.js";import{useAiuiContext as
|
|
1
|
+
import{Fragment as ye,jsx as s,jsxs as a}from"react/jsx-runtime";import{cn as b}from"../../helpers/utils.js";import{useAiuiContext as pe}from"../AiuiProvider/index.js";import{formatVariantPrice as ue}from"../ShelfDisplay/shelfDisplay.js";import fe from"../../components/badge.js";import"../../components/heading.js";import{Text as ge}from"../../components/text.js";import D from"../../components/button.js";import H from"../../components/picture.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{getFunctionMemberPrice as be}from"./component/price.js";import{useState as i,useEffect as k}from"react";const C="image",_="product_shelf",xe=999999999e-2,ve=e=>{let c;return e?.includes("products")?c=e?.split("products")[0]+"files/":c=e?.replace(e?.split("files")?.pop()||"","")+"/",c},he=({data:e,isSale:c=!1,buttonText:N,itemShape:W,metafields:A,onPrimaryChange:U,onSecondaryChange:E})=>{const{memberPriceDiscount:R,memberSetting:S,discounts:w,shopCommon:V}=A,[m,P]=i(""),[q,T]=i(""),[u,$]=i(""),[I,G]=i(!1),[B,J]=i({}),[K,Q]=i(!1),[x,X]=i({price:"",basePrice:""}),[M,Y]=i([]),[Z,ee]=i([]),[f,te]=i(""),[se,oe]=i(""),{locale:l="us",currencyCode:re,isLogin:L}=pe(),v=e?.custom_name||e?.title||e?.name,z=e?.custom_description||e?.description||e?.descriptionHtml,n=e?.filter_variants||e?.variants||[],ie=t=>$(t),h=(t,r,o,d)=>{Q(d),te(t||""),X({basePrice:r||"",price:o||""})};return k(()=>{if(u){const o=n?.find(d=>d?.name?.includes?.(u));P(o?.sku||n?.[0]?.sku||""),T(o?.image?.url||n?.[0]?.image?.url||"");return}const t=e?.options?.find(o=>o?.displayName==="color")?.values?.[0]?.label;t&&$(t);const r=n?.find(o=>o?.name?.includes?.(t));P(r?.sku||n?.[0]?.sku||""),T(r?.image?.url||n?.[0]?.image?.url||"")},[u]),k(()=>{if(!m)return;Y(e?.tags||[]);const t=n?.find(p=>p?.sku===m)||n?.[0]||{};J(t),G(!t?.availableForSale||t?.price?.amount===xe);const{infos:r}=t?.metafields||{},{productInfos:o,preRender:d}=e?.metafields||{};oe(r?.comingSoon||o?.comingSoon||d?.soldOut||V?.soldOut||"");const g=t?.coupons?.[0],{price:F,basePrice:O,discount:le,discountAmount:ne}=ue({locale:l,amount:g?g.variant_price4wscode:t.price,baseAmount:g?t.price:0,currencyCode:e?.price?.currencyCode||"USD"}),j=(g?.value_type==="fixed_amount"?ne:le)||"";if(L){const p=be({locale:l,variant:t,shopMemberPriceDiscountConfig:R,currencyCode:re||e?.price?.currencyCode||"USD"});if(p){const{hasMemberPrice:ae,salePriceWithCurrency:ce,originalPriceWithCurrency:me,savePriceWithCurrency:de}=p;h(de||"",me||"",ae?ce:"",p?.hasMemberPrice)}else h(j,O||"",F||"",!1)}else h(j,O||"",F||"",!1)},[e,m]),k(()=>{let t=[];if(f){const o=`${f}${w?.off}`;t.push(o)}const r=M?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,f?1:2);ee(t.concat(r))},[M,f]),c&&!x?.basePrice&&!e?.mImage?null:s("div",{className:b(W==="round"?"rounded-2xl":"rounded-none","lg-desktop:h-[538px] desktop:h-[478px] tablet:h-[448px] h-[419px] relative tablet:hover:bg-info-white","bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300",{"aiui-dark":e.theme==="dark"}),children:e?.mImage?s("div",{className:"absolute inset-0 box-border overflow-hidden hover:[&_img]:scale-105",children:s("div",{className:"relative inset-0 size-full",children:a("a",{className:"size-full",href:y(e?.link,`${C}_${_}`),children:[s(H,{alt:"",source:e?.mImage?.url||e?.mImage,className:"size-full [&_img]:object-cover [&_img]:size-full",imgClassName:"size-full object-cover transition-all duration-300"}),a("div",{className:"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4",children:[s("p",{className:"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-semibold",dangerouslySetInnerHTML:{__html:e?.subTitle}}),s("span",{className:"text-info-secondary desktop:text-[32px] text-[20px] font-semibold desktop:leading-9 line-clamp-4",dangerouslySetInnerHTML:{__html:e?.title}})]})]})})}):a("div",{className:"desktop:p-6 desktop:pt-4 absolute inset-0 box-border flex flex-col justify-between overflow-hidden tablet:p-4 p-2 pb-4",children:[s("div",{className:"flex flex-wrap gap-1 overflow-hidden collection-filter-tags",children:Z?.map?.((t,r)=>s(fe,{className:"whitespace-nowrap max-w-full truncate px-1 box-border font-semibold item-badge",children:t},r))}),s("a",{target:"_blank","aria-label":v,href:y(`${l==="us"||!l?"":`/${l}`}/products/${e?.handle}`,`${C}_${_}`),children:s("div",{className:b("my-1 m-auto desktop:size-[196px] size-[120px] overflow-hidden"),children:s(H,{alt:"",source:q,className:"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit"})})}),e?.options?.map(t=>{if(t?.displayName==="color")return s("div",{className:"flex items-center gap-1",children:t?.values?.map(r=>{const o=r?.hexColors?r.hexColors?.[0]:r?.label;return s("button",{onClick:()=>ie(r?.label),className:b("size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent",`${u===r?.label?"border-[#00BEFA]":""}`),children:s("img",{alt:o,className:"h-full w-full object-cover",src:`${ve(e?.images?.[0]?.url)}${o?.toLowerCase().split(" ")?.join("-")}_50x.png`})},r?.label)})})}),a("div",{children:[v?s("span",{dangerouslySetInnerHTML:{__html:v||""},className:"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-semibold"}):null,e?.metafields?.judgemeBadge?s("a",{target:"_blank",className:"font-semibold text-xs [&_.jdgm-star]:text-[#F77234]",dangerouslySetInnerHTML:{__html:e?.metafields?.judgemeBadge},href:y(`${l==="us"||!l?"":`/${l}`}/products/${e?.handle}`,`${C}_${_}`)}):null,z?s(ge,{size:2,html:z||"",className:"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-semibold"}):null,a("div",{className:"mt-3 mb-2",children:[s("p",{dangerouslySetInnerHTML:{__html:L&&K&&(w?.memberPrice||S?.member_price||S?.plus_member_price)||""},className:"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-semibold"}),s("div",{className:"flex items-center",children:I?s("div",{className:"desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold",children:se||""}):a(ye,{children:[s("div",{className:"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold",children:B?.availableForSale&&x?.price||""}),s("div",{className:"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-semibold line-through",children:B?.availableForSale&&x?.basePrice||""})]})})]}),a("div",{className:b("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col"),children:[s(D,{variant:"secondary",className:"m-tablet:w-full",onClick:()=>E?.(e,m),children:N?.secondaryButton||"Learn More"}),s(D,{variant:"primary",className:"m-tablet:w-full",disabled:I,onClick:()=>U?.(e,m),children:N?.primaryButton||"Shop Now"})]})]})]})},e?.id||e?.handle)};var Le=he;export{Le as default};
|
|
2
2
|
//# sourceMappingURL=FilterCardWrapItem.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionsFilters/FilterCardWrapItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getFunctionMemberPrice } from './component/price.js'\nimport { useState, useEffect } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nconst getShopifyCdnBaseUrl = (imagePath: string | null) => {\n // \u76EE\u524D\u77E5\u9053\u7684 shopify \u56FE\u7247\u8DEF\u7531\u7684\u5F62\u5F0F\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/files/Group_5581_2.jpg?v=1662379184\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/products/B2633123.jpg?v=1631264041_3840x\n // \u8FD4\u56DE https://cdn.shopify.com/s/files/1/0493/9834/9974/files/\n let path\n if (imagePath?.includes('products')) {\n path = imagePath?.split('products')[0] + 'files/'\n } else {\n path = imagePath?.replace(imagePath?.split('files')?.pop() || '', '') + '/'\n }\n return path\n}\n\ntype FilterCardWrapItemProps = {\n data: any\n isSale?: boolean\n buttonText?: any\n itemShape?: string\n metafields: any\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n}\n\nconst FilterCardWrapItem = ({\n data,\n isSale = false,\n buttonText,\n itemShape,\n metafields,\n onPrimaryChange,\n onSecondaryChange,\n}: FilterCardWrapItemProps) => {\n const { memberPriceDiscount, memberSetting, discounts, shopCommon } = metafields\n const [currentSku, setCurrentSku] = useState<string>('')\n const [currentImage, setCurrentImage] = useState<string>('')\n const [selectedColor, setSelectedColor] = useState<string>('')\n const [isSoldOut, setIsSoldOut] = useState<any>(false)\n const [currentVariant, setCurrentVariant] = useState<any>({})\n const [plusMemberStatus, setPlusMemberStatus] = useState<boolean>(false)\n const [priceCollection, setPriceCollection] = useState<{ price: string; basePrice: string }>({\n price: '',\n basePrice: '',\n })\n const [tags, setTags] = useState<string[]>([])\n const [showTags, setShowTags] = useState<string[]>([])\n const [discountCollection, setDiscountCollection] = useState<string>('')\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const { locale = 'us', currencyCode, isLogin } = useAiuiContext()\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description || data?.descriptionHtml\n const skuArray = data?.filter_variants || data?.variants || []\n\n const onColorClick = (color: string) => setSelectedColor(color)\n\n const handleBasePrice = (discount: string, priceCurrency: string, salePrice: string, status: boolean) => {\n setPlusMemberStatus(status)\n setDiscountCollection(discount || '')\n setPriceCollection({\n basePrice: priceCurrency || '',\n price: salePrice || '',\n })\n }\n\n useEffect(() => {\n if (selectedColor) {\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(selectedColor))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n return\n }\n const firstOption = data?.options?.find((item: any) => item?.displayName === 'color')?.values?.[0]?.label\n firstOption && setSelectedColor(firstOption)\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(firstOption))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n }, [selectedColor])\n\n useEffect(() => {\n if (!currentSku) return\n setTags(data?.tags || [])\n const variant = skuArray?.find((item: any) => item?.sku === currentSku) || skuArray?.[0] || {}\n setCurrentVariant(variant)\n setIsSoldOut(!variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE)\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n const { price, basePrice, discount, discountAmount } = formatVariantPrice({\n locale: locale,\n amount: coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n const showPrice = (coupon?.value_type === 'fixed_amount' ? discountAmount : discount) || ''\n // \u4F1A\u5458\u6298\u6263\n if (isLogin) {\n const result = getFunctionMemberPrice({\n locale: locale,\n variant: variant,\n shopMemberPriceDiscountConfig: memberPriceDiscount,\n currencyCode: currencyCode || data?.price?.currencyCode || 'USD',\n })\n if (result) {\n const { hasMemberPrice, salePriceWithCurrency, originalPriceWithCurrency, savePriceWithCurrency } = result\n handleBasePrice(\n savePriceWithCurrency || '',\n originalPriceWithCurrency || '',\n hasMemberPrice ? salePriceWithCurrency : '',\n result?.hasMemberPrice\n )\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n }, [data, currentSku])\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discountCollection) {\n const discountTag = `${discountCollection}${discounts?.off}`\n handleTags.push(discountTag)\n }\n const newTags = tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discountCollection ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [tags, discountCollection])\n\n if (isSale && !priceCollection?.basePrice && !data?.mImage) {\n return null\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:h-[493px] laptop:h-[433px] h-[398px] relative tablet:hover:bg-info-white',\n 'bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n {data?.mImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden hover:[&_img]:scale-105\">\n <div className=\"relative inset-0 size-full\">\n <a className=\"size-full\" href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}>\n <Picture\n alt=\"\"\n source={data?.mImage?.url || data?.mImage}\n className=\"size-full [&_img]:object-cover [&_img]:size-full\"\n imgClassName=\"size-full object-cover transition-all duration-300\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4\">\n <p\n className=\"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-semibold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n />\n <span\n className=\"text-info-secondary desktop:text-[32px] text-[20px] font-semibold desktop:leading-9 line-clamp-4\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n />\n </div>\n </a>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden tablet:p-4 p-2 pb-4\">\n <div className=\"flex flex-wrap gap-1 overflow-hidden collection-filter-tags\">\n {showTags?.map?.((item: string, index: number) => (\n <Badge\n key={index}\n className=\"whitespace-nowrap max-w-full truncate px-1 box-border font-semibold item-badge\"\n >\n {item}\n </Badge>\n ))}\n </div>\n <a\n target=\"_blank\"\n aria-label={displayTitle}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n >\n <div className={cn('my-1 m-auto desktop:size-[196px] size-[120px] overflow-hidden')}>\n <Picture\n alt=\"\"\n source={currentImage}\n className=\"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit\"\n />\n </div>\n </a>\n {data?.options?.map((option: any) => {\n if (option?.displayName === 'color') {\n return (\n <div className=\"flex items-center gap-1\">\n {option?.values?.map((item: any) => {\n const color = item?.hexColors ? item.hexColors?.[0] : item?.label\n return (\n <button\n key={item?.label}\n onClick={() => onColorClick(item?.label)}\n className={cn(\n 'size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent',\n `${selectedColor === item?.label ? 'border-[#00BEFA]' : ''}`\n )}\n >\n <img\n alt={color}\n className=\"h-full w-full object-cover\"\n src={`${getShopifyCdnBaseUrl(data?.images?.[0]?.url)}${color\n ?.toLowerCase()\n .split(' ')\n ?.join('-')}_${'50x'}.png`}\n />\n </button>\n )\n })}\n </div>\n )\n }\n })}\n <div>\n {displayTitle ? (\n <span\n dangerouslySetInnerHTML={{ __html: displayTitle || '' }}\n className=\"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-semibold\"\n />\n ) : null}\n {data?.metafields?.judgemeBadge ? (\n <a\n target=\"_blank\"\n className=\"font-semibold text-xs [&_.jdgm-star]:text-[#F77234]\"\n dangerouslySetInnerHTML={{ __html: data?.metafields?.judgemeBadge }}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription || ''}\n className=\"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-semibold\"\n />\n ) : null}\n <div className=\"mt-3 mb-2\">\n <p\n dangerouslySetInnerHTML={{\n __html:\n isLogin && plusMemberStatus\n ? discounts?.memberPrice || memberSetting?.member_price || memberSetting?.plus_member_price || ''\n : '',\n }}\n className=\"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-semibold\"\n />\n <div className=\"flex items-center\">\n {isSoldOut ? (\n <div className=\"desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold\">\n {soldOutText || ''}\n </div>\n ) : (\n <>\n <div className=\"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold\">\n {currentVariant?.availableForSale ? priceCollection?.price || '' : ''}\n </div>\n <div className=\"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-semibold line-through\">\n {currentVariant?.availableForSale ? priceCollection?.basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn('shelf-flex-button-group', 'lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col')}\n >\n <Button\n variant=\"secondary\"\n className=\"m-tablet:w-full\"\n onClick={() => onSecondaryChange?.(data, currentSku)}\n >\n {buttonText?.secondaryButton || 'Learn More'}\n </Button>\n <Button\n variant=\"primary\"\n className=\"m-tablet:w-full\"\n disabled={isSoldOut}\n onClick={() => onPrimaryChange?.(data, currentSku)}\n >\n {buttonText?.primaryButton || 'Shop Now'}\n </Button>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\nexport default FilterCardWrapItem\n"],
|
|
5
|
-
"mappings": "AA6Kc,OAsHI,YAAAA,GAtHJ,OAAAC,EAMA,QAAAC,MANA,oBA7Kd,OAAS,MAAAC,MAAU,yBACnB,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,sBAAAC,OAA0B,kCACnC,OAAOC,OAAW,4BAClB,MAAwB,8BACxB,OAAS,QAAAC,OAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAOC,MAAa,8BACpB,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,0BAAAC,OAA8B,uBACvC,OAAS,YAAAC,EAAU,aAAAC,MAAiB,QAEpC,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAEjBC,GAAwBC,GAA6B,CAKzD,IAAIC,EACJ,OAAID,GAAW,SAAS,UAAU,EAChCC,EAAOD,GAAW,MAAM,UAAU,EAAE,CAAC,EAAI,SAEzCC,EAAOD,GAAW,QAAQA,GAAW,MAAM,OAAO,GAAG,IAAI,GAAK,GAAI,EAAE,EAAI,IAEnEC,CACT,EAYMC,GAAqB,CAAC,CAC1B,KAAAC,EACA,OAAAC,EAAS,GACT,WAAAC,EACA,UAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAA+B,CAC7B,KAAM,CAAE,oBAAAC,EAAqB,cAAAC,EAAe,UAAAC,EAAW,WAA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zF,GAAIP,EAAS,CACX,MAAMuB,EAASpE,GAAuB,CACpC,OAAQ2C,EACR,QAASgB,EACT,8BAA+B1C,EAC/B,aAAc2B,IAAgBlC,GAAM,OAAO,cAAgB,KAC7D,CAAC,EACD,GAAI0D,EAAQ,CACV,KAAM,CAAE,eAAAC,GAAgB,sBAAAC,GAAuB,0BAAAC,GAA2B,sBAAAC,EAAsB,EAAIJ,EACpGjB,EACEqB,IAAyB,GACzBD,IAA6B,GAC7BF,GAAiBC,GAAwB,GACzCF,GAAQ,cACV,CACF,MACEjB,EAAgBgB,EAAWF,GAAa,GAAID,GAAS,GAAI,EAAK,CAElE,MACEb,EAAgBgB,EAAWF,GAAa,GAAID,GAAS,GAAI,EAAK,CAElE,EAAG,CAACtD,EAAMW,CAAU,CAAC,EAGrBnB,EAAU,IAAM,CACd,IAAIuE,EAAuB,CAAC,EAC5B,GAAIlC,EAAoB,CACtB,MAAMmC,EAAc,GAAGnC,CAAkB,GAAGpB,GAAW,GAAG,GAC1DsD,EAAW,KAAKC,CAAW,CAC7B,CACA,MAAMC,EAAUxC,GACZ,SAAUsB,GAAiBA,GAAM,aAAa,OAAO,CAAC,GACtD,MAAOA,GAAiBA,GAAM,UAAU,SAAU,EAAE,CAAC,GACrD,QAAQ,EAAGlB,EAAqB,EAAI,CAAC,EACzCD,GAAYmC,EAAW,OAAOE,CAAO,CAAC,CACxC,EAAG,CAACxC,EAAMI,CAAkB,CAAC,EAEzB5B,GAAU,CAACsB,GAAiB,WAAa,CAACvB,GAAM,OAC3C,KAIPpB,EAAC,OAEC,UAAWE,EACTqB,IAAc,QAAU,cAAgB,eACxC,
|
|
4
|
+
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getFunctionMemberPrice } from './component/price.js'\nimport { useState, useEffect } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nconst getShopifyCdnBaseUrl = (imagePath: string | null) => {\n // \u76EE\u524D\u77E5\u9053\u7684 shopify \u56FE\u7247\u8DEF\u7531\u7684\u5F62\u5F0F\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/files/Group_5581_2.jpg?v=1662379184\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/products/B2633123.jpg?v=1631264041_3840x\n // \u8FD4\u56DE https://cdn.shopify.com/s/files/1/0493/9834/9974/files/\n let path\n if (imagePath?.includes('products')) {\n path = imagePath?.split('products')[0] + 'files/'\n } else {\n path = imagePath?.replace(imagePath?.split('files')?.pop() || '', '') + '/'\n }\n return path\n}\n\ntype FilterCardWrapItemProps = {\n data: any\n isSale?: boolean\n buttonText?: any\n itemShape?: string\n metafields: any\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n}\n\nconst FilterCardWrapItem = ({\n data,\n isSale = false,\n buttonText,\n itemShape,\n metafields,\n onPrimaryChange,\n onSecondaryChange,\n}: FilterCardWrapItemProps) => {\n const { memberPriceDiscount, memberSetting, discounts, shopCommon } = metafields\n const [currentSku, setCurrentSku] = useState<string>('')\n const [currentImage, setCurrentImage] = useState<string>('')\n const [selectedColor, setSelectedColor] = useState<string>('')\n const [isSoldOut, setIsSoldOut] = useState<any>(false)\n const [currentVariant, setCurrentVariant] = useState<any>({})\n const [plusMemberStatus, setPlusMemberStatus] = useState<boolean>(false)\n const [priceCollection, setPriceCollection] = useState<{ price: string; basePrice: string }>({\n price: '',\n basePrice: '',\n })\n const [tags, setTags] = useState<string[]>([])\n const [showTags, setShowTags] = useState<string[]>([])\n const [discountCollection, setDiscountCollection] = useState<string>('')\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const { locale = 'us', currencyCode, isLogin } = useAiuiContext()\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description || data?.descriptionHtml\n const skuArray = data?.filter_variants || data?.variants || []\n\n const onColorClick = (color: string) => setSelectedColor(color)\n\n const handleBasePrice = (discount: string, priceCurrency: string, salePrice: string, status: boolean) => {\n setPlusMemberStatus(status)\n setDiscountCollection(discount || '')\n setPriceCollection({\n basePrice: priceCurrency || '',\n price: salePrice || '',\n })\n }\n\n useEffect(() => {\n if (selectedColor) {\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(selectedColor))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n return\n }\n const firstOption = data?.options?.find((item: any) => item?.displayName === 'color')?.values?.[0]?.label\n firstOption && setSelectedColor(firstOption)\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(firstOption))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n }, [selectedColor])\n\n useEffect(() => {\n if (!currentSku) return\n setTags(data?.tags || [])\n const variant = skuArray?.find((item: any) => item?.sku === currentSku) || skuArray?.[0] || {}\n setCurrentVariant(variant)\n setIsSoldOut(!variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE)\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n const { price, basePrice, discount, discountAmount } = formatVariantPrice({\n locale: locale,\n amount: coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n const showPrice = (coupon?.value_type === 'fixed_amount' ? discountAmount : discount) || ''\n // \u4F1A\u5458\u6298\u6263\n if (isLogin) {\n const result = getFunctionMemberPrice({\n locale: locale,\n variant: variant,\n shopMemberPriceDiscountConfig: memberPriceDiscount,\n currencyCode: currencyCode || data?.price?.currencyCode || 'USD',\n })\n if (result) {\n const { hasMemberPrice, salePriceWithCurrency, originalPriceWithCurrency, savePriceWithCurrency } = result\n handleBasePrice(\n savePriceWithCurrency || '',\n originalPriceWithCurrency || '',\n hasMemberPrice ? salePriceWithCurrency : '',\n result?.hasMemberPrice\n )\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n }, [data, currentSku])\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discountCollection) {\n const discountTag = `${discountCollection}${discounts?.off}`\n handleTags.push(discountTag)\n }\n const newTags = tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discountCollection ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [tags, discountCollection])\n\n if (isSale && !priceCollection?.basePrice && !data?.mImage) {\n return null\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:h-[538px] desktop:h-[478px] tablet:h-[448px] h-[419px] relative tablet:hover:bg-info-white',\n 'bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n {data?.mImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden hover:[&_img]:scale-105\">\n <div className=\"relative inset-0 size-full\">\n <a className=\"size-full\" href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}>\n <Picture\n alt=\"\"\n source={data?.mImage?.url || data?.mImage}\n className=\"size-full [&_img]:object-cover [&_img]:size-full\"\n imgClassName=\"size-full object-cover transition-all duration-300\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4\">\n <p\n className=\"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-semibold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n />\n <span\n className=\"text-info-secondary desktop:text-[32px] text-[20px] font-semibold desktop:leading-9 line-clamp-4\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n />\n </div>\n </a>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 desktop:pt-4 absolute inset-0 box-border flex flex-col justify-between overflow-hidden tablet:p-4 p-2 pb-4\">\n <div className=\"flex flex-wrap gap-1 overflow-hidden collection-filter-tags\">\n {showTags?.map?.((item: string, index: number) => (\n <Badge\n key={index}\n className=\"whitespace-nowrap max-w-full truncate px-1 box-border font-semibold item-badge\"\n >\n {item}\n </Badge>\n ))}\n </div>\n <a\n target=\"_blank\"\n aria-label={displayTitle}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n >\n <div className={cn('my-1 m-auto desktop:size-[196px] size-[120px] overflow-hidden')}>\n <Picture\n alt=\"\"\n source={currentImage}\n className=\"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit\"\n />\n </div>\n </a>\n {data?.options?.map((option: any) => {\n if (option?.displayName === 'color') {\n return (\n <div className=\"flex items-center gap-1\">\n {option?.values?.map((item: any) => {\n const color = item?.hexColors ? item.hexColors?.[0] : item?.label\n return (\n <button\n key={item?.label}\n onClick={() => onColorClick(item?.label)}\n className={cn(\n 'size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent',\n `${selectedColor === item?.label ? 'border-[#00BEFA]' : ''}`\n )}\n >\n <img\n alt={color}\n className=\"h-full w-full object-cover\"\n src={`${getShopifyCdnBaseUrl(data?.images?.[0]?.url)}${color\n ?.toLowerCase()\n .split(' ')\n ?.join('-')}_${'50x'}.png`}\n />\n </button>\n )\n })}\n </div>\n )\n }\n })}\n <div>\n {displayTitle ? (\n <span\n dangerouslySetInnerHTML={{ __html: displayTitle || '' }}\n className=\"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-semibold\"\n />\n ) : null}\n {data?.metafields?.judgemeBadge ? (\n <a\n target=\"_blank\"\n className=\"font-semibold text-xs [&_.jdgm-star]:text-[#F77234]\"\n dangerouslySetInnerHTML={{ __html: data?.metafields?.judgemeBadge }}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription || ''}\n className=\"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-semibold\"\n />\n ) : null}\n <div className=\"mt-3 mb-2\">\n <p\n dangerouslySetInnerHTML={{\n __html:\n isLogin && plusMemberStatus\n ? discounts?.memberPrice || memberSetting?.member_price || memberSetting?.plus_member_price || ''\n : '',\n }}\n className=\"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-semibold\"\n />\n <div className=\"flex items-center\">\n {isSoldOut ? (\n <div className=\"desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold\">\n {soldOutText || ''}\n </div>\n ) : (\n <>\n <div className=\"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-semibold\">\n {currentVariant?.availableForSale ? priceCollection?.price || '' : ''}\n </div>\n <div className=\"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-semibold line-through\">\n {currentVariant?.availableForSale ? priceCollection?.basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn('shelf-flex-button-group', 'lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col')}\n >\n <Button\n variant=\"secondary\"\n className=\"m-tablet:w-full\"\n onClick={() => onSecondaryChange?.(data, currentSku)}\n >\n {buttonText?.secondaryButton || 'Learn More'}\n </Button>\n <Button\n variant=\"primary\"\n className=\"m-tablet:w-full\"\n disabled={isSoldOut}\n onClick={() => onPrimaryChange?.(data, currentSku)}\n >\n {buttonText?.primaryButton || 'Shop Now'}\n </Button>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\nexport default FilterCardWrapItem\n"],
|
|
5
|
+
"mappings": "AA6Kc,OAsHI,YAAAA,GAtHJ,OAAAC,EAMA,QAAAC,MANA,oBA7Kd,OAAS,MAAAC,MAAU,yBACnB,OAAS,kBAAAC,OAAsB,2BAC/B,OAAS,sBAAAC,OAA0B,kCACnC,OAAOC,OAAW,4BAClB,MAAwB,8BACxB,OAAS,QAAAC,OAAY,2BACrB,OAAOC,MAAY,6BACnB,OAAOC,MAAa,8BACpB,OAAS,eAAAC,MAAmB,8BAC5B,OAAS,0BAAAC,OAA8B,uBACvC,OAAS,YAAAC,EAAU,aAAAC,MAAiB,QAEpC,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAEjBC,GAAwBC,GAA6B,CAKzD,IAAIC,EACJ,OAAID,GAAW,SAAS,UAAU,EAChCC,EAAOD,GAAW,MAAM,UAAU,EAAE,CAAC,EAAI,SAEzCC,EAAOD,GAAW,QAAQA,GAAW,MAAM,OAAO,GAAG,IAAI,GAAK,GAAI,EAAE,EAAI,IAEnEC,CACT,EAYMC,GAAqB,CAAC,CAC1B,KAAAC,EACA,OAAAC,EAAS,GACT,WAAAC,EACA,UAAAC,EACA,WAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAA+B,CAC7B,KAAM,CAAE,oBAAAC,EAAqB,cAAAC,EAAe,UAAAC,EAAW,WAAAC,CAAW,EAAIN,EAChE,CAACO,EAAYC,CAAa,EAAIrB,EAAiB,EAAE,EACjD,CAACsB,EAAcC,CAAe,EAAIvB,EAAiB,EAAE,EACrD,CAACwB,EAAeC,CAAgB,EAAIzB,EAAiB,EAAE,EACvD,CAAC0B,EAAWC,CAAY,EAAI3B,EA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ice", "Badge", "Text", "Button", "Picture", "trackUrlRef", "getFunctionMemberPrice", "useState", "useEffect", "componentType", "componentName", "SOLD_OUT_PRICE", "getShopifyCdnBaseUrl", "imagePath", "path", "FilterCardWrapItem", "data", "isSale", "buttonText", "itemShape", "metafields", "onPrimaryChange", "onSecondaryChange", "memberPriceDiscount", "memberSetting", "discounts", "shopCommon", "currentSku", "setCurrentSku", "currentImage", "setCurrentImage", "selectedColor", "setSelectedColor", "isSoldOut", "setIsSoldOut", "currentVariant", "setCurrentVariant", "plusMemberStatus", "setPlusMemberStatus", "priceCollection", "setPriceCollection", "tags", "setTags", "showTags", "setShowTags", "discountCollection", "setDiscountCollection", "soldOutText", "setSoldOutText", "locale", "currencyCode", "isLogin", "displayTitle", "displayDescription", "skuArray", "onColorClick", "color", "handleBasePrice", "discount", "priceCurrency", "salePrice", "status", "findSku", "item", "firstOption", "variant", "infos", "productInfos", "preRender", "coupon", "price", "basePrice", "discountAmount", "showPrice", "result", "hasMemberPrice", "salePriceWithCurrency", "originalPriceWithCurrency", "savePriceWithCurrency", "handleTags", "discountTag", "newTags", "index", "option", "FilterCardWrapItem_default"]
|
|
7
7
|
}
|