@funhub/platform 0.1.35 → 0.1.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/assets/images/frame.mjs +2 -0
  2. package/dist/biz.d.mts +13 -13
  3. package/dist/biz.mjs +1 -1
  4. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  5. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  6. package/dist/components/biz/business/detail/materials/registry.d.mts +1 -1
  7. package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +1 -1
  8. package/dist/components/biz/business/detail/materials/video-detail-recommend/schema.d.mts +1 -1
  9. package/dist/components/biz/business/index.d.mts +12 -12
  10. package/dist/components/biz/business/index.mjs +1 -1
  11. package/dist/components/biz/business/marquee/client.d.mts +7 -9
  12. package/dist/components/biz/business/marquee/client.mjs +1 -1
  13. package/dist/components/biz/business/marquee/index.d.mts +2 -2
  14. package/dist/components/biz/business/marquee/material.d.mts +15 -6
  15. package/dist/components/biz/business/marquee/schema.d.mts +23 -28
  16. package/dist/components/biz/business/marquee/schema.mjs +1 -1
  17. package/dist/components/biz/business/marquee/server.d.mts +1 -1
  18. package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
  19. package/dist/components/biz/business/search-history/client.d.mts +10 -12
  20. package/dist/components/biz/business/search-history/client.mjs +1 -1
  21. package/dist/components/biz/business/search-history/index.d.mts +2 -2
  22. package/dist/components/biz/business/search-history/material.d.mts +1 -1
  23. package/dist/components/biz/business/search-history/schema.d.mts +7 -15
  24. package/dist/components/biz/business/search-history/schema.mjs +1 -1
  25. package/dist/components/biz/business/search-history/server.d.mts +6 -2
  26. package/dist/components/biz/business/search-input/client.d.mts +11 -9
  27. package/dist/components/biz/business/search-input/client.mjs +1 -1
  28. package/dist/components/biz/business/search-input/index.d.mts +2 -2
  29. package/dist/components/biz/business/search-input/schema.d.mts +6 -10
  30. package/dist/components/biz/business/search-input/schema.mjs +1 -1
  31. package/dist/components/biz/business/search-input/server.d.mts +1 -1
  32. package/dist/components/biz/business/tab-bar/client.d.mts +6 -5
  33. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  34. package/dist/components/biz/business/tab-bar/index.d.mts +2 -2
  35. package/dist/components/biz/business/tab-bar/schema.d.mts +10 -18
  36. package/dist/components/biz/business/tab-bar/schema.mjs +1 -1
  37. package/dist/components/biz/business/tab-bar/server.d.mts +1 -1
  38. package/dist/components/biz/business/text-recommend/client.d.mts +10 -14
  39. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  40. package/dist/components/biz/business/text-recommend/index.d.mts +2 -2
  41. package/dist/components/biz/business/text-recommend/material.d.mts +4 -1
  42. package/dist/components/biz/business/text-recommend/schema.d.mts +9 -12
  43. package/dist/components/biz/business/text-recommend/schema.mjs +1 -1
  44. package/dist/components/biz/business/text-recommend/server.d.mts +1 -1
  45. package/dist/components/biz/business/text-recommend/server.mjs +1 -1
  46. package/dist/components/biz/business/video-horizontal-list/client.d.mts +5 -2
  47. package/dist/components/biz/business/video-horizontal-list/client.mjs +1 -1
  48. package/dist/components/biz/business/video-horizontal-list/index.d.mts +2 -2
  49. package/dist/components/biz/business/video-horizontal-list/material.d.mts +19 -8
  50. package/dist/components/biz/business/video-horizontal-list/schema.d.mts +20 -24
  51. package/dist/components/biz/business/video-horizontal-list/schema.mjs +1 -1
  52. package/dist/components/biz/business/video-horizontal-list/server.d.mts +1 -1
  53. package/dist/components/common/delete-confirm-dialog/delete-confirm-dialog.mjs +1 -1
  54. package/dist/components/common/popup-video/index.mjs +1 -1
  55. package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
  56. package/dist/components/pages/home/client.mjs +1 -1
  57. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  58. package/dist/components/pages/publish/page-client.mjs +1 -1
  59. package/dist/components/pages/search/hot-recommend.mjs +1 -1
  60. package/dist/components/pages/search/page-client.mjs +1 -1
  61. package/dist/components/pages/search/search-result/search-all.mjs +1 -1
  62. package/dist/components/pages/user-follow/page.mjs +1 -1
  63. package/dist/components/pages/video-detail/page.mjs +1 -1
  64. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  65. package/dist/components/ui/badge.d.mts +1 -1
  66. package/dist/components/ui/button.d.mts +2 -2
  67. package/dist/constants/event-key.mjs +1 -1
  68. package/dist/hooks/use-search-history.mjs +1 -1
  69. package/dist/i18n/locales/en.mjs +1 -1
  70. package/dist/i18n/locales/zh-CN.mjs +1 -1
  71. package/dist/utils/schema/index.d.mts +1 -1
  72. package/dist/utils/schema/inspector.d.mts +31 -1
  73. package/dist/utils/schema/schema.d.mts +31 -2
  74. package/dist/utils/schema/schema.mjs +1 -1
  75. package/dist/utils.d.mts +2 -2
  76. package/dist/utils.mjs +1 -1
  77. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../../assets/icons/clear.mjs";import i from"../../../../assets/icons/right_arrow.mjs";import a from"../../../../assets/images/marquee.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useRouter as d}from"next/navigation";function f({contents:f,showClose:p,startTime:m,endTime:h,displayStrategy:g}){let _=d(),[v,y]=c(!0),[b,x]=c(0),[S,C]=c(!1);o(()=>{C(!0)},[]);let w=s(()=>{if(!m&&!h)return!0;let e=Date.now(),t=m?new Date(m).getTime():0,n=h?new Date(h).getTime():2**53-1;return e>=t&&e<=n},[m,h]);if(o(()=>{if(!S)return;let e=`marquee_closed_${g}`,t=localStorage.getItem(e);t&&(g===`once`||g===`daily`&&new Date(Number(t)).toLocaleDateString()===new Date().toLocaleDateString())&&y(!1)},[S,g]),o(()=>{if(!f||f.length<=1)return;let e=setInterval(()=>{x(e=>(e+1)%f.length)},3e3);return()=>clearInterval(e)},[f]),!S||!v||!w||!f||f.length===0)return null;let T=f[b],E=T.enableClick&&!!T.link;return l(t,{className:`px-[12px] py-[8px] w-full bg-bg1`,children:u(t,{className:`flex items-center pl-[2px] pr-[12px] py-[2px] rounded-[8px] w-full cursor-pointer relative overflow-hidden`,style:{backgroundImage:`linear-gradient(154deg, rgba(255, 228, 133, 0.2) 9.14%, rgba(207, 129, 37, 0.05) 90.86%)`},onClick:()=>{E&&T.link&&_.push(T.link)},children:[l(t,{className:`relative shrink-0 w-[36px] h-[36px]`,children:l(e,{src:typeof a==`string`?a:a.src,alt:`notice`,fill:!0,className:`object-cover`,unoptimized:!0})}),l(t,{className:`flex-1 overflow-hidden relative h-[22px]`,children:l(t,{className:`absolute inset-0 flex items-center transition-transform duration-500 ease-in-out`,style:{transform:`translateY(0)`},children:l(n,{className:`text-[14px] text-[#f59e0b] leading-[22px] truncate w-full`,children:T.text})})}),u(t,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[E&&l(i,{className:`w-[16px] h-[16px] text-[#f59e0b]`}),p&&l(t,{className:`opacity-30 hover:opacity-100 transition-opacity p-1`,onClick:e=>{e.stopPropagation(),y(!1);let t=`marquee_closed_${g}`;localStorage.setItem(t,Date.now().toString())},children:l(r,{className:`w-[12px] h-[12px] text-[#999]`})})]})]})})}export{f as MarqueeClient};
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../../assets/icons/clear.mjs";import i from"../../../../assets/icons/right_arrow.mjs";import a from"../../../../assets/images/marquee.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useRouter as d}from"next/navigation";const f=[];function p(p){let{contents:m=f,click:h,close:g,displayStrategy:_}=p,v=d(),[y,b]=c(!0),[x,S]=c(0),[C,w]=c(!1);o(()=>{w(!0)},[]);let T=s(()=>{let e=_?.period?.start,t=_?.period?.end;if(!e&&!t)return!0;let n=Date.now(),r=e?new Date(e).getTime():0,i=t?new Date(t).getTime():2**53-1;return n>=r&&n<=i},[_?.period]);if(o(()=>{if(!C||!_?.rule)return;let e=`marquee_closed_${_.rule}`,t=localStorage.getItem(e);t&&(_.rule===`once`||_.rule===`daily`&&new Date(Number(t)).toLocaleDateString()===new Date().toLocaleDateString())&&b(!1)},[C,_?.rule]),o(()=>{if(!m||m.length<=1)return;let e=setInterval(()=>{S(e=>(e+1)%m.length)},3e3);return()=>clearInterval(e)},[m]),!C||!y||!T||!m||m.length===0)return null;let E=m[x],D=h?.enabled,O=h?.link||E.link,k=D&&!!O;return l(t,{className:`px-[12px] py-[8px] w-full bg-bg1`,children:u(t,{className:`flex items-center pl-[2px] pr-[12px] py-[2px] rounded-[8px] w-full cursor-pointer relative overflow-hidden`,style:{backgroundImage:`linear-gradient(154deg, rgba(255, 228, 133, 0.2) 9.14%, rgba(207, 129, 37, 0.05) 90.86%)`},onClick:()=>{k&&O&&v.push(O)},children:[l(t,{className:`relative shrink-0 w-[36px] h-[36px]`,children:l(e,{src:typeof a==`string`?a:a.src,alt:`notice`,fill:!0,className:`object-cover`,unoptimized:!0})}),l(t,{className:`flex-1 overflow-hidden relative h-[22px] ml-1`,children:l(t,{className:`absolute inset-0 flex items-center transition-transform duration-500 ease-in-out`,style:{transform:`translateY(0)`},children:l(n,{className:`text-[14px] text-[#f59e0b] leading-[22px] truncate w-full font-medium`,children:E.text})})}),u(t,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[k&&l(i,{className:`w-[16px] h-[16px] text-[#f59e0b]`}),g?.enabled&&l(t,{className:`opacity-30 hover:opacity-100 transition-opacity p-1`,onClick:e=>{if(e.stopPropagation(),b(!1),_?.rule){let e=`marquee_closed_${_.rule}`;localStorage.setItem(e,Date.now().toString())}},children:l(r,{className:`w-[12px] h-[12px] text-[#999]`})})]})]})})}export{p as MarqueeClient};
@@ -1,5 +1,5 @@
1
1
 
2
- import { MarqueeInspectorProps, MarqueeProps, marqueeInspectorDefaultProps, marqueeInspectorPropsSchema } from "./schema.mjs";
3
- import { MarqueeClient } from "./client.mjs";
2
+ import { marqueeInspectorPropsSchema } from "./schema.mjs";
3
+ import { MarqueeClient, MarqueeProps } from "./client.mjs";
4
4
  import { MarqueeServer } from "./server.mjs";
5
5
  import { marqueeMaterial } from "./material.mjs";
@@ -14,14 +14,23 @@ import * as zod_v4_core0 from "zod/v4/core";
14
14
  declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof MarqueeClient, zod.ZodObject<{
15
15
  contents: zod.ZodArray<zod.ZodObject<{
16
16
  text: zod.ZodString & SchemaHasDefaultValue;
17
- enableClick: zod.ZodBoolean & SchemaHasDefaultValue;
18
- linkType: zod.ZodType<"content" | "content-list" | "url", unknown, zod_v4_core0.$ZodTypeInternals<"content" | "content-list" | "url", unknown>> & SchemaHasDefaultValue;
19
17
  link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
20
18
  }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
21
- showClose: zod.ZodBoolean & SchemaHasDefaultValue;
22
- displayStrategy: zod.ZodType<"once" | "daily", unknown, zod_v4_core0.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
23
- startTime: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
24
- endTime: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
19
+ click: zod.ZodObject<{
20
+ readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
21
+ readonly redirectType: zod.ZodOptional<zod.ZodType<"link" | "content_list" | "content", unknown, zod_v4_core0.$ZodTypeInternals<"link" | "content_list" | "content", unknown>>> & SchemaHasDefaultValue;
22
+ readonly link: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
23
+ }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
24
+ close: zod.ZodObject<{
25
+ readonly enabled: zod.ZodBoolean & SchemaHasDefaultValue;
26
+ }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
27
+ displayStrategy: zod.ZodObject<{
28
+ readonly rule: zod.ZodType<"once" | "daily", unknown, zod_v4_core0.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
29
+ readonly period: zod.ZodOptional<zod.ZodObject<{
30
+ readonly start: zod.ZodString;
31
+ readonly end: zod.ZodString;
32
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
33
+ }, zod_v4_core0.$strip> & SchemaHasDefaultValue;
25
34
  }, zod_v4_core0.$strip>, "marquee">;
26
35
  //#endregion
27
36
  export { marqueeMaterial };
@@ -1,37 +1,32 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
3
  import "../../../../utils.mjs";
4
- import z$1 from "zod";
4
+ import { z } from "zod";
5
5
 
6
6
  //#region components/biz/business/marquee/schema.d.ts
7
7
  /**
8
8
  * 跑马灯物料属性定义
9
9
  */
10
- declare const marqueeInspectorPropsSchema: z$1.ZodObject<{
11
- contents: z$1.ZodArray<z$1.ZodObject<{
12
- text: z$1.ZodString & SchemaHasDefaultValue;
13
- enableClick: z$1.ZodBoolean & SchemaHasDefaultValue;
14
- linkType: z$1.ZodType<"content" | "content-list" | "url", unknown, z$1.core.$ZodTypeInternals<"content" | "content-list" | "url", unknown>> & SchemaHasDefaultValue;
15
- link: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
16
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
17
- showClose: z$1.ZodBoolean & SchemaHasDefaultValue;
18
- displayStrategy: z$1.ZodType<"once" | "daily", unknown, z$1.core.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
19
- startTime: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
20
- endTime: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
21
- }, z$1.core.$strip>;
22
- declare const marqueeInspectorDefaultProps: {
23
- contents: {
24
- text: string;
25
- enableClick: boolean;
26
- linkType: "content" | "content-list" | "url";
27
- link?: string | undefined;
28
- }[];
29
- showClose: boolean;
30
- displayStrategy: "once" | "daily";
31
- startTime: string;
32
- endTime: string;
33
- };
34
- type MarqueeInspectorProps = z$1.infer<typeof marqueeInspectorPropsSchema>;
35
- type MarqueeProps = MarqueeInspectorProps;
10
+ declare const marqueeInspectorPropsSchema: z.ZodObject<{
11
+ contents: z.ZodArray<z.ZodObject<{
12
+ text: z.ZodString & SchemaHasDefaultValue;
13
+ link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
14
+ }, z.core.$strip>> & SchemaHasDefaultValue;
15
+ click: z.ZodObject<{
16
+ readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
17
+ readonly redirectType: z.ZodOptional<z.ZodType<"link" | "content_list" | "content", unknown, z.core.$ZodTypeInternals<"link" | "content_list" | "content", unknown>>> & SchemaHasDefaultValue;
18
+ readonly link: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
19
+ }, z.core.$strip> & SchemaHasDefaultValue;
20
+ close: z.ZodObject<{
21
+ readonly enabled: z.ZodBoolean & SchemaHasDefaultValue;
22
+ }, z.core.$strip> & SchemaHasDefaultValue;
23
+ displayStrategy: z.ZodObject<{
24
+ readonly rule: z.ZodType<"once" | "daily", unknown, z.core.$ZodTypeInternals<"once" | "daily", unknown>> & SchemaHasDefaultValue;
25
+ readonly period: z.ZodOptional<z.ZodObject<{
26
+ readonly start: z.ZodString;
27
+ readonly end: z.ZodString;
28
+ }, z.core.$strip>> & SchemaHasDefaultValue;
29
+ }, z.core.$strip> & SchemaHasDefaultValue;
30
+ }, z.core.$strip>;
36
31
  //#endregion
37
- export { MarqueeInspectorProps, MarqueeProps, marqueeInspectorDefaultProps, marqueeInspectorPropsSchema };
32
+ export { marqueeInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineSelectEnumPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../utils/schema/schema.mjs";const o=t({contents:e(t({text:i({label:`消息内容`,defaultValue:`请在这里输入跑马灯消息内容`}),enableClick:r({label:`支持点击`,defaultValue:!1}),linkType:n([`content-list`,`content`,`url`],{label:`跳转指向`,defaultValue:`url`}),link:i({label:`跳转链接`,defaultValue:``,required:!1})}),{label:`跑马灯内容`,defaultValue:[{text:`请在这里输入跑马灯消息内容`,enableClick:!1,linkType:`url`,link:``}]}),showClose:r({label:`支持关闭`,defaultValue:!0}),displayStrategy:n([`once`,`daily`],{label:`展示规则`,defaultValue:`once`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),startTime:i({label:`开始时间`,defaultValue:``,required:!1,description:`格式:YYYY-MM-DD HH:mm:ss`}),endTime:i({label:`结束时间`,defaultValue:``,required:!1,description:`格式:YYYY-MM-DD HH:mm:ss`})}),s=a(o);export{s as marqueeInspectorDefaultProps,o as marqueeInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineObjectPropSchema as n,defineSelectEnumPropSchema as r,defineSwitchPropSchema as i,defineTextPropSchema as a,defineTimeRangePropSchema as o}from"../../../../utils/schema/schema.mjs";import{z as s}from"zod";const c=t({contents:e(s.object({text:a({label:`文本内容`,defaultValue:``}),link:a({label:`跳转链接`,defaultValue:``,required:!1})}),{label:`消息内容`,defaultValue:[{text:`请输入跑马灯内容`}],description:`支持多条消息循环播放`}),click:n({enabled:i({label:`支持点击`,defaultValue:!0}),redirectType:r([`content_list`,`content`,`link`],{label:`跳转指向`,defaultValue:`link`,required:!1}),link:a({label:`跳转链接`,defaultValue:``,required:!1})},{label:`点击配置`,defaultValue:{enabled:!0,redirectType:`link`,link:``}}),close:n({enabled:i({label:`支持关闭`,defaultValue:!0})},{label:`关闭配置`,defaultValue:{enabled:!0}}),displayStrategy:n({rule:r([`once`,`daily`],{label:`展示规则`,defaultValue:`once`,description:`「只展示1次」即当前消息只展示1次;「每天展示1次」即当前消息每天展示1次,0点刷新`}),period:o({label:`展示周期`,defaultValue:{start:``,end:``},required:!1})},{label:`展示策略`,defaultValue:{rule:`once`,period:{start:``,end:``}}})});export{c as marqueeInspectorPropsSchema};
@@ -1,5 +1,5 @@
1
1
 
2
- import { MarqueeProps } from "./schema.mjs";
2
+ import { MarqueeProps } from "./client.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/marquee/server.d.ts
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{useSticky as i}from"../../../../../../../hooks/use-sticky.mjs";import a,{loadHiddenChannelIdsFromStorage as o}from"./channel-filter-dialog.mjs";import{urlPrefix as s}from"../../../../../../../constants/url-prefix.mjs";import c from"../../../../../../../assets/icons/search.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${s.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:s=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...s},[j,M]=m(!1),{isSticky:N,ref:P}=i(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=o();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(c,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(a,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
2
+ "use client";import{mergeStyles as e}from"../../../../../utils/styles/helpers.mjs";import{pxToVw as t}from"../../../../../../../utils/helper.mjs";import{Box as n}from"../../../../../../ui/box.mjs";import r from"../../../../../../ui/link.mjs";import{urlPrefix as i}from"../../../../../../../constants/url-prefix.mjs";import{useSticky as a}from"../../../../../../../hooks/use-sticky.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import c from"../../../../../../../assets/icons/search.mjs";import{defaultProps as l}from"../defaults/default-props.mjs";import u from"../../../../../../../assets/icons/filter_dark.mjs";import{clsx as d}from"clsx";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={},y={list:[],currentChannelId:null,isFullfeed:!1};function b(e,t){return t===0?`/`:`${i.CHANNEL}/${encodeURIComponent(e.cn_name)}`}function x({props:i=v,styles:x,events:S,data:C=y}){let{searchUrl:w,searchIconSize:T,filterIconSize:E,channelItemHeight:D,channelItemFontSize:O,channelItemActiveFontSize:k,channelItemGap:A}={...l,...i},[j,M]=m(!1),{isSticky:N,ref:P}=a(),[F,I]=m(C.list),L=p(()=>C.currentChannelId??null,[C.currentChannelId]);f(()=>{let e=s();I(C.list.filter(t=>!e.includes(t.id)))},[C.list]);let R=e=>{I(e)},z=(e,t)=>{S?.onChannelChange?.(e,t)},B=()=>{M(!0),S?.onFilterClick?.()},V=()=>{S?.onSearchClick?.()},H=x?e(x,{}):void 0,U=N?E+T+24:E+16;return _(h,{children:[N&&g(n,{className:`w-full`,style:{height:t(44)}}),g(n,{as:`nav`,ref:P,className:d(`w-full transition-all duration-200`,!C.isFullfeed&&N&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:H,children:_(n,{className:`relative flex items-center h-[44px]`,children:[g(n,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:g(n,{className:`flex items-center h-full`,style:{paddingLeft:t(16),paddingRight:t(U+16),gap:t(A)},children:F.map((e,n)=>{let i=L===e.id||L===null&&n===0;return g(r,{href:b(e,n),className:d(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center`),style:{height:t(D),fontSize:t(i?k:O),fontWeight:i?`bold`:`normal`,color:i?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>z(e,n),children:e.cn_name},e.id||`channel-${n}`)})})}),_(n,{className:`flex items-center gap-[12px] px-[8px]`,children:[g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(E+8),height:t(E+8)},onClick:B,children:g(u,{width:t(E),height:t(E),style:{color:`var(--color-text1)`}})}),N&&g(r,{href:w,onClick:V,children:g(n,{className:`flex items-center justify-center cursor-pointer`,style:{width:t(T+8),height:t(T+8)},children:g(c,{width:t(T),height:t(T),style:{color:`var(--color-text1)`}})})})]})]})}),g(o,{open:j,onOpenChange:M,channels:C.list,currentChannelId:L,onChannelClick:z,onChannelsChange:R})]})}export{x as default};
@@ -1,22 +1,20 @@
1
1
 
2
- import { SearchHistoryProps } from "./schema.mjs";
2
+ import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils/schema/index.mjs";
4
+ import { searchHistoryInspectorPropsSchema } from "./schema.mjs";
3
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
6
 
5
7
  //#region components/biz/business/search-history/client.d.ts
6
- interface SearchHistoryClientProps extends SearchHistoryProps {
8
+ type SearchHistoryProps = InferSchemaProps<typeof searchHistoryInspectorPropsSchema>;
9
+ interface ClientProps extends SearchHistoryProps {
7
10
  clearText?: string;
8
11
  confirmDescription?: string;
12
+ storageKey?: string;
13
+ onHistoryClick?: (keyword: string) => void;
9
14
  }
10
15
  /**
11
- * 搜索历史物料组件 - 客户端交互部分
16
+ * 搜索历史物料组件 (search-history) - 客户端交互部分
12
17
  */
13
- declare function SearchHistoryClient({
14
- rows,
15
- title,
16
- clearText,
17
- confirmDescription,
18
- storageKey,
19
- onHistoryClick
20
- }: SearchHistoryClientProps): react_jsx_runtime0.JSX.Element | null;
18
+ declare function SearchHistoryClient(props: ClientProps): react_jsx_runtime0.JSX.Element | null;
21
19
  //#endregion
22
- export { SearchHistoryClient };
20
+ export { SearchHistoryClient, SearchHistoryProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{useSearchHistory as n}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as r}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{useRouter as s}from"next/navigation";function c({rows:c,title:l,clearText:u=`清理`,confirmDescription:d=`确认删除全部搜索历史吗?`,storageKey:f,onHistoryClick:p}){let{userInfo:m}=t(),h=f||m?.user_id||`guest`,g=s(),[_,v]=i(!1),{history:y,clearHistory:b}=n({storageKey:h});return y.length===0?null:o(`div`,{className:`w-full bg-transparent pt-[12px] px-[12px] relative z-0`,children:[o(`div`,{className:`w-full flex items-center justify-between mb-[12px]`,children:[a(`span`,{className:`text-[16px] font-bold text-text1`,children:l}),o(`div`,{onClick:()=>v(!0),className:`cursor-pointer flex items-center gap-[4px]`,children:[a(`span`,{className:`text-text2 text-[14px] font-normal leading-[22px] text-right`,style:{fontFamily:`"Source Code Pro"`},children:u}),a(`svg`,{className:`w-[12px] h-[12px] text-text3`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:a(`path`,{d:`M4.8295 0C4.71306 0 4.60139 0.0511359 4.51905 0.142158C4.43671 0.233181 4.39046 0.356633 4.39046 0.485358V2.5889H0.439046C0.322604 2.5889 0.210931 2.64004 0.128594 2.73106C0.0462565 2.82208 0 2.94553 0 3.07426V5.66316C0 5.79189 0.0462565 5.91534 0.128594 6.00636C0.210931 6.09738 0.322604 6.14852 0.439046 6.14852H0.878092V11.5146C0.878092 11.6434 0.924348 11.7668 1.00669 11.8578C1.08902 11.9489 1.2007 12 1.31714 12H10.6829C10.7993 12 10.911 11.9489 10.9933 11.8578C11.0757 11.7668 11.1219 11.6434 11.1219 11.5146V6.14852H11.561C11.6774 6.14852 11.7891 6.09738 11.8714 6.00636C11.9537 5.91534 12 5.79189 12 5.66316V3.07426C12 2.94553 11.9537 2.82208 11.8714 2.73106C11.7891 2.64004 11.6774 2.5889 11.561 2.5889H7.60954V0.485358C7.60954 0.356633 7.56328 0.233181 7.48095 0.142158C7.39861 0.0511359 7.28694 0 7.1705 0H4.8295ZM10.2438 11.0293H8.78092V9.54603C8.78092 9.4173 8.73466 9.29385 8.65232 9.20283C8.56999 9.1118 8.45831 9.06067 8.34187 9.06067C8.22543 9.06067 8.11376 9.1118 8.03142 9.20283C7.94908 9.29385 7.90282 9.4173 7.90282 9.54603V11.0293H6.43905V9.54117C6.43905 9.41245 6.39279 9.289 6.31045 9.19797C6.22812 9.10695 6.11644 9.05582 6 9.05582C5.88356 9.05582 5.77188 9.10695 5.68955 9.19797C5.60721 9.289 5.56095 9.41245 5.56095 9.54117V11.0303H4.09718V9.547C4.09718 9.41827 4.05092 9.29482 3.96858 9.2038C3.88624 9.11278 3.77457 9.06164 3.65813 9.06164C3.54169 9.06164 3.43001 9.11278 3.34768 9.2038C3.26534 9.29482 3.21908 9.41827 3.21908 9.547V11.0303H1.75618V6.17667H10.2438V11.0303V11.0293ZM5.26855 3.07426V0.970717H6.73145V3.07426C6.73145 3.20298 6.77771 3.32644 6.86004 3.41746C6.94238 3.50848 7.05405 3.55962 7.1705 3.55962H11.1219V5.1778H0.878092V3.55962H4.8295C4.94595 3.55962 5.05762 3.50848 5.13996 3.41746C5.22229 3.32644 5.26855 3.20298 5.26855 3.07426Z`,fill:`currentColor`})})]})]}),a(`div`,{className:`w-full overflow-hidden ${c===`1`?`h-[30px]`:c===`2`?`h-[72px]`:`h-[114px]`}`,children:a(`ul`,{className:`list-none m-0 p-0 w-full flex flex-wrap gap-[12px]`,children:y.map((t,n)=>a(`li`,{className:`h-[30px] px-[12px] bg-bg2 rounded-[4px] flex items-center justify-center cursor-pointer`,onClick:()=>{p?p(t):(e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`))},children:a(`div`,{className:`text-text1 text-[14px] max-w-[124px] truncate`,children:t.length>8?`${t.slice(0,8)}...`:t})},`${t}-${n}`))})}),a(r,{open:_,onOpenChange:v,onConfirm:()=>{b(),v(!1)},title:``,description:d})]})}export{c as SearchHistoryClient};
2
+ "use client";import{Button as e}from"../../../ui/button.mjs";import t from"../../../../utils/event-bus.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{eventKey as i}from"../../../../constants/event-key.mjs";import{DeleteConfirmDialog as a}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useCallback as o,useEffect as s,useMemo as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{usePathname as f,useRouter as p,useSearchParams as m}from"next/navigation";function h(h){let{title:g,rows:_=1,clearText:v=`清理`,confirmDescription:y=`确认删除全部搜索历史吗?`,storageKey:b=`guest`,onHistoryClick:x}=h,[S,C]=l([]),[w,T]=l(!1),E=p(),D=f(),O=m(),k=`search_history_${b}`,A=o(()=>{let e=localStorage.getItem(k);if(e)try{C(JSON.parse(e))}catch(e){console.error(`Failed to parse search history`,e)}else C([])},[k]);s(()=>{A()},[A]),s(()=>(t.on(i.SEARCH_HISTORY_UPDATE,A),()=>{t.off(i.SEARCH_HISTORY_UPDATE,A)}),[A]);let j=()=>{C([]),localStorage.removeItem(k),T(!1),t.emit(i.SEARCH_HISTORY_UPDATE)},M=c(()=>{let e=_*10;return S.slice(0,e)},[S,_]);if(S.length===0)return null;let N=e=>{if(x)x(e);else{let t=new URLSearchParams(O.toString());t.set(`q`,e);let n=D.includes(`/search`)?D:`/search`;E.push(`${n}?${t.toString()}`)}};return d(n,{className:`px-4 py-2`,children:[d(n,{className:`flex justify-between items-center mb-2`,children:[u(r,{className:`text-[16px] font-bold text-text1`,children:g}),u(e,{variant:`ghost`,size:`sm`,className:`text-text3 text-[12px] p-0 h-auto`,onClick:()=>T(!0),children:v})]}),u(n,{className:`flex flex-wrap gap-2 overflow-hidden`,style:{maxHeight:`${_*40}px`},children:M.map((e,t)=>u(n,{className:`px-3 py-1 bg-bg2 rounded-full cursor-pointer`,onClick:()=>N(e),children:u(r,{className:`text-[14px] text-text2 truncate max-w-[150px]`,children:e})},t))}),u(a,{open:w,onOpenChange:T,onConfirm:()=>{j()},title:``,description:y})]})}export{h as SearchHistoryClient};
@@ -1,5 +1,5 @@
1
1
 
2
- import { SearchHistoryInspectorProps, SearchHistoryProps, searchHistoryInspectorDefaultProps, searchHistoryInspectorPropsSchema } from "./schema.mjs";
3
- import { SearchHistoryClient } from "./client.mjs";
2
+ import { searchHistoryInspectorPropsSchema } from "./schema.mjs";
3
+ import { SearchHistoryClient, SearchHistoryProps } from "./client.mjs";
4
4
  import { SearchHistoryServer } from "./server.mjs";
5
5
  import { searchHistoryMaterial } from "./material.mjs";
@@ -10,7 +10,7 @@ import * as zod_v4_core0 from "zod/v4/core";
10
10
  //#region components/biz/business/search-history/material.d.ts
11
11
  declare const searchHistoryMaterial: DefineMaterialOption<typeof SearchHistoryServer, typeof SearchHistoryClient, zod.ZodObject<{
12
12
  title: zod.ZodString & SchemaHasDefaultValue;
13
- rows: zod.ZodType<"2" | "1" | "3", unknown, zod_v4_core0.$ZodTypeInternals<"2" | "1" | "3", unknown>> & SchemaHasDefaultValue;
13
+ rows: zod.ZodNumber & SchemaHasDefaultValue;
14
14
  }, zod_v4_core0.$strip>, "search-history">;
15
15
  //#endregion
16
16
  export { searchHistoryMaterial };
@@ -1,24 +1,16 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
3
  import "../../../../utils.mjs";
4
- import z$1 from "zod";
4
+ import * as zod from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
5
6
 
6
7
  //#region components/biz/business/search-history/schema.d.ts
7
8
  /**
8
9
  * 搜索历史物料属性定义
9
10
  */
10
- declare const searchHistoryInspectorPropsSchema: z$1.ZodObject<{
11
- title: z$1.ZodString & SchemaHasDefaultValue;
12
- rows: z$1.ZodType<"2" | "1" | "3", unknown, z$1.core.$ZodTypeInternals<"2" | "1" | "3", unknown>> & SchemaHasDefaultValue;
13
- }, z$1.core.$strip>;
14
- declare const searchHistoryInspectorDefaultProps: {
15
- title: string;
16
- rows: "2" | "1" | "3";
17
- };
18
- type SearchHistoryInspectorProps = z$1.infer<typeof searchHistoryInspectorPropsSchema>;
19
- type SearchHistoryProps = SearchHistoryInspectorProps & {
20
- storageKey?: string;
21
- onHistoryClick?: (keyword: string) => void;
22
- };
11
+ declare const searchHistoryInspectorPropsSchema: zod.ZodObject<{
12
+ title: zod.ZodString & SchemaHasDefaultValue;
13
+ rows: zod.ZodNumber & SchemaHasDefaultValue;
14
+ }, zod_v4_core0.$strip>;
23
15
  //#endregion
24
- export { SearchHistoryInspectorProps, SearchHistoryProps, searchHistoryInspectorDefaultProps, searchHistoryInspectorPropsSchema };
16
+ export { searchHistoryInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineSelectEnumPropSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../utils/schema/schema.mjs";const i=e({title:n({label:`标题名称`,defaultValue:`搜索历史`}),rows:t([`1`,`2`,`3`],{label:`展示行数`,defaultValue:`1`})}),a=r(i);export{a as searchHistoryInspectorDefaultProps,i as searchHistoryInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,defineNumberPropSchema as t,defineTextPropSchema as n}from"../../../../utils/schema/schema.mjs";const r=e({title:n({label:`标题名称`,defaultValue:`搜索历史`,description:`支持输入,中/英/数/符,6个字符`}),rows:t({label:`展示行数`,defaultValue:1})});export{r as searchHistoryInspectorPropsSchema};
@@ -1,11 +1,15 @@
1
1
 
2
- import { SearchHistoryProps } from "./schema.mjs";
2
+ import { SearchHistoryProps } from "./client.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/search-history/server.d.ts
6
+ interface ServerProps extends SearchHistoryProps {
7
+ storageKey?: string;
8
+ onHistoryClick?: (keyword: string) => void;
9
+ }
6
10
  /**
7
11
  * 搜索历史物料组件 (search-history) - 服务端部分
8
12
  */
9
- declare function SearchHistoryServer(props: SearchHistoryProps): Promise<react_jsx_runtime0.JSX.Element>;
13
+ declare function SearchHistoryServer(props: ServerProps): Promise<react_jsx_runtime0.JSX.Element>;
10
14
  //#endregion
11
15
  export { SearchHistoryServer };
@@ -1,19 +1,21 @@
1
1
 
2
+ import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils/schema/index.mjs";
4
+ import { searchInputInspectorPropsSchema } from "./schema.mjs";
2
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
6
 
4
7
  //#region components/biz/business/search-input/client.d.ts
5
- interface SearchInputClientProps {
6
- placeholder?: string;
8
+ type SearchInputProps = InferSchemaProps<typeof searchInputInspectorPropsSchema>;
9
+ interface ClientProps extends SearchInputProps {
7
10
  defaultPlaceholder?: string;
8
11
  searchLabel?: string;
12
+ storageKey?: string;
13
+ onSearch?: (keyword: string) => void;
9
14
  }
10
15
  /**
11
- * 搜索输入框物料组件 - 客户端交互部分
16
+ * 搜索输入框物料组件 (SearchInput) - 客户端交互部分
17
+ * 适配 Figma 设计稿布局:包含返回按钮、带边框的输入框、外部搜索按钮
12
18
  */
13
- declare function SearchInputClient({
14
- placeholder,
15
- defaultPlaceholder,
16
- searchLabel
17
- }: SearchInputClientProps): react_jsx_runtime0.JSX.Element;
19
+ declare function SearchInputClient(props: ClientProps): react_jsx_runtime0.JSX.Element;
18
20
  //#endregion
19
- export { SearchInputClient };
21
+ export { SearchInputClient, SearchInputProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{Input as n}from"../../../ui/input.mjs";import{useSearchHistory as r}from"../../../../hooks/use-search-history.mjs";import{isPCEnv as i}from"../../../../utils/tools.mjs";import{HeaderNav as a}from"../../../common/header-nav/client.mjs";import o from"../../../../assets/icons/search.mjs";import s from"../../../../assets/icons/clear.mjs";import c from"../../../pages/search/style.module.mjs";import{useCallback as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useRouter as p}from"next/navigation";function m({placeholder:m,defaultPlaceholder:h=`搜索视频`,searchLabel:g=`搜索`}){let[_,v]=u(``),y=p(),{userInfo:b}=t(),{addHistory:x}=r({storageKey:b?.user_id||`guest`}),S=l(t=>{let n=t||_||h;n.trim()&&(x(n),e({q:n}),y.push(`${window.location.pathname}?q=${encodeURIComponent(n)}`))},[_,h,y,x]);return d(a,{className:`h-[55px]`,rightChild:d(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>S(_),children:d(`span`,{className:`text-[16px] text-text1`,children:g})}),centerChild:f(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[d(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),d(o,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),d(n,{id:`search-input-field`,placeholder:m||h,maxLength:20,value:_,className:c.searchInput,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),S(_))}}),_&&d(s,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px] cursor-pointer`,onClick:()=>{i()||(v(``),e({q:``}),y.push(window.location.pathname))}})]})})}export{m as SearchInputClient};
2
+ "use client";import e from"../../../../utils/event-bus.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{Text as r}from"../../../ui/text.mjs";import{eventKey as i}from"../../../../constants/event-key.mjs";import a from"../../../../assets/icons/left_arrow.mjs";import o from"../../../../assets/icons/search.mjs";import s from"../../../../assets/icons/clear.mjs";import{useCallback as c,useEffect as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{usePathname as p,useRouter as m,useSearchParams as h}from"next/navigation";function g(g){let{placeholder:_,defaultPlaceholder:v=`请输入搜索关键词`,searchLabel:y=`搜索`,storageKey:b=`guest`,onSearch:x}=g,[S,C]=u(``),w=m(),T=p(),E=h(),D=`search_history_${b}`,O=c(t=>{if(t.trim()){try{let n=localStorage.getItem(D),r=n?JSON.parse(n):[];r=[t,...r.filter(e=>e!==t)],localStorage.setItem(D,JSON.stringify(r.slice(0,20))),e.emit(i.SEARCH_HISTORY_UPDATE)}catch(e){console.error(`Failed to save search history`,e)}if(x)x(t);else{let e=new URLSearchParams(E.toString());e.set(`q`,t);let n=T.includes(`/search`)?T:`/search`;w.push(`${n}?${e.toString()}`)}}},[D,x,T,w,E]);l(()=>{let e=E.get(`q`);e&&e!==S&&(C(e),O(e))},[E,O,S]),l(()=>{if(S===``){if(E.has(`q`)){let e=new URLSearchParams(E.toString());e.delete(`q`);let t=T.includes(`/search`)?T:`/search`;w.push(`${t}${e.toString()?`?${e.toString()}`:``}`)}e.emit(i.SEARCH_HISTORY_UPDATE)}},[S,T,w,E]);let k=()=>{O(S)};return f(t,{className:`px-3 py-2 bg-bg1 flex items-center gap-3 w-full`,children:[d(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{w.back()},children:d(a,{className:`w-4 h-4 text-text1`})}),f(t,{className:`flex-1 flex items-center gap-1 bg-bg2 border border-theme5 rounded-[20px] px-2 py-1.5 overflow-hidden`,children:[d(t,{className:`p-1 shrink-0`,children:d(o,{className:`w-[14px] h-[14px] text-text3`})}),d(n,{className:`flex-1 border-none bg-transparent p-0 h-auto text-[14px] leading-[22px] focus-visible:ring-0 text-text1 placeholder:text-text3`,placeholder:_||v,value:S,onChange:e=>C(e.target.value),onKeyDown:e=>e.key===`Enter`&&k()}),S&&d(s,{className:`w-[15px] h-[15px] text-text3 shrink-0 cursor-pointer active:opacity-70`,onClick:()=>{C(``)}})]}),d(t,{className:`shrink-0 cursor-pointer active:opacity-70`,onClick:k,children:d(r,{className:`text-[16px] text-text1 leading-[24px] font-normal`,children:y})})]})}export{g as SearchInputClient};
@@ -1,5 +1,5 @@
1
1
 
2
- import { SearchInputClient } from "./client.mjs";
3
- import { SearchInputInspectorProps, SearchInputProps, searchInputInspectorDefaultProps, searchInputInspectorPropsSchema } from "./schema.mjs";
2
+ import { searchInputInspectorPropsSchema } from "./schema.mjs";
3
+ import { SearchInputClient, SearchInputProps } from "./client.mjs";
4
4
  import { SearchInputServer } from "./server.mjs";
5
5
  import { searchInputMaterial } from "./material.mjs";
@@ -1,19 +1,15 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
3
  import "../../../../utils.mjs";
4
- import z$1 from "zod";
4
+ import * as zod from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
5
6
 
6
7
  //#region components/biz/business/search-input/schema.d.ts
7
8
  /**
8
9
  * 搜索输入框物料属性定义
9
10
  */
10
- declare const searchInputInspectorPropsSchema: z$1.ZodObject<{
11
- placeholder: z$1.ZodString & SchemaHasDefaultValue;
12
- }, z$1.core.$strip>;
13
- declare const searchInputInspectorDefaultProps: {
14
- placeholder: string;
15
- };
16
- type SearchInputInspectorProps = z$1.infer<typeof searchInputInspectorPropsSchema>;
17
- type SearchInputProps = SearchInputInspectorProps;
11
+ declare const searchInputInspectorPropsSchema: zod.ZodObject<{
12
+ placeholder: zod.ZodString & SchemaHasDefaultValue;
13
+ }, zod_v4_core0.$strip>;
18
14
  //#endregion
19
- export { SearchInputInspectorProps, SearchInputProps, searchInputInspectorDefaultProps, searchInputInspectorPropsSchema };
15
+ export { searchInputInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,defineTextPropSchema as t,getSchemaDefaultProps as n}from"../../../../utils/schema/schema.mjs";const r=e({placeholder:t({label:`占位文本`,defaultValue:`搜索关键词`})}),i=n(r);export{i as searchInputInspectorDefaultProps,r as searchInputInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,defineTextPropSchema as t}from"../../../../utils/schema/schema.mjs";const n=e({placeholder:t({label:`占位文本`,defaultValue:`搜索关键词`})});export{n as searchInputInspectorPropsSchema};
@@ -1,5 +1,5 @@
1
1
 
2
- import { SearchInputProps } from "./schema.mjs";
2
+ import { SearchInputProps } from "./client.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/search-input/server.d.ts
@@ -1,13 +1,14 @@
1
1
 
2
- import { TabBarProps } from "./schema.mjs";
2
+ import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils/schema/index.mjs";
4
+ import { tabBarInspectorPropsSchema } from "./schema.mjs";
3
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
6
 
5
7
  //#region components/biz/business/tab-bar/client.d.ts
8
+ type TabBarProps = InferSchemaProps<typeof tabBarInspectorPropsSchema>;
6
9
  /**
7
10
  * TabBar 物料组件 - 客户端交互部分
8
11
  */
9
- declare function TabBarClient({
10
- items
11
- }: TabBarProps): react_jsx_runtime0.JSX.Element | null;
12
+ declare function TabBarClient(props: TabBarProps): react_jsx_runtime0.JSX.Element | null;
12
13
  //#endregion
13
- export { TabBarClient };
14
+ export { TabBarClient, TabBarProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/tabs/follow.mjs";import i from"../../../../assets/icons/tabs/follow_active.mjs";import a from"../../../../assets/icons/tabs/home.mjs";import o from"../../../../assets/icons/tabs/home_active.mjs";import s from"../../../../assets/icons/tabs/mine.mjs";import c from"../../../../assets/icons/tabs/mine_active.mjs";import{useEffect as l,useState as u,useTransition as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{usePathname as h}from"next/navigation";const g=`env(safe-area-inset-bottom, 0px)`;function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v={home:{icon:a,activeIcon:o},follow:{icon:r,activeIcon:i},mine:{icon:s,activeIcon:c}};function y({items:r}){let i=h(),[a,o]=u(null),[,s]=d(),[c,y]=u(!1);return l(()=>{y(!0)},[]),l(()=>{a&&_(i,a)&&s(()=>{o(null)})},[i,a]),!r||r.length===0?null:p(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line1 flex items-center justify-around z-50`,style:{height:`calc(56px + ${g})`,paddingBottom:g},children:r.map((r,s)=>{let l=c?_(a||i||``,r.path):!1,u=v[r.iconType]||v.home,d=m(f,{children:[p(l?u.activeIcon:u.icon,{width:22,height:22}),p(t,{className:`text-[10px] mt-[4px] ${l?`text-theme5`:`text-text2`}`,children:r.label})]});return l?p(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:d},`${r.path}-${s}`):p(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:()=>{r.path!==i&&o(r.path)},children:d},`${r.path}-${s}`)})})}export{y as TabBarClient};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import{useMemo as n}from"react";import{HomeIcon as r,UserIcon as i,UsersIcon as a}from"lucide-react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{usePathname as c,useRouter as l}from"next/navigation";const u=[];function d(d){let{items:f=u}=d,p=l(),m=c(),h=n(()=>f.findIndex(e=>e.path===m)||0,[f,m]),g=(e,t)=>{let n=`w-6 h-6 ${t?`text-brand`:`text-text3`}`;switch(e){case`home`:return o(r,{className:n});case`follow`:return o(a,{className:n});case`mine`:return o(i,{className:n});default:return o(r,{className:n})}};return!f||f.length===0?null:o(e,{className:`fixed bottom-0 left-0 right-0 bg-bg1 border-t border-line safe-area-bottom z-50`,children:o(e,{className:`flex h-[50px] items-center justify-around`,children:f.map((n,r)=>{let i=h===r;return s(e,{className:`flex flex-col items-center justify-center flex-1 cursor-pointer`,onClick:()=>p.push(n.path),children:[g(n.iconType,i),o(t,{className:`text-[10px] mt-0.5 ${i?`text-brand font-medium`:`text-text3`}`,children:n.label})]},r)})})})}export{d as TabBarClient};
@@ -1,5 +1,5 @@
1
1
 
2
- import { TabBarInspectorProps, TabBarProps, tabBarInspectorDefaultProps, tabBarInspectorPropsSchema } from "./schema.mjs";
3
- import { TabBarClient } from "./client.mjs";
2
+ import { tabBarInspectorPropsSchema } from "./schema.mjs";
3
+ import { TabBarClient, TabBarProps } from "./client.mjs";
4
4
  import { TabBarServer } from "./server.mjs";
5
5
  import { tabBarMaterial } from "./material.mjs";
@@ -1,27 +1,19 @@
1
1
 
2
2
  import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
3
3
  import "../../../../utils.mjs";
4
- import z$1 from "zod";
4
+ import * as zod from "zod";
5
+ import * as zod_v4_core0 from "zod/v4/core";
5
6
 
6
7
  //#region components/biz/business/tab-bar/schema.d.ts
7
8
  /**
8
9
  * TabBar 物料属性定义
9
10
  */
10
- declare const tabBarInspectorPropsSchema: z$1.ZodObject<{
11
- items: z$1.ZodArray<z$1.ZodObject<{
12
- label: z$1.ZodString & SchemaHasDefaultValue;
13
- path: z$1.ZodString & SchemaHasDefaultValue;
14
- iconType: z$1.ZodString & SchemaHasDefaultValue;
15
- }, z$1.core.$strip>> & SchemaHasDefaultValue;
16
- }, z$1.core.$strip>;
17
- declare const tabBarInspectorDefaultProps: {
18
- items: {
19
- label: string;
20
- path: string;
21
- iconType: string;
22
- }[];
23
- };
24
- type TabBarInspectorProps = z$1.infer<typeof tabBarInspectorPropsSchema>;
25
- type TabBarProps = TabBarInspectorProps;
11
+ declare const tabBarInspectorPropsSchema: zod.ZodObject<{
12
+ items: zod.ZodArray<zod.ZodObject<{
13
+ label: zod.ZodString & SchemaHasDefaultValue;
14
+ path: zod.ZodString & SchemaHasDefaultValue;
15
+ iconType: zod.ZodString & SchemaHasDefaultValue;
16
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
17
+ }, zod_v4_core0.$strip>;
26
18
  //#endregion
27
- export { TabBarInspectorProps, TabBarProps, tabBarInspectorDefaultProps, tabBarInspectorPropsSchema };
19
+ export { tabBarInspectorPropsSchema };
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineTextPropSchema as n,getSchemaDefaultProps as r}from"../../../../utils/schema/schema.mjs";const i=t({items:e(t({label:n({label:`名称`,defaultValue:`首页`}),path:n({label:`跳转路径`,defaultValue:`/`}),iconType:n({label:`图标类型`,defaultValue:`home`})}),{label:`导航项`,defaultValue:[{label:`首页`,path:`/`,iconType:`home`},{label:`关注`,path:`/user/follow`,iconType:`follow`},{label:`我的`,path:`/user/mine`,iconType:`mine`}]})}),a=r(i);export{a as tabBarInspectorDefaultProps,i as tabBarInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineTextPropSchema as n}from"../../../../utils/schema/schema.mjs";const r=t({items:e(t({label:n({label:`名称`,defaultValue:`首页`}),path:n({label:`跳转路径`,defaultValue:`/`}),iconType:n({label:`图标类型`,defaultValue:`home`})}),{label:`导航项`,defaultValue:[{label:`首页`,path:`/`,iconType:`home`},{label:`关注`,path:`/user/follow`,iconType:`follow`},{label:`我的`,path:`/user/mine`,iconType:`mine`}]})});export{r as tabBarInspectorPropsSchema};
@@ -1,5 +1,5 @@
1
1
 
2
- import { TabBarProps } from "./schema.mjs";
2
+ import { TabBarProps } from "./client.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/tab-bar/server.d.ts
@@ -1,22 +1,18 @@
1
1
 
2
- import { ContentRecommendInfo } from "../../../../types.mjs";
2
+ import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
3
+ import "../../../../utils/schema/index.mjs";
4
+ import { textRecommendInspectorPropsSchema } from "./schema.mjs";
3
5
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
6
 
5
7
  //#region components/biz/business/text-recommend/client.d.ts
6
- interface TextRecommendClientProps {
7
- title?: string;
8
- count?: string;
9
- initialList?: ContentRecommendInfo[];
10
- defaultTitle?: string;
8
+ type TextRecommendProps = InferSchemaProps<typeof textRecommendInspectorPropsSchema>;
9
+ interface ClientProps extends TextRecommendProps {
10
+ onItemClick?: (keyword: string) => void;
11
11
  }
12
12
  /**
13
- * 文字推荐物料组件 - 客户端交互部分
13
+ * 文字推荐物料组件 (推荐搜索) - 客户端交互部分
14
+ * 适配 Figma 设计稿布局:一行展示2个,包含“换一批”功能
14
15
  */
15
- declare function TextRecommendClient({
16
- title,
17
- count,
18
- initialList,
19
- defaultTitle
20
- }: TextRecommendClientProps): react_jsx_runtime0.JSX.Element;
16
+ declare function TextRecommendClient(props: ClientProps): react_jsx_runtime0.JSX.Element | null;
21
17
  //#endregion
22
- export { TextRecommendClient };
18
+ export { TextRecommendClient, TextRecommendProps };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as n}from"../../../../service/generated/client.mjs";import{useRequest as r}from"../../../../hooks/query/use-query.mjs";import i from"../../../../assets/icons/refresh.mjs";import{useMemo as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{useRouter as l}from"next/navigation";function u({title:u,count:d,initialList:f=[],defaultTitle:p=`推荐搜索`}){let{userInfo:m}=t(),h=m?.user_id||`guest`,g=l(),[_,v]=o(null),{data:y,refetch:b,isFetching:x}=r([`hotSearchKey`,h],()=>n({user_id:h}),{enabled:!1}),S=a(()=>_||(y?.data?.recommend_list??f).slice(0,Number(d||6)),[y,_,f,d]),C=async()=>{let e=await b();e.data?.data?.recommend_list&&v(e.data.data.recommend_list)},w=t=>{e({q:t}),g.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`)};return c(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[c(`div`,{className:`w-full px-[12px] h-[24px] mb-[12px] flex items-center justify-between`,children:[s(`span`,{className:`leading-[24px] text-[16px] text-text1 font-semibold`,children:u||p}),s(`div`,{className:`h-full px-[12px] flex items-center cursor-pointer`,onClick:C,children:s(i,{className:`w-[16px] h-[16px] text-text2 ${x?`animate-spin`:``}`})})]}),s(`div`,{className:`w-full px-[12px] flex gap-y-[16px] flex-wrap`,children:x&&!_?Array.from({length:Number(d||6)}).map((e,t)=>s(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`}`,children:s(`div`,{className:`w-[70%] h-[22px] bg-bg2 animate-pulse rounded`})},`skeleton-${t}`)):S.map((e,t)=>s(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`} cursor-pointer`,onClick:()=>w(e.title||``),children:s(`span`,{className:`text-text1 text-[14px] leading-[22px] max-w-[90%] line-clamp-1`,children:e.title})},String(e.title??t)))})]})}export{u as TextRecommendClient};
2
+ "use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../../assets/icons/refresh.mjs";import{useMemo as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useRouter as c,useSearchParams as l}from"next/navigation";const u=[];function d(d){let{title:f,displayCount:p=6,items:m=u,onItemClick:h}=d,g=c(),_=s(),v=l(),[y,b]=i(0),x=Math.ceil(m.length/p),S=r(()=>{if(m.length<=p)return m;let e=y%x*p;return m.slice(e,e+p)},[m,p,y,x]);if(m.length===0)return null;let C=e=>{e.stopPropagation(),b(e=>e+1)},w=e=>{if(h)h(e);else{let t=new URLSearchParams(v.toString());t.set(`q`,e);let n=_.includes(`/search`)?_:`/search`;g.push(`${n}?${t.toString()}`)}};return o(e,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full`,children:[o(e,{className:`flex items-center justify-between w-full`,children:[a(t,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:f||`推荐搜索`}),m.length>p&&o(e,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:C,children:[a(t,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),a(n,{className:`w-3 h-3 text-text3`})]})]}),a(e,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:S.map((n,r)=>a(e,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>w(n.label),children:a(t,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:n.label})},`${y}-${r}`))})]})}export{d as TextRecommendClient};
@@ -1,5 +1,5 @@
1
1
 
2
- import { TextRecommendClient } from "./client.mjs";
3
- import { TextRecommendInspectorProps, TextRecommendProps, textRecommendInspectorDefaultProps, textRecommendInspectorPropsSchema } from "./schema.mjs";
2
+ import { textRecommendInspectorPropsSchema } from "./schema.mjs";
3
+ import { TextRecommendClient, TextRecommendProps } from "./client.mjs";
4
4
  import { TextRecommendServer } from "./server.mjs";
5
5
  import { textRecommendMaterial } from "./material.mjs";
@@ -10,7 +10,10 @@ import * as zod_v4_core0 from "zod/v4/core";
10
10
  //#region components/biz/business/text-recommend/material.d.ts
11
11
  declare const textRecommendMaterial: DefineMaterialOption<typeof TextRecommendServer, typeof TextRecommendClient, zod.ZodObject<{
12
12
  title: zod.ZodString & SchemaHasDefaultValue;
13
- count: zod.ZodType<"4" | "6" | "8" | "10", unknown, zod_v4_core0.$ZodTypeInternals<"4" | "6" | "8" | "10", unknown>> & SchemaHasDefaultValue;
13
+ displayCount: zod.ZodNumber & SchemaHasDefaultValue;
14
+ items: zod.ZodArray<zod.ZodObject<{
15
+ label: zod.ZodString & SchemaHasDefaultValue;
16
+ }, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
14
17
  }, zod_v4_core0.$strip>, "text-recommend">;
15
18
  //#endregion
16
19
  export { textRecommendMaterial };