@anker-in/headless-ui 1.1.80 → 1.1.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/AccordionCards/index.d.ts +36 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +3 -1
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +13 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js +2 -0
- package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +2 -7
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +17 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
- package/dist/cjs/biz-components/Category/index.d.ts +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +7 -1
- package/dist/cjs/biz-components/DownLoad/index.d.ts +6 -1
- package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
- package/dist/cjs/biz-components/Features/index.d.ts +8 -1
- package/dist/cjs/biz-components/FootCharger/index.d.ts +7 -1
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +2 -1
- package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -1
- package/dist/cjs/biz-components/GiftShelf/index.d.ts +3 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +3 -1
- package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +7 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +3 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +3 -2
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +2 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +2 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +2 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +5 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +3 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +3 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +2 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +2 -7
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/cjs/biz-components/SelectStore/index.d.ts +7 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +3 -1
- package/dist/cjs/biz-components/Slogan/index.d.ts +3 -1
- package/dist/cjs/biz-components/Spacer/index.d.ts +3 -1
- package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +3 -1
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +3 -1
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
- package/dist/cjs/biz-components/Title/index.d.ts +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
- package/dist/cjs/biz-components/WheelLottery/index.d.ts +1 -1
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js.map +2 -2
- package/dist/cjs/shared/Styles.d.ts +2 -1
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +2 -2
- package/dist/esm/biz-components/AccordionCards/index.d.ts +36 -1
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +3 -1
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +13 -1
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js +2 -0
- package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +2 -7
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/AplusDesc/index.d.ts +17 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
- package/dist/esm/biz-components/Category/index.d.ts +1 -1
- package/dist/esm/biz-components/CreativeModule/index.d.ts +7 -1
- package/dist/esm/biz-components/DownLoad/index.d.ts +6 -1
- package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +3 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
- package/dist/esm/biz-components/Features/index.d.ts +8 -1
- package/dist/esm/biz-components/FootCharger/index.d.ts +7 -1
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +2 -1
- package/dist/esm/biz-components/GiftBox/index.d.ts +3 -1
- package/dist/esm/biz-components/GiftShelf/index.d.ts +3 -1
- package/dist/esm/biz-components/GiftTierShelf/index.d.ts +3 -1
- package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
- package/dist/esm/biz-components/GraphicMore/index.d.ts +7 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +3 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +3 -2
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/esm/biz-components/MediaEndorsement/index.d.ts +2 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +2 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +2 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +5 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
- package/dist/esm/biz-components/MemberEquity/index.d.ts +3 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +3 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +2 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +2 -7
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/esm/biz-components/SelectStore/index.d.ts +7 -1
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +3 -1
- package/dist/esm/biz-components/Slogan/index.d.ts +3 -1
- package/dist/esm/biz-components/Spacer/index.d.ts +3 -1
- package/dist/esm/biz-components/Specs/index.d.ts +1 -1
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +3 -1
- package/dist/esm/biz-components/TabsGroup/index.d.ts +3 -1
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
- package/dist/esm/biz-components/Title/index.d.ts +1 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
- package/dist/esm/biz-components/WheelLottery/index.d.ts +1 -1
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.js.map +2 -2
- package/dist/esm/shared/Styles.d.ts +2 -1
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +2 -2
- package/package.json +1 -1
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface BenefitsTabTextConfig {
|
|
3
|
+
couponCode?: string;
|
|
4
|
+
copyCode?: string;
|
|
5
|
+
copied?: string;
|
|
6
|
+
expired?: string;
|
|
7
|
+
offCoupon?: string;
|
|
8
|
+
offMemberOnly?: string;
|
|
9
|
+
loginNow?: string;
|
|
10
|
+
selectFreeGift?: string;
|
|
11
|
+
bundleSaveUpTo?: string;
|
|
12
|
+
bundleOffer?: string;
|
|
13
|
+
creditsTitle?: string;
|
|
14
|
+
creditsDesc?: string;
|
|
15
|
+
off?: string;
|
|
16
|
+
memberBenefitsNotLogin?: string;
|
|
17
|
+
memberBenefitsNotLoginText?: string;
|
|
18
|
+
forNewMember?: string;
|
|
19
|
+
expressShipping?: string;
|
|
20
|
+
creditsAfterActivation?: string;
|
|
21
|
+
active?: string;
|
|
22
|
+
flexibleInstallment?: string;
|
|
23
|
+
}
|
|
2
24
|
export type ProductBenefitsTabsValueType = 'coupon' | 'membership' | 'pay' | 'installment';
|
|
3
25
|
export type ModalData = {
|
|
4
26
|
needClickAway?: boolean;
|
|
@@ -7,5 +29,8 @@ export type ModalData = {
|
|
|
7
29
|
content?: string;
|
|
8
30
|
domContent?: React.ReactNode;
|
|
9
31
|
};
|
|
10
|
-
|
|
32
|
+
interface BenefitsTabProps {
|
|
33
|
+
textConfig?: BenefitsTabTextConfig;
|
|
34
|
+
}
|
|
35
|
+
declare const _default: React.ForwardRefExoticComponent<BenefitsTabProps & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
|
|
11
36
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface ProductGalleryTabRef {
|
|
2
2
|
scrollToTab: (index: number) => void;
|
|
3
3
|
}
|
|
4
|
-
declare const _default: any
|
|
4
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
5
5
|
export default _default;
|
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Product, ProductVariant } from '../../../types/product.js';
|
|
2
|
+
import type { DeliveryCustom } from '../../PaidShipping/type.js';
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
metafields: any;
|
|
5
|
+
productList: Array<Product & {
|
|
6
|
+
variant: ProductVariant;
|
|
7
|
+
}>;
|
|
8
|
+
variant: ProductVariant;
|
|
9
|
+
onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
} & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
12
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PurchaseBarProps } from './types.js';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<PurchaseBarProps & Partial<import("../../../../shared/Styles.js").StylesProps & import("../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
2
3
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
|
|
2
|
+
import type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
|
|
3
|
+
import { type SwiperRef } from 'swiper/react';
|
|
3
4
|
declare const MarqueeItem: {
|
|
4
5
|
({ data, configuration }: MarqueeItemProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
displayName: string;
|
|
@@ -9,6 +10,6 @@ declare const MarqueeImageContent: {
|
|
|
9
10
|
displayName: string;
|
|
10
11
|
};
|
|
11
12
|
declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
declare const _default:
|
|
13
|
+
declare const _default: React.ForwardRefExoticComponent<MarqueeProps & React.RefAttributes<SwiperRef> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
13
14
|
export default _default;
|
|
14
15
|
export { MarqueeItem, MarqueeImageContent, MarqueeTextContent };
|
|
@@ -33,5 +33,5 @@ export interface MarqueeReviewProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
33
33
|
/** 评论数据 */
|
|
34
34
|
data: MarqueeReviewData;
|
|
35
35
|
}
|
|
36
|
-
declare const _default: any
|
|
36
|
+
declare const _default: React.ForwardRefExoticComponent<MarqueeReviewProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
|
|
37
37
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import 'swiper/css/pagination';
|
|
2
3
|
import type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName } from './types.js';
|
|
3
|
-
declare const _default:
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<MediaEndorsementProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
4
5
|
export default _default;
|
|
5
6
|
export type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MediaPlayerBaseProps } from './types.js';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var He=Object.create;var M=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var Ne=(r,o)=>{for(var n in o)M(r,n,{get:o[n],enumerable:!0})},A=(r,o,n,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of ke(o))!Le.call(r,s)&&s!==n&&M(r,s,{get:()=>o[s],enumerable:!(c=Te(o,s))||c.enumerable});return r};var ee=(r,o,n)=>(n=r!=null?He(Me(r)):{},A(o||!r||!r.__esModule?M(n,"default",{value:r,enumerable:!0}):n,r)),Re=r=>A(M({},"__esModule",{value:!0}),r);var Pe={};Ne(Pe,{default:()=>Ee});module.exports=Re(Pe);var t=require("react/jsx-runtime"),e=require("react"),ne=require("lodash"),a=require("../../helpers/utils.js"),oe=require("../../shared/Styles.js"),S=ee(require("../../components/button.js")),se=require("../VideoModal/index.js"),V=require("@payloadcms/richtext-lexical/html"),le=require("react-intersection-observer"),ie=require("../../hooks/useExposure.js"),_=ee(require("../../helpers/ScrollLoadVideo.js")),u=require("gsap"),$=require("gsap/dist/SplitText"),L=require("gsap/dist/ScrollTrigger");const Ie="media_player_base",ze="video";u.gsap.registerPlugin(L.ScrollTrigger,$.SplitText);const te=({defaultConverters:r})=>({...r,text:o=>{const{node:n}=o;return n.$&&n.$.color?`<span class="lexical-${n.$.color}">${n.text}</span>`:n.text}}),re=(0,e.forwardRef)(({className:r="",id:o,onBtnClick:n,data:{title:c,videoTitle:s,btnText:h,youtubeId:B,video:C,mobileVideo:ae,theme:D,img:F,shape:j,titleAnimation:b="fade-in",...ce},...q},de)=>{const{sticky:l}=ce,[U,Y]=(0,e.useState)(!1),[O,pe]=(0,e.useState)(0),[ue,me]=(0,e.useState)(0),[w,fe]=(0,e.useState)(0),[G,N]=(0,e.useState)(!1),H=(0,e.useRef)(null),J=(0,e.useRef)(null),i=(0,e.useRef)(null),T=(0,e.useRef)(null),K=(0,e.useRef)(null),k=(0,e.useRef)(null),g=(0,e.useRef)(null),R=(0,e.useRef)(null),I=(0,e.useRef)(null),{ref:ge,inView:d}=(0,le.useInView)();(0,e.useImperativeHandle)(de,()=>i.current);const v=typeof c=="string"?c:c&&(0,V.convertLexicalToHTML)({data:c,converters:te}),Q=typeof s=="string"?s:s&&(0,V.convertLexicalToHTML)({data:s,converters:te});(0,e.useEffect)(()=>{d?(H.current?.play(),Y(!0)):(H.current?.pause(),Y(!1))},[d]);const z=(0,ne.debounce)(()=>{if(i.current){const y=i.current.getBoundingClientRect(),m=window.innerHeight,x=window.scrollY||window.pageYOffset,p=y.bottom+x,f=document.documentElement.scrollHeight-p;pe(f>m?m:f)}if(i.current){const y=i.current.clientHeight,m=window.innerHeight;me(y+m)}},600);(0,e.useEffect)(()=>(z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[]),(0,e.useEffect)(()=>{function y(){if(!T.current||b!=="fade-in")return;const x=T.current?.clientHeight||80;k.current=new $.SplitText(T.current,{type:"words",wordsClass:"word"});const p=k.current.words;u.gsap.set(p,{opacity:0}),g.current&&u.gsap.set(g.current,{opacity:0}),R.current=L.ScrollTrigger.create({trigger:i.current,start:"top center-=10%",end:`top+=${x*1.5+80}px center-=10%`,scrub:!0,onUpdate:W=>{const f=W.progress,X=p.length,ye=1/X,Z=.5;p.forEach((xe,he)=>{const be=he/X*(1-Z),we=ye*(1+Z);let P=(f-be)/we;P=Math.max(0,Math.min(P,1)),u.gsap.set(xe,{opacity:P})}),u.gsap.set(J.current,{opacity:f}),g.current&&u.gsap.set(g.current,{opacity:f>=.6?1:0})}})}function m(){I.current=L.ScrollTrigger.create({trigger:i.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:x=>{const p=x.progress;fe(p)}})}return d&&(y(),m()),()=>{k.current&&k.current.revert(),R.current&&R.current.kill(),I.current&&I.current.kill()}},[b,d]),(0,ie.useExposure)(K,{componentType:ze,componentName:Ie,componentTitle:v});const ve=(0,e.useMemo)(()=>d&&w>0&&w<.9?3:d?2:1,[w,d]),E="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)("div",{...q,ref:i,className:(0,a.cn)("pointer-events-none relative z-10",E,{"aiui-dark":D==="dark","rounded-box":j==="rounded"},r),children:(0,t.jsx)("div",{ref:ge,children:!b&&(0,t.jsxs)("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[v&&!U&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:v}}),Q&&U&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:Q}}),h&&(0,t.jsx)(S.default,{variant:"link",className:(0,a.cn)("member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),n&&n?.()},children:h})]})})}),(0,t.jsxs)("div",{...l?{}:q,style:l?{marginBottom:`-${O}px`,marginTop:`-${ue}px`,zIndex:ve}:{zIndex:5},className:(0,a.cn)("relative",r),children:[(0,t.jsx)("div",{className:"sticky top-0 ",children:(0,t.jsxs)("div",{id:o,className:(0,a.cn)("relative overflow-hidden",l?"h-screen w-full":E,{"aiui-dark":D==="dark","rounded-box":j==="rounded"}),children:[b==="fade-in"&&(0,t.jsxs)("div",{className:(0,a.cn)("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",l?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[v&&(0,t.jsx)("div",{ref:T,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:v}}),h&&(0,t.jsx)(S.default,{ref:g,variant:"link",className:(0,a.cn)("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),n&&n?.()},children:h})]}),(0,t.jsxs)("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-w*100}vh`},children:[(0,t.jsx)(_.default,{videoRef:H,poster:F?.url||"",src:C?.url,className:"tablet:block hidden size-full !h-auto",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline"
|
|
1
|
+
"use strict";"use client";var He=Object.create;var M=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var Ne=(r,o)=>{for(var n in o)M(r,n,{get:o[n],enumerable:!0})},A=(r,o,n,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of ke(o))!Le.call(r,s)&&s!==n&&M(r,s,{get:()=>o[s],enumerable:!(c=Te(o,s))||c.enumerable});return r};var ee=(r,o,n)=>(n=r!=null?He(Me(r)):{},A(o||!r||!r.__esModule?M(n,"default",{value:r,enumerable:!0}):n,r)),Re=r=>A(M({},"__esModule",{value:!0}),r);var Pe={};Ne(Pe,{default:()=>Ee});module.exports=Re(Pe);var t=require("react/jsx-runtime"),e=require("react"),ne=require("lodash"),a=require("../../helpers/utils.js"),oe=require("../../shared/Styles.js"),S=ee(require("../../components/button.js")),se=require("../VideoModal/index.js"),V=require("@payloadcms/richtext-lexical/html"),le=require("react-intersection-observer"),ie=require("../../hooks/useExposure.js"),_=ee(require("../../helpers/ScrollLoadVideo.js")),u=require("gsap"),$=require("gsap/dist/SplitText"),L=require("gsap/dist/ScrollTrigger");const Ie="media_player_base",ze="video";u.gsap.registerPlugin(L.ScrollTrigger,$.SplitText);const te=({defaultConverters:r})=>({...r,text:o=>{const{node:n}=o;return n.$&&n.$.color?`<span class="lexical-${n.$.color}">${n.text}</span>`:n.text}}),re=(0,e.forwardRef)(({className:r="",id:o,onBtnClick:n,data:{title:c,videoTitle:s,btnText:h,youtubeId:B,video:C,mobileVideo:ae,theme:D,img:F,shape:j,titleAnimation:b="fade-in",...ce},...q},de)=>{const{sticky:l}=ce,[U,Y]=(0,e.useState)(!1),[O,pe]=(0,e.useState)(0),[ue,me]=(0,e.useState)(0),[w,fe]=(0,e.useState)(0),[G,N]=(0,e.useState)(!1),H=(0,e.useRef)(null),J=(0,e.useRef)(null),i=(0,e.useRef)(null),T=(0,e.useRef)(null),K=(0,e.useRef)(null),k=(0,e.useRef)(null),g=(0,e.useRef)(null),R=(0,e.useRef)(null),I=(0,e.useRef)(null),{ref:ge,inView:d}=(0,le.useInView)();(0,e.useImperativeHandle)(de,()=>i.current);const v=typeof c=="string"?c:c&&(0,V.convertLexicalToHTML)({data:c,converters:te}),Q=typeof s=="string"?s:s&&(0,V.convertLexicalToHTML)({data:s,converters:te});(0,e.useEffect)(()=>{d?(H.current?.play(),Y(!0)):(H.current?.pause(),Y(!1))},[d]);const z=(0,ne.debounce)(()=>{if(i.current){const y=i.current.getBoundingClientRect(),m=window.innerHeight,x=window.scrollY||window.pageYOffset,p=y.bottom+x,f=document.documentElement.scrollHeight-p;pe(f>m?m:f)}if(i.current){const y=i.current.clientHeight,m=window.innerHeight;me(y+m)}},600);(0,e.useEffect)(()=>(z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[]),(0,e.useEffect)(()=>{function y(){if(!T.current||b!=="fade-in")return;const x=T.current?.clientHeight||80;k.current=new $.SplitText(T.current,{type:"words",wordsClass:"word"});const p=k.current.words;u.gsap.set(p,{opacity:0}),g.current&&u.gsap.set(g.current,{opacity:0}),R.current=L.ScrollTrigger.create({trigger:i.current,start:"top center-=10%",end:`top+=${x*1.5+80}px center-=10%`,scrub:!0,onUpdate:W=>{const f=W.progress,X=p.length,ye=1/X,Z=.5;p.forEach((xe,he)=>{const be=he/X*(1-Z),we=ye*(1+Z);let P=(f-be)/we;P=Math.max(0,Math.min(P,1)),u.gsap.set(xe,{opacity:P})}),u.gsap.set(J.current,{opacity:f}),g.current&&u.gsap.set(g.current,{opacity:f>=.6?1:0})}})}function m(){I.current=L.ScrollTrigger.create({trigger:i.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:x=>{const p=x.progress;fe(p)}})}return d&&(y(),m()),()=>{k.current&&k.current.revert(),R.current&&R.current.kill(),I.current&&I.current.kill()}},[b,d]),(0,ie.useExposure)(K,{componentType:ze,componentName:Ie,componentTitle:v});const ve=(0,e.useMemo)(()=>d&&w>0&&w<.9?3:d?2:1,[w,d]),E="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return(0,t.jsxs)(t.Fragment,{children:[l&&(0,t.jsx)("div",{...q,ref:i,className:(0,a.cn)("pointer-events-none relative z-10",E,{"aiui-dark":D==="dark","rounded-box":j==="rounded"},r),children:(0,t.jsx)("div",{ref:ge,children:!b&&(0,t.jsxs)("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[v&&!U&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:v}}),Q&&U&&(0,t.jsx)("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:Q}}),h&&(0,t.jsx)(S.default,{variant:"link",className:(0,a.cn)("member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),n&&n?.()},children:h})]})})}),(0,t.jsxs)("div",{...l?{}:q,style:l?{marginBottom:`-${O}px`,marginTop:`-${ue}px`,zIndex:ve}:{zIndex:5},className:(0,a.cn)("relative",r),children:[(0,t.jsx)("div",{className:"sticky top-0 ",children:(0,t.jsxs)("div",{id:o,className:(0,a.cn)("relative overflow-hidden",l?"h-screen w-full":E,{"aiui-dark":D==="dark","rounded-box":j==="rounded"}),children:[b==="fade-in"&&(0,t.jsxs)("div",{className:(0,a.cn)("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",l?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[v&&(0,t.jsx)("div",{ref:T,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:v}}),h&&(0,t.jsx)(S.default,{ref:g,variant:"link",className:(0,a.cn)("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),n&&n?.()},children:h})]}),(0,t.jsxs)("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-w*100}vh`},children:[(0,t.jsx)(_.default,{videoRef:H,poster:F?.url||"",src:C?.url,className:"tablet:block hidden size-full !h-auto",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":"true","x5-playsinline":"true"}),(0,t.jsx)(_.default,{videoRef:H,poster:F?.url||"",src:ae?.url||C?.url,className:"tablet:hidden block min-h-screen w-full",videoClassName:"object-cover w-full h-auto",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":"true","x5-playsinline":"true"}),(0,t.jsx)("div",{ref:J,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),l&&(0,t.jsx)("div",{className:(0,a.cn)(l&&"pointer-events-none relative box-content block",E),style:l?{height:`${O}px`}:{},ref:K})]}),G&&B&&(0,t.jsx)(se.VideoModal,{visible:G,youTubeId:B,onCloseModal:()=>N(!1)})]})});re.displayName="MediaPlayerBase";var Ee=(0,oe.withLayout)(re);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MediaPlayerBase/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline\n x5-playsinline\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
|
|
5
|
-
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuMM,IAAAI,EAAA,6BAtMNC,EAAsF,iBACtFC,GAAyB,kBACzBC,EAAmB,kCACnBC,GAA2B,kCAC3BC,EAAmB,0CACnBC,GAA2B,kCAC3BC,EAAqC,6CAGrCC,GAA0B,uCAE1BC,GAA4B,sCAC5BC,EAA4B,gDAC5BC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAE9B,MAAMC,GAAgB,oBAChBC,GAAgB,QAGtB,OAAK,eAAe,gBAAe,WAAS,EAE5C,MAAMC,GAAyC,CAAC,CAAE,kBAAAC,CAAkB,KAAO,CACzE,GAAGA,EACH,KAAMC,GAAQ,CACZ,KAAM,CAAE,KAAAC,CAAK,EAAID,EAEjB,OAAIC,EAAK,GAAKA,EAAK,EAAE,MACZ,wBAAwBA,EAAK,EAAE,KAAK,KAAKA,EAAK,IAAI,U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import { useState, useRef, useMemo, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport { debounce } from 'lodash'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Button from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerBaseProps } from './types.js'\n// import { Right } from './right.js'\nimport { useInView } from 'react-intersection-observer'\nimport type { HTMLConvertersFunction } from '@payloadcms/richtext-lexical/html'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\n\nconst componentName = 'media_player_base'\nconst componentType = 'video'\n\n// \u6CE8\u518C gsap \u63D2\u4EF6\ngsap.registerPlugin(ScrollTrigger, SplitText)\n\nconst htmlConverters: HTMLConvertersFunction = ({ defaultConverters }) => ({\n ...defaultConverters,\n text: args => {\n const { node } = args\n // \u68C0\u67E5\u662F\u5426\u6709\u81EA\u5B9A\u4E49 color\n if (node.$ && node.$.color) {\n return `<span class=\"lexical-${node.$.color}\">${node.text}</span>`\n }\n return node.text\n },\n})\n\nconst MediaPlayerBase = forwardRef<HTMLDivElement, MediaPlayerBaseProps>(\n (\n {\n className = '',\n id,\n onBtnClick,\n data: {\n title,\n videoTitle,\n btnText,\n youtubeId,\n video,\n mobileVideo,\n theme,\n img,\n shape,\n titleAnimation = 'fade-in',\n ...dataRest\n },\n ...rest\n },\n ref\n ) => {\n const { sticky } = dataRest\n const [isPlaying, setIsPlaying] = useState(false)\n const [btb, setbtb] = useState(0)\n const [titleHeight, setTitleHeight] = useState(0)\n const [videoHeightProgress, setVideoHeightProgress] = useState(0)\n const [visible, setVisible] = useState<boolean>(false)\n\n const videoRef = useRef<HTMLVideoElement>(null)\n const bgRef = useRef<HTMLImageElement>(null)\n const titleRef = useRef<HTMLDivElement>(null)\n const titleFadeInRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const btnFadeInRef = useRef<HTMLButtonElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const heightTriggerRef = useRef<ScrollTrigger | null>(null)\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => titleRef.current as HTMLDivElement)\n\n const title_html =\n typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title, converters: htmlConverters })\n const videoTitle_html =\n typeof videoTitle === 'string'\n ? videoTitle\n : videoTitle && convertLexicalToHTML({ data: videoTitle, converters: htmlConverters })\n\n useEffect(() => {\n if (inView) {\n videoRef.current?.play()\n setIsPlaying(true)\n } else {\n videoRef.current?.pause()\n setIsPlaying(false)\n }\n }, [inView])\n\n const debouncedHandleResize = debounce(() => {\n if (titleRef.current) {\n const rect = titleRef.current.getBoundingClientRect()\n const screenHeight = window.innerHeight\n const scrollTop = window.scrollY || window.pageYOffset\n const elementBottomToPageTop = rect.bottom + scrollTop\n const pageHeight = document.documentElement.scrollHeight\n const distanceToPageBottom = pageHeight - elementBottomToPageTop\n setbtb(distanceToPageBottom > screenHeight ? screenHeight : distanceToPageBottom)\n }\n if (titleRef.current) {\n const titleHeight = titleRef.current.clientHeight\n const screenHeight = window.innerHeight\n setTitleHeight(titleHeight + screenHeight)\n }\n }, 600)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [])\n\n useEffect(() => {\n function gsapResize() {\n if (!titleFadeInRef.current || titleAnimation !== 'fade-in') return\n const height = titleFadeInRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleFadeInRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n if (btnFadeInRef.current) gsap.set(btnFadeInRef.current, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'top center-=10%',\n end: `top+=${height * 1.5 + 80}px center-=10%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n gsap.set(bgRef.current, { opacity: progress })\n if (btnFadeInRef.current) {\n gsap.set(btnFadeInRef.current, { opacity: progress >= 0.6 ? 1 : 0 })\n }\n },\n })\n }\n\n function gsapVideoHeightResize() {\n heightTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom',\n end: `bottom top`,\n // markers: true,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n setVideoHeightProgress(progress)\n },\n })\n }\n\n if (inView) {\n gsapResize()\n gsapVideoHeightResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n heightTriggerRef.current && heightTriggerRef.current.kill()\n }\n }, [titleAnimation, inView])\n\n useExposure(trackRef, {\n componentType,\n componentName,\n componentTitle: title_html,\n })\n\n const zIndexVideo = useMemo(() => {\n if (inView && videoHeightProgress > 0 && videoHeightProgress < 0.9) return 3\n if (inView) return 2\n return 1\n }, [videoHeightProgress, inView])\n\n const aspect =\n 'lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]'\n return (\n <>\n {sticky && (\n <div\n {...rest}\n ref={titleRef}\n className={cn(\n 'pointer-events-none relative z-10',\n aspect,\n {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n },\n className\n )}\n >\n <div ref={inViewRef}>\n {!titleAnimation && (\n <div className=\"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center\">\n {title_html && !isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {videoTitle_html && isPlaying && (\n <div\n className=\"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: videoTitle_html }}\n />\n )}\n {btnText && (\n <Button\n variant=\"link\"\n className={cn('member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n // if (isPlaying) {\n // if (videoRef.current) {\n // videoRef.current.pause()\n // }\n // setIsPlaying(false)\n // } else {\n // if (videoRef.current) {\n // videoRef.current.play()\n // }\n // setIsPlaying(true)\n // }\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n {/* <Right /> */}\n </Button>\n )}\n </div>\n )}\n </div>\n </div>\n )}\n <div\n {...(!sticky ? rest : {})}\n style={\n sticky\n ? {\n marginBottom: `-${btb}px`,\n marginTop: `-${titleHeight}px`,\n zIndex: zIndexVideo,\n }\n : { zIndex: 5 }\n }\n className={cn('relative', className)}\n >\n <div className=\"sticky top-0 \">\n <div\n id={id}\n className={cn('relative overflow-hidden', sticky ? 'h-screen w-full' : aspect, {\n 'aiui-dark': theme === 'dark',\n 'rounded-box': shape === 'rounded',\n })}\n >\n {titleAnimation === 'fade-in' && (\n <div\n className={cn(\n 'absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center',\n sticky ? 'left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' : 'left-0 top-0'\n )}\n >\n {title_html && (\n <div\n ref={titleFadeInRef}\n className=\"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl\"\n dangerouslySetInnerHTML={{ __html: title_html }}\n />\n )}\n {btnText && (\n <Button\n ref={btnFadeInRef}\n variant=\"link\"\n className={cn('media-player-base-button member-equity-button-secondary text-info-primary')}\n onClick={() => {\n setVisible(true)\n onBtnClick && onBtnClick?.()\n }}\n >\n {btnText}\n </Button>\n )}\n </div>\n )}\n <div\n className=\"media-cover left-0 top-0 h-screen w-screen overflow-hidden\"\n style={{ height: `${102 - videoHeightProgress * 100}vh` }}\n >\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={video?.url!}\n className=\"tablet:block hidden size-full !h-auto\"\n videoClassName=\"object-cover\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline=\"true\"\n x5-playsinline=\"true\"\n />\n <ScrollLoadVideo\n videoRef={videoRef}\n poster={img?.url || ''}\n src={mobileVideo?.url || video?.url!}\n className=\"tablet:hidden block min-h-screen w-full\"\n videoClassName=\"object-cover w-full h-auto\"\n muted\n loop\n playsInline\n autoplay\n webkit-playsinline=\"true\"\n x5-playsinline=\"true\"\n />\n <div\n ref={bgRef}\n className=\"absolute left-0 top-0 z-10 size-full opacity-0\"\n style={{\n background: 'rgba(0, 0, 0, 0.2)',\n }}\n />\n </div>\n </div>\n </div>\n {sticky && (\n <div\n className={cn(sticky && 'pointer-events-none relative box-content block', aspect)}\n style={sticky ? { height: `${btb}px` } : {}}\n ref={trackRef}\n />\n )}\n </div>\n {visible && youtubeId && (\n <VideoModal visible={visible} youTubeId={youtubeId} onCloseModal={() => setVisible(false)} />\n )}\n </>\n )\n }\n)\n\nMediaPlayerBase.displayName = 'MediaPlayerBase'\n\nexport default withLayout(MediaPlayerBase)\n"],
|
|
5
|
+
"mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuMM,IAAAI,EAAA,6BAtMNC,EAAsF,iBACtFC,GAAyB,kBACzBC,E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,CAAW,EAChD,EAEDjC,MACC,OAAC,EAAAyD,QAAA,CACC,IAAK7B,EACL,QAAQ,OACR,aAAW,MAAG,2EAA2E,EACzF,QAAS,IAAM,CACbP,EAAW,EAAI,EACfxB,GAAcA,IAAa,CAC7B,EAEC,SAAAG,EACH,GAEJ,KAEF,QAAC,OACC,UAAU,6DACV,MAAO,CAAE,OAAQ,GAAG,IAAMkB,EAAsB,GAAG,IAAK,EAExD,oBAAC,EAAAwC,QAAA,CACC,SAAUpC,EACV,OAAQjB,GAAK,KAAO,GACpB,IAAKH,GAAO,IACZ,UAAU,wCACV,eAAe,eACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAmB,OACnB,iBAAe,OACjB,KACA,OAAC,EAAAwD,QAAA,CACC,SAAUpC,EACV,OAAQjB,GAAK,KAAO,GACpB,IAAKF,IAAa,KAAOD,GAAO,IAChC,UAAU,0CACV,eAAe,6BACf,MAAK,GACL,KAAI,GACJ,YAAW,GACX,SAAQ,GACR,qBAAmB,OACnB,iBAAe,OACjB,KACA,OAAC,OACC,IAAKqB,EACL,UAAU,iDACV,MAAO,CACL,WAAY,oBACd,EACF,GACF,GACF,EACF,EACCZ,MACC,OAAC,OACC,aAAW,MAAGA,GAAU,iDAAkD6C,CAAM,EAChF,MAAO7C,EAAS,CAAE,OAAQ,GAAGG,CAAG,IAAK,EAAI,CAAC,EAC1C,IAAKY,EACP,GAEJ,EACCN,GAAWnB,MACV,OAAC,eAAW,QAASmB,EAAS,UAAWnB,EAAW,aAAc,IAAMoB,EAAW,EAAK,EAAG,GAE/F,CAEJ,CACF,EAEA3B,GAAgB,YAAc,kBAE9B,IAAOtB,MAAQ,eAAWsB,EAAe",
|
|
6
6
|
"names": ["MediaPlayerBase_exports", "__export", "MediaPlayerBase_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_lodash", "import_utils", "import_Styles", "import_button", "import_VideoModal", "import_html", "import_react_intersection_observer", "import_useExposure", "import_ScrollLoadVideo", "import_gsap", "import_SplitText", "import_ScrollTrigger", "componentName", "componentType", "htmlConverters", "defaultConverters", "args", "node", "MediaPlayerBase", "className", "id", "onBtnClick", "title", "videoTitle", "btnText", "youtubeId", "video", "mobileVideo", "theme", "img", "shape", "titleAnimation", "dataRest", "rest", "ref", "sticky", "isPlaying", "setIsPlaying", "btb", "setbtb", "titleHeight", "setTitleHeight", "videoHeightProgress", "setVideoHeightProgress", "visible", "setVisible", "videoRef", "bgRef", "titleRef", "titleFadeInRef", "trackRef", "splitTextInstance", "btnFadeInRef", "scrollTriggerRef", "heightTriggerRef", "inViewRef", "inView", "title_html", "videoTitle_html", "debouncedHandleResize", "rect", "screenHeight", "scrollTop", "elementBottomToPageTop", "distanceToPageBottom", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "gsapVideoHeightResize", "zIndexVideo", "aspect", "Button", "ScrollLoadVideo"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { MediaPlayerMultiProps } from './types.js';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<MediaPlayerMultiProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MediaPlayerBaseProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<MediaPlayerBaseProps & React.RefAttributes<{
|
|
4
|
+
mediaPlayerStickyRef: HTMLDivElement;
|
|
5
|
+
}> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
2
6
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MediaSceneSwitcherProps } from './types.js';
|
|
1
2
|
import 'swiper/css';
|
|
2
|
-
declare const _default:
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<MediaSceneSwitcherProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
3
4
|
export default _default;
|
|
@@ -54,5 +54,5 @@ export interface MediaSceneSwitcherV2Props extends React.HTMLAttributes<HTMLDivE
|
|
|
54
54
|
/** 场景切换回调 */
|
|
55
55
|
onSceneChange?: (index: number, scene: MediaSceneSwitcherV2Item) => void;
|
|
56
56
|
}
|
|
57
|
-
declare const _default:
|
|
57
|
+
declare const _default: React.ForwardRefExoticComponent<MediaSceneSwitcherV2Props & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
58
58
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MemberEquityProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<MemberEquityProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
|
|
2
4
|
export default _default;
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MultiLayoutGraphicBlockProps, Item } from './types';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
4
|
+
onSecondaryButtonClick?: () => void;
|
|
5
|
+
onPrimaryButtonClick?: () => void;
|
|
6
|
+
data: {
|
|
7
|
+
shape?: import("../../types/props").Shape;
|
|
8
|
+
sectionTitle?: string;
|
|
9
|
+
groupByTab?: boolean;
|
|
10
|
+
items: ({
|
|
11
|
+
width?: "full" | "half" | "one-third";
|
|
12
|
+
} & Item)[];
|
|
13
|
+
carousel?: {
|
|
14
|
+
items: Item[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
3
18
|
export default _default;
|
|
4
19
|
export type { MultiLayoutGraphicBlockProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NavigationSearchProps } from './types.js';
|
|
2
2
|
export declare const canSearch: (target: any) => boolean;
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<NavigationSearchProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
4
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var
|
|
1
|
+
"use strict";var k=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var M=(t,a)=>{for(var p in a)k(t,p,{get:a[p],enumerable:!0})},V=(t,a,p,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of K(a))!j.call(t,l)&&l!==p&&k(t,l,{get:()=>a[l],enumerable:!(r=H(a,l))||r.enumerable});return t};var R=t=>V(k({},"__esModule",{value:!0}),t);var Q={};M(Q,{canSearch:()=>S,default:()=>O});module.exports=R(Q);var e=require("react/jsx-runtime"),s=require("../../components/index.js"),v=require("../HeaderNavigation/icons/index.js"),i=require("react"),D=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js"),F=require("../../shared/Styles.js"),u=require("./types.js"),I=require("es-toolkit"),c=require("../../helpers/utils.js");const S=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),L=(0,i.forwardRef)(({data:t,onSearch:a,onClose:p,searchResult:r,isSearching:l,keywords:g,className:$,...E},P)=>{const{locale:n="us",copyWriting:U}=(0,D.useAiuiContext)(),[d,T]=(0,i.useState)(""),[y,N]=(0,i.useState)(!1),f=(0,i.useRef)(null);(0,i.useEffect)(()=>{f.current&&f.current.focus({preventScroll:!0})},[]);const B=(0,I.debounce)(o=>{a(o)},300),A=(0,i.useCallback)(o=>{o.key==="Enter"&&!y&&window.open((0,m.getLocalizedPath)(`${t?.moreLink}?q=${d.toLowerCase()}`,n),"_self")},[y,d,n,t?.moreLink]),_=(0,i.useMemo)(()=>Array.isArray(g)&&g?.length?g.map(o=>o.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(o=>o.popularWord):[],[g,t?.popularWords]),z=(0,i.useCallback)(o=>{switch(o.__typename||o.type){case"Product":return(0,m.getLocalizedPath)(`/products${o.path}?q=${d.toLowerCase()}`,n);case"Article":return(0,m.getLocalizedPath)(`/blogs/${o.blog.handle}/${o.handle.replace("storefront-","")}?q=${d.toLowerCase()}`,n);default:break}},[d,n]),w=(0,i.useMemo)(()=>{if(d){if(r?.totalCount)return u.SearchStatus.Predict;if(!l)return u.SearchStatus.Empty}else return u.SearchStatus.Default},[r?.totalCount,d,l]);return(0,e.jsxs)(s.Container,{childClassName:"!bg-white",...E,className:(0,c.cn)("relative",$),ref:P,children:[(0,e.jsx)("style",{children:`
|
|
2
2
|
.navigation-search-component input:-webkit-autofill,
|
|
3
3
|
.navigation-search-component input:-webkit-autofill:hover,
|
|
4
4
|
.navigation-search-component input:-webkit-autofill:focus {
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
transition: background-color 9999s ease-in-out 0s !important;
|
|
8
8
|
caret-color: #000;
|
|
9
9
|
}
|
|
10
|
-
`}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{ref:f,value:d,onCompositionStart:()=>N(!0),onCompositionEnd:()=>N(!1),onKeyDown:
|
|
10
|
+
`}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{ref:f,value:d,onCompositionStart:()=>N(!0),onCompositionEnd:()=>N(!1),onKeyDown:A,onChange:o=>{T(o.target.value),o.target.value&&B(o.target.value)},type:"text",className:"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none placeholder:text-[#4A4C56] focus-visible:!outline-none",placeholder:t?.placeholder}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(v.Search,{className:"size-5 cursor-pointer",onClick:()=>a(d)}),(0,e.jsx)("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),(0,e.jsx)(v.Close,{className:"size-5 cursor-pointer",onClick:p})]})]}),(0,e.jsx)("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:w===u.SearchStatus.Predict?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(s.Text,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),r?.items?.length>6&&(0,e.jsx)(s.Button,{as:"a",iconClassName:"size-4",href:(0,m.getLocalizedPath)(`${t?.moreLink}?q=${d.toLowerCase()}`,n),className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:r?.items?.filter(o=>S(o)).slice(0,6)?.map(o=>(0,e.jsx)(s.Link,{className:"rounded-sidebar-shelf w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:z(o),children:(0,e.jsx)(s.Text,{html:(0,c.highlightSearchWord)(o.title,d),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},o.id))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&(0,e.jsx)(s.Link,{asChild:!t?.advertisingLink,href:(0,m.getLocalizedPath)(t?.advertisingLink,n),children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative",children:[(0,e.jsx)(s.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(s.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,c.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(s.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,c.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),r?.items?.filter(o=>o.type.toLowerCase()==="product").slice(0,t?.advertisingBgImg?.url?7:8)?.map(o=>{const h=o?.variants?.[0],b=`${h?.image?.url||o?.images?.[0]?.url}`,x=o?.title||o?.name,W=o?.description,q=o?.badge||"",G=(0,m.getLocalizedPath)(`/products/${o?.handle}?variant=${(0,c.atobID)(h?.id)}`,n);return(0,e.jsx)(C,{productImage:b,productName:x,productDesc:W,productBadge:q,listingLink:G},o.id)})]})]},"predict-advertising-card")]}):(0,e.jsxs)(e.Fragment,{children:[w===u.SearchStatus.Empty&&(0,e.jsx)(s.Text,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)(J,{data:t,keywords:_,locale:n}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&(0,e.jsx)(s.Grid,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(o=>(0,e.jsx)(s.GridItem,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:(0,e.jsx)("a",{href:(0,m.getLocalizedPath)(`${t?.moreLink}?q=${o?.popularPage.toLowerCase()}`,n),className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:o?.popularPage})},o?.id))})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&(0,e.jsx)(s.Link,{asChild:!t?.advertisingLink,href:(0,m.getLocalizedPath)(t?.advertisingLink,n),children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(s.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(s.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,c.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(s.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,c.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),t?.hotProducts?.slice(0,t?.advertisingBgImg?.url?7:8)?.map(o=>{const h=o?.custom_description,b=o?.badge||"",x=(0,m.getLocalizedPath)(`/products/${o?.handle}?variant=${(0,c.atobID)(o?.shopify_id)}`,n);return(0,e.jsx)(C,{productImage:o?.image,productName:o?.name,productDesc:h,productBadge:b,listingLink:x},o.shopify_id||o.id)})]})]},"empty-advertising-card")]})})]})});L.displayName="NavigationSearch";const C=({productImage:t,productName:a,productDesc:p,productBadge:r,className:l,listingLink:g})=>(0,e.jsx)(s.Link,{href:g,className:"block no-underline hover:text-current",children:(0,e.jsxs)("div",{className:(0,c.cn)("rounded-sidebar-shelf flex shrink-0 gap-4 overflow-hidden bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",l),children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:t,loading:"lazy",alt:a,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:" h-[24px] ",children:r&&(0,e.jsx)(s.Text,{as:"p",html:r,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(s.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:a}),p&&(0,e.jsx)(s.Text,{as:"p",html:p,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]})}),J=({data:t,keywords:a,locale:p})=>(0,e.jsx)("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:a?.map((r,l)=>(0,e.jsx)("a",{href:(0,m.getLocalizedPath)(`${t?.moreLink}?q=${r?.toLowerCase()}`,p),className:"rounded-sidebar-shelf laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:r},l))});var O=(0,F.withLayout)(L);
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/NavigationSearch/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/no-unknown-property */\nimport { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState, useEffect, useRef } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords, className, ...rest }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n\n // \u81EA\u52A8\u805A\u7126\u5230\u8F93\u5165\u6846\uFF08\u963B\u6B62\u6EDA\u52A8\u884C\u4E3A\uFF09\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus({ preventScroll: true })\n }\n }, [])\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n window.open(getLocalizedPath(`${data?.moreLink}?q=${searchValue.toLowerCase()}`, locale), '_self')\n }\n },\n [isComposing, searchValue, locale, data?.moreLink]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n const type = item.__typename || item.type\n switch (type) {\n case 'Product':\n return getLocalizedPath(`/products${item.path}?q=${searchValue.toLowerCase()}`, locale)\n case 'Article':\n return getLocalizedPath(\n `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`,\n locale\n )\n default:\n break\n }\n },\n [searchValue, locale]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue, isSearching])\n\n return (\n <Container childClassName=\"!bg-white\" {...rest} className={cn('relative', className)} ref={ref}>\n <style>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black\">\n <input\n ref={inputRef}\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none placeholder:text-[#4A4C56] focus-visible:!outline-none\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-1\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n iconClassName=\"size-4\"\n href={getLocalizedPath(`${data?.moreLink}?q=${searchValue.toLowerCase()}`, locale)}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"rounded-sidebar-shelf w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div key=\"predict-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={getLocalizedPath(data?.advertisingLink, locale)}>\n <div className=\"rounded-sidebar-shelf relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, data?.advertisingBgImg?.url ? 7 : 8)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = getLocalizedPath(\n `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`,\n locale\n )\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={getLocalizedPath(`${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`, locale)}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div key=\"empty-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={getLocalizedPath(data?.advertisingLink, locale)}>\n <div className=\"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {data?.hotProducts?.slice(0, data?.advertisingBgImg?.url ? 7 : 8)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = getLocalizedPath(\n `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`,\n locale\n )\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.shopify_id || item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nNavigationSearch.displayName = 'NavigationSearch'\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <Link href={listingLink} className=\"block no-underline hover:text-current\">\n <div\n className={cn(\n 'rounded-sidebar-shelf flex shrink-0 gap-4 overflow-hidden bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500',\n className\n )}\n >\n <div className=\"shrink-0\">\n <img\n src={productImage}\n loading=\"lazy\"\n alt={productName}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n <div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n </Link>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={getLocalizedPath(`${data?.moreLink}?q=${keyword?.toLowerCase()}`, locale)}\n key={index}\n className=\"rounded-sidebar-shelf laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,
|
|
6
|
-
"names": ["NavigationSearch_exports", "__export", "canSearch", "NavigationSearch_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_icons", "import_react", "import_AiuiProvider", "import_utils", "import_types", "import_es_toolkit", "target", "NavigationSearch", "data", "onSearch", "onClose", "searchResult", "isSearching", "keywords", "className", "rest", "ref", "locale", "copyWriting", "searchValue", "setSearchValue", "isComposing", "setIsComposing", "inputRef", "debouncedFunction", "value", "handleKeyDown", "e", "searchKeywords", "keyword", "word", "getLink", "item", "searchStatus", "SearchIcon", "CloseIcon", "variant", "productImage", "productName", "productDesc", "productBadge", "listingLink", "SearchProduct", "SearchKeyword", "index"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/no-unknown-property */\nimport { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState, useEffect, useRef } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords, className, ...rest }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n\n // \u81EA\u52A8\u805A\u7126\u5230\u8F93\u5165\u6846\uFF08\u963B\u6B62\u6EDA\u52A8\u884C\u4E3A\uFF09\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus({ preventScroll: true })\n }\n }, [])\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n window.open(getLocalizedPath(`${data?.moreLink}?q=${searchValue.toLowerCase()}`, locale), '_self')\n }\n },\n [isComposing, searchValue, locale, data?.moreLink]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n const type = item.__typename || item.type\n switch (type) {\n case 'Product':\n return getLocalizedPath(`/products${item.path}?q=${searchValue.toLowerCase()}`, locale)\n case 'Article':\n return getLocalizedPath(\n `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`,\n locale\n )\n default:\n break\n }\n },\n [searchValue, locale]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue, isSearching])\n\n return (\n <Container childClassName=\"!bg-white\" {...rest} className={cn('relative', className)} ref={ref}>\n <style>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black\">\n <input\n ref={inputRef}\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none placeholder:text-[#4A4C56] focus-visible:!outline-none\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-1\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n iconClassName=\"size-4\"\n href={getLocalizedPath(`${data?.moreLink}?q=${searchValue.toLowerCase()}`, locale)}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"rounded-sidebar-shelf w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div key=\"predict-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={getLocalizedPath(data?.advertisingLink, locale)}>\n <div className=\"rounded-sidebar-shelf relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, data?.advertisingBgImg?.url ? 7 : 8)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = getLocalizedPath(\n `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`,\n locale\n )\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={getLocalizedPath(`${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`, locale)}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div key=\"empty-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={getLocalizedPath(data?.advertisingLink, locale)}>\n <div className=\"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {data?.hotProducts?.slice(0, data?.advertisingBgImg?.url ? 7 : 8)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = getLocalizedPath(\n `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`,\n locale\n )\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.shopify_id || item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nNavigationSearch.displayName = 'NavigationSearch'\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <Link href={listingLink} className=\"block no-underline hover:text-current\">\n <div\n className={cn(\n 'rounded-sidebar-shelf flex shrink-0 gap-4 overflow-hidden bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500',\n className\n )}\n >\n <div className=\"shrink-0\">\n <img\n src={productImage}\n loading=\"lazy\"\n alt={productName}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n <div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n </Link>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={getLocalizedPath(`${data?.moreLink}?q=${keyword?.toLowerCase()}`, locale)}\n key={index}\n className=\"rounded-sidebar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QAAK,KAAMA,EAAa,UAAU,wCACjC,oBAAC,OACC,aAAW,MACT,sIACA3B,CACF,EAEA,oBAAC,OAAI,UAAU,WACb,mBAAC,OACC,IAAKuB,EACL,QAAQ,OACR,IAAKC,EACL,MAAO,GACP,OAAQ,GACR,UAAU,6BACZ,EACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,SAAAE,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,gIACZ,EAEJ,KACA,QAAC,OACC,oBAAC,QACC,UAAU,iGACV,KAAMF,EACR,EACCC,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,sFACZ,GAEJ,GACF,GACF,EACF,EAIEI,EAAgB,CAAC,CAAE,KAAAnC,EAAM,SAAAK,EAAU,OAAAI,CAAO,OAE5C,OAAC,OAAI,UAAU,oCACZ,SAAAJ,GAAU,IAAI,CAACgB,EAAce,OAC5B,OAAC,KACC,QAAM,oBAAiB,GAAGpC,GAAM,QAAQ,MAAMqB,GAAS,YAAY,CAAC,GAAIZ,CAAM,EAE9E,UAAU,qHAET,SAAAY,GAHIe,CAIP,CACD,EACH,EAIJ,IAAOjD,KAAQ,cAAWY,CAAgB",
|
|
6
|
+
"names": ["NavigationSearch_exports", "__export", "canSearch", "NavigationSearch_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_icons", "import_react", "import_AiuiProvider", "import_utils", "import_Styles", "import_types", "import_es_toolkit", "target", "NavigationSearch", "data", "onSearch", "onClose", "searchResult", "isSearching", "keywords", "className", "rest", "ref", "locale", "copyWriting", "searchValue", "setSearchValue", "isComposing", "setIsComposing", "inputRef", "debouncedFunction", "value", "handleKeyDown", "e", "searchKeywords", "keyword", "word", "getLink", "item", "searchStatus", "SearchIcon", "CloseIcon", "variant", "productImage", "productName", "productDesc", "productBadge", "listingLink", "SearchProduct", "SearchKeyword", "index"]
|
|
7
7
|
}
|
|
@@ -44,5 +44,5 @@ export interface ProductCompareProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
44
44
|
theme?: Theme;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
declare const _default: any
|
|
47
|
+
declare const _default: import("react").ForwardRefExoticComponent<ProductCompareProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
|
|
48
48
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ProductHeroProps } from './types.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<ProductHeroProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
2
4
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ProductNavProps } from './types.js';
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<ProductNavProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
2
3
|
export default _default;
|
|
@@ -42,5 +42,5 @@ export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
42
42
|
data: PromotionalBarData;
|
|
43
43
|
classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>;
|
|
44
44
|
}
|
|
45
|
-
declare const _default:
|
|
45
|
+
declare const _default: React.ForwardRefExoticComponent<PromotionalBarProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
|
|
46
46
|
export default _default;
|