@anker-in/headless-ui 1.3.87 → 1.3.88
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/CONTRIBUTING.md +57 -0
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/types.d.ts +12 -1
- package/dist/cjs/biz-components/ActiveShelf/types.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +28 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
- package/dist/cjs/biz-components/Chat/button.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +12 -6
- package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/cjs/biz-components/ImageWithText/types.js +1 -1
- package/dist/cjs/biz-components/Ksp/index.d.ts +2 -0
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/MarqueeReview/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/cjs/biz-components/ProductHero/types.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/ProductNav/types.d.ts +5 -2
- package/dist/cjs/biz-components/ProductNav/types.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +5 -4
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.js +1 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/index.d.ts +1 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/hooks/useBoaButton.d.ts +27 -0
- package/dist/cjs/hooks/useBoaButton.js +1 -0
- package/dist/cjs/hooks/useDraggableScroll.js +1 -1
- package/dist/cjs/hooks/useExposure.d.ts +1 -1
- package/dist/cjs/hooks/useExposure.js +1 -1
- package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
- package/dist/cjs/index.d.ts +10 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/shared/ContainerGridContext.d.ts +20 -0
- package/dist/cjs/shared/ContainerGridContext.js +1 -0
- package/dist/cjs/shared/Styles.d.ts +2 -0
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/adTrack.d.ts +38 -0
- package/dist/cjs/shared/adTrack.js +1 -0
- package/dist/cjs/shared/amazonAttribution.d.ts +31 -0
- package/dist/cjs/shared/amazonAttribution.js +1 -0
- package/dist/cjs/shared/mediaGridSpec.d.ts +87 -0
- package/dist/cjs/shared/mediaGridSpec.js +1 -0
- package/dist/cjs/stories/BoaStoryProvider.d.ts +10 -0
- package/dist/cjs/stories/BoaStoryProvider.js +1 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/types.d.ts +12 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +28 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/esm/biz-components/Chat/button.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/esm/biz-components/HeroBanner/types.d.ts +12 -6
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +2 -0
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/MarqueeReview/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/ProductNav/types.d.ts +5 -2
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +5 -4
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.js +1 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/index.d.ts +1 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/hooks/useBoaButton.d.ts +27 -0
- package/dist/esm/hooks/useBoaButton.js +1 -0
- package/dist/esm/hooks/useDraggableScroll.js +1 -1
- package/dist/esm/hooks/useExposure.d.ts +1 -1
- package/dist/esm/hooks/useExposure.js +1 -1
- package/dist/esm/hooks/useViewItemList.d.ts +1 -1
- package/dist/esm/index.d.ts +10 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/shared/ContainerGridContext.d.ts +20 -0
- package/dist/esm/shared/ContainerGridContext.js +1 -0
- package/dist/esm/shared/Styles.d.ts +2 -0
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/adTrack.d.ts +38 -0
- package/dist/esm/shared/adTrack.js +1 -0
- package/dist/esm/shared/amazonAttribution.d.ts +31 -0
- package/dist/esm/shared/amazonAttribution.js +1 -0
- package/dist/esm/shared/mediaGridSpec.d.ts +87 -0
- package/dist/esm/shared/mediaGridSpec.js +1 -0
- package/dist/esm/stories/BoaStoryProvider.d.ts +10 -0
- package/dist/esm/stories/BoaStoryProvider.js +1 -0
- package/dist/tokens/base.css +22 -1
- package/package.json +5 -2
- package/style.css +250 -136
- package/tailwind.config.js +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as ae,useEffect as B,useCallback as se,forwardRef as ie,useImperativeHandle as le,useRef as w}from"react";import{cn as I}from"../../helpers/utils.js";import{withLayout as ce}from"../../shared/Styles.js";import{Button as K,Text as D}from"../../components/index.js";import{useExposure as de}from"../../hooks/useExposure.js";import{useBoaButton as pe}from"../../hooks/useBoaButton.js";import{useTracking as ue}from"../../hooks/useTracking.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as P}from"../../shared/track.js";import*as j from"@radix-ui/react-popover";const v="navigation",p="product_nav",R=m=>m.anchorId??m.id??"",me=m=>n("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m,children:n("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),Q=ie(({className:m="",data:X,id:Z,onAnchorClick:Y,scrollOffsetExtra:C=0},ee)=>{const{tabLinks:u=[],anchorList:i=[],textLink:a,buyBtn:s,theme:te="light"}=X||{},{buildRef:E}=ue(),f=(e,t,o=1)=>({href:_(e,E(v,p)),"data-headless-type-name":`${v}#${p}`,"data-headless-title-desc-button":`##${P(t)}`,"data-headless-nav-position":`${P(t)}#${o}`}),[ne,y]=ae(""),k=w(null),T=w(!1),g=w(""),b=w(null),S=w(new Map);le(ee,()=>k.current);const{resolveLink:G,trackAd:O,hasAdTrack:N}=pe(),l=G(a?.link,a),h=G(s?.link,s),L=l.isAmazon?l.href:_(l.href,E(v,p)),$=h.isAmazon?h.href:_(h.href,E(v,p)),H=a?.target??(l.isAmazon?"_blank":"_self"),M=s?.target??(h.isAmazon?"_blank":void 0),V=M==="_blank"?"noopener noreferrer":void 0,q=l.isAmazon&&H==="_blank"?"noopener noreferrer":void 0,F=()=>O(a,{componentName:p,buttonPosition:"text_link",buttonText:a?.text,href:L}),U=()=>O(s,{componentName:p,buttonPosition:"buy",buttonText:s?.text,href:$});de(k,{componentType:v,componentName:p,componentTitle:[...u.map(e=>e.label),...i.map(e=>e.label)].join(" | "),componentDescription:s?.text??a?.text??""});const z=se(()=>{if(i.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;i.forEach(o=>{const r=R(o),c=document.getElementById(r);if(c){const A=c.getBoundingClientRect();t.set(r,A.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[i]);B(()=>{if(i.length===0)return;const e=setTimeout(z,100);return()=>clearTimeout(e)},[i,z]),B(()=>{if(i.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(z,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[i,z]),B(()=>{if(i.length===0)return;const e=()=>{if(T.current){b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{T.current=!1,g.current&&(y(g.current),g.current="")},100);return}const o=k.current?.offsetHeight||0,r=window.scrollY+o+C+10;let c="";const A=S.current;for(let x=i.length-1;x>=0;x--){const re=i[x],W=R(re),J=A.get(W);if(J!==void 0&&r>=J){c=W;break}}if(!c&&i.length>0){const x=A.get(R(i[0]));x!==void 0&&r<x&&(c="")}y(c)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),b.current&&clearTimeout(b.current)}},[i,C]),B(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(o=>{const r=o;t.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{t.forEach(({element:o,originalPosition:r})=>{o.style.position=r==="static"?"":r})}},[]);const oe=(e,t)=>{e.preventDefault();const o=S.current.get(t);if(o===void 0){console.warn(`Cached position for "${t}" not found`);return}y(t),g.current=t,T.current=!0;const r=k.current?.offsetHeight||0,c=o-r-C;window.scrollTo({top:c,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return d("div",{id:Z,ref:k,className:I("product-nav text-info-primary bg-info-white px-grid !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden py-0",{"aiui-dark":te==="dark"},m),children:[d("div",{className:"product-nav-main desktop:flex-row desktop:gap-[32px] lg-desktop:gap-[48px] flex w-full flex-col justify-start",children:[d("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] py-[6px]",children:[d("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[u.map((e,t)=>d("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[n("a",{...f(e.link,e.label,u.indexOf(e)+1),className:I("product-nav-tab-link hover:text-brand-color desktop:text-[16px] lg-desktop:text-[18px] text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-info-tertiary":t!==0,"hidden desktop:block":t===1}),children:n("span",{children:e.label})}),t!==u.length-1&&n("div",{className:"product-nav-tab-divider desktop:inline-block bg-lines hidden h-[14px] w-px"})]},e.link||t)),u.length>1&&d(j.Root,{children:[n(j.Trigger,{asChild:!0,children:n("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:n(me,{className:"text-info-primary"})})}),n(j.Content,{className:"product-nav-dropdown-content border-lines bg-info-white rounded-[6px] border p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:u.slice(1).map(e=>n("a",{...f(e.link,e.label,u.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:n("span",{children:e.label})},e.link))})]})]}),d("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[a?.link&&n("a",{...f(a.link,a.text),href:L,target:H,rel:q,onClick:F,"data-headless-ad-track":N(a)?"true":void 0,"data-headless-amazon":l.isAmazon?"true":void 0,"data-headless-amazon-style":l.isAmazon?"link":void 0,className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:n(D,{size:2,className:"text-nowrap",children:a.text})}),s?.link&&n(K,{as:"a",...f(s.link,s.text),href:$,target:M,rel:V,onClick:U,"data-headless-ad-track":N(s)?"true":void 0,"data-headless-amazon":h.isAmazon?"true":void 0,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]}),n("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[6px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:i.map((e,t)=>{const o=R(e);return d("a",{href:`#${o}`,className:"product-nav-anchor-link","data-headless-type-name":`${v}#${p}`,"data-headless-title-desc-button":`##${P(e.label)}`,"data-headless-nav-position":`${P(e.label)}#${t+1}`,onClick:r=>{Y?(r.preventDefault(),y(o),g.current=o,T.current=!0,Y(e,t)):oe(r,o)},children:[n(D,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),n("div",{className:I("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":ne===o})})]},o)})})]}),d("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[a?.link&&n("a",{...f(a.link,a.text),href:L,target:H,rel:q,onClick:F,"data-headless-ad-track":N(a)?"true":void 0,"data-headless-amazon":l.isAmazon?"true":void 0,"data-headless-amazon-style":l.isAmazon?"link":void 0,className:"product-nav-text-link hover:text-brand-color text-info-primary cursor-pointer",children:n(D,{size:2,className:"text-nowrap",children:a.text})}),s?.link&&n(K,{as:"a",...f(s.link,s.text),href:$,target:M,rel:V,onClick:U,"data-headless-ad-track":N(s)?"true":void 0,"data-headless-amazon":h.isAmazon?"true":void 0,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]})});Q.displayName="ProductNav";var Te=ce(Q);export{Te as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentCommonProps, Theme } from '../../types/props.js';
|
|
2
|
+
import type { BoaButtonFields } from '../../hooks/useBoaButton.js';
|
|
2
3
|
export interface TabLink {
|
|
3
4
|
link: string;
|
|
4
5
|
label: string;
|
|
@@ -9,11 +10,13 @@ export interface AnchorItem {
|
|
|
9
10
|
anchorId?: string;
|
|
10
11
|
label: string;
|
|
11
12
|
}
|
|
12
|
-
export interface BuyButton {
|
|
13
|
+
export interface BuyButton extends BoaButtonFields {
|
|
13
14
|
link: string;
|
|
14
15
|
text: string;
|
|
16
|
+
/** 打开方式,亚马逊链接默认新窗口 */
|
|
17
|
+
target?: '_self' | '_blank';
|
|
15
18
|
}
|
|
16
|
-
export interface TextLink {
|
|
19
|
+
export interface TextLink extends BoaButtonFields {
|
|
17
20
|
/** 链接地址 */
|
|
18
21
|
link: string;
|
|
19
22
|
/** 链接文字 */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { Media as MediaType, Theme } from '../../types/props.js';
|
|
3
3
|
import type { ButtonProps } from '../../components/button.js';
|
|
4
|
+
import { type BoaButtonFields } from '../../hooks/useBoaButton.js';
|
|
4
5
|
export type SecondaryBannerSemanticName = 'root' | 'title' | 'superTitle' | 'subtitle' | 'content' | 'buttonGroup' | 'primaryButton' | 'secondaryButton';
|
|
5
6
|
/**
|
|
6
7
|
* Accessibility label overrides for the SecondaryBanner carousel controls.
|
|
@@ -80,12 +81,12 @@ export interface SecondaryBannerSlideData {
|
|
|
80
81
|
text: string;
|
|
81
82
|
link?: string;
|
|
82
83
|
onClick?: () => void;
|
|
83
|
-
} & Omit<ButtonProps, 'children'>;
|
|
84
|
+
} & BoaButtonFields & Omit<ButtonProps, 'children'>;
|
|
84
85
|
secondaryButton?: {
|
|
85
86
|
text: string;
|
|
86
87
|
link?: string;
|
|
87
88
|
onClick?: () => void;
|
|
88
|
-
} & Omit<ButtonProps, 'children'>;
|
|
89
|
+
} & BoaButtonFields & Omit<ButtonProps, 'children'>;
|
|
89
90
|
iconArray?: Array<{
|
|
90
91
|
pcImage: MediaType;
|
|
91
92
|
}>;
|
|
@@ -157,13 +158,13 @@ export interface SecondaryBannerData {
|
|
|
157
158
|
text: string;
|
|
158
159
|
link?: string;
|
|
159
160
|
onClick?: () => void;
|
|
160
|
-
} & Omit<ButtonProps, 'children'>;
|
|
161
|
+
} & BoaButtonFields & Omit<ButtonProps, 'children'>;
|
|
161
162
|
/** 次级按钮配置 */
|
|
162
163
|
secondaryButton?: {
|
|
163
164
|
text: string;
|
|
164
165
|
link?: string;
|
|
165
166
|
onClick?: () => void;
|
|
166
|
-
} & Omit<ButtonProps, 'children'>;
|
|
167
|
+
} & BoaButtonFields & Omit<ButtonProps, 'children'>;
|
|
167
168
|
iconArray?: Array<{
|
|
168
169
|
pcImage: MediaType;
|
|
169
170
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as a,jsxs as f}from"react/jsx-runtime";import*as p from"react";import{cva as xe}from"class-variance-authority";import{useMediaQuery as O}from"react-responsive";import P from"jump.js";import{cn as s,getLocalizedPath as he}from"../../helpers/index.js";import{Text as F,Button as V,Heading as Be,Picture as Te,Countdown as ve}from"../../components/index.js";import{withLayout as Ie}from"../../shared/Styles.js";import Me from"../Media/index.js";import{useAiuiContext as Le}from"../AiuiProvider/index.js";import{useExposure as ze}from"../../hooks/useExposure.js";import{buildTrackingRef as Se,trackUrlRef as Ce}from"../../shared/trackUrlRef.js";import{useBoaButton as Ae}from"../../hooks/useBoaButton.js";import{buildClickTrackingProps as j,resolveComponentMediaType as Ne}from"../../shared/track.js";import Re from"./SecondaryBannerCarousel.js";const c="secondary_banner",_e=xe("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/480] desktop:aspect-[1440/480] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/1320] laptop:aspect-[1024/864] desktop:aspect-[1440/1152] lg-desktop:aspect-[1920/1440] aspect-[390/1440] overflow-visible"}},defaultVariants:{size:"base"}}),$=p.forwardRef(({className:L,classNames:r={},data:t,jumpOptions:z={},isActive:J,a11yLabels:q,trackExposure:W=!0,frameIndex:b,...S},l)=>{const{pcImage:G,padImage:Q,mobileImage:U,isVideoLoop:K,endDate:C,endDate_tz:X,dateFormat:Y,size:Z,iconArray:y,theme:ee,primaryButton:n,secondaryButton:o,title:d,titleTag:te}=t,ne=K??!0,k=Z??"base",oe=ee??"light",ie=te??"h2",{locale:ae="us",pageHandle:re}=Le(),{resolveLink:x,hasAdTrack:m,trackAd:se}=Ae(),le=O({query:"(max-width: 767px)"}),pe=O({query:"(min-width: 768px) and (max-width: 1024px)"}),A=le?t.mobileImage:pe?t.padImage??t.pcImage:t.pcImage,u=Ne(A?.mimeType==="video/mp4"),N=b??1,ce=`${Se(re??"",u,c)}${b===void 0?"":`_${b}`}`,h=A?.id||t.pcImage?.id||"",R=p.useRef(null),de=p.useCallback(e=>{R.current=e,typeof l=="function"?l(e):l&&(l.current=e)},[l]),me=p.useRef(null);ze(W?R:me,{componentType:u,componentName:c,componentTitle:d?.trim()||"",componentDescription:t.subtitle?.trim()||"",position:1,creativeId:h});const ue=!!(o?.link||typeof o?.onClick=="function"||m(o)),ge=!!(n?.link||typeof n?.onClick=="function"||m(n)),_=e=>{if(!e?.link||e.link.startsWith("#"))return{href:void 0,target:void 0};const i=x(e.link,e);return i.isAmazon?{href:i.href,target:e.target??"_blank"}:{href:Ce(he(e.link,ae),ce),target:void 0}},B=_(o),T=_(n),v=B.href,I=T.href,D=(e,i,ke)=>se(e,{componentName:c,buttonPosition:i,buttonText:e?.text,href:ke}),fe=j({interactive:ue,componentType:u,componentName:c,title:d,description:t.subtitle,buttonName:o?.text,position:N,creativeId:h}),be=j({interactive:ge,componentType:u,componentName:c,title:d,description:t.subtitle,buttonName:n?.text,position:N,creativeId:h}),H={...{duration:500,offset:0},...z},M=p.useId(),g=d?`${M}-title`:void 0,E=t.subtitle?`${M}-subtitle`:void 0,w=t.superTitle?`${M}-super-title`:void 0,ye=[w,E].filter(Boolean).join(" ")||void 0;return t.items&&t.items.length>0?a(Re,{data:t,className:L,classNames:r,jumpOptions:z,a11yLabels:q,ref:l,...S}):f("section",{ref:de,role:"banner","aria-labelledby":g,"aria-describedby":ye,className:s({"aiui-dark":oe==="dark"},_e({size:k}),L,r?.root),...S,children:[a("div",{className:s("absolute inset-0",{"h-fit":k==="xlg"}),children:a(Me,{pcImage:G,padImage:Q,mobileImage:U,className:"size-full",imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:ne,playsInline:!0,autoPlay:J??!0})}),f("div",{className:s("banner-content laptop:top-[min(50%,50vh)] laptop:-translate-y-1/2 px-grid absolute top-12 z-10 flex flex-col items-start justify-center text-left",r?.content),children:[f("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[t.superTitle&&a(F,{as:"p",size:2,id:w,className:s("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",r?.superTitle),html:t.superTitle}),t.title&&a(Be,{as:ie,size:["xlg","lg"].includes(k)?5:4,id:g,className:s("banner-title ",r?.title),html:t.title}),t.subtitle&&a(F,{as:"p",size:2,id:E,className:s("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",r?.subtitle),html:t.subtitle})]}),C&&a("div",{className:"banner-countdown",children:a(ve,{endDate:C,endDate_tz:X,dateFormat:Y,variant:"spacious",className:"lg-desktop:mt-8 lg-desktop:[&_.time-block]:size-12 lg-desktop:[&_.time-block]:p-1 lg-desktop:[&_.separator]:text-2xl mt-6 [&_.separator]:text-xl [&_.time-block]:size-10 [&_.time-block]:p-[2px]"})}),f("div",{className:s("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",r?.buttonGroup),children:[o?.text&&a(V,{variant:"secondary","data-headless-ad-track":m(o)?"true":void 0,"data-headless-amazon":x(o.link,o).isAmazon?"true":void 0,onClick:e=>{if(D(o,"secondary",v),o.link?.startsWith("#")){e.preventDefault();const i=document.querySelector(o.link);i&&P(i,H)}o.onClick?.()},className:s("",r?.secondaryButton),"aria-describedby":g,...v?{as:"a",href:v,...B.target?{target:B.target,rel:o.rel??"noopener noreferrer"}:{}}:{},...fe,children:o.text}),n?.text&&a(V,{onClick:e=>{if(D(n,"primary",I),n.link?.startsWith("#")){e.preventDefault();const i=document.querySelector(n.link);i&&P(i,H)}n.onClick?.()},className:s("",r?.primaryButton),"data-headless-ad-track":m(n)?"true":void 0,"data-headless-amazon":x(n.link,n).isAmazon?"true":void 0,"aria-describedby":g,...I?{as:"a",href:I,...T.target?{target:T.target,rel:n.rel??"noopener noreferrer"}:{}}:{},...be,children:n.text})]}),Array.isArray(y)&&y.length>0&&a("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:y.map((e,i)=>e.pcImage?a(Te,{source:e.pcImage.url,alt:e.pcImage.alt||`icon ${i+1}`,role:"img",className:"lg-desktop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},i):null)})]})]})});$.displayName="SecondaryBanner";var Qe=Ie($);export{Qe as default,_e as secondaryBannerVariants};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{jsx as s}from"react/jsx-runtime";import{useEffect as
|
|
2
|
-
${e?.handle===a?.handle?"bg-[#EAEAEC]":""}`,children:r},o)})})})};var k=v;export{k as default};
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{useEffect as m,useRef as y}from"react";import{cn as p}from"../../helpers/index.js";const b="openDropDown",v=({index:e,active:l,list:u,setActive:f,setVisible:c,visible:a,resolveName:i})=>{const d=y(null);return m(()=>{const n=o=>{const r=o?.target?.getAttribute?.("class");!d?.current?.contains(o?.target)&&!r?.includes(b)&&c({...a,[e]:!1})};return document.addEventListener("click",n),()=>document.removeEventListener("click",n)},[]),s("div",{ref:d,className:p("specs-dropdown-panel rounded-box-small bg-container-secondary-1 text-info-primary absolute left-0 top-[calc(100%+8px)] z-30 box-border max-h-[340px] w-full overflow-y-auto",a?.[e]?"block":"hidden"),children:s("div",{className:"dropdown-wrapper m-0 box-border h-full flex-1 overflow-hidden p-0 [&:last-child]:border-r-0",children:u?.map((n,o)=>{const r=n?.sku||n?.variants?.[0]?.sku,t=i?i(n,r):n?.name||n?.title;return s("div",{onClick:()=>{f({...l,[e]:{sku:r,name:t,handle:n?.handle}}),c({...a,[e]:!1})},title:t,className:p("openDropDown specs-dropdown-option text-info-primary box-border cursor-pointer truncate px-6 py-4 text-base font-bold","[&:hover]:bg-container-primary",n?.handle===l?.handle?"bg-container-primary":""),children:t},o)})})})};var k=v;export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as _,jsx as o,jsxs as i}from"react/jsx-runtime";import Y from"./dropdown.js";import{useAiuiContext as Z}from"../AiuiProvider/index.js";import{useMediaQuery as ee}from"react-responsive";import{useMemo as H,useState as h,useEffect as E,useCallback as te}from"react";import{withLayout as se}from"../../shared/Styles.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{Picture as S,Text as ne,Button as re,Heading as C}from"../../components/index.js";import{cn as P}from"../../helpers/index.js";import ae,{useImperativeHandle as le,useRef as ie}from"react";const R=ae.forwardRef(({data:d,buildData:p,onChange:$,onSecondaryChange:ce,className:I,...O},U)=>{const u=ee({query:"(max-width: 768px)"}),[l,v]=h({}),[y,V]=h([]),[g,L]=h(!1),[b,D]=h({}),T=ie(null),{locale:q="us",currencyDisplay:B,trackingData:z,currencyCode:F}=Z(),Q=z?.showComparePrice??!0,{LeftMenu:A,RightMenu:k,DefaultSelectMenu:x}=H(()=>d?.data||{},[d?.data]),w=H(()=>{const e={};return(Array.isArray(d?.items)?d?.items:[]).forEach(t=>{t?.custom_name&&(t?.sku&&(e[t.sku]=t.custom_name),t?.handle&&(e[t.handle]=t.custom_name))}),e},[d?.items]),N=te((e,s)=>w[s||""]||w[e?.handle||""]||e?.name||e?.title||"",[w]),W=e=>{try{const t=new URL(e).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(t)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(e)}},G=(e,s)=>{const t=e?.variants?.find?.(c=>c?.sku===e?.sku),n=t?.coupons?.[0],{price:r,basePrice:a}=oe({locale:F==="CAD"?"us":q||"us",amount:n?n?.variant_price4wscode:t?.price,baseAmount:n?t?.price:0,currencyDisplay:B,currencyCode:e?.price?.currencyCode||"USD"}),m=typeof x?.buttonText=="string"?x?.buttonText:x?.buttonText?.[String(s)]||"";return i("div",{className:"specs-sku-node-wrap box-border",children:[i(ne,{as:"div",className:"md-tablet:px-4 md-tablet:py-2.5 md-tablet:text-sm l-tablet:mb-4 l-tablet:text-sm laptop:flex laptop:h-[54px] laptop:flex-col laptop:justify-center laptop:py-0 desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text rounded-box-small border-lines bg-container-secondary-0 text-info-primary relative mb-4 box-border block border px-4 py-3 text-base font-bold",onClick:()=>{if(y?.length<=1)return null;D({...b,[s]:!b?.[s]})},children:[i("div",{className:"flex items-center justify-between overflow-hidden",children:[o("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title text-info-primary flex-1 truncate text-base",title:l?.[s]?.name||"",children:l?.[s]?.name||""}),y?.length>1?o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:P("openDropDown specs-sku-node-chevron shrink-0 transition-transform duration-300",b?.[s]?"rotate-180":""),children:o("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]}),o(Y,{index:s,list:y,active:l,setActive:v,visible:b,setVisible:D,resolveName:N})]}),o("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:o(S,{source:t?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),o("div",{className:"lg-desktop:text-2xl mb-2 mt-6 text-xl font-bold tracking-[-0.04em]",children:o("div",{className:"lg-desktop:min-h-[32px] flex min-h-[28px] items-center",children:t?.availableForSale?i(_,{children:[o("div",{className:"specs-sku-node-price text-info-primary",children:r||""}),Q&&a&&o("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price text-info-quaternary ml-1 text-xl line-through",children:a})]}):null})}),m?o(re,{onClick:()=>{$?.(e,s)},className:"specs-sku-node-button hover:text-info-primary",children:m}):null]})},J=e=>e&&typeof e!="string"?i("div",{className:"size-full",children:[o("p",{className:"desktop:text-base lg-desktop:text-lg specs-normal-node-text text-info-primary text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.text||""}}),o(S,{source:e?.imgUrl,className:"m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):o("div",{className:"break-all",children:W(e)?o(S,{source:e,className:"m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):o("p",{className:"desktop:text-base lg-desktop:text-lg specs-normal-node-text text-info-primary text-sm font-bold",dangerouslySetInnerHTML:{__html:e||""}})}),j=e=>e.map(s=>i("div",{className:`l-tablet:flex l-tablet:flex-col border-t-lines specs-product-node-wrap box-border grid w-full cursor-pointer overflow-hidden border-t ${g?"grid-cols-4":"grid-cols-3"}`,children:[o(C,{as:"h3",html:s||"",className:"l-tablet:text-info-quaternary tablet:py-4 laptop:py-6 desktop:p-6 lg-desktop:text-lg specs-product-node-title desktop:text-base mr-2 flex-1 pt-4 text-sm font-bold"}),o("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 specs-product-node-body grid flex-1 py-4 ${g?"col-span-3 grid-cols-3":"col-span-2 grid-cols-2"}`,children:Object.keys(l)?.map?.(t=>{const n=l?.[t],r=k?.menus?.find?.(a=>a?.handle===n?.handle)?.subTitle;return J(r?.[s])})})]},s)),K=e=>{if(!l)return;const{subTitle:s,isProduct:t}=e;return t?i(_,{children:[i("div",{className:`l-tablet:flex l-tablet:flex-col specs-content-item-product border-t-lines box-border grid w-full cursor-pointer border-t-0 ${g?"grid-cols-4":"grid-cols-3"}`,children:[e?.title&&o(C,{as:"h3",html:e?.title||"",className:"l-tablet:hidden lg-desktop:text-lg specs-product-node-title specs-item-product-title desktop:text-base text-sm font-bold"}),o("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 specs-item-product-body grid flex-1 pb-4 pr-0 ${g?"col-span-3 grid-cols-3":"col-span-2 grid-cols-2"}`,children:Object.keys(l)?.map((n,r)=>{const a=l?.[n],m=p?.products?.find?.(c=>c?.handle===a?.handle);return o("div",{children:G({...m,item:n,sku:a?.sku},r)},n)})})]}),e?.categoryLabel&&o(C,{size:2,as:"h4",html:e?.categoryLabel||"",className:"desktop:p-6 specs-item-product-category py-6"}),s?.length?j(s):null]}):j(s)};return le(U,()=>T.current),E(()=>{if(!p?.products?.length)return;const e=x?.sku?.split?.(",")||[],s=u&&e?.length>2?e?.slice(0,2):e;let t={};s?.forEach?.((r,a)=>{const c=k?.menus?.find?.(f=>f?.sku===r)?.handle,M=c?p?.products?.find?.(f=>f?.handle===c):p?.products?.find?.(f=>{if(f?.variants?.find?.(X=>X?.sku===r))return!0});M&&(t={...t,[a]:{sku:r,name:N(M,r),handle:c||M?.handle}})});const n=p?.products?.filter(r=>k?.menus?.find(a=>a?.handle===r?.handle));v(t),V(n),L(e?.length>2&&!u)},[p,u,N]),E(()=>{if(u){const e=Object.keys(l||{});if(e?.length>2){const s=e?.slice?.(0,2);let t={};s?.forEach?.(n=>{t={...t,[n]:l?.[n]}}),L(!1),v(t)}}},[u]),o("div",{...O,className:P("specs-wrapper w-full overflow-hidden",I),ref:T,children:A?.data?o("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:A?.data?.map?.((e,s)=>o("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:K(e)},s))}):null})});R.displayName="Specs";var ye=se(R);export{ye as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as G,jsx as t,jsxs as o}from"react/jsx-runtime";import c,{useRef as d,useImperativeHandle as
|
|
1
|
+
"use client";import{Fragment as G,jsx as t,jsxs as o}from"react/jsx-runtime";import c,{useRef as d,useImperativeHandle as j}from"react";import{Button as k,Heading as u,Picture as y,Text as N}from"../../components/index.js";import{cn as i,getLocalizedPath as T}from"../../helpers/utils.js";import{withLayout as I}from"../../shared/Styles.js";import{useExposure as U}from"../../hooks/useExposure.js";import{useAiuiContext as $}from"../AiuiProvider/index.js";import{useTracking as O}from"../../hooks/useTracking.js";import{trackUrlRef as V}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as p}from"../../shared/track.js";import{Swiper as S,SwiperSlide as C}from"swiper/react";import{Navigation as W,EffectCoverflow as A}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";import"swiper/css/effect-coverflow";const m="carousel",h="three_d_carousel",q=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 hover:text-info-primary scale-[70%] text-white",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),F=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 hover:text-info-primary scale-[70%] text-white",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),L=c.forwardRef(({data:z,className:E},R)=>{const{title:f,items:s=[],titleTag:D}=z,v=s.length<6?[...s,...s]:s,r=d(null),n=d(null),b=d(null),[P,B]=c.useState(180),{locale:w="us"}=$(),{buildRef:H}=O(),x=e=>e?V(T(e,w),H(m,h)):T("",w),g=e=>e.buttonLink?{"data-headless-type-name":`${m}#${h}`,"data-headless-title-desc-button":`${p(e.title)}#${p(e.description)}#${p(e.buttonText)}`,"data-headless-nav-position":`#${s.indexOf(e)+1}`}:{};return U(n,{componentType:m,componentName:h,componentTitle:f}),j(R,()=>n.current),c.useEffect(()=>{const e=b.current;if(!e)return;const l=()=>{const M=e.offsetWidth,_=Math.round(M*.125);B(_),r.current?.params?.coverflowEffect&&(r.current.params.coverflowEffect.stretch=_,r.current.update())};l();const a=new ResizeObserver(l);return a.observe(e),()=>a.disconnect()},[]),o("section",{ref:n,"data-ui-component-id":"ThreeDCarousel",className:i("three-d-carousel laptop:overflow-hidden w-full overflow-visible",E),children:[t(u,{as:D??"h2",size:4,html:f,className:"three-d-carousel__title laptop:text-center text-left"}),o("div",{ref:b,className:"three-d-carousel__desktop laptop:block lg-desktop:max-w-[1648px] relative mx-auto mt-[24px] hidden w-full",children:[t(S,{onSwiper:e=>r.current=e,centeredSlides:!0,initialSlide:0,loop:!0,loopAdditionalSlides:2,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[A,W],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[103/30] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:P,depth:300,modifier:1,slideShadows:!0},children:v.map((e,l)=>t(C,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100 [.swiper-slide-visible&]:opacity-100",children:({isActive:a})=>o(G,{children:[t(y,{source:e.imageUrl?.url||"",alt:e.imageUrl?.alt||e.title,className:i("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:a?"":"brightness(50%) contrast(120%)"}}),o("div",{className:i("three-d-carousel__image-content tablet:p-[24px] desktop:p-[24px] lg-desktop:p-[32px] text-info-primary absolute left-0 top-0 box-border flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark","opacity-0":!a}),children:[t(u,{as:"h3",size:3,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]"}),e.buttonText&&t("a",{href:x(e.buttonLink),...g(e),className:"three-d-carousel__image-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:e.buttonText})})]})]})},l))}),o("div",{className:"three-d-carousel__nav-controls pointer-events-none absolute inset-0 z-20",children:[t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev pointer-events-auto absolute left-[calc(25%-24px)] top-1/2 -translate-x-full -translate-y-1/2",onClick:()=>r.current?.slidePrev(),"aria-label":"Previous slide",children:t(q,{})}),t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next pointer-events-auto absolute right-[calc(25%-24px)] top-1/2 -translate-y-1/2 translate-x-full",onClick:()=>r.current?.slideNext(),"aria-label":"Next slide",children:t(F,{})})]})]}),t("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:t(S,{loop:!0,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:v.map((e,l)=>o(C,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[t(y,{source:e.mobImageUrl?.url||e.imageUrl?.url||"",alt:e.mobImageUrl?.alt||e.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),o("div",{className:i("three-d-carousel__image-mobile-content text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark"}),children:[t(u,{as:"h3",size:3,html:e.title}),t(N,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),e.buttonText&&t("a",{href:x(e.buttonLink),...g(e),className:"three-d-carousel__image-mobile-link ",children:t(k,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:e.buttonText})})]})]},l))})})]})});L.displayName="ThreeDCarousel";var ce=I(L,{style:"overflow: hidden;"});export{ce as default};
|
|
@@ -251,6 +251,7 @@ export declare const PAYLOAD_COMPONENT_MAP: {
|
|
|
251
251
|
export { CartSummaryHeader, CartItemRow, CartGiftSection, CartPerksSection, CartThirdPartyBanner, CartPriceSummary, } from './CartDetail/index.js';
|
|
252
252
|
export type { CartSummaryHeaderProps, CartItemRowProps, CartGiftSectionProps, CartPerksSectionProps, CartPerk, CartThirdPartyProps, GiftOption, GiftSlotConfig, CartPriceSummaryProps, } from './CartDetail/index.js';
|
|
253
253
|
export { useAiuiContext } from './AiuiProvider/index.js';
|
|
254
|
+
export type { AdTrackEvent, AdTrackContext, OnAdTrackCallback } from '../shared/adTrack.js';
|
|
254
255
|
export type { ContainerProps } from '../shared/Styles.js';
|
|
255
256
|
export { default as ModalRegisterSubscribe } from './ModalRegisterSubscribe/index.js';
|
|
256
257
|
export { default as ModalSubscribeConfirm } from './ModalSubscribeConfirm/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as B}from"./Title/index.js";import{default as T}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as L}from"./Category/index.js";import{default as V}from"./HeroBanner/index.js";import{default as k}from"./AccordionCards/index.js";import{default as W}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as re,MarqueeImageContent as te,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as ve}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as Oe}from"./TabsGroup/index.js";import{default as we,useBizProductContext as ke}from"./Listing/BizProductProvider.js";import{calcSummaryFinalPrice as We,calcUnlockedSaving as Ee}from"./Listing/utils/priceCalc.js";import{default as Re}from"./Listing/components/PurchaseBar/index.js";import{default as ze}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as Ue}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ye}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as Qe}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Ze}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as er}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as tr}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as ar}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as sr}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as dr}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as cr}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as lr}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as mr}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as yr}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as hr}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as Cr}from"./Listing/components/PaidShipping/index.js";import{default as Mr}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as vr}from"./NotifyMeDialog/index.js";import{default as Ir}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as Ar}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as Fr}from"./GraphicMore/index.js";import{default as Gr}from"./Features/index.js";import{default as Or}from"./AplusDesc/index.js";import{default as wr}from"./GiftBox/index.js";import{default as Nr}from"./SelectStore/index.js";import{default as Er}from"./DownLoad/index.js";import{default as Rr}from"./FootCharger/index.js";import{default as zr}from"./BrandCardLink/index.js";import*as Kr from"./IPRedirect/index.js";import{default as _r}from"./WheelLottery/index.js";import{default as Jr}from"./ProductLottery/index.js";import{default as Xr}from"./ProductCompare/index.js";import{default as $r}from"./Ksp/index.js";import{default as rt}from"./ImageTextFeature/index.js";import{default as ot}from"./FeatureCards/index.js";import{default as it}from"./FeaturedBlogPosts/index.js";import{default as pt}from"./ImageWithText/index.js";import{default as ft}from"./VideoFeature/index.js";import{default as nt}from"./TabsWithMedia/index.js";import{default as ut}from"./TabWithImage/index.js";import{default as xt}from"./FeatureShowcase/index.js";import{default as St}from"./ProductHero/index.js";import{default as Pt}from"./SpecsComparison/index.js";import{default as gt}from"./MediaSceneSwitcher/index.js";import{default as Bt}from"./MediaSceneSwitcherV2/index.js";import{default as Tt}from"./ThreeDCarousel/index.js";import{default as bt}from"./ProductNav/index.js";import{default as Dt}from"./AnchorNavigation/index.js";import{default as jt}from"./PromotionalBar/index.js";import{default as Lt}from"./EventSchedule/index.js";import{default as Vt}from"./SecondaryBanner/index.js";import{default as kt}from"./BuyOneGetOneShelf/index.js";import{default as Wt}from"./ActiveShelf/index.js";import{default as Ht}from"./MediaShelf/index.js";import{default as qt,CreditsProductCard as zt}from"./CreditsShelf/index.js";import{default as Ut,SceneProductCard as _t}from"./SceneShelf/index.js";import{default as Jt,SceneShelfV2ProductCard as Qt}from"./SceneShelfV2/index.js";import{default as Zt}from"./SceneShelfV3/index.js";import{default as eo}from"./MediaEndorsement/index.js";import{default as to}from"./MediaTextOverlay/index.js";import{default as ao}from"./ImageOverlayShelf/index.js";import{default as so,AccessoryProductCard as po}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as co}from"./ImageTextOverlay/index.js";import{default as lo}from"./MiniCart/index.js";import{default as mo}from"./MiniCart/CircleProgress.js";import{default as yo,MiniCartDialog as So}from"./MiniCart/MiniCartDialog.js";import{default as Po}from"./WebPushPopup/index.js";import{useEmarsysWebPush as go}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as Bo,CartItemRow as vo,CartGiftSection as To,CartPerksSection as Io,CartThirdPartyBanner as bo,CartPriceSummary as Ao}from"./CartDetail/index.js";import{useAiuiContext as Fo}from"./AiuiProvider/index.js";import{default as Go}from"./ModalRegisterSubscribe/index.js";import{default as Oo}from"./ModalSubscribeConfirm/index.js";import{default as wo}from"./ModalCoupon/index.js";import{default as No}from"./ModalSmsSubscribe/index.js";import{default as Eo}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,po as AccessoryProductCard,so as AccessoryShelf,k as AccordionCards,Wt as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,Dt as AnchorNavigation,Or as AplusDesc,yr as BenefitsTab,we as BizProductProvider,zr as BrandCardLink,S as BrandEquity,kt as BuyOneGetOneShelf,Mr as CartActionButtons,To as CartGiftSection,vo as CartItemRow,Io as CartPerksSection,Ao as CartPriceSummary,Bo as CartSummaryHeader,bo as CartThirdPartyBanner,L as Category,Ae as CreativeModule,hr as CreditCouponRedeem,zt as CreditsProductCard,qt as CreditsShelf,Er as DownLoad,j as Evaluate,Lt as EventSchedule,$ as Faq,ot as FeatureCards,xt as FeatureShowcase,it as FeaturedBlogPosts,Gr as Features,Rr as FootCharger,ne as FooterNavigation,wr as GiftBox,n as GiftShelf,u as GiftTierShelf,W as Graphic,pe as GraphicAttractionBlock,Fr as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,V as HeroBanner,xe as IPC_SEARCH_PAGE,Kr as IPRedirect,ao as ImageOverlayShelf,rt as ImageTextFeature,co as ImageTextOverlay,pt as ImageWithText,$r as Ksp,s as MainProductArea,_ as Marquee,te as MarqueeImageContent,re as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,eo as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,gt as MediaSceneSwitcher,Bt as MediaSceneSwitcherV2,Ht as MediaShelf,to as MediaTextOverlay,P as MemberEquity,lo as MiniCart,mo as MiniCartCircleProgress,yo as MiniCartDialog,So as MiniCartDialogComponent,wo as ModalCoupon,Go as ModalRegisterSubscribe,No as ModalSmsSubscribe,Oo as ModalSubscribeConfirm,Eo as ModalVerify,ie as MultiLayoutGraphicBlock,vr as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,Cr as PaidShipping,ze as ProductActions,dr as ProductBanner,Ye as ProductBenefits,Ue as ProductBenefitsTabs,ar as ProductBundle,Xr as ProductCompare,sr as ProductCoupon,Ze as ProductFreeGift,er as ProductFunctionFreeGift,lr as ProductGallery,cr as ProductGridBox,St as ProductHero,Qe as ProductHighlight,Jr as ProductLottery,bt as ProductNav,tr as ProductOptions,Ar as ProductPaidShipping,Ir as ProductServiceBenefits,mr as ProductSummary,i as PromoBanner,jt as PromotionalBar,Re as PurchaseBar,_t as SceneProductCard,Ut as SceneShelf,Jt as SceneShelfV2,Qt as SceneShelfV2ProductCard,Zt as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,Vt as SecondaryBanner,a as SectionHeader,Nr as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,T as Spacer,Ge as Specs,Pt as SpecsComparison,ve as SwiperBox,Oe as TabGroup,ut as TabWithImage,Me as Tabs,nt as TabsWithMedia,Tt as ThreeDCarousel,B as Title,ft as VideoFeature,Ie as VideoModal,Po as WebPushPopup,_r as WheelLottery,X as WhyChoose,We as calcSummaryFinalPrice,Ee as calcUnlockedSaving,Fo as useAiuiContext,ke as useBizProductContext,go as useEmarsysWebPush,he as withLayout};
|
|
1
|
+
import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as T}from"./Title/index.js";import{default as B}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as L}from"./Category/index.js";import{default as k}from"./HeroBanner/index.js";import{default as w}from"./AccordionCards/index.js";import{default as W}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as re,MarqueeImageContent as te,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as ve}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as Oe}from"./TabsGroup/index.js";import{default as Ve,useBizProductContext as we}from"./Listing/BizProductProvider.js";import{calcSummaryFinalPrice as We,calcUnlockedSaving as Ee}from"./Listing/utils/priceCalc.js";import{default as Re}from"./Listing/components/PurchaseBar/index.js";import{default as ze}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as Ue}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ye}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as Qe}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Ze}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as er}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as tr}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as ar}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as sr}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as dr}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as cr}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as lr}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as mr}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as yr}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as hr}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as Cr}from"./Listing/components/PaidShipping/index.js";import{default as Mr}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as vr}from"./NotifyMeDialog/index.js";import{default as Ir}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as Ar}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as Fr}from"./GraphicMore/index.js";import{default as Gr}from"./Features/index.js";import{default as Or}from"./AplusDesc/index.js";import{default as Vr}from"./GiftBox/index.js";import{default as Nr}from"./SelectStore/index.js";import{default as Er}from"./DownLoad/index.js";import{default as Rr}from"./FootCharger/index.js";import{default as zr}from"./BrandCardLink/index.js";import*as Kr from"./IPRedirect/index.js";import{default as _r}from"./WheelLottery/index.js";import{default as Jr}from"./ProductLottery/index.js";import{default as Xr}from"./ProductCompare/index.js";import{default as $r}from"./Ksp/index.js";import{default as rt}from"./ImageTextFeature/index.js";import{default as ot}from"./FeatureCards/index.js";import{default as it}from"./FeaturedBlogPosts/index.js";import{default as pt}from"./ImageWithText/index.js";import{default as ft}from"./VideoFeature/index.js";import{default as nt}from"./TabsWithMedia/index.js";import{default as ut}from"./TabWithImage/index.js";import{default as xt}from"./FeatureShowcase/index.js";import{default as St}from"./ProductHero/index.js";import{default as Pt}from"./SpecsComparison/index.js";import{default as gt}from"./MediaSceneSwitcher/index.js";import{default as Tt}from"./MediaSceneSwitcherV2/index.js";import{default as Bt}from"./ThreeDCarousel/index.js";import{default as bt}from"./ProductNav/index.js";import{default as Dt}from"./AnchorNavigation/index.js";import{default as jt}from"./PromotionalBar/index.js";import{default as Lt}from"./EventSchedule/index.js";import{default as kt}from"./SecondaryBanner/index.js";import{default as wt}from"./BuyOneGetOneShelf/index.js";import{default as Wt}from"./ActiveShelf/index.js";import{default as Ht}from"./MediaShelf/index.js";import{default as qt,CreditsProductCard as zt}from"./CreditsShelf/index.js";import{default as Ut,SceneProductCard as _t}from"./SceneShelf/index.js";import{default as Jt,SceneShelfV2ProductCard as Qt}from"./SceneShelfV2/index.js";import{default as Zt}from"./SceneShelfV3/index.js";import{default as eo}from"./MediaEndorsement/index.js";import{default as to}from"./MediaTextOverlay/index.js";import{default as ao}from"./ImageOverlayShelf/index.js";import{default as so,AccessoryProductCard as po}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as co}from"./ImageTextOverlay/index.js";import{default as lo}from"./MiniCart/index.js";import{default as mo}from"./MiniCart/CircleProgress.js";import{default as yo,MiniCartDialog as So}from"./MiniCart/MiniCartDialog.js";import{default as Po}from"./WebPushPopup/index.js";import{useEmarsysWebPush as go}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as To,CartItemRow as vo,CartGiftSection as Bo,CartPerksSection as Io,CartThirdPartyBanner as bo,CartPriceSummary as Ao}from"./CartDetail/index.js";import{useAiuiContext as Fo}from"./AiuiProvider/index.js";import{default as Go}from"./ModalRegisterSubscribe/index.js";import{default as Oo}from"./ModalSubscribeConfirm/index.js";import{default as Vo}from"./ModalCoupon/index.js";import{default as No}from"./ModalSmsSubscribe/index.js";import{default as Eo}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,po as AccessoryProductCard,so as AccessoryShelf,w as AccordionCards,Wt as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,Dt as AnchorNavigation,Or as AplusDesc,yr as BenefitsTab,Ve as BizProductProvider,zr as BrandCardLink,S as BrandEquity,wt as BuyOneGetOneShelf,Mr as CartActionButtons,Bo as CartGiftSection,vo as CartItemRow,Io as CartPerksSection,Ao as CartPriceSummary,To as CartSummaryHeader,bo as CartThirdPartyBanner,L as Category,Ae as CreativeModule,hr as CreditCouponRedeem,zt as CreditsProductCard,qt as CreditsShelf,Er as DownLoad,j as Evaluate,Lt as EventSchedule,$ as Faq,ot as FeatureCards,xt as FeatureShowcase,it as FeaturedBlogPosts,Gr as Features,Rr as FootCharger,ne as FooterNavigation,Vr as GiftBox,n as GiftShelf,u as GiftTierShelf,W as Graphic,pe as GraphicAttractionBlock,Fr as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,k as HeroBanner,xe as IPC_SEARCH_PAGE,Kr as IPRedirect,ao as ImageOverlayShelf,rt as ImageTextFeature,co as ImageTextOverlay,pt as ImageWithText,$r as Ksp,s as MainProductArea,_ as Marquee,te as MarqueeImageContent,re as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,eo as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,gt as MediaSceneSwitcher,Tt as MediaSceneSwitcherV2,Ht as MediaShelf,to as MediaTextOverlay,P as MemberEquity,lo as MiniCart,mo as MiniCartCircleProgress,yo as MiniCartDialog,So as MiniCartDialogComponent,Vo as ModalCoupon,Go as ModalRegisterSubscribe,No as ModalSmsSubscribe,Oo as ModalSubscribeConfirm,Eo as ModalVerify,ie as MultiLayoutGraphicBlock,vr as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,Cr as PaidShipping,ze as ProductActions,dr as ProductBanner,Ye as ProductBenefits,Ue as ProductBenefitsTabs,ar as ProductBundle,Xr as ProductCompare,sr as ProductCoupon,Ze as ProductFreeGift,er as ProductFunctionFreeGift,lr as ProductGallery,cr as ProductGridBox,St as ProductHero,Qe as ProductHighlight,Jr as ProductLottery,bt as ProductNav,tr as ProductOptions,Ar as ProductPaidShipping,Ir as ProductServiceBenefits,mr as ProductSummary,i as PromoBanner,jt as PromotionalBar,Re as PurchaseBar,_t as SceneProductCard,Ut as SceneShelf,Jt as SceneShelfV2,Qt as SceneShelfV2ProductCard,Zt as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,kt as SecondaryBanner,a as SectionHeader,Nr as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,B as Spacer,Ge as Specs,Pt as SpecsComparison,ve as SwiperBox,Oe as TabGroup,ut as TabWithImage,Me as Tabs,nt as TabsWithMedia,Bt as ThreeDCarousel,T as Title,ft as VideoFeature,Ie as VideoModal,Po as WebPushPopup,_r as WheelLottery,X as WhyChoose,We as calcSummaryFinalPrice,Ee as calcUnlockedSaving,Fo as useAiuiContext,we as useBizProductContext,go as useEmarsysWebPush,he as withLayout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as h,jsx as
|
|
1
|
+
"use client";import{Fragment as h,jsx as l,jsxs as R}from"react/jsx-runtime";import s from"react";import{Slot as x}from"@radix-ui/react-slot";import{cn as v}from"../helpers/index.js";import{cva as C}from"class-variance-authority";const P=C("tracking hover:text-brand-0 font-bold underline transition-colors",{variants:{size:{base:"text-text-2",lg:"text-text-3"},variant:{secondary:"text-info-secondary hover:text-info-primary",primary:"text-info-primary hover:text-brand-0"}}}),p=s.forwardRef(({children:t,size:m="base",variant:c="primary",className:f,asChild:y=!1,href:r,style:n,disabled:e=!1,suffixIcon:o,onClick:k,...u},d)=>{const a=y&&s.isValidElement(t);return l(a?x:"a",{ref:d,onClick:i=>{if(!e&&k?.(i),e||!r){i.preventDefault();return}},href:e?void 0:r,className:v(P({size:m,variant:c}),f,{"flex items-center":o,"cursor-pointer":!e,"text-info-quaternary cursor-not-allowed hover:text-info-quaternary":e}),...n?{style:n}:null,...u,children:a?t:R(h,{children:[t,o&&l("span",{className:"svg",children:o})]})})});p.displayName="Link";var S=p;export{S as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AmazonLinkFields } from '../shared/amazonAttribution.js';
|
|
2
|
+
import { type AdTrackContext, type AdTrackFields } from '../shared/adTrack.js';
|
|
3
|
+
export type BoaButtonFields = AmazonLinkFields & AdTrackFields;
|
|
4
|
+
export interface ResolvedBoaLink {
|
|
5
|
+
/** 最终链接。非亚马逊链接、开关关闭、服务端渲染阶段都返回原链接 */
|
|
6
|
+
href: string | undefined;
|
|
7
|
+
/** 是否按亚马逊链接处理(开关打开且按钮已勾选) */
|
|
8
|
+
isAmazon: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseBoaButtonResult {
|
|
11
|
+
/** 页面级开关是否打开 */
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
/** 按按钮配置解析链接,亚马逊链接补全归因参数 */
|
|
14
|
+
resolveLink: (href: string | undefined, fields?: AmazonLinkFields) => ResolvedBoaLink;
|
|
15
|
+
/** 该按钮是否有可交接的有效埋点事件 */
|
|
16
|
+
hasAdTrack: (fields?: AdTrackFields) => boolean;
|
|
17
|
+
/** 按钮被点击时,把有效埋点事件交给业务端。业务端未接入时静默跳过 */
|
|
18
|
+
trackAd: (fields: AdTrackFields | undefined, context: AdTrackContext) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* BOA 按钮能力:亚马逊链接归因参数拼接 + 广告埋点数据交接。
|
|
22
|
+
*
|
|
23
|
+
* - 服务端渲染输出原链接;挂载后再带上访客落地页的 utm 参数写入完整链接
|
|
24
|
+
* - 页面级开关(AiuiProvider.componentBoaEnabled)关闭时,链接保持原样
|
|
25
|
+
* - 埋点不依赖「自定义按钮事件」,只看按钮自己的 hasTrack 与 trackEvents
|
|
26
|
+
*/
|
|
27
|
+
export declare const useBoaButton: () => UseBoaButtonResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as r,useEffect as p,useState as B}from"react";import{useAiuiContext as T}from"../biz-components/AiuiProvider/index.js";import{buildAmazonUrl as g}from"../shared/amazonAttribution.js";import{getValidAdTrackEvents as l}from"../shared/adTrack.js";const C=()=>{const{componentBoaEnabled:u,amazonAttribution:i,onAdTrack:o}=T(),[a,k]=B(void 0);p(()=>{k(window.location.search)},[]);const s=!!u,d=i?.adCampaign,c=i?.maas,A=r((e,t)=>{const n=s&&!!t?.isAmazonlink;return!n||!e?{href:e,isAmazon:n}:a===void 0?{href:e,isAmazon:n}:{href:g(e,{buttonAdCampaign:t?.adCampaign,pageAdCampaign:d,maas:c,search:a}),isAmazon:n}},[s,c,d,a]),f=r(e=>l(e).length>0,[]),m=r((e,t)=>{if(typeof o!="function")return;const n=l(e);if(n.length!==0)try{o(n,t)}catch{typeof process<"u"}},[o]);return{enabled:s,resolveLink:A,hasAdTrack:f,trackAd:m}};export{C as useBoaButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{useRef as d,useState as l,useEffect as L}from"react";function T(i={}){const{dragSpeed:v=1,enableMomentum:p=!0,dragElastic:D=.1}=i,o=d(null),[g,M]=l(!1),[u,f]=l(0),[m,b]=l(!1),[S,h]=l(!1),n=()=>{const r=o.current;if(!r)return;const{scrollLeft:e,scrollWidth:t,clientWidth:s}=r,a=t-s,R=a>0?e/a*100:0;f(Math.min(100,Math.max(0,R))),b(e>0),h(e<a-1)};L(()=>{const r=o.current;if(!r)return;n(),r.addEventListener("scroll",n);const e=new ResizeObserver(n);return e.observe(r),()=>{r.removeEventListener("scroll",n),e.disconnect()}},[]);const c=(r,e=!0)=>{const t=o.current;t&&t.scrollTo({left:r,behavior:e?"smooth":"auto"})};return{containerRef:o,isDragging:g,scrollProgress:u,canScrollLeft:m,canScrollRight:S,scrollTo:c,scrollLeft:(r=300)=>{const e=o.current;if(!e)return;const t=Math.max(0,e.scrollLeft-r);c(t)},scrollRight:(r=300)=>{const e=o.current;if(!e)return;const t=e.scrollWidth-e.clientWidth,s=Math.min(t,e.scrollLeft+r);c(s)}}}export{T as useDraggableScroll};
|
|
@@ -15,5 +15,5 @@ interface ExposureOptions {
|
|
|
15
15
|
/** 创意 ID(图片/视频媒体 ID),用于区分轮播中的具体创意 → creative_id */
|
|
16
16
|
creativeId?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare const useExposure: (ref: RefObject<HTMLElement>, { componentType, componentName, componentTitle, componentDescription, navigation, position, pageGroup: explicitPageGroup, category, creativeId, }: ExposureOptions) => void;
|
|
18
|
+
export declare const useExposure: (ref: RefObject<HTMLElement | null>, { componentType, componentName, componentTitle, componentDescription, navigation, position, pageGroup: explicitPageGroup, category, creativeId, }: ExposureOptions) => void;
|
|
19
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as o}from"react";import{gaTrack as b,toPlainTrackingText as y}from"../shared/track.js";import{buildPageGroup as v}from"../shared/trackUrlRef.js";import{useIntersectionObserverDelay as G}from"./useIntersectionObserver.js";import{useAiuiContext as S}from"../biz-components/AiuiProvider/index.js";import{convertLexicalToPlaintext as E}from"@payloadcms/richtext-lexical/plaintext";const H=(_,{componentType:n,componentName:i,componentTitle:t,componentDescription:r,navigation:a="",position:p=1,pageGroup:s,category:
|
|
1
|
+
import{useMemo as o}from"react";import{gaTrack as b,toPlainTrackingText as y}from"../shared/track.js";import{buildPageGroup as v}from"../shared/trackUrlRef.js";import{useIntersectionObserverDelay as G}from"./useIntersectionObserver.js";import{useAiuiContext as S}from"../biz-components/AiuiProvider/index.js";import{convertLexicalToPlaintext as E}from"@payloadcms/richtext-lexical/plaintext";const H=(_,{componentType:n,componentName:i,componentTitle:t,componentDescription:r,navigation:a="",position:p=1,pageGroup:s,category:l,creativeId:c=""})=>{const{trackingData:g,onExposure:u,pageHandle:m}=S(),d=o(()=>l||v({pageHandle:m,pageGroup:s||g.pageGroup}),[l,s,m,g.pageGroup]),f=o(()=>{const e=typeof t=="object"&&t!==null?E({data:t}):t;return typeof e=="string"?y(e):e},[t]),x=o(()=>{const e=typeof r=="object"&&r!==null?E({data:r}):r;return typeof e=="string"?y(e):e},[r]);G(_,{once:!0,threshold:.5,delay:2e3,callback:()=>{u?u({componentType:n,componentName:i,componentTitle:f,componentDescription:x,navigation:a,pageGroup:d,position:p,creativeId:c}):b({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:d,component_type:n,component_name:i,position:p,creative_id:c,component_title:f,component_description:x,navigation:a}})}})};export{H as useExposure};
|
|
@@ -27,5 +27,5 @@ interface ViewItemListOptions {
|
|
|
27
27
|
itemListName?: string;
|
|
28
28
|
items?: ViewItemListProduct[];
|
|
29
29
|
}
|
|
30
|
-
export declare const useViewItemList: (ref: RefObject<HTMLElement>, { componentType, componentName, componentTitle, componentDescription, navigation, position, itemListName, itemListId, items, tabName, pageGroup: explicitPageGroup, category, currency, }: ViewItemListOptions) => void;
|
|
30
|
+
export declare const useViewItemList: (ref: RefObject<HTMLElement | null>, { componentType, componentName, componentTitle, componentDescription, navigation, position, itemListName, itemListId, items, tabName, pageGroup: explicitPageGroup, category, currency, }: ViewItemListOptions) => void;
|
|
31
31
|
export {};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ export { gaTrack, trackSelectItem, buildClickTrackingProps, resolveComponentMedi
|
|
|
3
3
|
export type { SelectItemProduct, TrackSelectItemOptions, ComponentMediaType, ClickTrackingPropsInput, TrackComponentClickOptions, } from './shared/track.js';
|
|
4
4
|
export { trackUrlRef, buildTrackingRef, buildPageGroup } from './shared/trackUrlRef.js';
|
|
5
5
|
export type { BuildPageGroupOptions } from './shared/trackUrlRef.js';
|
|
6
|
+
export { buildAmazonUrl, extractAmazonAsin } from './shared/amazonAttribution.js';
|
|
7
|
+
export type { AmazonLinkFields, BuildAmazonUrlOptions } from './shared/amazonAttribution.js';
|
|
8
|
+
export { getValidAdTrackEvents } from './shared/adTrack.js';
|
|
9
|
+
export type { AdTrackChannel, AdTrackEvent, AdTrackFields, AdTrackContext, OnAdTrackCallback, } from './shared/adTrack.js';
|
|
10
|
+
export { useBoaButton } from './hooks/useBoaButton.js';
|
|
11
|
+
export type { BoaButtonFields, ResolvedBoaLink, UseBoaButtonResult } from './hooks/useBoaButton.js';
|
|
6
12
|
export type { ExposureParams, OnExposureCallback } from './biz-components/AiuiProvider/index.js';
|
|
7
13
|
export type { Media, Theme, Img, Video, ContainerProps, ComponentCommonProps, ResponsiveMedia, Shape, Align, CurrencyDisplayType, } from './types/props.js';
|
|
8
14
|
export { default as useCountDown } from './hooks/useCountDown.js';
|
|
@@ -18,7 +24,9 @@ export type { UseTrackingOptions, UseTrackingResult } from './hooks/useTracking.
|
|
|
18
24
|
export { useCarouselPlayback } from './hooks/useCarouselPlayback.js';
|
|
19
25
|
export type { CarouselPlaybackState, CarouselSlideTrigger, UseCarouselPlaybackOptions, UseCarouselPlaybackResult, } from './hooks/useCarouselPlayback.js';
|
|
20
26
|
export { cn, getLocalizedPath, noop } from './helpers/index.js';
|
|
21
|
-
export { formatPrice, languageTerritory, PRICE_SYMBOL } from './helpers/index.js';
|
|
27
|
+
export { formatPrice, languageTerritory, PRICE_SYMBOL, extendLocaleMap } from './helpers/index.js';
|
|
22
28
|
export { LocalizedLink, type LocalizedLinkProps } from './shared/LocalizedLink.js';
|
|
23
|
-
export { CarouselArrows, CarouselProgressControls } from './shared/CarouselControls.js';
|
|
29
|
+
export { CarouselArrows, CarouselCornerToggle, CarouselProgressControls } from './shared/CarouselControls.js';
|
|
24
30
|
export type { CarouselArrowsProps, CarouselProgressControlsProps } from './shared/CarouselControls.js';
|
|
31
|
+
export { MEDIA_GRID_SPEC, resolveMediaGridSpec, mediaGridSpecToCssVars, type GridColumns, type MediaMode, type BreakpointSpec, type MediaGridSpec, } from './shared/mediaGridSpec.js';
|
|
32
|
+
export { ContainerGridContext, useContainerGrid, type ContainerGridInfo } from './shared/ContainerGridContext.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./components/index.js";import{gaTrack as t,trackSelectItem as
|
|
1
|
+
export*from"./components/index.js";import{gaTrack as t,trackSelectItem as a,buildClickTrackingProps as s,resolveComponentMediaType as p,trackComponentClick as i,toPlainTrackingText as n}from"./shared/track.js";import{trackUrlRef as m,buildTrackingRef as u,buildPageGroup as c}from"./shared/trackUrlRef.js";import{buildAmazonUrl as k,extractAmazonAsin as C}from"./shared/amazonAttribution.js";import{getValidAdTrackEvents as f}from"./shared/adTrack.js";import{useBoaButton as T}from"./hooks/useBoaButton.js";import{default as P}from"./hooks/useCountDown.js";import{useDraggableScroll as b}from"./hooks/useDraggableScroll.js";import{useExposure as B}from"./hooks/useExposure.js";import{useGridRowCount as S}from"./hooks/useGridRowCount.js";import{useIntersectionObserverDelay as R}from"./hooks/useIntersectionObserver.js";import{useRollout as G}from"./hooks/useRollout.js";import{useViewItemList as O}from"./hooks/useViewItemList.js";import{useTracking as U}from"./hooks/useTracking.js";import{useCarouselPlayback as E}from"./hooks/useCarouselPlayback.js";import{cn as D,getLocalizedPath as V,noop as F}from"./helpers/index.js";import{formatPrice as Y,languageTerritory as q,PRICE_SYMBOL as H,extendLocaleMap as J}from"./helpers/index.js";import{LocalizedLink as N}from"./shared/LocalizedLink.js";import{CarouselArrows as W,CarouselCornerToggle as X,CarouselProgressControls as Z}from"./shared/CarouselControls.js";import{MEDIA_GRID_SPEC as ee,resolveMediaGridSpec as oe,mediaGridSpecToCssVars as re}from"./shared/mediaGridSpec.js";import{ContainerGridContext as ae,useContainerGrid as se}from"./shared/ContainerGridContext.js";export{W as CarouselArrows,X as CarouselCornerToggle,Z as CarouselProgressControls,ae as ContainerGridContext,N as LocalizedLink,ee as MEDIA_GRID_SPEC,H as PRICE_SYMBOL,k as buildAmazonUrl,s as buildClickTrackingProps,c as buildPageGroup,u as buildTrackingRef,D as cn,J as extendLocaleMap,C as extractAmazonAsin,Y as formatPrice,t as gaTrack,V as getLocalizedPath,f as getValidAdTrackEvents,q as languageTerritory,re as mediaGridSpecToCssVars,F as noop,p as resolveComponentMediaType,oe as resolveMediaGridSpec,n as toPlainTrackingText,i as trackComponentClick,a as trackSelectItem,m as trackUrlRef,T as useBoaButton,E as useCarouselPlayback,se as useContainerGrid,P as useCountDown,b as useDraggableScroll,B as useExposure,S as useGridRowCount,R as useIntersectionObserverDelay,G as useRollout,U as useTracking,O as useViewItemList};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { GridColumns } from './mediaGridSpec.js';
|
|
2
|
+
/**
|
|
3
|
+
* withLayout container 布局的栅格信息(由 withContainerLayout 注入)
|
|
4
|
+
*/
|
|
5
|
+
export interface ContainerGridInfo {
|
|
6
|
+
/** 组件在 12 列页面栅格中占据的列数(来自 container.desktopSpan,默认 12) */
|
|
7
|
+
gridColumns: GridColumns;
|
|
8
|
+
/** 移动端栅格跨度(来自 container.mobileSpan,可选) */
|
|
9
|
+
mobileSpan?: number;
|
|
10
|
+
/** 平板档(768–1024px)栅格跨度(来自 container.tabletSpan,可选;缺省时 tablet 档沿用 desktopSpan) */
|
|
11
|
+
tabletSpan?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const ContainerGridContext: import("react").Context<ContainerGridInfo | null>;
|
|
14
|
+
/**
|
|
15
|
+
* 读取当前组件所处的 container 栅格信息
|
|
16
|
+
*
|
|
17
|
+
* @returns 无 provider(组件未通过 withLayout container 布局包裹)时返回
|
|
18
|
+
* `null`,调用方应回退到 legacy aspect-ratio 类名
|
|
19
|
+
*/
|
|
20
|
+
export declare function useContainerGrid(): ContainerGridInfo | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{createContext as n,useContext as e}from"react";const r=n(null);function o(){return e(r)}export{r as ContainerGridContext,o as useContainerGrid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as
|
|
1
|
+
import{Fragment as K,jsx as s,jsxs as M}from"react/jsx-runtime";import u,{useMemo as y}from"react";import{simpleHash as g}from"./simpleHash.js";import b from"./getKeyPropsString.js";import{Grid as w,GridItem as N}from"../components/grid.js";import{Container as T}from"../components/container.js";import I from"./ErrorBoundary.js";import{ContainerGridContext as k}from"./ContainerGridContext.js";const $=[12,10,8,6,4],h=t=>{const e=typeof t=="string"?Number.parseInt(t,10):t;return $.includes(e??12)?e??12:12},x={12:"col-start-1 col-end-13",10:"col-start-2 col-end-12",8:"col-start-3 col-end-11",6:"col-start-4 col-end-10",4:"col-start-5 col-end-9"},C={12:"tablet:col-start-1 tablet:col-end-13",10:"tablet:col-start-2 tablet:col-end-12",8:"tablet:col-start-3 tablet:col-end-11",6:"tablet:col-start-4 tablet:col-end-10",4:"tablet:col-start-5 tablet:col-end-9"},G={12:"laptop:col-start-1 laptop:col-end-13",10:"laptop:col-start-2 laptop:col-end-12",8:"laptop:col-start-3 laptop:col-end-11",6:"laptop:col-start-4 laptop:col-end-10",4:"laptop:col-start-5 laptop:col-end-9"},P=t=>{const e=b(t);return`style_${g(e)}`},L=t=>{const{style:e,uid:n,disabled:o,containerClassName:r}=t;return{style:e,uid:n,disabled:o,containerClassName:r}},j=({style:t,uid:e=P({}),disabled:n=!1})=>!t||n?null:s("style",{suppressHydrationWarning:!0,"data-style-id":e,dangerouslySetInnerHTML:{__html:`.block-${e} { ${t} }`}}),_=(t,e)=>{const n=y(()=>t?.uid||P({...t,...e??{}}),[e,t]),o=y(()=>s(j,{...t,uid:n}),[t,n]);return{className:`block-${n} `,StyleComponent:o,uid:n,idx:e?.idx!=null?String(e.idx):void 0}},E=t=>{const{desktopSpan:e,mobileSpan:n,tabletSpan:o}=t||{},r=n?x[n]:"";if(!o){const c=e?C[e]:"";return`${r} ${c}`.trim()}const a=C[o]??"",l=e?G[e]:"";return`${r} ${a} ${l}`.trim()},B=t=>t?typeof t=="string"?t:typeof t=="object"&&Object.entries(t).length<=0?"":Object.entries(t).map(([e,n])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; ")+";":"",O=(t,e)=>[t,e].map(B).filter(n=>!!n).map(n=>n.trim().endsWith(";")?n:`${n};`).join(" ");function v(t,e){const n=u.forwardRef((o,r)=>{const{container:a,containerClassName:l,className:c,...p}=o;if(!a||Reflect.ownKeys(a).length===0)return s(t,{...p,className:c,ref:r});const m=[e,l,c].filter(Boolean).join(" ").trim(),i=a,d={gridColumns:h(i?.desktopSpan),mobileSpan:i?.mobileSpan,tabletSpan:i?.tabletSpan};return s(T,{className:m,children:s(w,{className:"container_grid",children:s(N,{className:E(i),children:s(k.Provider,{value:d,children:s(t,{...p,ref:r})})})})})});return n.displayName=`WithContainerLayout(${t.displayName||t.name||"Component"})`,n}function A(t,e){const n=u.forwardRef((o,r)=>{const a=L(o),l=O(e?.style,a.style),c={...e,...a,...l&&{style:l}},{className:p,StyleComponent:m,idx:i}=_(c,o.data),{style:d,uid:H,disabled:D,className:S,...R}=o;return M(K,{children:[m,s(t,{...i?{id:i}:{},...R,className:[p,S].filter(Boolean).join(" ").trim(),ref:r})]})});return n.displayName=`WithStyleInjection(${t.displayName||t.name||"Component"})`,n}function F(t){const e=u.forwardRef((n,o)=>s(I,{children:s(t,{...n,ref:o})}));return e.displayName=`WithErrorBoundary(${t.displayName||t.name||"Component"})`,e}const f=new WeakMap;function X(t,e){if(f.has(t))return t;const n=F(A(v(t,e?.containerClassName),e));n.displayName=`WithLayout(${t.displayName||t.name||"Component"})`,f.set(t,!0);const o=n;return Object.getOwnPropertyNames(t).forEach(r=>{!(r in o)&&r!=="arguments"&&r!=="caller"&&r!=="length"&&r!=="name"&&(o[r]=t[r])}),o}export{L as getStylesProps,_ as useStyles,X as withLayout};
|