@anker-in/headless-ui 1.1.60 → 1.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/index.d.ts +9 -0
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/index.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/types.d.ts +27 -0
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/types.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/CompanyStatsBanner/types.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.d.ts +3 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MobileMulticolMenu.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.d.ts +3 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/index.d.ts +9 -0
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/index.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/index.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/types.d.ts +27 -0
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/types.js +1 -0
- package/dist/esm/biz-components/HeaderNavigation/CompanyStatsBanner/types.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.d.ts +3 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MobileMulticolMenu.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.d.ts +3 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CompanyStatsBannerProps, StatItem } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* 公司统计横幅组件
|
|
5
|
+
* 用于展示公司 Logo、标语和关键统计数据
|
|
6
|
+
*/
|
|
7
|
+
declare const CompanyStatsBanner: React.ForwardRefExoticComponent<CompanyStatsBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default CompanyStatsBanner;
|
|
9
|
+
export type { CompanyStatsBannerProps, StatItem };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var k=Object.create;var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var l in e)i(t,l,{get:e[l],enumerable:!0})},x=(t,e,l,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of h(e))!w.call(t,s)&&s!==l&&i(t,s,{get:()=>e[s],enumerable:!(r=g(e,s))||r.enumerable});return t};var y=(t,e,l)=>(l=t!=null?k(v(t)):{},x(e||!t||!t.__esModule?i(l,"default",{value:t,enumerable:!0}):l,t)),N=t=>x(i({},"__esModule",{value:!0}),t);var B={};u(B,{default:()=>S});module.exports=N(B);var a=require("react/jsx-runtime"),c=y(require("react")),d=require("../../../components/index.js"),o=require("../../../helpers/index.js");const C=({stat:t,theme:e,isLast:l})=>(0,a.jsxs)("div",{className:(0,o.cn)("tablet:after:hidden relative flex flex-col gap-1 after:absolute after:bottom-1 after:right-0 after:h-[calc(100%-8px)] after:w-px after:bg-[#3A3C40] after:content-['']",{"after:hidden":l}),children:[(0,a.jsx)(d.Text,{as:"div",html:t.value,className:(0,o.cn)("desktop:text-[32px] tablet:text-[24px] text-[14px] leading-[1.2]",{"text-white":e!=="dark","text-black":e==="dark"})}),(0,a.jsx)(d.Text,{as:"p",html:t.label,className:(0,o.cn)("desktop:text-base text-balance text-sm font-bold leading-[1.4] tracking-[-0.28px]",{"text-white":e!=="dark","text-black":e==="dark"})})]}),b=c.default.forwardRef(({data:t,className:e},l)=>{const{logo:r,tagline:s,stats:n=[],theme:p="dark"}=t;return(0,a.jsx)("div",{ref:l,"data-ui-component-id":"CompanyStatsBanner",className:(0,o.cn)("desktop:h-[200px] lg-desktop:h-[240px] relative flex w-full items-center justify-between overflow-hidden","p-4","tablet:p-6","desktop:px-16 desktop:py-8","lg-desktop:px-32",{"bg-black":p!=="dark","bg-white":p==="dark"},e),children:(0,a.jsxs)("div",{className:(0,o.cn)("relative z-10 flex w-full flex-col gap-4","desktop:flex-row desktop:items-center desktop:justify-between"),children:[(0,a.jsxs)("div",{className:"tablet:flex-row tablet:gap-4 flex shrink-0 flex-col items-start gap-2",children:[r?.url&&(0,a.jsx)(d.Picture,{source:r.url,alt:r.alt||"Company Logo",className:"tablet:h-10 h-9 w-auto",imgClassName:"h-full w-auto object-contain"}),r?.url&&s&&(0,a.jsx)("div",{className:(0,o.cn)("tablet:block tablet:h-10 hidden h-8 w-px",{"bg-white":p!=="dark","bg-black":p==="dark"})}),s&&(0,a.jsx)(d.Text,{as:"p",html:s,className:(0,o.cn)("text-sm font-bold leading-[1.4]","tablet:max-w-[320px] tablet:text-base",{"text-white":p!=="dark","text-black":p==="dark"})})]}),n.length>0&&(0,a.jsx)("div",{className:(0,o.cn)("tablet:flex grid grid-cols-3 gap-4","tablet:flex-nowrap tablet:gap-10 desktop:gap-[50px]"),children:n.map((f,m)=>(0,a.jsx)("div",{children:(0,a.jsx)(C,{stat:f,theme:p,isLast:m===n.length-1})},`stat-${m}`))})]})})});b.displayName="CompanyStatsBanner";var S=b;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/HeaderNavigation/CompanyStatsBanner/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport { Text, Picture } from '../../../components/index.js'\nimport { cn } from '../../../helpers/index.js'\nimport type { CompanyStatsBannerProps, StatItem } from './types.js'\n\n/**\n * \u7EDF\u8BA1\u9879\u7EC4\u4EF6\n */\nconst StatItemComp = ({ stat, theme, isLast }: { stat: StatItem; theme?: 'light' | 'dark'; isLast?: boolean }) => {\n return (\n <div\n className={cn(\n \"tablet:after:hidden relative flex flex-col gap-1 after:absolute after:bottom-1 after:right-0 after:h-[calc(100%-8px)] after:w-px after:bg-[#3A3C40] after:content-['']\",\n { 'after:hidden': isLast }\n )}\n >\n <Text\n as=\"div\"\n html={stat.value}\n className={cn('desktop:text-[32px] tablet:text-[24px] text-[14px] leading-[1.2]', {\n 'text-white': theme !== 'dark',\n 'text-black': theme === 'dark',\n })}\n />\n <Text\n as=\"p\"\n html={stat.label}\n className={cn('desktop:text-base text-balance text-sm font-bold leading-[1.4] tracking-[-0.28px]', {\n 'text-white': theme !== 'dark',\n 'text-black': theme === 'dark',\n })}\n />\n </div>\n )\n}\n\n/**\n * \u516C\u53F8\u7EDF\u8BA1\u6A2A\u5E45\u7EC4\u4EF6\n * \u7528\u4E8E\u5C55\u793A\u516C\u53F8 Logo\u3001\u6807\u8BED\u548C\u5173\u952E\u7EDF\u8BA1\u6570\u636E\n */\nconst CompanyStatsBanner = React.forwardRef<HTMLDivElement, CompanyStatsBannerProps>(({ data, className }, ref) => {\n const { logo, tagline, stats = [], theme = 'dark' } = data\n\n return (\n <div\n ref={ref}\n data-ui-component-id=\"CompanyStatsBanner\"\n className={cn(\n 'desktop:h-[200px] lg-desktop:h-[240px] relative flex w-full items-center justify-between overflow-hidden',\n 'p-4',\n 'tablet:p-6',\n 'desktop:px-16 desktop:py-8',\n 'lg-desktop:px-32',\n {\n 'bg-black': theme !== 'dark',\n 'bg-white': theme === 'dark',\n },\n className\n )}\n >\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div\n className={cn(\n 'relative z-10 flex w-full flex-col gap-4',\n 'desktop:flex-row desktop:items-center desktop:justify-between'\n )}\n >\n {/* \u5DE6\u4FA7: Logo + \u5206\u9694\u7EBF + \u6807\u8BED */}\n <div className=\"tablet:flex-row tablet:gap-4 flex shrink-0 flex-col items-start gap-2\">\n {logo?.url && (\n <Picture\n source={logo.url}\n alt={logo.alt || 'Company Logo'}\n className=\"tablet:h-10 h-9 w-auto\"\n imgClassName=\"h-full w-auto object-contain\"\n />\n )}\n {logo?.url && tagline && (\n <div\n className={cn('tablet:block tablet:h-10 hidden h-8 w-px', {\n 'bg-white': theme !== 'dark',\n 'bg-black': theme === 'dark',\n })}\n />\n )}\n {tagline && (\n <Text\n as=\"p\"\n html={tagline}\n className={cn('text-sm font-bold leading-[1.4]', 'tablet:max-w-[320px] tablet:text-base', {\n 'text-white': theme !== 'dark',\n 'text-black': theme === 'dark',\n })}\n />\n )}\n </div>\n\n {/* \u53F3\u4FA7: \u7EDF\u8BA1\u6570\u636E */}\n {stats.length > 0 && (\n <div\n className={cn('tablet:flex grid grid-cols-3 gap-4', 'tablet:flex-nowrap tablet:gap-10 desktop:gap-[50px]')}\n >\n {stats.map((stat, index) => (\n <div key={`stat-${index}`}>\n <StatItemComp stat={stat} theme={theme} isLast={index === stats.length - 1} />\n </div>\n ))}\n </div>\n )}\n </div>\n </div>\n )\n})\n\nCompanyStatsBanner.displayName = 'CompanyStatsBanner'\n\nexport default CompanyStatsBanner\nexport type { CompanyStatsBannerProps, StatItem }\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAUI,IAAAI,EAAA,6BAVJC,EAAkB,oBAClBC,EAA8B,wCAC9BC,EAAmB,qCAMnB,MAAMC,EAAe,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,OAAAC,CAAO,OAExC,QAAC,OACC,aAAW,MACT,yKACA,CAAE,eAAgBA,CAAO,CAC3B,EAEA,oBAAC,QACC,GAAG,MACH,KAAMF,EAAK,MACX,aAAW,MAAG,mEAAoE,CAChF,aAAcC,IAAU,OACxB,aAAcA,IAAU,MAC1B,CAAC,EACH,KACA,OAAC,QACC,GAAG,IACH,KAAMD,EAAK,MACX,aAAW,MAAG,oFAAqF,CACjG,aAAcC,IAAU,OACxB,aAAcA,IAAU,MAC1B,CAAC,EACH,GACF,EAQEE,EAAqB,EAAAC,QAAM,WAAoD,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACjH,KAAM,CAAE,KAAAC,EAAM,QAAAC,EAAS,MAAAC,EAAQ,CAAC,EAAG,MAAAT,EAAQ,MAAO,EAAII,EAEtD,SACE,OAAC,OACC,IAAKE,EACL,uBAAqB,qBACrB,aAAW,MACT,2GACA,MACA,aACA,6BACA,mBACA,CACE,WAAYN,IAAU,OACtB,WAAYA,IAAU,MACxB,EACAK,CACF,EAGA,oBAAC,OACC,aAAW,MACT,2CACA,+DACF,EAGA,qBAAC,OAAI,UAAU,wEACZ,UAAAE,GAAM,QACL,OAAC,WACC,OAAQA,EAAK,IACb,IAAKA,EAAK,KAAO,eACjB,UAAU,yBACV,aAAa,+BACf,EAEDA,GAAM,KAAOC,MACZ,OAAC,OACC,aAAW,MAAG,2CAA4C,CACxD,WAAYR,IAAU,OACtB,WAAYA,IAAU,MACxB,CAAC,EACH,EAEDQ,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,aAAW,MAAG,kCAAmC,wCAAyC,CACxF,aAAcR,IAAU,OACxB,aAAcA,IAAU,MAC1B,CAAC,EACH,GAEJ,EAGCS,EAAM,OAAS,MACd,OAAC,OACC,aAAW,MAAG,qCAAsC,qDAAqD,EAExG,SAAAA,EAAM,IAAI,CAACV,EAAMW,OAChB,OAAC,OACC,mBAACZ,EAAA,CAAa,KAAMC,EAAM,MAAOC,EAAO,OAAQU,IAAUD,EAAM,OAAS,EAAG,GADpE,QAAQC,CAAK,EAEvB,CACD,EACH,GAEJ,EACF,CAEJ,CAAC,EAEDR,EAAmB,YAAc,qBAEjC,IAAOV,EAAQU",
|
|
6
|
+
"names": ["CompanyStatsBanner_exports", "__export", "CompanyStatsBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_helpers", "StatItemComp", "stat", "theme", "isLast", "CompanyStatsBanner", "React", "data", "className", "ref", "logo", "tagline", "stats", "index"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Media, Theme } from '../../../types/props.js';
|
|
2
|
+
/**
|
|
3
|
+
* 统计项
|
|
4
|
+
*/
|
|
5
|
+
export interface StatItem {
|
|
6
|
+
/** 统计数值 (如: "146+", "47.75%", "5,000+") */
|
|
7
|
+
value: string;
|
|
8
|
+
/** 统计标签 (如: "Countries and Regions") */
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CompanyStatsBanner 组件属性
|
|
13
|
+
*/
|
|
14
|
+
export interface CompanyStatsBannerProps {
|
|
15
|
+
data: {
|
|
16
|
+
/** Logo 图片 */
|
|
17
|
+
logo?: Media;
|
|
18
|
+
/** 公司标语 */
|
|
19
|
+
tagline?: string;
|
|
20
|
+
/** 统计数据列表 */
|
|
21
|
+
stats?: StatItem[];
|
|
22
|
+
/** 主题 (light: 白色文字, dark: 黑色文字) */
|
|
23
|
+
theme?: Theme;
|
|
24
|
+
};
|
|
25
|
+
/** 自定义类名 */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var p=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of m(t))!o.call(e,a)&&a!==i&&s(e,a,{get:()=>t[a],enumerable:!(r=n(t,a))||r.enumerable});return e};var g=e=>p(s({},"__esModule",{value:!0}),e);var l={};module.exports=g(l);
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/HeaderNavigation/CompanyStatsBanner/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Media, Theme } from '../../../types/props.js'\n\n/**\n * \u7EDF\u8BA1\u9879\n */\nexport interface StatItem {\n /** \u7EDF\u8BA1\u6570\u503C (\u5982: \"146+\", \"47.75%\", \"5,000+\") */\n value: string\n /** \u7EDF\u8BA1\u6807\u7B7E (\u5982: \"Countries and Regions\") */\n label: string\n}\n\n/**\n * CompanyStatsBanner \u7EC4\u4EF6\u5C5E\u6027\n */\nexport interface CompanyStatsBannerProps {\n data: {\n /** Logo \u56FE\u7247 */\n logo?: Media\n /** \u516C\u53F8\u6807\u8BED */\n tagline?: string\n /** \u7EDF\u8BA1\u6570\u636E\u5217\u8868 */\n stats?: StatItem[]\n /** \u4E3B\u9898 (light: \u767D\u8272\u6587\u5B57, dark: \u9ED1\u8272\u6587\u5B57) */\n theme?: Theme\n }\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["types_exports", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* 移动端multicol菜单
|
|
3
3
|
* @param multicolMetadata multicol菜单元数据
|
|
4
4
|
*/
|
|
5
|
-
export declare const MobileMulticolMenu: ({ multicolMetadata }: {
|
|
5
|
+
export declare const MobileMulticolMenu: ({ multicolMetadata, showStatsBanner, statsBannerData, }: {
|
|
6
6
|
multicolMetadata: any;
|
|
7
|
+
showStatsBanner: boolean;
|
|
8
|
+
statsBannerData: any;
|
|
7
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.create;var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var x=(a,t)=>{for(var l in t)p(a,l,{get:t[l],enumerable:!0})},r=(a,t,l,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of f(t))!v.call(a,e)&&e!==l&&p(a,e,{get:()=>t[e],enumerable:!(n=d(t,e))||n.enumerable});return a};var y=(a,t,l)=>(l=a!=null?u(g(a)):{},r(t||!a||!a.__esModule?p(l,"default",{value:a,enumerable:!0}):l,a)),M=a=>r(p({},"__esModule",{value:!0}),a);var I={};x(I,{MobileMulticolMenu:()=>B});module.exports=M(I);var o=require("react/jsx-runtime"),m=require("react"),i=require("../../helpers/utils.js"),s=require("./MulticolDropdown.js"),c=y(require("./CompanyStatsBanner/index.js"));const B=({multicolMetadata:a,showStatsBanner:t,statsBannerData:l})=>{const n=(0,m.useMemo)(()=>!a?.some(e=>!!e.columns),[a]);return(0,o.jsxs)("div",{className:"tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-3 p-4",children:[t&&(0,o.jsx)(c.default,{data:l}),(0,o.jsx)("div",{className:(0,i.cn)(" flex flex-col gap-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":n}),children:a?.map((e,b)=>(0,o.jsx)("div",{children:(0,o.jsx)(s.MulticolItem,{item:e,allPicture:n})},`multicolItem-${e?.label}-${b}`))})]})};
|
|
2
2
|
//# sourceMappingURL=MobileMulticolMenu.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 = ({
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["MobileMulticolMenu_exports", "__export", "MobileMulticolMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_MulticolDropdown", "multicolMetadata", "allPicture", "item", "index"]
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { MulticolItem } from './MulticolDropdown.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\n\n/**\n * \u79FB\u52A8\u7AEFmulticol\u83DC\u5355\n * @param multicolMetadata multicol\u83DC\u5355\u5143\u6570\u636E\n */\nexport const MobileMulticolMenu = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\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 className=\"tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-3 p-4\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n\n <div\n className={cn(' flex flex-col gap-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 </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAwBI,IAAAI,EAAA,6BAxBJC,EAA+B,iBAC/BC,EAAmB,kCACnBC,EAA6B,iCAC7BC,EAA+B,4CAMxB,MAAMN,EAAqB,CAAC,CACjC,iBAAAO,EACA,gBAAAC,EACA,gBAAAC,CACF,IAIM,CAEJ,MAAMC,KAAa,WAAQ,IAClB,CAACH,GAAkB,KAAMI,GAAc,CAAC,CAACA,EAAK,OAAO,EAC3D,CAACJ,CAAgB,CAAC,EAErB,SACE,QAAC,OAAI,UAAU,gEACZ,UAAAC,MAAmB,OAAC,EAAAI,QAAA,CAAmB,KAAMH,EAAiB,KAE/D,OAAC,OACC,aAAW,MAAG,uBAAwB,CACnC,2DAA6DC,CAChE,CAAC,EAEA,SAAAH,GAAkB,IAAI,CAACI,EAAWE,OACjC,OAAC,OACC,mBAAC,gBAAa,KAAMF,EAAM,WAAYD,EAAY,GAD1C,gBAAgBC,GAAM,KAAK,IAAIE,CAAK,EAE9C,CACD,EACH,GACF,CAEJ",
|
|
6
|
+
"names": ["MobileMulticolMenu_exports", "__export", "MobileMulticolMenu", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_MulticolDropdown", "import_CompanyStatsBanner", "multicolMetadata", "showStatsBanner", "statsBannerData", "allPicture", "item", "CompanyStatsBanner", "index"]
|
|
7
7
|
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* 多列下拉
|
|
3
3
|
* @param categoriesItem 分类项
|
|
4
4
|
*/
|
|
5
|
-
export declare const MulticolDropdown: ({ multicolMetadata }: {
|
|
5
|
+
export declare const MulticolDropdown: ({ multicolMetadata, showStatsBanner, statsBannerData, }: {
|
|
6
6
|
multicolMetadata: any;
|
|
7
|
+
showStatsBanner: boolean;
|
|
8
|
+
statsBannerData: any;
|
|
7
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
/**
|
|
9
11
|
* 多列下拉项
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var u=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(a,l)=>{for(var t in l)i(a,t,{get:l[t],enumerable:!0})},d=(a,l,t,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of h(l))!g.call(a,r)&&r!==t&&i(a,r,{get:()=>l[r],enumerable:!(s=b(l,r))||s.enumerable});return a};var w=(a,l,t)=>(t=a!=null?u(v(a)):{},d(l||!a||!a.__esModule?i(t,"default",{value:a,enumerable:!0}):t,a)),k=a=>d(i({},"__esModule",{value:!0}),a);var C={};N(C,{MulticolDropdown:()=>y,MulticolItem:()=>c});module.exports=k(C);var e=require("react/jsx-runtime"),p=require("react"),o=require("../../components/index.js"),x=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),m=require("../AiuiProvider/index.js");const y=({multicolMetadata:a,showStatsBanner:l,statsBannerData:t})=>{const s=(0,p.useRef)(null);return(0,e.jsx)("div",{ref:s,className:"bg-white py-4",children:(0,e.jsx)(o.Container,{childClassName:"bg-white",className:"h-full",children:(0,e.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,e.jsx)(x.default,{data:t}),(0,e.jsx)("div",{className:"flex gap-4",children:a?.map((r,f)=>(0,e.jsx)("div",{className:"w-1/4",children:(0,e.jsx)(c,{item:r})},`multicolItem-${r?.label}-${f}`))})]})})})},c=({item:a,allPicture:l})=>{const{locale:t="us"}=(0,m.useAiuiContext)();return(0,e.jsxs)(e.Fragment,{children:[a?.columns&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.Text,{html:a.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:a.columns?.map(s=>(0,e.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,e.jsx)(o.Link,{href:`${(0,n.getLocalizedPath)(s.url,t)}?ref=navMenu`,asChild:!s.url,className:"text-sm font-bold leading-[1.4] no-underline",children:s.label}),s?.badge&&(0,e.jsx)(o.Text,{as:"p",html:s?.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]"})]},s.label))})]}),a?.imageUrl&&(0,e.jsx)("div",{className:(0,n.cn)("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":l}),children:(0,e.jsxs)(o.Link,{href:`${(0,n.getLocalizedPath)(a.url,t)}?ref=navMenu`,asChild:!a.url,children:[(0,e.jsx)(o.Picture,{source:a.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,e.jsx)(o.Text,{html:a.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":a?.theme==="dark"})}),a.subtitle&&(0,e.jsx)(o.Text,{html:a.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":a?.theme==="dark"})}),a?.primary?.label&&(0,e.jsx)(o.Button,{as:"a",href:(0,n.getLocalizedPath)(a?.primary?.url,t),variant:"link",size:"lg",className:(0,n.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":a?.theme==="dark"}),children:a?.primary?.label||"more"})]})]})})]})};
|
|
2
2
|
//# sourceMappingURL=MulticolDropdown.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["MulticolDropdown_exports", "__export", "MulticolDropdown", "MulticolItem", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_AiuiProvider", "multicolMetadata", "multicolDropdownRef", "item", "index", "allPicture", "locale", "columnItem"]
|
|
4
|
+
"sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button } from '../../components/index.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef} className=\"bg-white py-4\">\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"laptop:gap-4 flex flex-col gap-3\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n <div className=\"flex gap-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 </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 const { locale = 'us' } = useAiuiContext()\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={`${getLocalizedPath(columnItem.url, locale)}?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={`${getLocalizedPath(item.url, locale)}?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={getLocalizedPath(item?.primary?.url, locale)}\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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,iBAAAC,IAAA,eAAAC,EAAAJ,GAwBQ,IAAAK,EAAA,6BAxBRC,EAA8B,iBAC9BC,EAAuD,qCACvDC,EAA+B,4CAC/BC,EAAqC,kCACrCC,EAA+B,oCAMxB,MAAMR,EAAmB,CAAC,CAC/B,iBAAAS,EACA,gBAAAC,EACA,gBAAAC,CACF,IAIM,CACJ,MAAMC,KAAsB,UAAuB,IAAI,EAEvD,SACE,OAAC,OAAI,IAAKA,EAAqB,UAAU,gBACvC,mBAAC,aAAU,eAAe,WAAW,UAAU,SAC7C,oBAAC,OAAI,UAAU,mCACZ,UAAAF,MAAmB,OAAC,EAAAG,QAAA,CAAmB,KAAMF,EAAiB,KAC/D,OAAC,OAAI,UAAU,aACZ,SAAAF,GAAkB,IAAI,CAACK,EAAWC,OACjC,OAAC,OAAiD,UAAU,QAC1D,mBAACd,EAAA,CAAa,KAAMa,EAAM,GADlB,gBAAgBA,GAAM,KAAK,IAAIC,CAAK,EAE9C,CACD,EACH,GACF,EACF,EACF,CAEJ,EAMad,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,GAEJ,CAEJ",
|
|
6
|
+
"names": ["MulticolDropdown_exports", "__export", "MulticolDropdown", "MulticolItem", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_CompanyStatsBanner", "import_utils", "import_AiuiProvider", "multicolMetadata", "showStatsBanner", "statsBannerData", "multicolDropdownRef", "CompanyStatsBanner", "item", "index", "allPicture", "locale", "columnItem"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var p=Object.create;var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var h=(a,e)=>{for(var r in e)d(a,r,{get:e[r],enumerable:!0})},l=(a,e,r,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of M(e))!w.call(a,n)&&n!==r&&d(a,n,{get:()=>e[n],enumerable:!(u=y(e,n))||u.enumerable});return a};var P=(a,e,r)=>(r=a!=null?p(f(a)):{},l(e||!a||!a.__esModule?d(r,"default",{value:a,enumerable:!0}):r,a)),N=a=>l(d({},"__esModule",{value:!0}),a);var g={};h(g,{WithGroupCategory:()=>D,WithMulticol:()=>S,WithResource:()=>b,WithSidebar:()=>m,WithSupports:()=>R});module.exports=N(g);var c=require("react/jsx-runtime"),s=P(require("react"));function m(a,e){const r=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.sidebar?.categoriesMetadata||"{}")}catch(o){console.log("categoriesMetadata Parse error",o)}return t},[e]),u=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.sidebar?.seriesMetadata||"[]")}catch(o){console.log("seriesMetadata Parse error",o)}return t},[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,ref:o,seriesMetadata:u,sidebarCategoriesMetadata:r}));return n.displayName=a.displayName||a.name||"WithSidebarDropdown",n}function R(a,{categoriesItem:e,currentNavItemRef:r}){const u=(0,s.useMemo)(()=>e?.components?.[0]?.supports,[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,supportsMetadata:u,currentNavItemRef:r,ref:o}));return n.displayName=a.displayName||a.name||"WithSupportsDropdown",n}function S(a,e){const r=e?.components?.[0]?.showStatsBanner,u=e?.components?.[0]?.statsBanner?.[0],n=(0,s.useMemo)(()=>{try{return JSON.parse(e?.components?.[0]?.multicol?.multicolMetadata||"{}")}catch(o){console.log("multicolMetadata Parse error",o)}return null},[e]),t=s.default.forwardRef((o,i)=>(0,c.jsx)(a,{...o,ref:i,multicolMetadata:n,showStatsBanner:r,statsBannerData:u}));return t.displayName=a.displayName||a.name||"WithMulticolDropdown",t}function b(a,e){const r=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.resource?.categoriesMetadata||"{}")}catch(o){console.log("resourceCategoriesMetadata Parse error",o)}return t},[e]),u=(0,s.useMemo)(()=>{let t=null;try{t=JSON.parse(e?.components?.[0]?.resource?.resourceMetadata||"[]")}catch(o){console.log("resourcesMetadata Parse error",o)}return t},[e]),n=s.default.forwardRef((t,o)=>(0,c.jsx)(a,{...t,ref:o,resourcesMetadata:u,resourceCategoriesMetadata:r}));return n.displayName=a.displayName||a.name||"WithResourceDropdown",n}function D(a){return a?Object.values(a?.reduce((e,r)=>(e[r.group]||(e[r.group]=[]),e[r.group].push(r),e),{})):[[]]}
|
|
2
2
|
//# sourceMappingURL=withCategory.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeaderNavigation/withCategory.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n { categoriesItem, currentNavItemRef }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return <WrappedComponent
|
|
5
|
-
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BACjFY,CACT,CAEO,SAASnB,EAA+BO,EAA4CC,EAAqB,CAC9G,MAAMY,KAAmB,WAAQ,IAAM,CACrC,GAAI,CACF,OAAO,KAAK,
|
|
6
|
-
"names": ["withCategory_exports", "__export", "WithGroupCategory", "WithMulticol", "WithResource", "WithSidebar", "WithSupports", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "supportsMetadata", "supportsDropdown", "multicolMetadata", "multicolDropdown", "resourceCategoriesMetadata", "resourcesMetadata", "withResourceDropdown", "categories", "acc", "item"]
|
|
4
|
+
"sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n { categoriesItem, currentNavItemRef }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const showStatsBanner = categoriesItem?.components?.[0]?.showStatsBanner\n const statsBannerData = categoriesItem?.components?.[0]?.statsBanner?.[0]\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n multicolMetadata={multicolMetadata}\n showStatsBanner={showStatsBanner}\n statsBannerData={statsBannerData}\n />\n )\n })\n\n multicolDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithMulticolDropdown'\n return multicolDropdown\n}\n\nexport function WithResource<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u8D44\u6E90\u4F4D\u5206\u7C7B\u5143\u6570\u636E\n const resourceCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('resourceCategoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u8D44\u6E90\u4F4D\u5143\u6570\u636E\n const resourcesMetadata = useMemo(() => {\n let resourcesMetadata = null\n try {\n resourcesMetadata = JSON.parse(categoriesItem?.components?.[0]?.resource?.resourceMetadata || '[]')\n } catch (error) {\n console.log('resourcesMetadata Parse error', error)\n }\n return resourcesMetadata\n }, [categoriesItem])\n\n const withResourceDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n resourcesMetadata={resourcesMetadata}\n resourceCategoriesMetadata={resourceCategoriesMetadata}\n />\n )\n })\n\n withResourceDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithResourceDropdown'\n return withResourceDropdown\n}\n\nexport function WithGroupCategory(categories: any) {\n if (!categories) return [[]]\n return Object.values(\n categories?.reduce((acc: any, item: any) => {\n if (!acc[item.group]) {\n acc[item.group] = []\n }\n acc[item.group].push(item)\n return acc\n }, {})\n )\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAP,GA2BM,IAAAQ,EAAA,6BA3BNC,EAA+B,oBAExB,SAASJ,EAA8BK,EAA4CC,EAAqB,CAE7G,MAAMC,KAA4B,WAAQ,IAAM,CAC9C,IAAIC,EAAqB,KACzB,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,SAAS,oBAAsB,IAAI,CACtG,OAASG,EAAO,CACd,QAAQ,IAAI,iCAAkCA,CAAK,CACrD,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbI,KAAiB,WAAQ,IAAM,CACnC,IAAIA,EAAiB,KACrB,GAAI,CACFA,EAAiB,KAAK,MAAMJ,GAAgB,aAAa,CAAC,GAAG,SAAS,gBAAkB,IAAI,CAC9F,OAASG,EAAO,CACd,QAAQ,IAAI,6BAA8BA,CAAK,CACjD,CACA,OAAOC,CACT,EAAG,CAACJ,CA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,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,UAAU,oBAAsB,IAAI,CACvG,OAASG,EAAO,CACd,QAAQ,IAAI,yCAA0CA,CAAK,CAC7D,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbiB,KAAoB,WAAQ,IAAM,CACtC,IAAIA,EAAoB,KACxB,GAAI,CACFA,EAAoB,KAAK,MAAMjB,GAAgB,aAAa,CAAC,GAAG,UAAU,kBAAoB,IAAI,CACpG,OAASG,EAAO,CACd,QAAQ,IAAI,gCAAiCA,CAAK,CACpD,CACA,OAAOc,CACT,EAAG,CAACjB,CAAc,CAAC,EAEbkB,EAAuB,EAAAZ,QAAM,WAAmB,CAACC,EAAOC,OAE1D,OAACT,EAAA,CACE,GAAIQ,EACL,IAAKC,EACL,kBAAmBS,EACnB,2BAA4BD,EAC9B,CAEH,EAED,OAAAE,EAAqB,YAAcnB,EAAiB,aAAeA,EAAiB,MAAQ,uBACrFmB,CACT,CAEO,SAAS3B,EAAkB4B,EAAiB,CACjD,OAAKA,EACE,OAAO,OACZA,GAAY,OAAO,CAACC,EAAUC,KACvBD,EAAIC,EAAK,KAAK,IACjBD,EAAIC,EAAK,KAAK,EAAI,CAAC,GAErBD,EAAIC,EAAK,KAAK,EAAE,KAAKA,CAAI,EAClBD,GACN,CAAC,CAAC,CACP,EATwB,CAAC,CAAC,CAAC,CAU7B",
|
|
6
|
+
"names": ["withCategory_exports", "__export", "WithGroupCategory", "WithMulticol", "WithResource", "WithSidebar", "WithSupports", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "supportsMetadata", "supportsDropdown", "showStatsBanner", "statsBannerData", "multicolMetadata", "multicolDropdown", "resourceCategoriesMetadata", "resourcesMetadata", "withResourceDropdown", "categories", "acc", "item"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var R=Object.create;var p=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of U(t))!j.call(e,s)&&s!==i&&p(e,s,{get:()=>t[s],enumerable:!(a=S(t,s))||a.enumerable});return e};var v=(e,t,i)=>(i=e!=null?R(_(e)):{},h(t||!e||!e.__esModule?p(i,"default",{value:e,enumerable:!0}):i,e)),Y=e=>h(p({},"__esModule",{value:!0}),e);var F={};q(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),o=require("react"),g=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),M=v(require("../SwiperBox/index.js")),k=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),T=require("../../hooks/useExposure.js"),L=require("../../shared/trackUrlRef.js");const m="video",d="media_player_multi",Z=({data:e,configuration:t})=>{const i=(0,o.useRef)(null);return(0,T.useExposure)(i,{componentType:m,componentName:d,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:i,className:(0,g.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(r.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(r.Link,{asChild:!e?.href,href:(0,L.trackUrlRef)(e?.href,`${m}_${d}`),"data-headless-type-name":`${m}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(r.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=(0,o.forwardRef)(({data:{items:e=[],shape:t="square",title:i,containerProps:a},className:s="",key:I,onVideoPlayBtnClick:V},B)=>{const[f,c]=(0,o.useState)(!1),[C,$]=(0,o.useState)(""),[z,D]=(0,o.useState)(""),u=typeof i=="string"?i:i&&(0,N.convertLexicalToHTML)({data:i}),E=(0,o.useRef)(null),x=e.length===2;return(0,l.jsxs)("div",{className:s,ref:E,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(k.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:B,children:[i&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:u||""}}),(0,l.jsx)(M.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+I,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(H,n)=>{c(!0),n?.isYouTube?D?.(n?.youtubeId||""):$?.(n?.video?.url||""),V?.(H)},title:u}},Slide:Z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(P.VideoModal,{visible:f,youTubeId:z,videoUrl:C,onCloseModal:()=>c(!1)})]})});b.displayName="MediaPlayerMulti";var A=(0,w.withLayout)(b);
|
|
1
|
+
"use strict";"use client";var R=Object.create;var p=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of U(t))!j.call(e,s)&&s!==i&&p(e,s,{get:()=>t[s],enumerable:!(a=S(t,s))||a.enumerable});return e};var v=(e,t,i)=>(i=e!=null?R(_(e)):{},h(t||!e||!e.__esModule?p(i,"default",{value:e,enumerable:!0}):i,e)),Y=e=>h(p({},"__esModule",{value:!0}),e);var F={};q(F,{default:()=>A});module.exports=Y(F);var l=require("react/jsx-runtime"),o=require("react"),g=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),r=require("../../components/index.js"),y=v(require("../Title/index.js")),M=v(require("../SwiperBox/index.js")),k=require("../../components/container.js"),P=require("../VideoModal/index.js"),N=require("@payloadcms/richtext-lexical/html"),T=require("../../hooks/useExposure.js"),L=require("../../shared/trackUrlRef.js");const m="video",d="media_player_multi",Z=({data:e,configuration:t})=>{const i=(0,o.useRef)(null);return(0,T.useExposure)(i,{componentType:m,componentName:d,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:i,className:(0,g.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto",t.shape==="round"?"rounded-2xl":""),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(r.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(r.Link,{asChild:!e?.href,href:(0,L.trackUrlRef)(e?.href,`${m}_${d}`),"data-headless-type-name":`${m}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(r.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},b=(0,o.forwardRef)(({data:{items:e=[],shape:t="square",title:i,containerProps:a},className:s="",key:I,onVideoPlayBtnClick:V},B)=>{const[f,c]=(0,o.useState)(!1),[C,$]=(0,o.useState)(""),[z,D]=(0,o.useState)(""),u=typeof i=="string"?i:i&&(0,N.convertLexicalToHTML)({data:i}),E=(0,o.useRef)(null),x=e.length===2;return(0,l.jsxs)("div",{className:s,ref:E,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(k.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:B,children:[i&&(0,l.jsx)(y.default,{className:"mediaplayermulti-title",data:{title:u||""}}),(0,l.jsx)(M.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+I,data:{list:e,configuration:{shape:t,onVideoPlayBtnClick:(H,n)=>{c(!0),n?.isYouTube?D?.(n?.youtubeId||""):$?.(n?.video?.url||""),V?.(H)},title:u}},Slide:Z,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(P.VideoModal,{visible:f,youTubeId:z,videoUrl:C,onCloseModal:()=>c(!1)})]})});b.displayName="MediaPlayerMulti";var A=(0,w.withLayout)(b);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MediaPlayerMulti/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white 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 </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\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: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCM,IAAAI,EAAA,6BArCNC,EAA6C,iBAC7CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAoC,qCACpCC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA0B,yCAC1BC,EAA2B,kCAC3BC,EAAqC,6CAErCC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAkB,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAA2D,CACxG,MAAMC,KAAM,UAAuB,IAAI,EAEvC,wBAAYA,EAAK,CACf,cAAAL,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,SAAUC,GAAe,MAAQ,EACjC,qBAAsBD,GAAM,WAC9B,CAAC,KAGC,QAAC,OACC,IAAKE,EACL,aAAW,MACT,2CACA,yCACA,iEACAD,EAAc,QAAU,QAAU,cAAgB,EACpD,EAEA,qBAAC,OAAI,UAAU,uFACb,oBAAC,WACC,OAAQD,EAAK,KAAK,IAClB,IAAKA,EAAK,KAAK,KAAO,GACtB,UAAU,gCACV,aAAa,gFACf,KACA,OAAC,WACC,OAAQA,EAAK,WAAW,KAAOA,EAAK,KAAK,IACzC,IAAKA,EAAK,WAAW,KAAOA,EAAK,KAAK,KAAO,GAC7C,UAAU,gCACV,aAAa,6BACf,KACA,OAAC,OAAI,UAAU,2DACX,UAAAA,GAAM,OAAO,KAAOA,GAAM,eAC1B,OAAC,UACC,QAAS,IAAM,CACbC,GAAe,sBAAsBA,GAAe,OAAS,EAAGD,CAAI,CACtE,EACA,UAAU
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { useState, forwardRef, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Link, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Container } from '../../components/container.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'\nimport type { MediaPlayerMultiProps, MediaPlayerItemProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'video'\nconst componentName = 'media_player_multi'\n\nconst MediaPlayerItem = ({ data, configuration }: { data: MediaPlayerItemProps; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.description,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'laptop:max-w-full w-full overflow-hidden',\n 'laptop:flex-row flex shrink-0 flex-col',\n 'lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto',\n configuration.shape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <div className=\"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none\">\n <Picture\n source={data.img?.url}\n alt={data.img?.alt || ''}\n className=\"tablet:block hidden size-full\"\n imgClassName=\"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n />\n <Picture\n source={data.mobileImg?.url || data.img?.url}\n alt={data.mobileImg?.alt || data.img?.alt || ''}\n className=\"tablet:hidden block size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4\">\n {(data?.video?.url || data?.youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-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 </div>\n </div>\n\n <div className=\"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4\">\n <div className=\"flex flex-col\">\n <h3 className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]\">\n {data.title}\n </h3>\n {data.quote && (\n <Link\n asChild={!data?.href}\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Text\n html={data.quote}\n weight=\"bold\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm\"\n />\n </Link>\n )}\n </div>\n\n <p className=\"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]\">\n {data.description}\n </p>\n </div>\n </div>\n )\n}\n\nconst MediaPlayerMulti = forwardRef<HTMLDivElement, MediaPlayerMultiProps>(\n (\n { data: { items = [], shape = 'square', title, containerProps }, className = '', key, onVideoPlayBtnClick },\n ref\n ) => {\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const title_html = typeof title === 'string' ? title : title && convertLexicalToHTML({ data: title })\n const wrapperRef = useRef<HTMLDivElement>(null)\n\n // \u5982\u679C\u53EA\u6709\u4E24\u4E2Aitem, \u5219\u5E73\u5747\u5206\u914D\u7A7A\u95F4\n const itemsLength = items.length === 2\n\n return (\n <div className={className} ref={wrapperRef}>\n <div className=\"mediaplayermulti-box\">\n <Container {...(containerProps || {})} className=\"overflow-hidden\">\n <div className={className} ref={ref}>\n {title && <Title className=\"mediaplayermulti-title\" data={{ title: title_html || '' }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MediaPlayerMultiSwiper' + key}\n data={{\n list: items,\n configuration: {\n shape,\n onVideoPlayBtnClick: (_: number, data: MediaPlayerItemProps) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n }\n onVideoPlayBtnClick?.(_)\n },\n title: title_html,\n },\n }}\n Slide={MediaPlayerItem}\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: itemsLength ? 2 : 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: itemsLength ? 2 : 1.5,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2,\n },\n }}\n />\n </div>\n </Container>\n </div>\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n )\n }\n)\n\nMediaPlayerMulti.displayName = 'MediaPlayerMulti'\nexport default withLayout(MediaPlayerMulti)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCM,IAAAI,EAAA,6BArCNC,EAA6C,iBAC7CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAAoC,qCACpCC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA0B,yCAC1BC,EAA2B,kCAC3BC,EAAqC,6CAErCC,EAA4B,sCAC5BC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAkB,CAAC,CAAE,KAAAC,EAAM,cA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AAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAc,EAAI,GACnC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACCR,MACC,OAAC,cACC,QAASA,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CACF,EAEAT,EAAiB,YAAc,mBAC/B,IAAOpB,KAAQ,cAAWoB,CAAgB",
|
|
6
6
|
"names": ["MediaPlayerMulti_exports", "__export", "MediaPlayerMulti_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_Title", "import_SwiperBox", "import_container", "import_VideoModal", "import_html", "import_useExposure", "import_trackUrlRef", "componentType", "componentName", "MediaPlayerItem", "data", "configuration", "ref", "MediaPlayerMulti", "items", "shape", "title", "containerProps", "className", "key", "onVideoPlayBtnClick", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "title_html", "wrapperRef", "itemsLength", "Title", "SwiperBox", "_"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var G=(t,a)=>{for(var l in a)x(t,l,{get:a[l],enumerable:!0})},H=(t,a,l,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of W(a))!q.call(t,n)&&n!==l&&x(t,n,{get:()=>a[n],enumerable:!(r=z(a,n))||r.enumerable});return t};var K=t=>H(x({},"__esModule",{value:!0}),t);var V={};G(V,{canSearch:()=>D,default:()=>M});module.exports=K(V);var e=require("react/jsx-runtime"),o=require("../../components/index.js"),h=require("../HeaderNavigation/icons/index.js"),i=require("react"),C=require("../AiuiProvider/index.js"),g=require("./types.js"),$=require("es-toolkit"),p=require("../../helpers/utils.js");const D=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),w=(0,i.forwardRef)(({data:t,onSearch:a,onClose:l,searchResult:r,isSearching:n,keywords:m},F)=>{const{locale:d="us",copyWriting:R}=(0,C.useAiuiContext)(),[c,S]=(0,i.useState)(""),[k,y]=(0,i.useState)(!1),v=(0,i.useRef)(null);(0,i.useEffect)(()=>{v.current&&v.current.focus({preventScroll:!0})},[]);const E=(0,$.debounce)(s=>{a(s)},300),I=(0,i.useCallback)(s=>{s.key==="Enter"&&!k&&window.open(`${d==="us"?"":d}${t?.moreLink}?q=${c.toLowerCase()}`,"_self")},[k,c,d,t?.moreLink]),T=(0,i.useMemo)(()=>Array.isArray(m)&&m?.length?m.map(s=>s.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(s=>s.popularWord):[],[m,t?.popularWords]),P=(0,i.useCallback)(s=>{switch(s.__typename||s.type){case"Product":return`/products${s.path}?q=${c.toLowerCase()}`;case"Article":return`/blogs/${s.blog.handle}/${s.handle.replace("storefront-","")}?q=${c.toLowerCase()}`;default:break}},[c]),N=(0,i.useMemo)(()=>{if(c){if(r?.totalCount)return g.SearchStatus.Predict;if(!n)return g.SearchStatus.Empty}else return g.SearchStatus.Default},[r?.totalCount,c,n]);return(0,e.jsxs)(o.Container,{childClassName:"!bg-white",className:"relative",ref:F,children:[(0,e.jsx)("style",{children:`
|
|
2
2
|
.navigation-search-component input:-webkit-autofill,
|
|
3
3
|
.navigation-search-component input:-webkit-autofill:hover,
|
|
4
4
|
.navigation-search-component input:-webkit-autofill:focus {
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
transition: background-color 9999s ease-in-out 0s !important;
|
|
8
8
|
caret-color: #000;
|
|
9
9
|
}
|
|
10
|
-
`}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{ref:v,value:
|
|
10
|
+
`}),(0,e.jsxs)("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black",children:[(0,e.jsx)("input",{ref:v,value:c,onCompositionStart:()=>y(!0),onCompositionEnd:()=>y(!1),onKeyDown:I,onChange:s=>{S(s.target.value),s.target.value&&E(s.target.value)},type:"text",className:"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none ",placeholder:t?.placeholder}),(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(h.Search,{className:"size-5 cursor-pointer",onClick:()=>a(c)}),(0,e.jsx)("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),(0,e.jsx)(h.Close,{className:"size-5 cursor-pointer",onClick:l})]})]}),(0,e.jsx)("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:N===g.SearchStatus.Predict?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(o.Text,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),r?.items?.length>6&&(0,e.jsx)(o.Button,{as:"a",iconClassName:"size-4",href:`${d==="us"?"":d}${t?.moreLink}?q=${c.toLowerCase()}`,className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:r?.items?.filter(s=>D(s)).slice(0,6)?.map(s=>(0,e.jsx)(o.Link,{className:"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:P(s),children:(0,e.jsx)(o.Text,{html:(0,p.highlightSearchWord)(s.title,c),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},s.id))})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(o.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&(0,e.jsx)(o.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative",children:[(0,e.jsx)(o.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,p.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,p.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),r?.items?.filter(s=>s.type.toLowerCase()==="product").slice(0,7)?.map(s=>{const u=s?.variants?.[0],f=`${u?.image?.url||s?.images?.[0]?.url}`,b=s?.title||s?.name,B=s?.description,_=s?.badge||"",A=`/products/${s?.handle}?variant=${(0,p.atobID)(u?.id)}`;return(0,e.jsx)(L,{productImage:f,productName:b,productDesc:B,productBadge:_,listingLink:A},s.id)})]})]},"predict-advertising-card")]}):(0,e.jsxs)(e.Fragment,{children:[N===g.SearchStatus.Empty&&(0,e.jsx)(o.Text,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{children:[(0,e.jsx)(o.Text,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"mt-2",children:[(0,e.jsx)(j,{data:t,keywords:T,locale:d}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&(0,e.jsx)(o.Grid,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(s=>(0,e.jsx)(o.GridItem,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:(0,e.jsx)("a",{href:`${d==="us"?"":d}${t?.moreLink}?q=${s?.popularPage.toLowerCase()}`,className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:s?.popularPage})},s?.id))})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)(o.Text,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[t?.advertisingBgImg?.url&&(0,e.jsx)(o.Link,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:(0,p.cn)("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.advertisingSubtitle||"20.000mAh",className:(0,p.cn)("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),t?.hotProducts?.slice(0,7)?.map(s=>{const u=s?.custom_description,f=s?.badge||"",b=`/products/${s?.handle}?variant=${(0,p.atobID)(s?.shopify_id)}`;return(0,e.jsx)(L,{productImage:s?.image,productName:s?.name,productDesc:u,productBadge:f,listingLink:b},s.shopify_id||s.id)})]})]},"empty-advertising-card")]})})]})});w.displayName="NavigationSearch";const L=({productImage:t,productName:a,productDesc:l,productBadge:r,className:n,listingLink:m})=>(0,e.jsx)(o.Link,{href:m,className:"block no-underline hover:text-current",children:(0,e.jsxs)("div",{className:(0,p.cn)("flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",n),children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:t,loading:"lazy",alt:a,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:" h-[24px] ",children:r&&(0,e.jsx)(o.Text,{as:"p",html:r,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(o.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:a}),l&&(0,e.jsx)(o.Text,{as:"p",html:l,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]})}),j=({data:t,keywords:a,locale:l})=>(0,e.jsx)("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:a?.map((r,n)=>(0,e.jsx)("a",{href:`${l==="us"?"":l}${t?.moreLink}?q=${r?.toLowerCase()}`,className:"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:r},n))});var M=w;
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/NavigationSearch/index.tsx"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/no-unknown-property */\nimport { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState, useEffect, useRef } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n\n // \u81EA\u52A8\u805A\u7126\u5230\u8F93\u5165\u6846\uFF08\u963B\u6B62\u6EDA\u52A8\u884C\u4E3A\uFF09\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus({ preventScroll: true })\n }\n }, [])\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n window.open(`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`, '_self')\n }\n },\n [isComposing, searchValue, locale, data?.moreLink]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n const type = item.__typename || item.type\n switch (type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue, isSearching])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black\">\n <input\n ref={inputRef}\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none \"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-1\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n iconClassName=\"size-4\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div key=\"predict-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div key=\"empty-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className=\"font-bold text-white\"\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className=\"text-sm font-bold text-white\"\n />\n </div>\n </div>\n </Link>\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.shopify_id || item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nNavigationSearch.displayName = 'NavigationSearch'\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <Link href={listingLink} className=\"block no-underline hover:text-current\">\n <div\n className={cn(\n 'flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500',\n className\n )}\n >\n <div className=\"shrink-0\">\n <img\n src={productImage}\n loading=\"lazy\"\n alt={productName}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n <div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n </Link>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAwFQ,IAAAK,EAAA,6BAvFRC,EAAgF,qCAChFC,EAAyD,8CACzDC,EAA8E,iBAE9EC,EAA+B,oCAE/BC,EAA6B,sBAE7BC,EAAyB,sBACzBC,EAAgD,kCAEzC,MAAMV,EAAaW,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,KAAK,SAAS,SAI/BC,KAAmB,cACvB,CAAC,CAAE,KAAAC,EAAM,SAAAC,EAAU,QAAAC,EAAS,aAAAC,EAAc,YAAAC,EAAa,SAAAC,CAAS,EAAGC,IAAQ,CACzE,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAEhD,CAACC,EAAaC,CAAc,KAAI,YAAS,EAAE,EAC3C,CAACC,EAAaC,CAAc,KAAI,YAAS,EAAK,EAC9CC,KAAW,UAAyB,IAAI,KAG9C,aAAU,IAAM,CACVA,EAAS,SACXA,EAAS,QAAQ,MAAM,CAAE,cAAe,EAAK,CAAC,CAElD,EAAG,CAAC,C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text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState, useEffect, useRef } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n const inputRef = useRef<HTMLInputElement>(null)\n\n // \u81EA\u52A8\u805A\u7126\u5230\u8F93\u5165\u6846\uFF08\u963B\u6B62\u6EDA\u52A8\u884C\u4E3A\uFF09\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus({ preventScroll: true })\n }\n }, [])\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n window.open(`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`, '_self')\n }\n },\n [isComposing, searchValue, locale, data?.moreLink]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n const type = item.__typename || item.type\n switch (type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue, isSearching])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between gap-4 border-b border-b-gray-200 py-4 text-black\">\n <input\n ref={inputRef}\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"flex-1 bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none \"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-1\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n iconClassName=\"size-4\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div key=\"predict-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"rounded-sidebar-shelf relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div key=\"empty-advertising-card\">\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n {data?.advertisingBgImg?.url && (\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"rounded-sidebar-shelf relative overflow-hidden [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.shopify_id || item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nNavigationSearch.displayName = 'NavigationSearch'\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <Link href={listingLink} className=\"block no-underline hover:text-current\">\n <div\n className={cn(\n 'flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500',\n className\n )}\n >\n <div className=\"shrink-0\">\n <img\n src={productImage}\n loading=\"lazy\"\n alt={productName}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n <div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n </Link>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAwFQ,IAAAK,EAAA,6BAvFRC,EAAgF,qCAChFC,EAAyD,8CACzDC,EAA8E,iBAE9EC,EAA+B,oCAE/BC,EAA6B,sBAE7BC,EAAyB,sBACzBC,EAAgD,kCAEzC,MAAMV,EAAaW,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,KAAK,SAAS,SAI/BC,KAAmB,cACvB,CAAC,CAAE,KAAAC,EAAM,SAAAC,EAAU,QAAAC,EAAS,aAAAC,EAAc,YAAAC,EAAa,SAAAC,CAAS,EAAGC,IAAQ,CACzE,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KA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,aAAcV,GAAM,MACpB,YAAaA,GAAM,KACnB,YAAaO,EACb,aAAcC,EACd,YAAaC,GACRT,EAAK,YAAcA,EAAK,EAC/B,CAEJ,CAAC,GACH,IA5CO,wBA6CT,GACF,EAEJ,GACF,CAEJ,CACF,EAEAvB,EAAiB,YAAc,mBAE/B,MAAMiC,EAAgB,CAAC,CACrB,aAAAL,EACA,YAAAC,EACA,YAAAC,EACA,aAAAC,EACA,UAAAI,EACA,YAAAH,CACF,OASI,OAAC,QAAK,KAAMA,EAAa,UAAU,wCACjC,oBAAC,OACC,aAAW,MACT,gGACAG,CACF,EAEA,oBAAC,OAAI,UAAU,WACb,mBAAC,OACC,IAAKP,EACL,QAAQ,OACR,IAAKC,EACL,MAAO,GACP,OAAQ,GACR,UAAU,6BACZ,EACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,SAAAE,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,gIACZ,EAEJ,KACA,QAAC,OACC,oBAAC,QACC,UAAU,iGACV,KAAMF,EACR,EACCC,MACC,OAAC,QACC,GAAG,IACH,KAAMA,EACN,UAAU,sFACZ,GAEJ,GACF,GACF,EACF,EAIEI,EAAgB,CAAC,CAAE,KAAAjC,EAAM,SAAAK,EAAU,OAAAE,CAAO,OAE5C,OAAC,OAAI,UAAU,oCACZ,SAAAF,GAAU,IAAI,CAACc,EAAcgB,OAC5B,OAAC,KACC,KAAM,GAAG5B,IAAW,KAAO,GAAKA,CAAM,GAAGP,GAAM,QAAQ,MAAMmB,GAAS,YAAY,CAAC,GAEnF,UAAU,+FAET,SAAAA,GAHIgB,CAIP,CACD,EACH,EAIJ,IAAO/C,EAAQW",
|
|
6
6
|
"names": ["NavigationSearch_exports", "__export", "canSearch", "NavigationSearch_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_icons", "import_react", "import_AiuiProvider", "import_types", "import_es_toolkit", "import_utils", "target", "NavigationSearch", "data", "onSearch", "onClose", "searchResult", "isSearching", "keywords", "ref", "locale", "copyWriting", "searchValue", "setSearchValue", "isComposing", "setIsComposing", "inputRef", "debouncedFunction", "value", "handleKeyDown", "e", "searchKeywords", "keyword", "word", "getLink", "item", "searchStatus", "SearchIcon", "CloseIcon", "variant", "productImage", "productName", "productDesc", "productBadge", "listingLink", "SearchProduct", "SearchKeyword", "className", "index"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CompanyStatsBannerProps, StatItem } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* 公司统计横幅组件
|
|
5
|
+
* 用于展示公司 Logo、标语和关键统计数据
|
|
6
|
+
*/
|
|
7
|
+
declare const CompanyStatsBanner: React.ForwardRefExoticComponent<CompanyStatsBannerProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default CompanyStatsBanner;
|
|
9
|
+
export type { CompanyStatsBannerProps, StatItem };
|