@anker-in/headless-ui 1.3.84 → 1.3.86
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/README.md +6 -0
- package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/cjs/biz-components/Category/index.d.ts +4 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Chat/action.d.ts +25 -0
- package/dist/cjs/biz-components/Chat/action.js +1 -0
- package/dist/cjs/biz-components/Chat/button.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/button.js +1 -0
- package/dist/cjs/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/cjs/biz-components/Chat/chatContext.js +1 -0
- package/dist/cjs/biz-components/Chat/exports.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/exports.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/cjs/biz-components/Chat/index.d.ts +71 -0
- package/dist/cjs/biz-components/Chat/index.js +1 -0
- package/dist/cjs/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/cjs/biz-components/Chat/markdown.js +1 -0
- package/dist/cjs/biz-components/Chat/messages.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/messages.js +1 -0
- package/dist/cjs/biz-components/Chat/props.d.ts +43 -0
- package/dist/cjs/biz-components/Chat/props.js +1 -0
- package/dist/cjs/biz-components/Chat/response.d.ts +4 -0
- package/dist/cjs/biz-components/Chat/response.js +1 -0
- package/dist/cjs/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/suggestions.js +1 -0
- package/dist/cjs/biz-components/Chat/utils.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/utils.js +1 -0
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/cjs/biz-components/Faq/Faq.js +2 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.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/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/Root.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/shared/track.d.ts +13 -7
- package/dist/cjs/shared/track.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/esm/biz-components/Category/index.d.ts +4 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Chat/action.d.ts +25 -0
- package/dist/esm/biz-components/Chat/action.js +1 -0
- package/dist/esm/biz-components/Chat/button.d.ts +3 -0
- package/dist/esm/biz-components/Chat/button.js +1 -0
- package/dist/esm/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/esm/biz-components/Chat/chatContext.js +1 -0
- package/dist/esm/biz-components/Chat/exports.d.ts +3 -0
- package/dist/esm/biz-components/Chat/exports.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/esm/biz-components/Chat/index.d.ts +71 -0
- package/dist/esm/biz-components/Chat/index.js +1 -0
- package/dist/esm/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/esm/biz-components/Chat/markdown.js +1 -0
- package/dist/esm/biz-components/Chat/messages.d.ts +3 -0
- package/dist/esm/biz-components/Chat/messages.js +1 -0
- package/dist/esm/biz-components/Chat/props.d.ts +43 -0
- package/dist/esm/biz-components/Chat/props.js +1 -0
- package/dist/esm/biz-components/Chat/response.d.ts +4 -0
- package/dist/esm/biz-components/Chat/response.js +1 -0
- package/dist/esm/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/esm/biz-components/Chat/suggestions.js +1 -0
- package/dist/esm/biz-components/Chat/utils.d.ts +3 -0
- package/dist/esm/biz-components/Chat/utils.js +1 -0
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/esm/biz-components/Faq/Faq.js +2 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.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/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/Root.js +1 -1
- package/dist/esm/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/esm/biz-components/SceneShelf/context.js +1 -1
- package/dist/esm/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/shared/track.d.ts +13 -7
- package/dist/esm/shared/track.js +1 -1
- package/dist/tokens/base.css +48 -0
- package/package.json +50 -3
- package/src/biz-components/Chat/styles/chat.css +14 -0
- package/src/biz-components/Chat/styles/css/animations.css +35 -0
- package/src/biz-components/Chat/styles/css/button.css +56 -0
- package/src/biz-components/Chat/styles/css/colors.css +12 -0
- package/src/biz-components/Chat/styles/css/console.css +134 -0
- package/src/biz-components/Chat/styles/css/header.css +43 -0
- package/src/biz-components/Chat/styles/css/input.css +89 -0
- package/src/biz-components/Chat/styles/css/markdown.css +131 -0
- package/src/biz-components/Chat/styles/css/messages.css +85 -0
- package/src/biz-components/Chat/styles/css/panel.css +23 -0
- package/src/biz-components/Chat/styles/css/popup.css +44 -0
- package/src/biz-components/Chat/styles/css/response.css +25 -0
- package/src/biz-components/Chat/styles/css/sidebar.css +31 -0
- package/src/biz-components/Chat/styles/css/suggestions.css +36 -0
- package/src/biz-components/Chat/styles/css/window.css +60 -0
- package/src/biz-components/Chat/styles/image.png +0 -0
- package/style.css +9 -12
- package/tailwind.config.js +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as h}from"react/jsx-runtime";import{gaTrack as P}from"../../shared/track.js";import{buildPageGroup as R}from"../../shared/trackUrlRef.js";import{createContext as N,useContext as H,useEffect as i,useMemo as G,useRef as u,useState as L}from"react";import{extendLocaleMap as w}from"../../helpers/index.js";const x=N({trackingData:{},locale:void 0,copyWriting:{}}),K=()=>{const o=H(x);if(!o)throw new Error("useAiui must be used in <AiuiProvider>");return o},O=({children:o,...e})=>{const d=u(null),l=u(e?.trackingData),g=u(e?.pageHandle),[m,C]=L(void 0);i(()=>{e.localeMap&&Object.keys(e.localeMap).length>0&&w(e.localeMap)},[e.localeMap]),i(()=>{l.current=e?.trackingData},[e?.trackingData]),i(()=>{g.current=e?.pageHandle},[e?.pageHandle]),i(()=>{const r=d.current;if(!r)return;const v=()=>{r.querySelectorAll("[data-headless-type-name]").forEach(n=>{n.closest("[data-aiui-provider-root]")===r&&(n.hasAttribute("data-headless-track-bound")||(n.addEventListener("click",a=>E(a,n)),n.setAttribute("data-headless-track-bound","true")))})},E=(n,a)=>{const t={};if(!a||!a.attributes)return t;for(const M of Array.from(a.attributes)){const p=M?.name;p?.startsWith("data-headless-")&&(t[p]=a.getAttribute(p))}const D=t?.["data-headless-sku"],T=t?.["data-headless-creative-id"],b=t?.["data-headless-type-name"]?.split?.("#"),s=t?.["data-headless-title-desc-button"]?.split?.("#"),y=t?.["data-headless-nav-position"]?.split?.("#"),_=R({pageHandle:g.current,pageGroup:l.current?.pageGroup}),c=y?.[1],k=c===void 0||c===""?"":Number(c);P({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:_,component_type:b?.[0]||"",component_name:b?.[1]||"",position:Number.isNaN(k)?"":k,navigation:y?.[0]||"",button_name:s?.[2]||"",SKU:D||"",creative_id:T||"",component_title:s?.[0]||"",component_description:s?.[1]||""}})},f=new MutationObserver(v);return f.observe(r,{childList:!0,subtree:!0}),v(),()=>f.disconnect()},[]);const A=G(()=>({...e,navCollapsed:m,setNavCollapsed:C}),[e,m]);return h(x.Provider,{value:A,children:h("div",{ref:d,"data-aiui-provider-root":"",children:o})})};var U=O;export{x as AiuiContext,U as default,K as useAiuiContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as p}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import*as a from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import H from"./useAnchorPosition.js";import{Container as k}from"../../components/container.js";import{withLayout as B}from"../../shared/Styles.js";import{useExposure as V}from"../../hooks/useExposure.js";const N="copy",R="anchor_navigation",z=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),M=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),P=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"!bg-white",dark:"!bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),$={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},j={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},T=a.forwardRef(({classNames:l={},data:n,onItemClick:b,buttonStyle:s,className:L,...x},w)=>{const{alignment:D="start",theme:I="light",size:C="small"}=n,i=H(n.sectionIds?.map(t=>t.targetId)||[]),c=a.useRef(null),f=a.useRef(null),A=a.useRef([]);a.useImperativeHandle(w,()=>c.current);const y=n.sectionIds?.find(t=>t.targetId===i)?.label??"",E=n.sectionIds?.map(t=>t.label).join(" | ")??"";V(c,{componentType:N,componentName:R,componentTitle:E,componentDescription:y,navigation:y});const d=I==="dark"?j:$,u={defaultColor:s?.defaultColor??d.defaultColor,activeColor:s?.activeColor??d.activeColor,activeIndicatorColor:s?.activeIndicatorColor??d.activeIndicatorColor},m=a.useCallback(t=>{const e=A.current[t];if(e&&f.current){const r=f.current,o=e,v=o.offsetLeft-r.offsetWidth/2+o.offsetWidth/2;typeof r.scrollTo=="function"&&r.scrollTo({left:v,behavior:"smooth"})}},[]);return a.useEffect(()=>{if(!i)return;const t=n.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,n.sectionIds,m]),p(k,{ref:c,className:g(P({theme:I}),L,l?.root),...x,children:p("div",{ref:f,className:g(z({alignment:D,size:C}),"relative",l?.content),children:n.sectionIds?.map((t,e)=>{const r=i===t.targetId;return p("button",{ref:o=>{o&&(A.current[e]=o)},"data-headless-type-name":`${N}#${R}`,"data-headless-title-desc-button":`${t.label}##${t.label}`,"data-headless-nav-position":`${t.label}#${e+1}`,"aria-current":r?!0:void 0,onClick:()=>{if(m(e),b){b(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,S=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:S,behavior:"smooth"})}},className:g(M({size:C}),r?[u.activeColor,u.activeIndicatorColor,"after:w-full after:opacity-100"]:u.defaultColor,l?.item),children:t.label},t.targetId)})})})});T.displayName="AnchorNavigation";var K=B(T);export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
"use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{forwardRef as S,useEffect as T,useRef as h,useState as C,useImperativeHandle as M}from"react";import{cn as p,getLocalizedPath as v}from"../../helpers/utils.js";import B from"../../components/picture.js";import{withLayout as P}from"../../shared/Styles.js";import{useMediaQuery as A}from"react-responsive";import{useExposure as E}from"../../hooks/useExposure.js";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{useTracking as j}from"../../hooks/useTracking.js";import{trackUrlRef as R}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as d}from"../../shared/track.js";import{Swiper as $,SwiperSlide as D}from"swiper/react";import{Pagination as H,FreeMode as q,Mousewheel as z}from"swiper/modules";import"../Title/index.js";import F from"../../components/link.js";const c="copy",u="store_benefits",Q=(e,o)=>{const r=[];for(let i=0;i<e.length;i+=o)r.push(e.slice(i,i+o));return r},b=S(({data:{items:e=[],itemShape:o},className:r},i)=>{const[l,y]=C(!1),f=A({query:"(max-width: 768px)"}),k=h(null),m=h(null),{locale:x="us"}=I();M(i,()=>m.current),E(m,{componentType:c,componentName:u}),T(()=>{y(f)},[f]);const L=l?Q(e,3):e;return t("div",{ref:m,className:p("brand-equity-wrapper w-full",r),children:l?s($,{className:p(r),modules:[q,z,H],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:k.current},breakpoints:{0:{spaceBetween:12}},children:[L?.map((n,a)=>t(D,{className:"!flex flex-col gap-3",children:Array.isArray(n)&&n?.map((N,g)=>t(w,{data:N,itemShape:o,index:g,locale:x},g))},"SwiperSlide"+a)),t("div",{ref:k,className:"mt-3 flex justify-center"})]}):t("div",{className:p("laptop:gap-4 tablet:grid-cols-2 laptop:grid-cols-4 grid grid-cols-1 gap-3"),children:e.map((n,a)=>t(w,{data:n,itemShape:o,index:a,locale:x},a))})})}),w=({data:e,itemShape:o,index:r,locale:i})=>{const{buildRef:l}=j();return s("div",{className:p("brand-equity-item","lg-desktop:p-8 desktop:p-6 p-4","box-border flex w-full flex-col justify-between overflow-hidden bg-[#DAE7F2]","rounded-box"),children:[s("div",{className:"lg-desktop:h-[50px] flex h-10 items-center justify-between gap-3",children:[t("h3",{className:"link-item-title lg-desktop:text-[18px] desktop:text-[16px] line-clamp-2 flex-1 text-[14px] font-bold leading-[1.2] tracking-[-0.02em] text-[#080A0F]",children:e.title}),t("div",{className:"link-item-img lg-desktop:size-[36px] size-[30px] shrink-0",children:t(B,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),s("div",{className:"box-border overflow-hidden",children:[t("p",{title:e.description||"",className:"link-item-description lg-desktop:text-[24px] line-clamp-4 text-[20px] font-semibold leading-[1.2] tracking-[-0.04em] text-[#767880]",children:e.description||""}),s(F,{href:e?.link?R(v(e.link,i),l(c,u)):v("",i),asChild:!e?.link,...e?.link?{"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${d(e.title)}#${d(e.description)}#${d(e.linkText)}`,"data-headless-nav-position":`#${r+1}`}:{},className:"desktop:mt-4 mt-2 flex items-center gap-0.5 no-underline hover:underline",children:[t("span",{className:"link-item-text laptop:text-base text-sm",children:e?.linkText}),t("div",{className:"size-6",children:t("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:t("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})]})};b.displayName="BrandCardLink";var oe=P(b);export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as h from"react";import{cn as r}from"../../helpers/index.js";import"../../components/badge.js";import u from"../../components/picture.js";import{Text as l}from"../../components/text.js";import{buildBogoTrackProps as g}from"./tracking.js";const v=({checked:e,theme:n})=>{const o=n==="dark";return e?i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:o?"#F5F6F7":"#080A0F"}),t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),t("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:o?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},c=h.forwardRef(({gift:e,onClick:n,className:o,giftType:s,theme:p,tagBgColor:a,tagTextColor:d,trackingPosition:x},m)=>{const f=s===2||!!e.selected;return t("div",{ref:m,className:r("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","buy-one-get-one-shelf-free-gift-item",f?"buy-one-get-one-shelf-free-gift-item-selected":"buy-one-get-one-shelf-free-gift-item-unselected",s===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,o),onClick:()=>{s===1&&n?.(e)},...s===1?g({title:e.name,buttonName:e.selected?"Unselect gift":"Select gift",position:x,sku:e.sku}):{},children:i("div",{className:"flex size-full flex-col",children:[t("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&t("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...a?{backgroundColor:a}:{},...d?{color:d}:{}},children:e.tag})}),i("div",{className:r("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[t("div",{className:"flex size-5 shrink-0 items-center justify-center",children:t(v,{checked:!!e.selected,theme:p})}),t("div",{className:r("size-14 shrink-0","tablet:size-12"),children:t(u,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),i("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[t(l,{size:2,html:e.name,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),i("div",{className:"mt-auto flex items-center justify-between gap-2",children:[i("div",{className:"flex items-center gap-2",children:[t(l,{size:2,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&t(l,{size:2,className:r("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&i(l,{size:4,className:r("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})})});c.displayName="FreeGiftItem";var z=c;export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as u}from"react/jsx-runtime";import*as d from"react";import{cn as i}from"../../helpers/index.js";import{Text as G}from"../../components/text.js";import k from"./FreeGiftItem.js";const r=d.forwardRef(({freeGiftLabel:o,freeGifts:t,onGiftClick:f,className:n,giftType:a,theme:s,tagBgColor:p,tagTextColor:c,trackingPosition:m},g)=>!t||t.length===0?null:u("div",{ref:g,className:i("flex w-full flex-col gap-2",n),children:[o&&e(G,{size:2,className:i("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] w-full"),children:o}),e("div",{className:i("tablet:flex-row laptop:flex-col flex flex-col gap-2"),children:t.map((l,x)=>e("div",{className:"min-w-0 flex-1",children:e(k,{gift:l,onClick:f,giftType:a,theme:s,tagBgColor:p,tagTextColor:c,trackingPosition:m})},l.id||x))})]}));r.displayName="GiftSelection";var S=r;export{S as default};
|
|
@@ -15,6 +15,8 @@ export interface PriceAndActionsProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
15
15
|
trackingTitle?: string;
|
|
16
16
|
trackingDescription?: string;
|
|
17
17
|
trackingSku?: string;
|
|
18
|
+
/** 卡片在货架中的位置(从 1 开始),上报为 position */
|
|
19
|
+
trackingPosition?: number;
|
|
18
20
|
classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>;
|
|
19
21
|
/**
|
|
20
22
|
* 原价区域渲染函数,用于在原价位置展示自定义内容(如 Save 金额文案)。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as L,jsx as t,jsxs as o}from"react/jsx-runtime";import*as C from"react";import{cn as e}from"../../helpers/index.js";import u from"../../components/button.js";import{Text as x}from"../../components/text.js";import{Heading as f}from"../../components/index.js";import{buildBogoTrackProps as N}from"./tracking.js";const b=C.forwardRef(({currentPrice:P,originalPrice:r,priceLabel:n,learnMoreText:a="Learn More",shopNowText:s="Shop Now",soldOutText:v="Sold out",onLearnMore:w,onShopNow:y,availableForSale:l,learnMoreLoading:h,shopNowLoading:k,className:A,trackingTitle:c,trackingDescription:d,trackingSku:p,trackingPosition:m=1,classNames:i,renderOriginalPrice:g},B)=>o("div",{ref:B,className:e("flex w-full flex-col justify-center gap-2",A),children:[t("div",{className:"flex w-full items-center gap-2",children:l?o(L,{children:[t(f,{size:2,className:e("text-info-primary"),children:P}),g?g(r):r&&t(f,{size:2,className:e("text-info-tertiary line-through",i?.productCardOriginalPrice),children:r})]}):t(x,{size:4,className:e("text-info-primary text-2xl leading-[1.2] tracking-[-0.48px]","tablet:text-xl tablet:tracking-[-0.4px]"),children:v})}),n&&t(x,{size:4,className:e("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",i?.productCardPriceLabel),children:n}),o("div",{className:e("flex w-full items-stretch gap-3","tablet:gap-2"),children:[t(u,{variant:"secondary",size:"lg",onClick:w,loading:h,className:e("min-w-0 flex-1 whitespace-normal text-center",i?.productCardBtnGroup),...N({title:c,description:d,buttonName:a,position:m,sku:p}),children:a}),t(u,{variant:"primary",size:"lg",onClick:y,disabled:!l,loading:k,className:e("min-w-0 flex-1 whitespace-normal text-center",i?.productCardBtnGroup),...N({title:c,description:d,buttonName:s,position:m,sku:p}),children:s})]})]}));b.displayName="PriceAndActions";var O=b;export{O as default};
|
|
@@ -31,6 +31,8 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
31
31
|
onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void;
|
|
32
32
|
/** 赠品选择变化回调 */
|
|
33
33
|
onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void;
|
|
34
|
+
/** 卡片在货架中的位置(从 1 开始),由 Root 自动注入,用于埋点 position */
|
|
35
|
+
trackingPosition?: number;
|
|
34
36
|
/** 选中赠品SKU变化回调(受控组件) */
|
|
35
37
|
onSelectedGiftSkuChange?: (selectedSku: string | null) => void;
|
|
36
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as l,jsxs as
|
|
1
|
+
"use client";import{jsx as l,jsxs as C}from"react/jsx-runtime";import*as i from"react";import{cn as b}from"../../helpers/index.js";import ye from"./ProductImage.js";import ke from"./ProductInfo.js";import be from"./ProductTags.js";import Fe from"./DiscountBadge.js";import ve from"./GiftSelection.js";import we from"./PriceAndActions.js";import{BuyOneGetOneShelfContext as Be}from"./context.js";const Ne=[],F=i.forwardRef(({productData:e,gifts:t=Ne,giftType:a=1,selectedGiftSku:v,sceneImages:w,tags:B,layout:N,className:L,onProductClick:x,onProductImageClick:T,onLearnMore:M,onShopNow:O,onAddToCart:I,onGiftClick:G,onGiftSelectionChange:R,trackingPosition:d=1,classNames:u,soldOutText:A,renderOriginalPrice:H,tagTypeConfig:E,fill:j,outline:z,customTagStyle:W,customTagsIcon:$,renderDiscountBadge:V,discountTagTextColor:_,giftTagBgColor:U,giftTagTextColor:Y,...q},D)=>{const{layout:J,theme:K,tagTypeConfig:Q,fill:X,outline:Z,customTagStyle:ee,customTagsIcon:te,renderDiscountBadge:oe,discountTagTextColor:ne,giftTagBgColor:re,giftTagTextColor:ie}=i.useContext(Be),m=N??J,ae=E??Q,le=j??X,ce=z??Z,se=W??ee,de=$??te,ue=V??oe,fe=_??ne,ge=U??re,me=Y??ie,[pe,Ce]=i.useState(!1),[xe,Te]=i.useState(!1),[h,f]=i.useState(()=>!t||t.length===0?[]:a===2?t.map(o=>o.id):[t[0].id]),p=i.useMemo(()=>t?t.map(o=>({...o,selected:h.includes(o.id)})):[],[t,h]);i.useEffect(()=>{if(!t||t.length===0){f([]);return}f(a===2?t.map(o=>o.id):o=>{const n=o[0];return n&&t.some(c=>c.id===n)?[n]:[t[0].id]})},[t,a]);const s=i.useMemo(()=>({...e,gifts:t,gift_type:a}),[e,t,a]),Ge=o=>{if(a===2){const n=p.filter(r=>r.selected);G?.(o,n);return}f(()=>{const n=[o.id],r=t?.filter(c=>n.includes(c.id))||[];return G?.(o,r),R?.(r,s),n})},g=!!(T??x),P=e.variantId?.split("/").pop()?.split("?")[0],S=`/products/${e.handle}${P?`?variant=${encodeURIComponent(P)}`:""}`,y=()=>{(T??x)?.(s)},k=async(o,n)=>{const r=p.filter(Se=>Se.selected),c=n==="primary"?Te:Ce;c(!0);try{switch(o){case"buyNow":await O?.(s,r);break;case"addCart":await I?.(s,r);break;case"learnMore":await M?.(s,r);break}}finally{c(!1)}},he=e.learnMoreFun??"learnMore",Pe=e.shopNowFun??"buyNow";return C("div",{ref:D,className:b("bg-container-primary rounded-box relative flex items-stretch overflow-hidden",m==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-col","laptop:col-span-2"]:["flex-col justify-between"],L),...q,children:[l(Fe,{text:e.discountAmount,style:se,icon:de,renderBadge:ue,className:u?.productCardDiscountBadge,textClassName:u?.productCardDiscountBadgeText,textColor:fe}),l(ye,{images:w,name:e.name,layout:m,onClick:g?y:void 0,href:g?void 0:S,trackingTitle:e.name,trackingDescription:e.description,trackingSku:e.sku,trackingPosition:d}),l("div",{className:b("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",m==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:C("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[C("div",{className:"flex flex-col gap-2",children:[l(be,{tags:e.tags||B,tagTypeConfig:ae,fill:le,outline:ce}),l(ke,{name:e.name,onClick:g?y:void 0,href:g?void 0:S,trackingSku:e.sku,trackingPosition:d,description:e.description,classNames:u})]}),l(ve,{freeGiftLabel:e.freeGiftLabel,freeGifts:p,onGiftClick:Ge,giftType:a,selectedGiftSku:v,trackingPosition:d,theme:K,tagBgColor:ge,tagTextColor:me}),l(we,{currentPrice:e.currentPrice??"",originalPrice:e.originalPrice,priceLabel:e.priceLabel,learnMoreText:e.learnMoreText,shopNowText:e.shopNowText,soldOutText:A,onLearnMore:()=>k(he,"secondary"),onShopNow:()=>k(Pe,"primary"),availableForSale:e.availableForSale,learnMoreLoading:pe,shopNowLoading:xe,trackingTitle:e.name,trackingDescription:e.description,trackingSku:e.sku,trackingPosition:d,classNames:u,renderOriginalPrice:H})]})})]})});F.displayName="BuyOneGetOneShelf.ProductCard";var je=F;export{je as default};
|
|
@@ -10,6 +10,10 @@ export interface ProductImageProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
/** 产品链接(无 onClick 回调时自动使用 a 标签跳转) */
|
|
12
12
|
href?: string;
|
|
13
|
+
trackingTitle?: string;
|
|
14
|
+
trackingDescription?: string;
|
|
15
|
+
trackingSku?: string;
|
|
16
|
+
trackingPosition?: number;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* ProductImage - 产品图片区域
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import*as v from"react";import{cn as k}from"../../helpers/index.js";import P from"../../components/picture.js";import{buildBogoTrackProps as h,trackType as z,trackName as N}from"./tracking.js";import{trackUrlRef as L}from"../../shared/trackUrlRef.js";import{useTracking as T}from"../../hooks/useTracking.js";import{LocalizedLink as I}from"../../shared/LocalizedLink.js";const f=({images:i,name:r,layout:o})=>{const{laptop:u,mobile:a,tablet:s,desktop:p,lgDesktop:n}=i,l=p?.url||n?.url,c=u?.url||l,e=s?.url||c,d=a?.url||e,m=[n?.url||l,`${l} 1919`,`${c} 1439`,`${e} 1024`,`${d} 767`].join(", ");return t(P,{source:m,alt:r,className:k({"laptop:absolute inset-0 size-full static":o==="horizontal","w-full h-auto":o==="vertical"}),imgClassName:"size-full object-cover"})},b=v.forwardRef(({images:i,name:r,layout:o="horizontal",className:u,onClick:a,href:s,trackingTitle:p,trackingDescription:n,trackingSku:l,trackingPosition:c},e)=>{const{buildRef:d}=T(),m=h({title:p??r,description:n,buttonName:"image",position:c,sku:l}),g=k("relative grow overflow-hidden",o==="horizontal"?["min-h-[240px]","laptop:basis-[60.9%]","desktop:basis-[57.9%]","lg-desktop:basis-[57.9%]"]:["h-fit grow-0"],a||s?"cursor-pointer":"",u);return a?t("div",{ref:e,className:g,onClick:a,...m,children:t(f,{images:i,name:r,layout:o})}):s?t(I,{href:L(s,d(z,N)),className:g,...m,children:t("div",{ref:e,children:t(f,{images:i,name:r,layout:o})})}):t("div",{ref:e,className:g,children:t(f,{images:i,name:r,layout:o})})});b.displayName="ProductImage";var x=b;export{x as default};
|
|
@@ -7,6 +7,8 @@ export interface ProductInfoProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
/** 产品链接(无 onClick 回调时自动使用 a 标签跳转) */
|
|
9
9
|
href?: string;
|
|
10
|
+
trackingSku?: string;
|
|
11
|
+
trackingPosition?: number;
|
|
10
12
|
}
|
|
11
13
|
declare const ProductInfo: React.ForwardRefExoticComponent<ProductInfoProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
14
|
export default ProductInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as C}from"react/jsx-runtime";import*as k from"react";import{cn as t}from"../../helpers/index.js";import{Text as g}from"../../components/text.js";import{Heading as i}from"../../components/heading.js";import{LocalizedLink as P}from"../../shared/LocalizedLink.js";import{buildBogoTrackProps as h,trackType as x,trackName as T}from"./tracking.js";import{trackUrlRef as N}from"../../shared/trackUrlRef.js";import{useTracking as y}from"../../hooks/useTracking.js";const m=k.forwardRef(({name:r,description:a,onClick:c,href:l,trackingSku:s,trackingPosition:p,className:d,classNames:o={}},f)=>{const{buildRef:u}=y(),n=h({title:r,description:a,buttonName:"title",position:p,sku:s});return C("div",{ref:f,className:t("text-info-primary flex w-full flex-col gap-1",d),children:[c?e(i,{as:"h4",size:2,html:r,className:t("line-clamp-1 ",o?.productCardTitle),onClick:()=>c?.(),...n}):l?e(P,{href:N(l,u(x,T)),className:"block",...n,children:e(i,{as:"h4",size:2,html:r,className:t("line-clamp-1 ",o?.productCardTitle)})}):e(i,{as:"h4",size:2,html:r,className:t("line-clamp-1 ",o?.productCardTitle)}),e(g,{size:2,html:a,className:t("desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1",o?.productCardDescription)})]})});m.displayName="ProductInfo";var I=m;export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as s,jsxs as V}from"react/jsx-runtime";import*as t from"react";import{cn as i}from"../../helpers/index.js";import $ from"./ProductCard.js";import{Heading as F,Text as _}from"../../components/index.js";import{BuyOneGetOneShelfContext as W}from"./context.js";import{useExposure as A}from"../../hooks/useExposure.js";import{toPlainTrackingText as b}from"../../shared/track.js";const k="shelf",D="buy_one_get_one_shelf";function E(n){return t.Children.toArray(n).flatMap(e=>t.isValidElement(e)&&e.type===t.Fragment?E(e.props.children):[e])}function q(n){return t.isValidElement(n)?n.props.layout??"horizontal":"horizontal"}function J(n,e){let o=0,r=0;for(let a=0;a<e;a++){const p=q(n[a])==="horizontal"?2:1;p===2&&o>0&&(o=0),o+=p,o===2&&(r=a+1,o=0)}return n.slice(0,r)}const z=t.forwardRef(({className:n,classNames:e={},theme:o,title:r,subtitle:a,children:p,viewMoreThreshold:f=4,viewMoreText:y="View More",viewLessText:h="View Less",tagTypeConfig:g,fill:O,outline:R,customTagStyle:P,customTagsIcon:x,renderDiscountBadge:C,discountTagTextColor:N,giftTagBgColor:S,giftTagTextColor:v,...I},L)=>{const d=t.useRef(null),[c,M]=t.useState(!1);A(d,{componentType:k,componentName:D,componentTitle:r,componentDescription:a}),t.useImperativeHandle(L,()=>d.current);const u=E(p),B=u.length>f,T=B&&!c?J(u,f):u,j=t.useMemo(()=>({layout:"horizontal",theme:o,tagTypeConfig:g,fill:O,outline:R,customTagStyle:P,customTagsIcon:x,renderDiscountBadge:C,discountTagTextColor:N,giftTagBgColor:S,giftTagTextColor:v}),[o,g,O,R,P,x,C,N,S,v]),w=T.map((l,H)=>{if(!t.isValidElement(l))return l;const m=l.props,G={trackingPosition:m.trackingPosition??H+1};return m.layout==="horizontal"&&(G.className=i(m.className,"laptop:col-span-2")),t.cloneElement(l,G)});return s(W.Provider,{value:j,children:V("div",{ref:d,className:i("bogo-shelf-root w-full py-0",{"aiui-dark":o==="dark"},n,e?.root),...I,children:[r&&s(F,{as:"h2",size:3,html:r,className:i("bogo-shelf-title text-info-primary mb-4",e?.title)}),a&&s(_,{size:3,as:"p",html:a,className:i("bogo-shelf-description text-info-primary mb-6",e?.description)}),s("div",{className:i("grid grid-cols-1 gap-6","laptop:grid-cols-2"),children:w}),B&&s("div",{className:"mt-6 flex justify-center",children:V("button",{type:"button",onClick:()=>M(l=>!l),"aria-expanded":c,"data-headless-type-name":`${k}#${D}`,"data-headless-title-desc-button":`${b(r)}#${b(a)}#${c?h:y}`,"data-headless-nav-position":"#1",className:i("hover:text-brand-0 lg-desktop:text-[16px] text-info-primary flex cursor-pointer items-center gap-2 border-none bg-transparent text-[14px] font-bold outline-none transition-colors",e?.viewMoreBtn),children:[c?h:y,s("svg",{className:i("size-4 transition-transform",c&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:s("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})})]})})});z.displayName="BuyOneGetOneShelf.Root";const K={Root:z,ProductCard:$};var te=K;export{te as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const trackType = "shelf";
|
|
2
|
+
export declare const trackName = "buy_one_get_one_shelf";
|
|
3
|
+
interface TrackInput {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
buttonName?: string;
|
|
7
|
+
position?: number;
|
|
8
|
+
sku?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 买赠货架点击埋点属性。
|
|
12
|
+
* componentType 为 shelf,超出 buildClickTrackingProps 的 image | video 限定,按规范 4.2 手写属性。
|
|
13
|
+
*/
|
|
14
|
+
export declare const buildBogoTrackProps: ({ title, description, buttonName, position, sku }: TrackInput) => {
|
|
15
|
+
'data-headless-sku'?: string | undefined;
|
|
16
|
+
'data-headless-type-name': string;
|
|
17
|
+
'data-headless-title-desc-button': string;
|
|
18
|
+
'data-headless-nav-position': string;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toPlainTrackingText as t}from"../../shared/track.js";const r="shelf",i="buy_one_get_one_shelf",p=({title:a,description:s,buttonName:n,position:o=1,sku:e})=>({"data-headless-type-name":`${r}#${i}`,"data-headless-title-desc-button":`${t(a)}#${t(s)}#${t(n)}`,"data-headless-nav-position":`#${o}`,...e?{"data-headless-sku":e}:{}});export{p as buildBogoTrackProps,i as trackName,r as trackType};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Img } from '../../types/props.js';
|
|
3
3
|
export interface CategoryItem {
|
|
4
|
-
/**
|
|
5
|
-
image: Img
|
|
4
|
+
/** 产品图片;若 CMS 返回了媒体 id,会作为 creative_id 上报 */
|
|
5
|
+
image: Img & {
|
|
6
|
+
id?: string;
|
|
7
|
+
};
|
|
6
8
|
name: string;
|
|
7
9
|
link?: string;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as x}from"react/jsx-runtime";import S,{useImperativeHandle as _,useRef as f}from"react";import{cn as l,getLocalizedPath as D}from"../../helpers/utils.js";import b from"../../components/picture.js";import{withLayout as E}from"../../shared/Styles.js";import{useAiuiContext as h}from"../AiuiProvider/index.js";import M from"../Title/index.js";import v from"./SwiperCategory.js";import{useExposure as C}from"../../hooks/useExposure.js";import{useTracking as k}from"../../hooks/useTracking.js";import{buildClickTrackingProps as z}from"../../shared/track.js";import{trackUrlRef as H}from"../../shared/trackUrlRef.js";const p="image",d="category_banner",u=5,I=3,P=(e,i)=>{const t=[];for(let r=0;r<e.length;r+=i)t.push(e.slice(r,r+i));return t},w=(e,i,t)=>e?.trim()?H(D(e,i),t):void 0,N=(e,i)=>z({interactive:!0,componentType:p,componentName:d,title:e?.name,description:e?.name,buttonName:e?.name,position:i,creativeId:e?.image?.id}),A=({data:e,configuration:i})=>{const t=f(null),{locale:r="us"}=h(),{buildRef:n}=k();return C(t,{componentType:p,componentName:d,componentTitle:e?.name,componentDescription:e?.name,position:i?.index+1,creativeId:e?.image?.id}),x("div",{ref:t,className:l("tablet:p-3 laptop:p-4 desktop:p-6","bg-container-primary hover:bg-info-white group box-border flex h-full cursor-pointer flex-col justify-start overflow-hidden duration-300","desktop:gap-2 gap-1","rounded-box"),children:[o("div",{className:"flex items-center justify-center transition-all duration-300 group-hover:scale-110",children:o("a",{"aria-label":e?.name,href:w(e?.link,r,n(p,d)),...N(e,(i?.index??0)+1),onClick:()=>i?.event?.primaryButton(e,i?.index),children:o(b,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] desktop:size-[116px] lg-desktop:size-[146px] size-[72px]",imgClassName:"size-full object-cover"})})}),o("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})},R=({data:e,configuration:i,index:t,pageSize:r,isFirstItemLarger:n})=>{const a=(i?.index??0)*r+t+1,s=f(null),{locale:m="us"}=h(),{buildRef:g}=k();C(s,{componentType:p,componentName:d,componentTitle:e?.name,componentDescription:e?.name,position:a,creativeId:e?.image?.id});const c=t===0;return x("div",{ref:s,className:l("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",n?l("p-4",c?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4","rounded-box"),children:[o("a",{href:w(e?.link,m,g(p,d)),...N(e,a),onClick:()=>i?.event?.primaryButton(e,a),children:o(b,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:l("m-auto mb-2 flex justify-center object-contain [&_img]:h-full [&_img]:w-auto [&_img]:object-contain",n?l(c?"size-full max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),o("p",{className:l("text-info-primary w-full text-center text-sm font-bold",n?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},j=({data:e,configuration:i})=>{const r=(i?.totalCategories??0)<=u,n=r?u:I;return o("div",{className:`gap-3 ${r?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((a,s)=>o(R,{index:s,pageSize:n,data:a,configuration:i,isFirstItemLarger:r},s))})},T=S.forwardRef((e,i)=>{const{data:t,className:r="",key:n,event:a,...s}=e,m=(t?.isShowSelect?t?.products:t?.productData)||[],g=m.length>u,c=m.length,L=P(m,g?I:u),y=f(null);return _(i,()=>y.current),x("div",{...s,ref:y,className:l("w-full overflow-hidden",r,{"aiui-dark":t?.theme==="dark"}),children:[t?.title&&o(M,{data:{title:t?.title},className:"text-4xl"}),o("div",{className:"tablet:block hidden",children:o(v,{id:`Category${n}`,Slide:A,data:{list:m,configuration:{shape:t?.shape,event:a,title:t?.title,totalCategories:c}},paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"tablet:hidden block",children:o(v,{id:`Category1${n}`,Slide:j,data:{list:L,configuration:{shape:t?.shape,event:a,title:t?.title,totalCategories:c}},isHalf:g,paginationClassName:"[&_.swiper-pagination]:!-bottom-6"})}),o("div",{className:"h-7"})]})});T.displayName="Category";var Q=E(T);export{Q as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Message {
|
|
3
|
+
content: string;
|
|
4
|
+
role: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
scope?: any;
|
|
7
|
+
arguments?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface ActionProps {
|
|
10
|
+
start?: string;
|
|
11
|
+
history: Message[];
|
|
12
|
+
addtocartHandler?: (_args: any) => Promise<any>;
|
|
13
|
+
commonRender?: string | ((_props: any) => React.ReactElement);
|
|
14
|
+
pointsExchangeCouponRender?: string | ((_props: any) => React.ReactElement);
|
|
15
|
+
gotocheckoutRender?: string | ((_props: any) => React.ReactElement);
|
|
16
|
+
gotocartRender?: string | ((_props: any) => React.ReactElement);
|
|
17
|
+
addtocartRender?: string | ((_props: any) => React.ReactElement);
|
|
18
|
+
signupRender?: string | ((_props: any) => React.ReactElement);
|
|
19
|
+
shulexRender?: string | ((_props: any) => React.ReactElement);
|
|
20
|
+
productRender?: string | ((_props: any) => React.ReactElement);
|
|
21
|
+
productRenderTipMessage?: string;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const CopilotAction: ({ start, history, addtocartHandler, commonRender, pointsExchangeCouponRender, gotocheckoutRender, gotocartRender, addtocartRender, productRender, signupRender, shulexRender, children, }: ActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import"react";import{useEffect as N}from"react";import{useCopilotChat as v,useCopilotAction as t,useCopilotReadable as E}from"@copilotkit/react-core";import{Role as c,ActionExecutionMessage as x,TextMessage as S}from"@copilotkit/runtime-client-gql";const T=({start:J,history:s,addtocartHandler:i,commonRender:d,pointsExchangeCouponRender:p,gotocheckoutRender:m,gotocartRender:g,addtocartRender:l,productRender:u,signupRender:h,shulexRender:y,children:R})=>{const{setMessages:f,appendMessage:O,isLoading:M}=v();return N(()=>{const e=s?.filter(r=>r?.content||r?.arguments);if(e?.length>0){const r=e?.map(a=>{if(a?.name&&a?.arguments){const _=a?.arguments?.map(o=>o?{...o,ishistory:!0}:{});return new x({name:a?.name,arguments:_,scope:a?.scope})}return new S({...a,role:a?.role==="user"?c.User:c.Assistant})});f(r)}},[s]),t({name:"go_to_checkout",description:"go to cart",parameters:[{sku:"",handle:""}],render:m||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"common_action",description:"common action",parameters:[{act:""}],render:d||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"points_exchange_coupon",description:"points exchange coupon",parameters:[{act:""}],render:p||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"go_to_cart",description:"go to cart",parameters:[{sku:"",handle:""}],render:g||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"add_to_cart",description:"add to cart",parameters:[{sku:"",handle:""}],render:l||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(e){i&&i(e)}}),t({name:"show_product_card",description:"product card",parameters:[{sku:"",handle:""}],render:u||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(e){}}),t({name:"signup",description:"signup",parameters:[{name:"signup"}],render:h||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),t({name:"shulex",description:"shulex",parameters:[{name:"shulex"}],render:y||(e=>n("div",{className:"hidden",children:JSON.stringify(e)})),handler:function(){}}),E({description:"Today's date",value:new Date().toLocaleDateString()}),n("div",{children:R})};export{T as CopilotAction};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as p}from"react/jsx-runtime";import{useChatContext as c}from"@copilotkit/react-ui";const i=({setOpen:n})=>{const o=c();return p("button",{onClick:()=>n(),className:"copilotKitButton ","aria-label":"Open Chat",children:[t("div",{className:"copilotKitButtonIcon copilotKitButtonIconOpen",children:o.icons.openIcon}),t("div",{className:"copilotKitButtonIcon copilotKitButtonIconClose",children:o.icons.closeIcon})]})};var e=i;export{e as default};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Icons for CopilotChat component.
|
|
4
|
+
*/
|
|
5
|
+
export interface CopilotChatIcons {
|
|
6
|
+
/**
|
|
7
|
+
* The icon to use for the open chat button.
|
|
8
|
+
* @default <OpenIcon />
|
|
9
|
+
*/
|
|
10
|
+
openIcon?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The icon to use for the close chat button.
|
|
13
|
+
* @default <CloseIcon />
|
|
14
|
+
*/
|
|
15
|
+
closeIcon?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The icon to use for the close chat button in the header.
|
|
18
|
+
* @default <HeaderCloseIcon />
|
|
19
|
+
*/
|
|
20
|
+
headerCloseIcon?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The icon to use for the send button.
|
|
23
|
+
* @default <SendIcon />
|
|
24
|
+
*/
|
|
25
|
+
sendIcon?: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The icon to use for the activity indicator.
|
|
28
|
+
* @default <ActivityIcon />
|
|
29
|
+
*/
|
|
30
|
+
activityIcon?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* The icon to use for the spinner.
|
|
33
|
+
* @default <SpinnerIcon />
|
|
34
|
+
*/
|
|
35
|
+
spinnerIcon?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* The icon to use for the stop button.
|
|
38
|
+
* @default <StopIcon />
|
|
39
|
+
*/
|
|
40
|
+
stopIcon?: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* The icon to use for the regenerate button.
|
|
43
|
+
* @default <RegenerateIcon />
|
|
44
|
+
*/
|
|
45
|
+
regenerateIcon?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* The icons to use for push to talk.
|
|
48
|
+
* @default <PushToTalkIcon />
|
|
49
|
+
*/
|
|
50
|
+
pushToTalkIcon?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Labels for CopilotChat component.
|
|
54
|
+
*/
|
|
55
|
+
export interface CopilotChatLabels {
|
|
56
|
+
/**
|
|
57
|
+
* The initial message(s) to display in the chat window.
|
|
58
|
+
*/
|
|
59
|
+
initial?: string | string[];
|
|
60
|
+
/**
|
|
61
|
+
* The title to display in the header.
|
|
62
|
+
* @default "CopilotKit"
|
|
63
|
+
*/
|
|
64
|
+
title?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The placeholder to display in the input.
|
|
67
|
+
* @default "Type a message..."
|
|
68
|
+
*/
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The message to display when an error occurs.
|
|
72
|
+
* @default "❌ An error occurred. Please try again."
|
|
73
|
+
*/
|
|
74
|
+
error?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The label to display on the stop button.
|
|
77
|
+
* @default "Stop generating"
|
|
78
|
+
*/
|
|
79
|
+
stopGenerating?: string;
|
|
80
|
+
/**
|
|
81
|
+
* The label to display on the regenerate button.
|
|
82
|
+
* @default "Regenerate response"
|
|
83
|
+
*/
|
|
84
|
+
regenerateResponse?: string;
|
|
85
|
+
}
|
|
86
|
+
interface ChatContext {
|
|
87
|
+
labels: Required<CopilotChatLabels>;
|
|
88
|
+
icons: Required<CopilotChatIcons>;
|
|
89
|
+
open: boolean;
|
|
90
|
+
setOpen: (_open: boolean) => void;
|
|
91
|
+
}
|
|
92
|
+
export declare const ChatContext: React.Context<ChatContext | undefined>;
|
|
93
|
+
export declare function useChatContext(): ChatContext;
|
|
94
|
+
export interface ChatContextProps {
|
|
95
|
+
labels?: CopilotChatLabels;
|
|
96
|
+
icons?: CopilotChatIcons;
|
|
97
|
+
children?: React.ReactNode;
|
|
98
|
+
open: boolean;
|
|
99
|
+
setOpen: (_open: boolean) => void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"react";const o=t.createContext(void 0);function a(){const e=t.useContext(o);if(e===void 0)throw new Error("Context not found. Did you forget to wrap your app in a <ChatContextProvider> component?");return e}export{o as ChatContext,a as useChatContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as t}from"./index.js";import{Role as a,ActionExecutionMessage as p,TextMessage as i,useCopilotChat as r,useCopilotAction as l,useCopilotReadable as x}from"./utils.js";export{p as ActionExecutionMessage,t as Chat,a as Role,i as TextMessage,l as useCopilotAction,r as useCopilotChat,x as useCopilotReadable};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function getAsyncError(res: {
|
|
2
|
+
json: () => any;
|
|
3
|
+
status: any;
|
|
4
|
+
statusText: any;
|
|
5
|
+
}): Promise<{
|
|
6
|
+
status: any;
|
|
7
|
+
statusText: any;
|
|
8
|
+
errors: any;
|
|
9
|
+
type: any;
|
|
10
|
+
data: any;
|
|
11
|
+
message: any;
|
|
12
|
+
} | undefined>;
|
|
13
|
+
declare const handleFetchResponse: (res: Response) => Promise<any>;
|
|
14
|
+
export default handleFetchResponse;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(a){try{const t=await a.json();return{status:a.status,statusText:a.statusText,errors:t?.data?.error||t?.data?.code||a.statusText||a.status,type:t?.data?.type,data:t?.data,message:t?.data?.message}}catch(t){console.log(t)}}const o=async a=>{if(a.ok)try{const t=await a.json(),{errors:s}=t;return s&&s.length?{errors:s,status:a.status}:t}catch(t){console.log(t)}return await e(a)};var n=o;export{n as default,e as getAsyncError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import f from"./fetchResponse.js";const g=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),y=async({locale:e="en",url:s,method:a="POST",headers:l={},repeatKey:p,body:r,type:c,timeout:t=9e4})=>{let n="";c==="uploadFile"?n=r:n=r?JSON.stringify(r):"";const o=new AbortController;t&&setTimeout(()=>o.abort(),t);const i=await fetch(s,{method:a,mode:"cors",headers:{"current-language":e,...l},...t&&{signal:o.signal},...a!=="GET"&&{body:n}});return f(i)};var u=y;export{u as default};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ChatProps {
|
|
3
|
+
title: string;
|
|
4
|
+
runtimeUrl: string;
|
|
5
|
+
shopifyDomain: string;
|
|
6
|
+
/** GA 的 client id
|
|
7
|
+
*/
|
|
8
|
+
userId: string;
|
|
9
|
+
/** 是否登陆用户 0 or 1
|
|
10
|
+
*/
|
|
11
|
+
account?: string;
|
|
12
|
+
/** 用户浏览器语言
|
|
13
|
+
*/
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** 开场白
|
|
16
|
+
*/
|
|
17
|
+
prologue?: string;
|
|
18
|
+
/** ?a=1&b=2
|
|
19
|
+
*/
|
|
20
|
+
query?: string;
|
|
21
|
+
/** 'follow' or 'unfollow' | true or false
|
|
22
|
+
* follow: ResponseButton 会跟随在 messages 的后边
|
|
23
|
+
* unfollow: ResponseButton 在聊天框底部
|
|
24
|
+
*/
|
|
25
|
+
showResponseButton?: string | boolean;
|
|
26
|
+
/** messages 的回调事件
|
|
27
|
+
* 每次生成/接受新的messages,会将 整个 messages list 传递给外部
|
|
28
|
+
*/
|
|
29
|
+
messagesCallback?: (_messages: any) => void;
|
|
30
|
+
/** 通用 action 的触发事件
|
|
31
|
+
*/
|
|
32
|
+
commonRender?: string | ((_props: any) => React.ReactElement);
|
|
33
|
+
/** shulex的 action 的触发事件
|
|
34
|
+
*/
|
|
35
|
+
shulexRender?: string | ((_props: any) => React.ReactElement);
|
|
36
|
+
/** 通用 积分 换 Coupon 的触发事件
|
|
37
|
+
*/
|
|
38
|
+
pointsExchangeCouponRender?: string | ((_props: any) => React.ReactElement);
|
|
39
|
+
/** 跳转 checkout action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
40
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
41
|
+
*/
|
|
42
|
+
gotocheckoutRender?: string | ((_props: any) => React.ReactElement);
|
|
43
|
+
/** 打开购物车 action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
44
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
45
|
+
*/
|
|
46
|
+
gotocartRender?: string | ((_props: any) => React.ReactElement);
|
|
47
|
+
/** 打开购物车 action 的触发事件
|
|
48
|
+
*/
|
|
49
|
+
addtocartHandler?: (_args: any) => Promise<any>;
|
|
50
|
+
/** 加购卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
51
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
52
|
+
*/
|
|
53
|
+
addtocartRender?: string | ((_props: any) => React.ReactElement);
|
|
54
|
+
/** 订阅卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
55
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
56
|
+
*/
|
|
57
|
+
signupRender?: string | ((_props: any) => React.ReactElement);
|
|
58
|
+
/** 产品卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
59
|
+
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
60
|
+
*/
|
|
61
|
+
productRender?: string | ((_props: any) => React.ReactElement);
|
|
62
|
+
/** CopilotPopup 自定义参数,参考:https://docs.copilotkit.ai/reference/components/CopilotPopup */
|
|
63
|
+
popup?: any;
|
|
64
|
+
/** 文案,{"productRenderTipMessage": "","popupTip": "Hi ! Welcome to soundcore Innovations live chat!", "popupTipTimeout": [3000, 6000]} */
|
|
65
|
+
lang?: any;
|
|
66
|
+
/** 参考此文档:https://docs.copilotkit.ai/concepts/customize-look-and-feel */
|
|
67
|
+
style?: any;
|
|
68
|
+
className?: string;
|
|
69
|
+
}
|
|
70
|
+
declare const Chat: (props: ChatProps) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export default Chat;
|