@anker-in/headless-ui 1.1.28 → 1.1.30

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.
Files changed (143) hide show
  1. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +6 -0
  2. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +2 -0
  3. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +7 -0
  4. package/dist/cjs/biz-components/BrandCardLink/index.d.ts +1 -0
  5. package/dist/cjs/biz-components/BrandCardLink/index.js +2 -0
  6. package/dist/cjs/biz-components/BrandCardLink/index.js.map +7 -0
  7. package/dist/cjs/biz-components/BrandCardLink/types.d.ts +19 -0
  8. package/dist/cjs/biz-components/BrandCardLink/types.js +2 -0
  9. package/dist/cjs/biz-components/BrandCardLink/types.js.map +7 -0
  10. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  11. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  12. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  13. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  14. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +25 -0
  15. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +2 -0
  16. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js.map +7 -0
  17. package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.d.ts +7 -0
  18. package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.js +2 -0
  19. package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.js.map +7 -0
  20. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.d.ts +9 -0
  21. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +2 -0
  22. package/dist/cjs/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +7 -0
  23. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.d.ts +9 -0
  24. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js +2 -0
  25. package/dist/cjs/biz-components/HeaderNavigation/MobileSidebarMenu.js.map +7 -0
  26. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.d.ts +7 -0
  27. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js +2 -0
  28. package/dist/cjs/biz-components/HeaderNavigation/MobileSupportMenu.js.map +7 -0
  29. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.d.ts +15 -0
  30. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +2 -0
  31. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +7 -0
  32. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +2 -0
  33. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  34. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  35. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.d.ts +20 -0
  36. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js +2 -0
  37. package/dist/cjs/biz-components/HeaderNavigation/ResourceItem.js.map +7 -0
  38. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.d.ts +9 -0
  39. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +2 -0
  40. package/dist/cjs/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +7 -0
  41. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.d.ts +18 -0
  42. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +2 -0
  43. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js.map +7 -0
  44. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.d.ts +9 -0
  45. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +2 -0
  46. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js.map +7 -0
  47. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  48. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  49. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +2 -1
  50. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  51. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  52. package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  53. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  54. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  55. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  56. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  57. package/dist/cjs/biz-components/HeroBanner/types.d.ts +4 -0
  58. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  59. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  60. package/dist/cjs/biz-components/ImageTextFeature/types.d.ts +1 -0
  61. package/dist/cjs/biz-components/ImageTextFeature/types.js +1 -1
  62. package/dist/cjs/biz-components/ImageTextFeature/types.js.map +1 -1
  63. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  64. package/dist/cjs/biz-components/SearchPage/index.js.map +2 -2
  65. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
  66. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  67. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  68. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  69. package/dist/cjs/biz-components/Tabs/types.d.ts +9 -0
  70. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  71. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  72. package/dist/cjs/biz-components/index.d.ts +2 -0
  73. package/dist/cjs/biz-components/index.js +1 -1
  74. package/dist/cjs/biz-components/index.js.map +3 -3
  75. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +6 -0
  76. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +2 -0
  77. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +7 -0
  78. package/dist/esm/biz-components/BrandCardLink/index.d.ts +1 -0
  79. package/dist/esm/biz-components/BrandCardLink/index.js +2 -0
  80. package/dist/esm/biz-components/BrandCardLink/index.js.map +7 -0
  81. package/dist/esm/biz-components/BrandCardLink/types.d.ts +19 -0
  82. package/dist/esm/biz-components/BrandCardLink/types.js +1 -0
  83. package/dist/esm/biz-components/BrandCardLink/types.js.map +7 -0
  84. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  85. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  86. package/dist/esm/biz-components/Graphic/index.js +1 -1
  87. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  88. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +25 -0
  89. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +2 -0
  90. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js.map +7 -0
  91. package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.d.ts +7 -0
  92. package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.js +2 -0
  93. package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.js.map +7 -0
  94. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.d.ts +9 -0
  95. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js +2 -0
  96. package/dist/esm/biz-components/HeaderNavigation/MobileResourceSidebarMenu.js.map +7 -0
  97. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.d.ts +9 -0
  98. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js +2 -0
  99. package/dist/esm/biz-components/HeaderNavigation/MobileSidebarMenu.js.map +7 -0
  100. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.d.ts +7 -0
  101. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js +2 -0
  102. package/dist/esm/biz-components/HeaderNavigation/MobileSupportMenu.js.map +7 -0
  103. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.d.ts +15 -0
  104. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +2 -0
  105. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +7 -0
  106. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +2 -0
  107. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  108. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  109. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.d.ts +20 -0
  110. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js +2 -0
  111. package/dist/esm/biz-components/HeaderNavigation/ResourceItem.js.map +7 -0
  112. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.d.ts +9 -0
  113. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js +2 -0
  114. package/dist/esm/biz-components/HeaderNavigation/ResourceSidebarDropdown.js.map +7 -0
  115. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.d.ts +18 -0
  116. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +2 -0
  117. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js.map +7 -0
  118. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.d.ts +9 -0
  119. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +2 -0
  120. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js.map +7 -0
  121. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  122. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  123. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +2 -1
  124. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  125. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  126. package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
  127. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  128. package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  129. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  130. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  131. package/dist/esm/biz-components/HeroBanner/types.d.ts +4 -0
  132. package/dist/esm/biz-components/ImageTextFeature/types.d.ts +1 -0
  133. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  134. package/dist/esm/biz-components/SearchPage/index.js.map +2 -2
  135. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +5 -5
  136. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  137. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  138. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  139. package/dist/esm/biz-components/Tabs/types.d.ts +9 -0
  140. package/dist/esm/biz-components/index.d.ts +2 -0
  141. package/dist/esm/biz-components/index.js +1 -1
  142. package/dist/esm/biz-components/index.js.map +2 -2
  143. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Evaluate/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\">\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
- "mappings": "aA8EU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBA7EV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,UAA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,EAC9B,SAAApC,EAAC,OAAI,UAAU,6BACb,SAAAA,EAACa,EAAA,CAAW,GAAIO,GAAM,gBAAkB,CAAC,EAAI,UAAU,kBACrD,SAAAnB,EAAC,OAAI,IAAKqB,EAAK,UAAWhB,EAAG,SAAUwB,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EAChF,UAAAD,GAASjC,EAACK,EAAA,CAAM,KAAM,CAAE,MAAO4B,CAAM,EAAG,EACzCjC,EAACQ,EAAA,CACC,UAAU,oBACV,GAAI,WAAauB,EACjB,KAAM,CAAE,KAAMC,EAAU,cAAe,CAAE,GAAGG,EAAO,MAAOF,CAAM,CAAE,EAClE,MAAOd,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDU,EAAS,YAAc,WAEvB,IAAOQ,EAAQ5B,EAAWoB,CAAQ",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" title={data?.description || ''}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
+ "mappings": "aA8EU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBA7EV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,UAAAC,EAAQ,eAA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,EAAW,IAAKM,EAC9B,SAAApC,EAAC,OAAI,UAAU,6BACb,SAAAA,EAACa,EAAA,CAAW,GAAIO,GAAM,gBAAkB,CAAC,EAAI,UAAU,kBACrD,SAAAnB,EAAC,OAAI,IAAKqB,EAAK,UAAWhB,EAAG,SAAUwB,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EAChF,UAAAD,GAASjC,EAACK,EAAA,CAAM,KAAM,CAAE,MAAO4B,CAAM,EAAG,EACzCjC,EAACQ,EAAA,CACC,UAAU,oBACV,GAAI,WAAauB,EACjB,KAAM,CAAE,KAAMC,EAAU,cAAe,CAAE,GAAGG,EAAO,MAAOF,CAAM,CAAE,EAClE,MAAOd,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDU,EAAS,YAAc,WAEvB,IAAOQ,EAAQ5B,EAAWoB,CAAQ",
6
6
  "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "Title", "cn", "Picture", "SwiperBox", "withLayout", "Avatar", "AvatarImage", "AvatarFallback", "Container", "Text", "useExposure", "trackUrlRef", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "handleRating", "num", "raw", "count", "_", "index", "Evaluate", "className", "key", "products", "title", "theme", "ohter", "innerRef", "Evaluate_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import{useMediaQuery as B}from"react-responsive";import H,{useEffect as L,useImperativeHandle as D,useRef as w,useState as r}from"react";import{cn as m}from"../../helpers/utils.js";import{withLayout as E}from"../../shared/Styles.js";import U from"../SwiperBox/index.js";import{Button as z,Heading as j,Picture as f,Text as R}from"../../components/index.js";import _ from"../Title/index.js";import{VideoModal as q}from"../VideoModal/index.js";import{TextModal as Y}from"../TextModal/index.js";import{useExposure as y}from"../../hooks/useExposure.js";import{trackUrlRef as T}from"../../shared/trackUrlRef.js";const n="image",p="graphic",k="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",A=({data:e,configuration:l})=>{const h=w(null),u=()=>{switch(l.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};return y(h,{componentType:n,componentName:p,componentTitle:e?.title,componentDescription:e?.description,position:l?.index+1}),t("div",{ref:h,className:m(u(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":l?.itemShape==="round"}),children:c("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?t("a",{"aria-label":e?.title??e?.description,href:T(e?.href||"",`${n}_${p}`),className:"block size-full overflow-hidden","data-headless-nav-postion":`''#${l?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}):t("div",{className:"block size-full overflow-hidden",children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),c("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[c("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[c("div",{className:"flex-1 overflow-hidden",children:[t(R,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(e?.title?t(j,{html:e?.description,style:{color:e?.textColor},as:"h3",className:`${k} graphic-description`}):t("h3",{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${k} graphic-description-item`}))]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:i=>{i.preventDefault(),i.stopPropagation(),l?.onVideoPlayBtnClick?.(l?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),l?.onIconClick?.(e,l)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(f,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(z,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:T(e?.href,`${n}_${p}`),"data-headless-nav-postion":`''#${l?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},N=H.forwardRef(({data:e,className:l},h)=>{const u=B({query:"(max-width: 768px)"}),i=w(null),[I,b]=r(!1),[g,M]=r(""),[C,V]=r(""),[$,P]=r(""),[G,x]=r(null),[S,v]=r(!1),d=o=>{const s=e?.items?.length>3,a=e?.items?.length>2;switch(o){case 1440:return s?4:e?.items?.length;case 1024:return s?3:e?.items?.length;case 768:return e?.items?.length===1?1:s||a?2.3:2;default:return e?.items?.length===1?1:1.2}};return D(h,()=>i.current),y(i,{componentType:n,componentName:p,componentTitle:e?.title}),L(()=>{const o=i.current?.querySelectorAll(".graphic-description");if(o&&o.length>0){let s=0;o.forEach(a=>{s=Math.max(s,a.offsetHeight)}),o.forEach(a=>{a.style.height=`${s}px`})}},[]),c("div",{className:m("graphicBlock",l),ref:i,children:[c("div",{className:"graphic-box",children:[e?.title&&t(_,{data:{title:e?.title}}),t(U,{id:"Graphic",className:m("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(o,s)=>{b(!0),s?.isYouTube?V?.(s?.youtubeId||""):(M?.(s?.video?.url||""),P?.(s?.mobileVideo?.url||""))},onIconClick:o=>{v(!0),x(o)},title:e?.title}},Slide:A,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:d()},768:{spaceBetween:16,freeMode:!1,slidesPerView:d(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:d(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:d(1440)}}})]}),t(q,{visible:I,youTubeId:C,onCloseModal:()=>b(!1),videoUrl:u&&$||g}),t(Y,{textVisible:S,extension:G?.extension,onCloseModal:()=>{v(!1),x(null)}})]})});N.displayName="Graphic";var le=E(N);export{le as default};
1
+ "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import{useMediaQuery as B}from"react-responsive";import H,{useEffect as L,useImperativeHandle as D,useRef as w,useState as r}from"react";import{cn as m}from"../../helpers/utils.js";import{withLayout as E}from"../../shared/Styles.js";import U from"../SwiperBox/index.js";import{Button as z,Heading as j,Picture as f,Text as R}from"../../components/index.js";import _ from"../Title/index.js";import{VideoModal as q}from"../VideoModal/index.js";import{TextModal as Y}from"../TextModal/index.js";import{useExposure as y}from"../../hooks/useExposure.js";import{trackUrlRef as T}from"../../shared/trackUrlRef.js";const n="image",p="graphic",k="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",A=({data:e,configuration:i})=>{const h=w(null),u=()=>{switch(i.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};return y(h,{componentType:n,componentName:p,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),t("div",{ref:h,className:m(u(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":i?.itemShape==="round"}),children:c("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?t("a",{"aria-label":e?.title??e?.description,href:T(e?.href||"",`${n}_${p}`),className:"block size-full overflow-hidden","data-headless-nav-postion":`''#${i?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}):t("div",{className:"block size-full overflow-hidden",children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),c("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[c("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[c("div",{className:"flex-1 overflow-hidden",children:[t(R,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(e?.title?t(j,{html:e?.description,style:{color:e?.textColor},as:"h3",title:e?.description||"",className:`${k} graphic-description`}):t("h3",{style:{color:e?.textColor},title:e?.description||"",dangerouslySetInnerHTML:{__html:e?.description||""},className:`${k} graphic-description-item`}))]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),i?.onVideoPlayBtnClick?.(i?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),i?.onIconClick?.(e,i)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(f,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(z,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:T(e?.href,`${n}_${p}`),"data-headless-nav-postion":`''#${i?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},N=H.forwardRef(({data:e,className:i},h)=>{const u=B({query:"(max-width: 768px)"}),l=w(null),[I,b]=r(!1),[g,M]=r(""),[C,V]=r(""),[$,P]=r(""),[G,x]=r(null),[S,v]=r(!1),d=o=>{const s=e?.items?.length>3,a=e?.items?.length>2;switch(o){case 1440:return s?4:e?.items?.length;case 1024:return s?3:e?.items?.length;case 768:return e?.items?.length===1?1:s||a?2.3:2;default:return e?.items?.length===1?1:1.2}};return D(h,()=>l.current),y(l,{componentType:n,componentName:p,componentTitle:e?.title}),L(()=>{const o=l.current?.querySelectorAll(".graphic-description");if(o&&o.length>0){let s=0;o.forEach(a=>{s=Math.max(s,a.offsetHeight)}),o.forEach(a=>{a.style.height=`${s}px`})}},[]),c("div",{className:m("graphicBlock",i),ref:l,children:[c("div",{className:"graphic-box",children:[e?.title&&t(_,{data:{title:e?.title}}),t(U,{id:"Graphic",className:m("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(o,s)=>{b(!0),s?.isYouTube?V?.(s?.youtubeId||""):(M?.(s?.video?.url||""),P?.(s?.mobileVideo?.url||""))},onIconClick:o=>{v(!0),x(o)},title:e?.title}},Slide:A,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:d()},768:{spaceBetween:16,freeMode:!1,slidesPerView:d(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:d(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:d(1440)}}})]}),t(q,{visible:I,youTubeId:C,onCloseModal:()=>b(!1),videoUrl:u&&$||g}),t(Y,{textVisible:S,extension:G?.extension,onCloseModal:()=>{v(!1),x(null)}})]})});N.displayName="Graphic";var ie=E(N);export{ie as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Graphic/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description &&\n (data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n ))}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
- "mappings": "aAwGc,cAAAA,EAmBA,QAAAC,MAnBA,oBAvGd,OAAS,iBAAAC,MAAqB,mBAC9B,OAAOC,GAAS,aAAAC,EAAW,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QACxE,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAe,wBACtB,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAOC,MAAW,oBAClB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAyBhBC,EACJ,8IAWIC,EAAO,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAkD,CACpF,MAAMC,EAAMpB,EAAuB,IAAI,EACjCqB,EAAe,IAAM,CACzB,OAAQF,EAAc,IAAK,CACzB,IAAK,GACH,MAAO,8LACT,IAAK,GACH,MAAO,4LACT,IAAK,GACH,MAAO,4LACT,QACE,MAAO,2LACX,CACF,EAEA,OAAAP,EAAYQ,EAAK,CACf,cAAAN,EACA,cAAAC,EACA,eAAgBG,GAAM,MACtB,qBAAsBA,GAAM,YAC5B,SAAUC,GAAe,MAAQ,CACnC,CAAC,EAGCzB,EAAC,OACC,IAAK0B,EACL,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AM,CAAE,MAAOS,GAAM,KAAM,EAAG,EACrDxB,EAACU,EAAA,CACC,GAAG,UACH,UAAWF,EAAG,mBAAmB,EACjC,KAAM,CACJ,KAAMgB,GAAM,OAAS,CAAC,EACtB,cAAe,CACb,UAAWA,EAAK,UAChB,IAAKA,GAAM,OAAO,QAAU,EAC5B,oBAAqB,CAAC2B,EAAW3B,IAAsB,CACrDU,EAAW,EAAI,EACXV,GAAM,UACRc,IAAed,GAAM,WAAa,EAAE,GAEpCY,IAAcZ,GAAM,OAAO,KAAO,EAAE,EACpCgB,IAAoBhB,GAAM,aAAa,KAAO,EAAE,EAEpD,EACA,YAAcA,GAAsB,CAClCoB,EAAe,EAAI,EACnBF,EAAelB,CAAI,CACrB,EACA,MAAOA,GAAM,KACf,CACF,EACA,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAesB,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,EACA7C,EAACgB,EAAA,CACC,QAASiB,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,EACAnC,EAACiB,EAAA,CACC,YAAa0B,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDb,EAAQ,YAAc,UAEtB,IAAOuB,GAAQ3C,EAAWoB,CAAO",
4
+ "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description &&\n (data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n title={data?.description || ''}\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n title={data?.description || ''}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n ))}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
+ "mappings": "aAwGc,cAAAA,EAmBA,QAAAC,MAnBA,oBAvGd,OAAS,iBAAAC,MAAqB,mBAC9B,OAAOC,GAAS,aAAAC,EAAW,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QACxE,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAe,wBACtB,OAAS,UAAAC,EAA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AAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAesB,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,EACA7C,EAACgB,EAAA,CACC,QAASiB,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,EACAnC,EAACiB,EAAA,CACC,YAAa0B,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDb,EAAQ,YAAc,UAEtB,IAAOuB,GAAQ3C,EAAWoB,CAAO",
6
6
  "names": ["jsx", "jsxs", "useMediaQuery", "React", "useEffect", "useImperativeHandle", "useRef", "useState", "cn", "withLayout", "SwiperBox", "Button", "Heading", "Picture", "Text", "Title", "VideoModal", "TextModal", "useExposure", "trackUrlRef", "componentType", "componentName", "descriptionClass", "Item", "data", "configuration", "ref", "handleAspect", "e", "Graphic", "className", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "handleSwiperShow", "width", "isShow", "descriptions", "maxHeight", "el", "_", "Graphic_default"]
7
7
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 移动端菜单项
3
+ */
4
+ export declare const MenuItem: ({ label, href, onClick, active, icon, className, }: {
5
+ label: string;
6
+ href?: string;
7
+ onClick?: () => void;
8
+ active?: boolean;
9
+ icon?: string;
10
+ className?: string;
11
+ }) => import("react/jsx-runtime").JSX.Element;
12
+ /**
13
+ * 移动端子分类标题组件
14
+ */
15
+ export declare const SubSubCategoryItemComp: ({ matchSeriesMetadata, onSubSubCategoryItemClick, expanded, }: {
16
+ matchSeriesMetadata: any;
17
+ onSubSubCategoryItemClick?: () => void;
18
+ expanded?: boolean;
19
+ }) => import("react/jsx-runtime").JSX.Element;
20
+ /**
21
+ * 移动端子分类内容组件
22
+ */
23
+ export declare const SubSubCategoryContentComp: ({ matchSeriesMetadata }: {
24
+ matchSeriesMetadata: any;
25
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{Fragment as c,jsx as t,jsxs as r}from"react/jsx-runtime";import"react";import{Text as a,Link as p,Heading as d,Picture as u}from"../../components/index.js";import{cn as i}from"../../helpers/utils.js";import{DownArrow as f}from"./icons/index.js";import{SeriesProductItem as g}from"./SidebarDropdown.js";const w=({label:e,href:n,onClick:l,active:o,icon:s,className:m})=>{const b=r(c,{children:[r("div",{className:"flex items-center gap-4",children:[t(a,{html:e,className:i("text-sm font-bold leading-[1.4]",{underline:s})}),s&&t(a,{html:s,"aria-hidden":"true"})]}),t("svg",{className:`size-5 ${o?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return n?t(p,{href:n,className:i("flex cursor-pointer items-center justify-between py-4 no-underline",m),onClick:l,children:b}):t("button",{onClick:l,className:i("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",m),"aria-expanded":o,children:b})},C=({matchSeriesMetadata:e,onSubSubCategoryItemClick:n,expanded:l})=>{const o=r(c,{children:[e?.label&&t(a,{html:e?.label,className:"text-sm font-bold leading-[1.4]"}),n&&t(f,{"aria-hidden":"true",className:i("size-5",{"rotate-180":l})})]});return n?t("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":l,children:o}):t("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:o})},L=({matchSeriesMetadata:e})=>t("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!e?.series?.length&&e?.series?.map((n,l)=>r("div",{children:[n.label&&t(a,{html:n.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),r("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!e?.banner&&t(p,{asChild:!e?.banner?.href,href:e?.banner?.href,children:r("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[t(u,{source:e?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),r("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[t(d,{size:2,html:e?.banner?.title||"Buy in Guide",className:i("font-bold text-white",{"text-black":e?.banner?.theme==="dark"})}),t(a,{html:e?.banner?.desc||"20.000mAh",className:i("text-sm font-bold text-white",{"text-black":e?.banner?.theme==="dark"})})]})]})}),n.products?.map((o,s)=>t(g,{position:s,product:o,seriesLabel:e?.label,isCollection:e?.isCollection},`seriesProductItem-${l}-${s}`))]})]},`seriesItem-${l}`))});export{w as MenuItem,L as SubSubCategoryContentComp,C as SubSubCategoryItemComp};
2
+ //# sourceMappingURL=MobileMenuComponents.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MobileMenuComponents.tsx"],
4
+ "sourcesContent": ["import React from 'react'\nimport { Text, Link, Heading, Picture } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { DownArrow } from './icons/index.js'\nimport { SeriesProductItem } from './SidebarDropdown.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u83DC\u5355\u9879\n */\nexport const MenuItem = ({\n label,\n href,\n onClick,\n active,\n icon,\n className,\n}: {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}) => {\n const content = (\n <>\n <div className=\"flex items-center gap-4\">\n <Text html={label} className={cn('text-sm font-bold leading-[1.4]', { underline: icon })} />\n {icon && <Text html={icon} aria-hidden=\"true\" />}\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </>\n )\n\n return href ? (\n <Link\n href={href}\n className={cn('flex cursor-pointer items-center justify-between py-4 no-underline', className)}\n onClick={onClick}\n >\n {content}\n </Link>\n ) : (\n <button\n onClick={onClick}\n className={cn(\n 'flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left',\n className\n )}\n aria-expanded={active}\n >\n {content}\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u6807\u9898\u7EC4\u4EF6\n */\nexport const SubSubCategoryItemComp = ({\n matchSeriesMetadata,\n onSubSubCategoryItemClick,\n expanded,\n}: {\n matchSeriesMetadata: any\n onSubSubCategoryItemClick?: () => void\n expanded?: boolean\n}) => {\n const content = (\n <>\n {matchSeriesMetadata?.label && (\n <Text html={matchSeriesMetadata?.label} className=\"text-sm font-bold leading-[1.4]\" />\n )}\n {onSubSubCategoryItemClick && (\n <DownArrow\n aria-hidden=\"true\"\n className={cn('size-5', {\n ['rotate-180']: expanded,\n })}\n />\n )}\n </>\n )\n\n return onSubSubCategoryItemClick ? (\n <button\n className=\"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onSubSubCategoryItemClick}\n aria-expanded={expanded}\n >\n {content}\n </button>\n ) : (\n <div className=\"tablet:pt-0 flex items-center justify-between py-4\">{content}</div>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u5B50\u5206\u7C7B\u5185\u5BB9\u7EC4\u4EF6\n */\nexport const SubSubCategoryContentComp = ({ matchSeriesMetadata }: { matchSeriesMetadata: any }) => {\n return (\n <div className=\"laptop:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.series?.length &&\n matchSeriesMetadata?.series?.map((seriesItem: any, pIndex: number) => (\n <div key={`seriesItem-${pIndex}`}>\n {seriesItem.label && (\n <Text html={seriesItem.label} as=\"p\" className=\"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]\" />\n )}\n <div className=\"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2\">\n {!!matchSeriesMetadata?.banner && (\n <Link asChild={!matchSeriesMetadata?.banner?.href} href={matchSeriesMetadata?.banner?.href}>\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={matchSeriesMetadata?.banner?.imageUrl}\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={matchSeriesMetadata?.banner?.title || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n <Text\n html={matchSeriesMetadata?.banner?.desc || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {seriesItem.products?.map((product: any, index: number) => (\n <SeriesProductItem\n position={index}\n key={`seriesProductItem-${pIndex}-${index}`}\n product={product}\n seriesLabel={matchSeriesMetadata?.label}\n isCollection={matchSeriesMetadata?.isCollection}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "AAyBI,mBAAAA,EAEI,OAAAC,EADF,QAAAC,MADF,oBAzBJ,MAA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T,gBAAeC,EAEd,SAAAJ,EACH,EAEAhB,EAAC,OAAI,UAAU,qDAAsD,SAAAgB,EAAQ,CAEjF,EAKaK,EAA4B,CAAC,CAAE,oBAAAH,CAAoB,IAE5DlB,EAAC,OAAI,UAAU,mCACZ,UAAC,CAACkB,GAAqB,QAAQ,QAC9BA,GAAqB,QAAQ,IAAI,CAACI,EAAiBC,IACjDtB,EAAC,OACE,UAAAqB,EAAW,OACVtB,EAACE,EAAA,CAAK,KAAMoB,EAAW,MAAO,GAAG,IAAI,UAAU,sDAAsD,EAEvGrB,EAAC,OAAI,UAAU,kGACZ,WAAC,CAACiB,GAAqB,QACtBlB,EAACG,EAAA,CAAK,QAAS,CAACe,GAAqB,QAAQ,KAAM,KAAMA,GAAqB,QAAQ,KACpF,SAAAjB,EAAC,OAAI,UAAU,2FACb,UAAAD,EAACK,EAAA,CACC,OAAQa,GAAqB,QAAQ,SACrC,UAAU,6BACV,aAAa,sBACf,EACAjB,EAAC,OAAI,UAAU,kCACb,UAAAD,EAACI,EAAA,CACC,KAAM,EACN,KAAMc,GAAqB,QAAQ,OAAS,eAC5C,UAAWZ,EAAG,uBAAwB,CACpC,aAAcY,GAAqB,QAAQ,QAAU,MACvD,CAAC,EACH,EACAlB,EAACE,EAAA,CACC,KAAMgB,GAAqB,QAAQ,MAAQ,YAC3C,UAAWZ,EAAG,+BAAgC,CAC5C,aAAcY,GAAqB,QAAQ,QAAU,MACvD,CAAC,EACH,GACF,GACF,EACF,EAEDI,EAAW,UAAU,IAAI,CAACE,EAAcC,IACvCzB,EAACQ,EAAA,CACC,SAAUiB,EAEV,QAASD,EACT,YAAaN,GAAqB,MAClC,aAAcA,GAAqB,cAH9B,qBAAqBK,CAAM,IAAIE,CAAK,EAI3C,CACD,GACH,IAxCQ,cAAcF,CAAM,EAyC9B,CACD,EACL",
6
+ "names": ["Fragment", "jsx", "jsxs", "Text", "Link", "Heading", "Picture", "cn", "DownArrow", "SeriesProductItem", "MenuItem", "label", "href", "onClick", "active", "icon", "className", "content", "SubSubCategoryItemComp", "matchSeriesMetadata", "onSubSubCategoryItemClick", "expanded", "SubSubCategoryContentComp", "seriesItem", "pIndex", "product", "index"]
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 移动端multicol菜单
3
+ * @param multicolMetadata multicol菜单元数据
4
+ */
5
+ export declare const MobileMulticolMenu: ({ multicolMetadata }: {
6
+ multicolMetadata: any;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as p}from"react";import{cn as r}from"../../helpers/utils.js";import{MulticolItem as i}from"./MulticolDropdown.js";const u=({multicolMetadata:t})=>{const o=p(()=>!t?.some(l=>!!l.columns),[t]);return e("div",{className:r("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":o}),children:t?.map((l,a)=>e("div",{children:e(i,{item:l,allPicture:o})},`multicolItem-${l?.label}-${a}`))})};export{u as MobileMulticolMenu};
2
+ //# sourceMappingURL=MobileMulticolMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MobileMulticolMenu.tsx"],
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { MulticolItem } from './MulticolDropdown.js'\n\n/**\n * \u79FB\u52A8\u7AEFmulticol\u83DC\u5355\n * @param multicolMetadata multicol\u83DC\u5355\u5143\u6570\u636E\n */\nexport const MobileMulticolMenu = ({ multicolMetadata }: { multicolMetadata: any }) => {\n // \u662F\u5426\u5168\u90E8\u662F\u56FE\u7247\n const allPicture = useMemo(() => {\n return !multicolMetadata?.some((item: any) => !!item.columns)\n }, [multicolMetadata])\n\n return (\n <div\n className={cn('tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4', {\n ['tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4']: allPicture,\n })}\n >\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`}>\n <MulticolItem item={item} allPicture={allPicture} />\n </div>\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "AAsBU,cAAAA,MAAA,oBAtBV,OAAgB,WAAAC,MAAe,QAC/B,OAAS,MAAAC,MAAU,yBACnB,OAAS,gBAAAC,MAAoB,wBAMtB,MAAMC,EAAqB,CAAC,CAAE,iBAAAC,CAAiB,IAAiC,CAErF,MAAMC,EAAaL,EAAQ,IAClB,CAACI,GAAkB,KAAME,GAAc,CAAC,CAACA,EAAK,OAAO,EAC3D,CAACF,CAAgB,CAAC,EAErB,OACEL,EAAC,OACC,UAAWE,EAAG,4EAA6E,CACxF,2DAA6DI,CAChE,CAAC,EAEA,SAAAD,GAAkB,IAAI,CAACE,EAAWC,IACjCR,EAAC,OACC,SAAAA,EAACG,EAAA,CAAa,KAAMI,EAAM,WAAYD,EAAY,GAD1C,gBAAgBC,GAAM,KAAK,IAAIC,CAAK,EAE9C,CACD,EACH,CAEJ",
6
+ "names": ["jsx", "useMemo", "cn", "MulticolItem", "MobileMulticolMenu", "multicolMetadata", "allPicture", "item", "index"]
7
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 移动端资源位侧边栏下拉
3
+ * @param resourceCategoriesMetadata 资源位分类元数据
4
+ * @param resourcesMetadata 资源位元数据
5
+ */
6
+ export declare const MobileResourceSidebarMenu: ({ resourceCategoriesMetadata, resourcesMetadata, }: {
7
+ resourceCategoriesMetadata: any;
8
+ resourcesMetadata: any;
9
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import{Fragment as z,jsx as n,jsxs as i}from"react/jsx-runtime";import{useCallback as L,useEffect as S,useMemo as $,useState as w}from"react";import{Button as C}from"../../components/index.js";import{HeaderNavigationMenu as y}from"./types.js";import{useNavContext as B}from"./NavProvider.js";import{ResourceSubSubCategoryItemComp as R,ResourceSubSubCategoryContentComp as k}from"./ResourceItem.js";const j=({label:t,onClick:l,active:u})=>i("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:l,"aria-expanded":u,children:[n("div",{className:"flex items-center gap-4",children:n("span",{className:"text-sm font-bold leading-[1.4]",children:t})}),n("svg",{className:`size-5 ${u?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:n("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),q=({resourceCategoriesMetadata:t,resourcesMetadata:l})=>{const{currentMenu:u,setCurrentMenu:c,subSubCategory:r,setSubSubCategory:v,onSidebarNavClick:p,currentResourceMetadata:b,setCurrentResourceMetadata:d}=B(),[g,N]=w([]),[m,x]=w([]);S(()=>{t?.subcategories?.length&&N(t?.subcategories?.map((a,e)=>({index:e,open:!1})))},[t]),S(()=>{r?.subSubCategories?.length&&x(r?.subSubCategories?.map((a,e)=>({index:e,open:e===0})))},[r]);const h=L(a=>{v?.(a);const e=l?.find(s=>a?.label?.toLowerCase()===s.label?.toLowerCase())||{};c&&c(y.Third),d&&d(e)},[l,c,v,d]);return $(()=>{switch(u){case y.Secondary:return i("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[n("div",{children:t?.subcategories?.map((a,e)=>n("div",{children:n(j,{label:a?.label,active:g.find(s=>s.index===e)?.open,onClick:()=>{h(a),p?.(a,e)}})},`${a.label}-${e}`))}),i("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&n(C,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&n(C,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case y.Third:return n("div",{className:"tablet:px-8 laptop:px-16 p-4",children:r?.subSubCategories?r?.subSubCategories?.map((a,e)=>{const s=l?.find(o=>o.label.toLowerCase()===a?.label?.toLowerCase())||{};return i("div",{children:[Reflect.ownKeys(a).length>0&&n(R,{matchResourcesMetadata:s,onSubSubCategoryItemClick:()=>{p?.(a,e),x(o=>o.map((f,M)=>({...f,open:M===e?!f.open:f.open})))},expanded:!!m?.find(o=>o.index===e)?.open}),m?.find(o=>o.index===e)?.open&&n(k,{matchResourcesMetadata:s})]},`${a.label}-${e}`)}):i(z,{children:[Reflect.ownKeys(b).length>0&&n(R,{matchResourcesMetadata:b}),n(k,{matchResourcesMetadata:b})]})});default:return null}},[u,t,l,g,m,r,b,h,p])};export{q as MobileResourceSidebarMenu};
2
+ //# sourceMappingURL=MobileResourceSidebarMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MobileResourceSidebarMenu.tsx"],
4
+ "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { ResourceSubSubCategoryItemComp, ResourceSubSubCategoryContentComp } from './ResourceItem.js'\n\ninterface MenuItem {\n label: string\n href?: string\n onClick?: () => void\n active?: boolean\n icon?: string\n className?: string\n}\n\nconst MenuItem = ({ label, onClick, active }: MenuItem) => {\n return (\n <button\n className=\"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left\"\n onClick={onClick}\n aria-expanded={active}\n >\n <div className=\"flex items-center gap-4\">\n <span className=\"text-sm font-bold leading-[1.4]\">{label}</span>\n </div>\n <svg\n className={`size-5 ${active ? 'rotate-90' : ''}`}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path d=\"M9 5L16 12L9 19\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n )\n}\n\n/**\n * \u79FB\u52A8\u7AEF\u8D44\u6E90\u4F4D\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param resourceCategoriesMetadata \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n * @param resourcesMetadata \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n */\nexport const MobileResourceSidebarMenu = ({\n resourceCategoriesMetadata,\n resourcesMetadata,\n}: {\n resourceCategoriesMetadata: any\n resourcesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n onSidebarNavClick,\n currentResourceMetadata,\n setCurrentResourceMetadata,\n } = useNavContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedResourceCategories, setExpandedResourceCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (resourceCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n resourceCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [resourceCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedResourceCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any) => {\n setSubSubCategory?.(item)\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (resourceItem: any) => item?.label?.toLowerCase() === resourceItem.label?.toLowerCase()\n ) || {}\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setCurrentResourceMetadata && setCurrentResourceMetadata(curResourcesMetadata)\n },\n [resourcesMetadata, setCurrentMenu, setSubSubCategory, setCurrentResourceMetadata]\n )\n\n const MobileResourceSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {resourceCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {resourceCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${resourceCategoriesMetadata?.primary?.url}?ref=${resourceCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {resourceCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {resourceCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={resourceCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {resourceCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curResourcesMetadata =\n resourcesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <ResourceSubSubCategoryItemComp\n matchResourcesMetadata={curResourcesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedResourceCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedResourceCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedResourceCategories?.find(item => item.index === index)?.open && (\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={curResourcesMetadata} />\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentResourceMetadata).length > 0 && (\n <ResourceSubSubCategoryItemComp matchResourcesMetadata={currentResourceMetadata} />\n )}\n <ResourceSubSubCategoryContentComp matchResourcesMetadata={currentResourceMetadata} />\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n resourceCategoriesMetadata,\n resourcesMetadata,\n expandedSubcategory,\n expandedResourceCategories,\n subSubCategory,\n currentResourceMetadata,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n ])\n\n return MobileResourceSidebarMenuComp\n}\n"],
5
+ "mappings": "AAiBI,OA+JU,YAAAA,EAzJN,OAAAC,EANJ,QAAAC,MAAA,oBAjBJ,OAAgB,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QACjE,OAAS,UAAAC,MAAc,4BACvB,OAAS,wBAAAC,MAA4B,aACrC,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,kCAAAC,EAAgC,qCAAAC,MAAyC,oBAWlF,MAAMC,EAAW,CAAC,CAAE,MAAAC,EAAO,QAAAC,EAAS,OAAAC,CAAO,IAEvCb,EAAC,UACC,UAAU,iGACV,QAASY,EACT,gBAAeC,EAEf,UAAAd,EAAC,OAAI,UAAU,0BACb,SAAAA,EAAC,QAAK,UAAU,kCAAmC,SAAAY,EAAM,EAC3D,EACAZ,EAAC,OACC,UAAW,UAAUc,EAAS,YAAc,EAAE,GAC9C,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,cAAY,OAEZ,SAAAd,EAAC,QAAK,EAAE,kBAAkB,OAA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AAwBuB,EAAsB,IAd3E,GAAGE,EAAmB,KAAK,IAAIL,CAAK,EAgB9C,CAEJ,CAAC,EAED7B,EAAAF,EAAA,CACG,kBAAQ,QAAQwB,CAAuB,EAAE,OAAS,GACjDvB,EAACS,EAAA,CAA+B,uBAAwBc,EAAyB,EAEnFvB,EAACU,EAAA,CAAkC,uBAAwBa,EAAyB,GACtF,EAEJ,EAEJ,QACE,OAAO,IACX,CACF,EAAG,CACDL,EACAF,EACAC,EACAQ,EACAE,EACAP,EACAG,EACAQ,EACAT,CACF,CAAC,CAGH",
6
+ "names": ["Fragment", "jsx", "jsxs", "useCallback", "useEffect", "useMemo", "useState", "Button", "HeaderNavigationMenu", "useNavContext", "ResourceSubSubCategoryItemComp", "ResourceSubSubCategoryContentComp", "MenuItem", "label", "onClick", "active", "MobileResourceSidebarMenu", "resourceCategoriesMetadata", "resourcesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "onSidebarNavClick", "currentResourceMetadata", "setCurrentResourceMetadata", "expandedSubcategory", "setExpandedSubcategory", "expandedResourceCategories", "setExpandedResourceCategories", "_", "index", "handleSubSubCategoryClick", "item", "curResourcesMetadata", "resourceItem", "subSubCategoryItem", "prev", "i"]
7
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * 移动端侧边栏下拉
3
+ * @param sidebarCategoriesMetadata 侧边栏分类元数据
4
+ * @param seriesMetadata 侧边栏系列元数据
5
+ */
6
+ export declare const MobileSidebarMenu: ({ sidebarCategoriesMetadata, seriesMetadata, }: {
7
+ sidebarCategoriesMetadata: any;
8
+ seriesMetadata: any;
9
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import{Fragment as D,jsx as a,jsxs as c}from"react/jsx-runtime";import{useCallback as R,useEffect as w,useMemo as k,useState as L}from"react";import{Button as p,Text as $,Link as M}from"../../components/index.js";import{HeaderNavigationMenu as S}from"./types.js";import{useNavContext as T}from"./NavProvider.js";import{MenuItem as F,SubSubCategoryItemComp as B,SubSubCategoryContentComp as z}from"./MobileMenuComponents.js";const O=({sidebarCategoriesMetadata:n,seriesMetadata:s})=>{const{currentMenu:v,setCurrentMenu:d,subSubCategory:u,setSubSubCategory:h,setCurrentSeriesMetadata:m,currentSeriesMetadata:o,buildProps:b,onSidebarNavClick:y}=T(),[x,_]=L([]),[f,C]=L([]);w(()=>{n?.subcategories?.length&&_(n?.subcategories?.map((e,l)=>({index:l,open:!1})))},[n]),w(()=>{u?.subSubCategories?.length&&C(u?.subSubCategories?.map((e,l)=>({index:l,open:l===0})))},[u]);const N=R((e,l)=>{d&&d(S.Third),h?.(e);const r=s?.find(t=>l!==void 0?e?.subSubCategories?.[l]?.label?.toLowerCase()===t.label?.toLowerCase():e?.label?.toLowerCase()===t.label?.toLowerCase())||{};if(e?.collections){const t=b?.categories?.[e?.collections]||{};m?.({label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,guide:r?.guide,series:[{products:t?.products}]})}else m?.(r)},[s,d,h,m,b?.categories]),K=k(()=>s?.find(e=>!!e?.guide)?.guide,[s]);return k(()=>{switch(v){case S.Secondary:return c("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[a("div",{children:n?.subcategories?.map((e,l)=>a("div",{children:a(F,{label:e?.label,active:x.find(r=>r.index===l)?.open,onClick:()=>{N(e),y?.(e,l)}})},`${e.label}-${l}`))}),c("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[n?.primary&&a(p,{as:"a",href:`${n?.primary?.url}?ref=${n?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:n?.primary?.label}),n?.secondary&&a(p,{as:"a",href:n?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:n?.secondary?.label})]})]});case S.Third:return a("div",{className:"tablet:px-8 laptop:px-16 p-4",children:u?.subSubCategories?u?.subSubCategories?.map((e,l)=>{const r=s?.find(i=>i.label.toLowerCase()===e?.label?.toLowerCase())||{};let t={};if(e?.collections){const i=b?.categories?.[e?.collections]||{};t={label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,guide:r?.guide,series:[{products:i?.products}]}}else t=r;return c("div",{children:[Reflect.ownKeys(e).length>0&&a(B,{matchSeriesMetadata:t,onSubSubCategoryItemClick:()=>{y?.(e,l),C(i=>i.map((g,E)=>({...g,open:E===l?!g.open:g.open})))},expanded:!!f?.find(i=>i.index===l)?.open}),f?.find(i=>i.index===l)?.open&&c(D,{children:[a(z,{matchSeriesMetadata:t}),t?.primary&&a("div",{className:"my-4 text-center",children:a(p,{as:"a",href:t?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:t?.primary?.label})})]}),t?.guide?.label&&a(M,{href:t?.guide?.url,children:a("div",{className:"mt-4",children:a($,{html:t?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]},`${e.label}-${l}`)}):c(D,{children:[Reflect.ownKeys(o).length>0&&a(B,{matchSeriesMetadata:o}),a(z,{matchSeriesMetadata:o}),o?.primary&&a("div",{className:"my-4 text-center ",children:a(p,{as:"a",href:`${o?.primary?.url}?ref=${o?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:o?.primary?.label})}),o?.guide?.label&&a(M,{href:o?.guide?.url,children:a("div",{className:"mt-4",children:a($,{html:o?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]})});default:return null}},[v,n,s,x,f,u,o,b?.categories,N,y])};export{O as MobileSidebarMenu};
2
+ //# sourceMappingURL=MobileSidebarMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MobileSidebarMenu.tsx"],
4
+ "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { Button, Text, Link } from '../../components/index.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport { useNavContext } from './NavProvider.js'\nimport { MenuItem, SubSubCategoryItemComp, SubSubCategoryContentComp } from './MobileMenuComponents.js'\n\n/**\n * \u79FB\u52A8\u7AEF\u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param sidebarCategoriesMetadata \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n * @param seriesMetadata \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n */\nexport const MobileSidebarMenu = ({\n sidebarCategoriesMetadata,\n seriesMetadata,\n}: {\n sidebarCategoriesMetadata: any\n seriesMetadata: any\n}) => {\n const {\n currentMenu,\n setCurrentMenu,\n subSubCategory,\n setSubSubCategory,\n setCurrentSeriesMetadata,\n currentSeriesMetadata,\n buildProps,\n onSidebarNavClick,\n } = useNavContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [expandedSeriesCategories, setExpandedSeriesCategories] = useState<{ index: number; open: boolean }[]>([])\n\n useEffect(() => {\n if (sidebarCategoriesMetadata?.subcategories?.length) {\n setExpandedSubcategory(\n sidebarCategoriesMetadata?.subcategories?.map((_: any, index: number) => ({\n index,\n open: false,\n }))\n )\n }\n }, [sidebarCategoriesMetadata])\n\n useEffect(() => {\n if (subSubCategory?.subSubCategories?.length) {\n setExpandedSeriesCategories(\n subSubCategory?.subSubCategories?.map((_: any, index: number) => ({\n index,\n open: index === 0,\n }))\n )\n }\n }, [subSubCategory])\n\n const handleSubSubCategoryClick = useCallback(\n (item: any, subIndex?: number) => {\n setCurrentMenu && setCurrentMenu(HeaderNavigationMenu.Third)\n setSubSubCategory?.(item)\n const curSeriesMetadata =\n seriesMetadata?.find((seriesItem: any) =>\n subIndex !== undefined\n ? item?.subSubCategories?.[subIndex]?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n : item?.label?.toLowerCase() === seriesItem.label?.toLowerCase()\n ) || {}\n // \u901A\u8FC7categoriesMetadata\u7684subSubCategories\u7684label\u4E0Eseries\u7684label\u5339\u914D\n if (item?.collections) {\n const category = buildProps?.categories?.[item?.collections] || {}\n setCurrentSeriesMetadata?.({\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n guide: curSeriesMetadata?.guide,\n series: [\n {\n products: category?.products,\n },\n ],\n })\n } else {\n setCurrentSeriesMetadata?.(curSeriesMetadata)\n }\n },\n [seriesMetadata, setCurrentMenu, setSubSubCategory, setCurrentSeriesMetadata, buildProps?.categories]\n )\n\n const defaultGuide = useMemo(() => {\n return seriesMetadata?.find((item: any) => !!item?.guide)?.guide\n }, [seriesMetadata])\n\n const MobileSidebarMenuComp = useMemo(() => {\n switch (currentMenu) {\n case HeaderNavigationMenu.Secondary:\n return (\n // \u4E8C\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4\">\n <div>\n {sidebarCategoriesMetadata?.subcategories?.map((item: any, index: number) => {\n return (\n <div key={`${item.label}-${index}`}>\n <MenuItem\n label={item?.label}\n active={expandedSubcategory.find(item => item.index === index)?.open}\n onClick={() => {\n handleSubSubCategoryClick(item)\n onSidebarNavClick?.(item, index)\n }}\n />\n </div>\n )\n })}\n </div>\n <div className=\"tablet:items-start flex flex-col items-center gap-4\">\n {sidebarCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${sidebarCategoriesMetadata?.primary?.url}?ref=${sidebarCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"tablet:w-auto w-full text-base\"\n >\n {sidebarCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {sidebarCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={sidebarCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n className=\"tablet:w-auto tablet:px-0 w-full py-0 text-base\"\n >\n {sidebarCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )\n case HeaderNavigationMenu.Third:\n return (\n // \u4E09\u7EA7\u83DC\u5355\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {subSubCategory?.subSubCategories ? (\n subSubCategory?.subSubCategories?.map((subSubCategoryItem: any, index: number) => {\n const curSeriesMetadata =\n seriesMetadata?.find(\n (item: any) => item.label.toLowerCase() === subSubCategoryItem?.label?.toLowerCase()\n ) || {}\n let matchSeriesMetadata = {} as any\n if (subSubCategoryItem?.collections) {\n const category = buildProps?.categories?.[subSubCategoryItem?.collections] || {}\n matchSeriesMetadata = {\n label: curSeriesMetadata?.label,\n isCollection: true,\n banner: curSeriesMetadata?.banner,\n primary: curSeriesMetadata?.primary,\n guide: curSeriesMetadata?.guide,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n matchSeriesMetadata = curSeriesMetadata\n }\n return (\n <div key={`${subSubCategoryItem.label}-${index}`}>\n {Reflect.ownKeys(subSubCategoryItem).length > 0 && (\n <SubSubCategoryItemComp\n matchSeriesMetadata={matchSeriesMetadata}\n onSubSubCategoryItemClick={() => {\n onSidebarNavClick?.(subSubCategoryItem, index)\n setExpandedSeriesCategories(prev =>\n prev.map((item, i) => ({ ...item, open: i === index ? !item.open : item.open }))\n )\n }}\n expanded={!!expandedSeriesCategories?.find(item => item.index === index)?.open}\n />\n )}\n {expandedSeriesCategories?.find(item => item.index === index)?.open && (\n <>\n <SubSubCategoryContentComp matchSeriesMetadata={matchSeriesMetadata} />\n {matchSeriesMetadata?.primary && (\n <div className=\"my-4 text-center\">\n <Button\n as=\"a\"\n href={matchSeriesMetadata?.primary?.url}\n className=\"text-base leading-[1.2] no-underline\"\n variant=\"secondary\"\n size=\"base\"\n >\n {matchSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n </>\n )}\n {matchSeriesMetadata?.guide?.label && (\n <Link href={matchSeriesMetadata?.guide?.url}>\n <div className=\"mt-4\">\n <Text\n html={matchSeriesMetadata?.guide?.label}\n className=\"text-sm font-bold leading-[1.2] text-[#6D6D6F]\"\n />\n </div>\n </Link>\n )}\n </div>\n )\n })\n ) : (\n <>\n {Reflect.ownKeys(currentSeriesMetadata).length > 0 && (\n <SubSubCategoryItemComp matchSeriesMetadata={currentSeriesMetadata} />\n )}\n <SubSubCategoryContentComp matchSeriesMetadata={currentSeriesMetadata} />\n {currentSeriesMetadata?.primary && (\n <div className=\"my-4 text-center \">\n <Button\n as=\"a\"\n href={`${currentSeriesMetadata?.primary?.url}?ref=${currentSeriesMetadata?.label}_viewmore`}\n variant=\"secondary\"\n size=\"base\"\n className=\"text-base leading-[1.2] no-underline\"\n >\n {currentSeriesMetadata?.primary?.label}\n </Button>\n </div>\n )}\n {currentSeriesMetadata?.guide?.label && (\n <Link href={currentSeriesMetadata?.guide?.url}>\n <div className=\"mt-4\">\n <Text\n html={currentSeriesMetadata?.guide?.label}\n className=\"text-sm font-bold leading-[1.2] text-[#6D6D6F]\"\n />\n </div>\n </Link>\n )}\n </>\n )}\n </div>\n )\n default:\n return null\n }\n }, [\n currentMenu,\n sidebarCategoriesMetadata,\n seriesMetadata,\n expandedSubcategory,\n expandedSeriesCategories,\n subSubCategory,\n currentSeriesMetadata,\n buildProps?.categories,\n handleSubSubCategoryClick,\n onSidebarNavClick,\n ])\n\n return MobileSidebarMenuComp\n}\n"],
5
+ "mappings": "AAmGoB,OAiFE,YAAAA,EAjFF,OAAAC,EAYR,QAAAC,MAZQ,oBAnGpB,OAAgB,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QACjE,OAAS,UAAAC,EAAQ,QAAAC,EAAM,QAAAC,MAAY,4BACnC,OAAS,wBAAAC,MAA4B,aACrC,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,YAAAC,EAAU,0BAAAC,EAAwB,6BAAAC,MAAiC,4BAOrE,MAAMC,EAAoB,CAAC,CAChC,0BAAAC,EACA,eAAAC,CACF,IAGM,CACJ,KAAM,CACJ,YAAAC,EACA,eAAAC,E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AuB,EACtEA,GAAuB,SACtBtB,EAAC,OAAI,UAAU,oBACb,SAAAA,EAACM,EAAA,CACC,GAAG,IACH,KAAM,GAAGgB,GAAuB,SAAS,GAAG,QAAQA,GAAuB,KAAK,YAChF,QAAQ,YACR,KAAK,OACL,UAAU,uCAET,SAAAA,GAAuB,SAAS,MACnC,EACF,EAEDA,GAAuB,OAAO,OAC7BtB,EAACQ,EAAA,CAAK,KAAMc,GAAuB,OAAO,IACxC,SAAAtB,EAAC,OAAI,UAAU,OACb,SAAAA,EAACO,EAAA,CACC,KAAMe,GAAuB,OAAO,MACpC,UAAU,iDACZ,EACF,EACF,GAEJ,EAEJ,EAEJ,QACE,OAAO,IACX,CACF,EAAG,CACDL,EACAF,EACAC,EACAS,EACAE,EACAR,EACAG,EACAC,GAAY,WACZQ,EACAP,CACF,CAAC,CAGH",
6
+ "names": ["Fragment", "jsx", "jsxs", "useCallback", "useEffect", "useMemo", "useState", "Button", "Text", "Link", "HeaderNavigationMenu", "useNavContext", "MenuItem", "SubSubCategoryItemComp", "SubSubCategoryContentComp", "MobileSidebarMenu", "sidebarCategoriesMetadata", "seriesMetadata", "currentMenu", "setCurrentMenu", "subSubCategory", "setSubSubCategory", "setCurrentSeriesMetadata", "currentSeriesMetadata", "buildProps", "onSidebarNavClick", "expandedSubcategory", "setExpandedSubcategory", "expandedSeriesCategories", "setExpandedSeriesCategories", "_", "index", "handleSubSubCategoryClick", "item", "subIndex", "curSeriesMetadata", "seriesItem", "category", "defaultGuide", "subSubCategoryItem", "matchSeriesMetadata", "prev", "i"]
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 移动端support菜单
3
+ * @param supportsMetadata support菜单元数据
4
+ */
5
+ export declare const MobileSupportMenu: ({ supportsMetadata }: {
6
+ supportsMetadata: any;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{jsx as e}from"react/jsx-runtime";import"react";import{MenuItem as o}from"./MobileMenuComponents.js";const i=({supportsMetadata:l})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:l?.map(a=>e(o,{href:a.url,label:a.label,onClick:()=>{}},a.id))});export{i as MobileSupportMenu};
2
+ //# sourceMappingURL=MobileSupportMenu.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MobileSupportMenu.tsx"],
4
+ "sourcesContent": ["import React from 'react'\nimport { MenuItem } from './MobileMenuComponents.js'\n\n/**\n * \u79FB\u52A8\u7AEFsupport\u83DC\u5355\n * @param supportsMetadata support\u83DC\u5355\u5143\u6570\u636E\n */\nexport const MobileSupportMenu = ({ supportsMetadata }: { supportsMetadata: any }) => {\n return (\n <div className=\"tablet:px-8 laptop:px-16 p-4\">\n {supportsMetadata?.map((supportItem: any) => (\n <MenuItem key={supportItem.id} href={supportItem.url} label={supportItem.label} onClick={() => {}} />\n ))}\n </div>\n )\n}\n"],
5
+ "mappings": "AAWQ,cAAAA,MAAA,oBAXR,MAAkB,QAClB,OAAS,YAAAC,MAAgB,4BAMlB,MAAMC,EAAoB,CAAC,CAAE,iBAAAC,CAAiB,IAEjDH,EAAC,OAAI,UAAU,+BACZ,SAAAG,GAAkB,IAAKC,GACtBJ,EAACC,EAAA,CAA8B,KAAMG,EAAY,IAAK,MAAOA,EAAY,MAAO,QAAS,IAAM,CAAC,GAAjFA,EAAY,EAAwE,CACpG,EACH",
6
+ "names": ["jsx", "MenuItem", "MobileSupportMenu", "supportsMetadata", "supportItem"]
7
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 多列下拉
3
+ * @param categoriesItem 分类项
4
+ */
5
+ export declare const MulticolDropdown: ({ multicolMetadata }: {
6
+ multicolMetadata: any;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * 多列下拉项
10
+ * @param item 多列下拉项
11
+ */
12
+ export declare const MulticolItem: ({ item, allPicture }: {
13
+ item: any;
14
+ allPicture?: boolean;
15
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import{Fragment as d,jsx as e,jsxs as t}from"react/jsx-runtime";import{useRef as x}from"react";import{Container as p,Text as o,Link as n,Picture as m,Button as c}from"../../components/index.js";import{cn as r}from"../../helpers/utils.js";const g=({multicolMetadata:l})=>{const s=x(null);return e("div",{ref:s,children:e(p,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:l?.map((a,i)=>e("div",{className:"w-1/4",children:e(b,{item:a})},`multicolItem-${a?.label}-${i}`))})})})},b=({item:l,allPicture:s})=>t(d,{children:[l?.columns&&t(d,{children:[e(o,{html:l.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:l.columns?.map(a=>t("div",{className:"flex items-center gap-1 py-2",children:[e(n,{href:`${a.url}?ref=navMenu`,asChild:!a.url,className:"text-sm font-bold leading-[1.4] no-underline",children:a.label}),a?.badge&&e(o,{as:"p",html:a?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},a.label))})]}),l?.imageUrl&&e("div",{className:r("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":s}),children:t(n,{href:`${l.url}?ref=navMenu`,asChild:!l.url,children:[e(m,{source:l.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),t("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(o,{html:l.title,className:r("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":l?.theme==="dark"})}),l.subtitle&&e(o,{html:l.subtitle,className:r("text-sm font-bold leading-[1.4] text-white",{"text-black":l?.theme==="dark"})}),l?.primary?.label&&e(c,{as:"a",href:l?.primary?.url,variant:"link",size:"lg",className:r("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":l?.theme==="dark"}),children:l?.primary?.label||"more"})]})]})})]});export{g as MulticolDropdown,b as MulticolItem};
2
+ //# sourceMappingURL=MulticolDropdown.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/HeaderNavigation/MulticolDropdown.tsx"],
4
+ "sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({ multicolMetadata }: { multicolMetadata: any }) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef}>\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"flex gap-4 py-4\">\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`} className=\"w-1/4\">\n <MulticolItem item={item} />\n </div>\n ))}\n </div>\n </Container>\n </div>\n )\n}\n\n/**\n * \u591A\u5217\u4E0B\u62C9\u9879\n * @param item \u591A\u5217\u4E0B\u62C9\u9879\n */\nexport const MulticolItem = ({ item, allPicture }: { item: any; allPicture?: boolean }) => {\n return (\n <>\n {item?.columns && (\n <>\n <Text html={item.label} as=\"div\" className=\"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2 flex flex-col\">\n {item.columns?.map((columnItem: any) => (\n <div key={columnItem.label} className=\"flex items-center gap-1 py-2\">\n <Link\n href={`${columnItem.url}?ref=navMenu`}\n asChild={!columnItem.url}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {columnItem.label}\n </Link>\n {columnItem?.badge && (\n <Text\n as=\"p\"\n html={columnItem?.badge || 'badge'}\n className=\"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {item?.imageUrl && (\n <div\n className={cn(\n 'laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden',\n {\n ['tablet:max-w-none laptop:max-w-none']: allPicture,\n }\n )}\n >\n <Link href={`${item.url}?ref=navMenu`} asChild={!item.url}>\n <Picture\n source={item.imageUrl}\n width={404}\n height={280}\n className=\"size-full\"\n imgClassName=\"object-cover h-full hover:scale-105 transition-all duration-300\"\n />\n <div className=\"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline\">\n <Text\n html={item.title}\n className={cn('lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n {item.subtitle && (\n <Text\n html={item.subtitle}\n className={cn('text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n )}\n {item?.primary?.label && (\n <Button\n as=\"a\"\n href={item?.primary?.url}\n variant=\"link\"\n size=\"lg\"\n className={cn('mr-auto !p-0 text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n >\n {item?.primary?.label || 'more'}\n </Button>\n )}\n </div>\n </Link>\n </div>\n )}\n </>\n )\n}\n"],
5
+ "mappings": "AAiBc,OAiBN,YAAAA,EAjBM,OAAAC,EAqBA,QAAAC,MArBA,oBAjBd,OAAgB,UAAAC,MAAc,QAC9B,OAAS,aAAAC,EAAW,QAAAC,EAAM,QAAAC,EAAM,WAAAC,EAAS,UAAAC,MAAc,4BACvD,OAAS,MAAAC,MAAU,yBAMZ,MAAMC,EAAmB,CAAC,CAAE,iBAAAC,CAAiB,IAAiC,CACnF,MAAMC,EAAsBT,EAAuB,IAAI,EAEvD,OACEF,EAAC,OAAI,IAAKW,EACR,SAAAX,EA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CAA8C,CAC1D,aAAcI,GAAM,QAAU,MAChC,CAAC,EACH,EAEDA,GAAM,SAAS,OACdZ,EAACO,EAAA,CACC,GAAG,IACH,KAAMK,GAAM,SAAS,IACrB,QAAQ,OACR,KAAK,KACL,UAAWJ,EAAG,0DAA2D,CACvE,aAAcI,GAAM,QAAU,MAChC,CAAC,EAEA,SAAAA,GAAM,SAAS,OAAS,OAC3B,GAEJ,GACF,EACF,GAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "useRef", "Container", "Text", "Link", "Picture", "Button", "cn", "MulticolDropdown", "multicolMetadata", "multicolDropdownRef", "item", "index", "MulticolItem", "allPicture", "columnItem"]
7
+ }
@@ -25,6 +25,8 @@ interface NavContextType {
25
25
  setCurrentSeriesMetadata?: (_metadata: any) => void;
26
26
  subSubCategory?: any;
27
27
  setSubSubCategory?: (_category: any) => void;
28
+ currentResourceMetadata?: any;
29
+ setCurrentResourceMetadata?: (_metadata: any) => void;
28
30
  onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void;
29
31
  onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void;
30
32
  }
@@ -1,2 +1,2 @@
1
- import{jsx as T}from"react/jsx-runtime";import{createContext as S,useCallback as o,useContext as d,useMemo as p,useReducer as _}from"react";import{HeaderNavigationMenu as v}from"./types.js";const y={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:v.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{},onSeriesProductClick:(e,t,n)=>{},onSidebarNavClick:e=>{},cartCount:0},i=S(y),R=()=>{if(!d(i))throw new Error("useNavContext must be used in <NavProvider>");return d(i)},l=(e,t)=>{switch(t.type){case"SET_CURRENT_MENU":return{...e,currentMenu:t.value};case"SET_CURRENT_SERIES_METADATA":return{...e,currentSeriesMetadata:t.value};case"SET_SUB_SUB_CATEGORY":return{...e,subSubCategory:t.value}}},E=({children:e,...t})=>{const[n,r]=_(l,{...y,currentMenu:v.Primary,setCurrentMenu:()=>{}}),u=o(a=>r({type:"SET_CURRENT_MENU",value:a}),[r]),s=o(a=>r({type:"SET_CURRENT_SERIES_METADATA",value:a}),[r]),c=o(a=>r({type:"SET_SUB_SUB_CATEGORY",value:a}),[r]),C=p(()=>({...n,setCurrentMenu:u,setCurrentSeriesMetadata:s,setSubSubCategory:c}),[u,s,c,n]);return T(i.Provider,{value:{...C,...t},children:e})};var m=E;export{i as NavContext,m as default,R as useNavContext};
1
+ import{jsx as M}from"react/jsx-runtime";import{createContext as E,useCallback as n,useContext as C,useMemo as S,useReducer as R}from"react";import{HeaderNavigationMenu as _}from"./types.js";const v={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:_.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{},currentResourceMetadata:{},setCurrentResourceMetadata:()=>{},onSeriesProductClick:(e,t,o)=>{},onSidebarNavClick:e=>{},cartCount:0},u=E(v),A=()=>{if(!C(u))throw new Error("useNavContext must be used in <NavProvider>");return C(u)},T=(e,t)=>{switch(t.type){case"SET_CURRENT_MENU":return{...e,currentMenu:t.value};case"SET_CURRENT_SERIES_METADATA":return{...e,currentSeriesMetadata:t.value};case"SET_SUB_SUB_CATEGORY":return{...e,subSubCategory:t.value};case"SET_CURRENT_RESOURCE_METADATA":return{...e,currentResourceMetadata:t.value}}},p=({children:e,...t})=>{const[o,r]=R(T,{...v,currentMenu:_.Primary,setCurrentMenu:()=>{}}),s=n(a=>r({type:"SET_CURRENT_MENU",value:a}),[r]),i=n(a=>r({type:"SET_CURRENT_SERIES_METADATA",value:a}),[r]),c=n(a=>r({type:"SET_SUB_SUB_CATEGORY",value:a}),[r]),d=n(a=>r({type:"SET_CURRENT_RESOURCE_METADATA",value:a}),[r]),y=S(()=>({...o,setCurrentMenu:s,setCurrentSeriesMetadata:i,setSubSubCategory:c,setCurrentResourceMetadata:d}),[s,i,c,d,o]);return M(u.Provider,{value:{...y,...t},children:e})};var U=p;export{u as NavContext,U as default,A as useNavContext};
2
2
  //# sourceMappingURL=NavProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/NavProvider.tsx"],
4
- "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (_menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (_category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void // \u8BBE\u7F6E\u7CFB\u5217\u4EA7\u54C1\u70B9\u51FB\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void // \u8BBE\u7F6E\u4FA7\u8FB9\u680F\u5BFC\u822A\u70B9\u51FB\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n onSeriesProductClick: (_seriesProduct: any, _position: number, _seriesLabel?: string) => {},\n onSidebarNavClick: (_series: any) => {},\n cartCount: 0,\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n },\n [dispatch]\n )\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
- "mappings": "AAyIS,cAAAA,MAAA,oBAzIT,OAAgB,iBAAAC,EAAe,eAAAC,EAAa,cAAAC,EAAY,WAAAC,EAAS,cAAAC,MAAkB,QAEnF,OAAS,wBAAAC,MAA4B,aA8BrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,sBAAuB,CAAC,EACxB,yBAA0B,IAAM,CAAC,EACjC,qBAAsB,CAACE,EAAqBC,EAAmBC,IAA0B,CAAC,EAC1F,kBAAoBC,GAAiB,CAAC,EACtC,UAAW,CACb,EAeaC,EAAaX,EAA8BM,CAAY,EAEvDM,EAAgB,IAAM,CAEjC,GAAI,CADYV,EAAWS,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,OAAOT,EAAWS,CAAU,CAC9B,EAEME,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,8BACH,MAAO,CACL,GAAGD,EACH,sBAAuBC,EAAO,KAChC,EAEF,IAAK,uBACH,MAAO,CACL,GAAGD,EACH,eAAgBC,EAAO,KACzB,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,EAAIf,EAAWS,EAAS,CAC5C,GAAGP,EACH,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKe,EAAiBnB,EACpBoB,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,EAA2BrB,EAC9BoB,GACQF,EAAS,CAAE,KAAM,8BAA+B,MAAAE,CAAM,CAAC,EAEhE,CAACF,CAAQ,CACX,EAEMI,EAAoBtB,EACvBoB,GACQF,EAAS,CAAE,KAAM,uBAAwB,MAAAE,CAAM,CAAC,EAEzD,CAACF,CAAQ,CACX,EAEME,EAAQlB,EACZ,KAAO,CACL,GAAGW,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,CACF,GACA,CAACH,EAAgBE,EAA0BC,EAAmBT,CAAK,CACrE,EAEA,OAAOf,EAACY,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGU,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOO,EAAQR",
6
- "names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "_seriesProduct", "_position", "_seriesLabel", "_series", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setCurrentSeriesMetadata", "setSubSubCategory", "NavProvider_default"]
4
+ "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (_menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (_category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n currentResourceMetadata?: any // \u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n setCurrentResourceMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void // \u8BBE\u7F6E\u7CFB\u5217\u4EA7\u54C1\u70B9\u51FB\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void // \u8BBE\u7F6E\u4FA7\u8FB9\u680F\u5BFC\u822A\u70B9\u51FB\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n currentResourceMetadata: {},\n setCurrentResourceMetadata: () => {},\n onSeriesProductClick: (_seriesProduct: any, _position: number, _seriesLabel?: string) => {},\n onSidebarNavClick: (_series: any) => {},\n cartCount: 0,\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\n | {\n type: 'SET_CURRENT_RESOURCE_METADATA'\n value: any\n }\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n case 'SET_CURRENT_RESOURCE_METADATA': {\n return {\n ...state,\n currentResourceMetadata: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n },\n [dispatch]\n )\n\n const setCurrentResourceMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_RESOURCE_METADATA', value })\n },\n [dispatch]\n )\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n setCurrentResourceMetadata,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, setCurrentResourceMetadata, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
+ "mappings": "AA+JS,cAAAA,MAAA,oBA/JT,OAAgB,iBAAAC,EAAe,eAAAC,EAAa,cAAAC,EAAY,WAAAC,EAAS,cAAAC,MAAkB,QAEnF,OAAS,wBAAAC,MAA4B,aAgCrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YA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KAAM,gCAAiC,MAAAE,CAAM,CAAC,EAElE,CAACF,CAAQ,CACX,EAEME,EAAQlB,EACZ,KAAO,CACL,GAAGW,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,EACA,2BAAAC,CACF,GACA,CAACJ,EAAgBE,EAA0BC,EAAmBC,EAA4BV,CAAK,CACjG,EAEA,OAAOf,EAACY,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGU,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOQ,EAAQT",
6
+ "names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "_seriesProduct", "_position", "_seriesLabel", "_series", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setCurrentSeriesMetadata", "setSubSubCategory", "setCurrentResourceMetadata", "NavProvider_default"]
7
7
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 资源位项组件 - 桌面端
3
+ */
4
+ export declare const ResourceItem: ({ resource }: {
5
+ resource: any;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ /**
8
+ * 资源位子分类标题组件 - 移动端
9
+ */
10
+ export declare const ResourceSubSubCategoryItemComp: ({ matchResourcesMetadata, onSubSubCategoryItemClick, expanded, }: {
11
+ matchResourcesMetadata: any;
12
+ onSubSubCategoryItemClick?: () => void;
13
+ expanded?: boolean;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ /**
16
+ * 资源位子分类内容组件 - 移动端
17
+ */
18
+ export declare const ResourceSubSubCategoryContentComp: ({ matchResourcesMetadata }: {
19
+ matchResourcesMetadata: any;
20
+ }) => import("react/jsx-runtime").JSX.Element;