@funhub/platform 0.2.23 → 0.2.25

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 (99) hide show
  1. package/dist/biz.d.mts +6 -4
  2. package/dist/biz.mjs +1 -1
  3. package/dist/cli/init/create-client.mjs +1 -1
  4. package/dist/cli/init/shared/constants.mjs +1 -1
  5. package/dist/cli/init/shared/create-project.mjs +1 -1
  6. package/dist/cli/init/shared/prompts.mjs +1 -1
  7. package/dist/cli/init/shared/template.mjs +1 -1
  8. package/dist/cli.mjs +2 -2
  9. package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
  10. package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
  11. package/dist/components/biz/business/advertisement/ad-match.d.mts +0 -7
  12. package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
  13. package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
  14. package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +0 -3
  15. package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +0 -6
  16. package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
  17. package/dist/components/biz/business/channel-list/client.mjs +1 -1
  18. package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
  19. package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
  20. package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
  21. package/dist/components/biz/business/detail/shared/video-hero.mjs +1 -1
  22. package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
  23. package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
  24. package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
  25. package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
  26. package/dist/components/biz/business/index.d.mts +5 -3
  27. package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
  28. package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
  29. package/dist/components/biz/business/marquee/client.mjs +1 -1
  30. package/dist/components/biz/business/profile/index.d.mts +5 -3
  31. package/dist/components/biz/business/profile/profile-header/client.d.mts +3 -2
  32. package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
  33. package/dist/components/biz/business/profile/profile-header/index.d.mts +4 -2
  34. package/dist/components/biz/business/profile/profile-header/material.d.mts +44 -1
  35. package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
  36. package/dist/components/biz/business/profile/profile-header/my-client.d.mts +12 -0
  37. package/dist/components/biz/business/profile/profile-header/my-client.mjs +2 -0
  38. package/dist/components/biz/business/profile/profile-header/my-profile-actions.mjs +2 -0
  39. package/dist/components/biz/business/profile/profile-header/my-profile-header.mjs +2 -0
  40. package/dist/components/biz/business/profile/profile-header/schema.d.mts +13 -5
  41. package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
  42. package/dist/components/biz/business/profile/profile-header/shared.mjs +2 -0
  43. package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
  44. package/dist/components/biz/business/profile/profile-header/visitor-client.d.mts +12 -0
  45. package/dist/components/biz/business/profile/profile-header/visitor-client.mjs +2 -0
  46. package/dist/components/biz/business/profile/profile-header/visitor-profile-actions.mjs +2 -0
  47. package/dist/components/biz/business/profile/profile-header/visitor-profile-header.mjs +2 -0
  48. package/dist/components/biz/business/profile/profile-main/client.d.mts +1 -0
  49. package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
  50. package/dist/components/biz/business/profile/profile-main/index.d.mts +2 -2
  51. package/dist/components/biz/business/profile/profile-main/material.d.mts +3 -0
  52. package/dist/components/biz/business/profile/profile-main/schema.d.mts +7 -3
  53. package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
  54. package/dist/components/biz/business/profile/profile-main/shell.d.mts +4 -0
  55. package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
  56. package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
  57. package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
  58. package/dist/components/biz/business/profile/profile-main/variants.d.mts +22 -3
  59. package/dist/components/biz/business/profile/profile-main/variants.mjs +1 -1
  60. package/dist/components/biz/business/search-history/client.mjs +1 -1
  61. package/dist/components/biz/business/search-input/client.mjs +1 -1
  62. package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
  63. package/dist/components/biz/business/tab-bar/client.mjs +1 -1
  64. package/dist/components/biz/business/text-recommend/client.mjs +1 -1
  65. package/dist/components/common/analytics-init/page-lifecycle-tracker.mjs +1 -1
  66. package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +1 -1
  67. package/dist/components/common/popup-video/index.mjs +1 -1
  68. package/dist/components/common/tab-bar/index.mjs +1 -1
  69. package/dist/components/common/top-nav-bar/client.mjs +1 -1
  70. package/dist/components/common/video-player/video-blind-ad-overlay.mjs +1 -1
  71. package/dist/components/common/video-player/video-preroll-ad-overlay.mjs +1 -1
  72. package/dist/components/pages/collection-add/page.mjs +1 -1
  73. package/dist/components/pages/edit/page.mjs +1 -1
  74. package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
  75. package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
  76. package/dist/components/pages/search/page-client.mjs +1 -1
  77. package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
  78. package/dist/components/pages/search/top-header.mjs +1 -1
  79. package/dist/components/pages/search-result/page-client.mjs +1 -1
  80. package/dist/components/pages/search-result/top-header.mjs +1 -1
  81. package/dist/components/pages/settings/_components/settings.mjs +1 -1
  82. package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
  83. package/dist/components/ui/badge.d.mts +1 -1
  84. package/dist/components/ui/button.d.mts +2 -2
  85. package/dist/components/ui/image.d.mts +4 -4
  86. package/dist/hooks/use-content-operate.mjs +1 -1
  87. package/dist/materials.d.mts +2 -2
  88. package/dist/materials.mjs +1 -1
  89. package/dist/service/advertisement.d.mts +0 -4
  90. package/dist/service/advertisement.mjs +1 -1
  91. package/dist/utils/common.mjs +1 -1
  92. package/dist/utils/schema/inspector.d.mts +2 -2
  93. package/dist/utils/tracking.d.mts +11 -3
  94. package/dist/utils/tracking.mjs +1 -1
  95. package/dist/utils/use-compatible-router.mjs +1 -1
  96. package/dist/utils.d.mts +2 -2
  97. package/dist/utils.mjs +1 -1
  98. package/package.json +1 -1
  99. package/theme.css +0 -47
@@ -1,5 +1,5 @@
1
1
 
2
- import { InferSchemaProps } from "../../../../../utils/schema/schema.mjs";
2
+ import { InferSchemaProps, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
3
  import "../../../../../utils.mjs";
4
4
  import * as zod from "zod";
5
5
  import * as zod_v4_core0 from "zod/v4/core";
@@ -9,21 +9,29 @@ import * as zod_v4_core0 from "zod/v4/core";
9
9
  * 用户资料头部物料 inspector 配置。
10
10
  */
11
11
  declare const profileHeaderInspectorPropsSchema: zod.ZodObject<{
12
+ readonly defaultBackgroundSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
13
+ readonly enableCustomBackground: zod.ZodBoolean & SchemaHasDefaultValue;
14
+ readonly showInteractionSection: zod.ZodBoolean & SchemaHasDefaultValue;
15
+ } & {
12
16
  mode: zod.ZodOptional<zod.ZodEnum<{
13
17
  renderer: "renderer";
14
18
  editor: "editor";
15
19
  }>>;
16
20
  }, zod_v4_core0.$strip>;
17
- declare const profileHeaderInspectorDefaultProps: {};
21
+ declare const profileHeaderInspectorDefaultProps: {
22
+ readonly defaultBackgroundSrc: string;
23
+ readonly enableCustomBackground: boolean;
24
+ readonly showInteractionSection: boolean;
25
+ };
18
26
  type ProfileHeaderInspectorProps = InferSchemaProps<typeof profileHeaderInspectorPropsSchema>;
19
27
  interface UserProfileHeaderAuthConfig {
20
28
  headers?: Record<string, string>;
21
29
  }
22
- interface UserProfileHeaderClientProps extends ProfileHeaderInspectorProps {
30
+ interface UserProfileHeaderClientProps extends Partial<ProfileHeaderInspectorProps> {
23
31
  /** 用户 ID。 */
24
32
  id?: string;
25
- /** 是否允许自定义背景图。 */
26
- enableCustomBackground?: boolean;
33
+ /** 是否展示背景图。 */
34
+ showBackgroundImage?: boolean;
27
35
  /** 是否显示返回按钮。 */
28
36
  showBackButton?: boolean;
29
37
  /** 是否要求登录。 */
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({})),r=t(n);export{r as profileHeaderInspectorDefaultProps,n as profileHeaderInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({defaultBackgroundSrc:e.string(``,{label:`默认背景`,required:!1}),enableCustomBackground:e.boolean(!0,{fieldType:`switch`,label:`允许用户替换背景`,required:!0}),showInteractionSection:e.boolean(!0,{fieldType:`switch`,label:`是否展示互动组件`,required:!0})})),r=t(n);export{r as profileHeaderInspectorDefaultProps,n as profileHeaderInspectorPropsSchema};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Box as t}from"../../../../ui/box.mjs";import{Text as n}from"../../../../ui/text.mjs";import{UserProfileAvatar as r}from"./user-profile-avatar.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=`/images/mine/img_mine_head_bg.png`;function s(e){let t=typeof e==`string`?Number(String(e).trim()):Number(e??0);if(!Number.isFinite(t)||t<0)return`0`;let n=Math.floor(t);return n<1e3?String(n):n<1e6?`${(n/1e3).toFixed(1)}K`:n<1e9?`${(n/1e6).toFixed(1)}M`:`${(n/1e9).toFixed(1)}B`}function c({label:e,value:r}){return a(t,{className:`min-w-[64px] text-center`,children:[i(n,{as:`p`,className:`text-[16px] font-semibold leading-[22px] text-[var(--color-text-primary)]`,children:s(r)}),i(n,{as:`p`,className:`mt-0.5 text-[12px] leading-[18px] text-[var(--color-text-primary)]/66`,children:e})]})}function l({userInfo:o,interactionStats:s,showInteractionSection:l,canEditProfileMedia:u,shouldPromptLoginOnMediaClick:d,storeIsLogin:f,isMine:p,onOpenLoginDialog:m,actionSlot:h}){let g=o.name||``,_=o.description||o.signature||``;return a(t,{className:`relative z-10 mt-[56px]`,children:[a(t,{className:`flex items-start justify-between gap-4`,children:[a(t,{className:`w-[116px] shrink-0`,children:[i(r,{isMine:u,src:o.avatar||``,alt:g||`avatar`,onUnauthorizedClick:d?m:void 0}),i(t,{className:`pt-3`,children:i(n,{as:`p`,className:`break-words text-center text-[18px] font-semibold leading-[26px] text-[var(--color-text-primary)]`,onClick:()=>{!f&&p&&m()},children:g})})]}),a(t,{className:`min-w-0 flex-1 pt-1`,children:[l?i(t,{className:`flex items-start justify-end gap-6`,children:s.map(e=>i(c,{label:e.label,value:e.value},e.key))}):null,l&&h?i(t,{className:e(`mt-6 flex justify-end gap-3`),children:h}):null]})]}),_&&i(t,{className:`pt-8`,children:i(n,{as:`p`,className:`line-clamp-2 break-words text-[14px] leading-[20px] text-[rgba(255,255,255,0.8)]`,children:_})})]})}export{l as ProfileHeaderContent,o as defaultBackground};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{BackgroundPreviewModal as c}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{defaultBackground as l}from"./client.mjs";import{toast as u}from"sonner";import{useCallback as d,useEffect as f,useRef as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";const y=[`image/jpeg`,`image/png`];function b(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return y.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function x({isMine:y,enableCustomBackground:x=!0,src:S,onUnauthorizedClick:C}){let w=v(`components.pages.profile`),T=l,E=p(null),{userId:D,setUserInfo:O,userInfo:k}=e(),A=o(),[j,M]=m(!1),[N,P]=m(!1),[F,I]=m(!1),[L,R]=m(``),z=x&&(!!y||typeof C==`function`),B=d(()=>{L&&(URL.revokeObjectURL(L),R(``))},[L]),V=()=>{if(x){if(y){j||P(!0);return}C?.()}},H=()=>{P(!1)};function U(){j||E.current?.click()}async function W(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!b(t)){u.error(w(`client.imageTypeInvalid`));return}if(t.size>5242880){u.error(w(`client.imageTooLarge`));return}B(),R(URL.createObjectURL(t)),P(!1),I(!0)}catch(e){console.error(`上传背景图失败`,e),u.error(w(`client.uploadFailed`))}}let G=d(()=>{I(!1),B()},[B]);f(()=>{x||(P(!1),I(!1),B())},[B,x]);async function K(e){if(!D){u.error(w(`client.loginRequiredForUpload`));return}try{M(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(D),bg_image:r.objectKey}),O({...k,bg_image:r.objectKey}),A([`user-profile`,`mine`]),P(!1),I(!1),u.success(w(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),u.error(w(`client.uploadFailed`))}finally{B(),M(!1)}}return _(h,{children:[g(i,{className:`h-[284px]`,children:x?g(i,{className:`relative h-full w-full`,onClick:z?V:void 0,children:g(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:S||T})}):g(i,{className:`h-full w-full bg-bg1`})}),x&&_(h,{children:[g(c,{open:N,onClose:H,bgUrl:S||T,onUpload:U}),g(a,{ref:E,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:W}),g(s,{open:F,onClose:G,imageSrc:L,onConfirm:K,cropShape:`rect`,aspectRatio:430/256})]})]})}export{x as UserProfileCoverBackground};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as s}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{defaultBackground as c}from"./shared.mjs";import{BackgroundPreviewModal as l}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{toast as u}from"sonner";import{useCallback as d,useEffect as f,useRef as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";const y=[`image/jpeg`,`image/png`];function b(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return y.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function x({isMine:y,enableCustomBackground:x=!0,src:S,onUnauthorizedClick:C}){let w=v(`components.pages.profile`),T=c,E=p(null),{userId:D,setUserInfo:O,userInfo:k}=e(),A=o(),[j,M]=m(!1),[N,P]=m(!1),[F,I]=m(!1),[L,R]=m(``),z=x&&(!!y||typeof C==`function`),B=d(()=>{L&&(URL.revokeObjectURL(L),R(``))},[L]),V=()=>{if(x){if(y){j||P(!0);return}C?.()}},H=()=>{P(!1)};function U(){j||E.current?.click()}async function W(e){let t=e.target.files?.[0];if(e.target&&(e.target.value=``),t)try{if(!b(t)){u.error(w(`client.imageTypeInvalid`));return}if(t.size>5242880){u.error(w(`client.imageTooLarge`));return}B(),R(URL.createObjectURL(t)),P(!1),I(!0)}catch(e){console.error(`上传背景图失败`,e),u.error(w(`client.uploadFailed`))}}let G=d(()=>{I(!1),B()},[B]);f(()=>{x||(P(!1),I(!1),B())},[B,x]);async function K(e){if(!D){u.error(w(`client.loginRequiredForUpload`));return}try{M(!0);let r=await n(new File([e],`background.jpg`,{type:`image/jpeg`}),1);await t({user_id:String(D),bg_image:r.objectKey}),O({...k,bg_image:r.objectKey}),A([`user-profile`,`mine`]),P(!1),I(!1),u.success(w(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),u.error(w(`client.uploadFailed`))}finally{B(),M(!1)}}return _(h,{children:[g(i,{className:`h-[284px]`,children:x?g(i,{className:`relative h-full w-full`,onClick:z?V:void 0,children:g(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:S||T})}):g(i,{className:`h-full w-full bg-bg1`})}),x&&_(h,{children:[g(l,{open:N,onClose:H,bgUrl:S||T,onUpload:U}),g(a,{ref:E,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:W}),g(s,{open:F,onClose:G,imageSrc:L,onConfirm:K,cropShape:`rect`,aspectRatio:430/256})]})]})}export{x as UserProfileCoverBackground};
@@ -0,0 +1,12 @@
1
+
2
+ import { UserProfileHeaderClientProps } from "./schema.mjs";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region components/biz/business/profile/profile-header/visitor-client.d.ts
6
+ /**
7
+ * 他人主页头部组件入口。
8
+ * 在编辑器里强制走访客视角,便于单独编辑关注/私信布局。
9
+ */
10
+ declare function VisitorProfileHeaderClient(props: UserProfileHeaderClientProps): react_jsx_runtime0.JSX.Element;
11
+ //#endregion
12
+ export { VisitorProfileHeaderClient };
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{UserProfileHeaderClient as e}from"./client.mjs";import{jsx as t}from"react/jsx-runtime";function n(n){let{mode:r=`renderer`,currentUserId:i,id:a,requireLogin:o=!1,...s}=n,c=i||`editor-preview-viewer-user`,l=r===`editor`?`editor-preview-visitor-user`:a;return t(e,{...s,mode:r,requireLogin:o,currentUserId:c,id:l})}export{n as VisitorProfileHeaderClient};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{pInteractionFollow as t,pInteractionUnfollow as n}from"../../../../../service/generated/client.mjs";import{Button as r}from"../../../../ui/button.mjs";import{toast as i}from"../../../../../ui.mjs";import{useLoginModalStore as a}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as o,useMutation as s,useUpdateRequest as c}from"../../../../../hooks/query/use-query.mjs";import{useEffect as l,useState as u}from"react";import{Check as d,MessageCircle as f,Plus as p}from"lucide-react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _({userId:f,currentUserId:_,isFollowing:v,useLocalPreview:y=!1}){let b=g(`components.pages.profile`),{open:x}=a(),S=o(),C=c(),[w,T]=u(!!v),{mutateAsync:E,isPending:D}=s(async e=>t(e)),{mutateAsync:O,isPending:k}=s(async e=>n(e)),A=D||k,j=!!_&&!!f&&!y&&_!==f;l(()=>{T(!!v)},[v]);async function M(){return E({app_id:0,follower_id:_||``,followee_id:f})}async function N(){return O({app_id:0,follower_id:_||``,followee_id:f})}function P(e){C([`user-profile`,`profile`,f],t=>!t||!t.data?t:{...t,data:{...t.data,is_following:e}})}async function F(){if(!A){if(!j){T(e=>!e);return}if(!_){x();return}try{if(w){let e=await N();e.code===0?(i.success(b(`client.unfollowSuccess`),{duration:1500}),T(!1),P(!1),S([`check-follow`,f]),S([`user-profile`,`profile`,f])):i.error(e.message||b(`client.unfollowFailed`))}else{let e=await M();e.code===0?(i.success(b(`client.followSuccess`),{duration:1500}),T(!0),P(!0),S([`check-follow`,f]),S([`user-profile`,`profile`,f])):i.error(e.message||b(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),i.error(b(`client.operationFailed`))}}}return h(r,{type:`button`,variant:`ghost`,size:`xs`,className:e(`h-7 min-w-0 gap-1 rounded-full border px-3 py-0 text-[12px] font-medium leading-[18px] shadow-none`,`disabled:pointer-events-none disabled:opacity-100`,w?`!border-text3 !bg-transparent !text-text3 hover:!bg-transparent hover:!text-text3`:`!border-theme5 !bg-transparent !text-theme5 hover:!bg-transparent hover:!text-theme5`),onClick:F,disabled:A,children:[m(w?d:p,{className:`size-3`}),b(A?`client.processing`:w?`client.followed`:`client.follow`)]})}function v({userId:e,currentUserId:t}){let n=g(`components.pages.profile`);return h(r,{type:`button`,variant:`ghost`,size:`xs`,className:`h-7 min-w-0 gap-1 rounded-full border border-text3 bg-transparent px-3 py-0 text-[12px] font-medium leading-[18px] text-text3 shadow-none hover:!bg-transparent hover:!text-text3 disabled:pointer-events-none disabled:opacity-100`,disabled:!0,children:[m(f,{className:`size-3`}),n(`client.message`)]})}export{_ as FollowButton,v as MessageButton};
@@ -0,0 +1,2 @@
1
+
2
+ "use client";import{ProfileHeaderContent as e}from"./shared.mjs";import{FollowButton as t,MessageButton as n}from"./visitor-profile-actions.mjs";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";function o({userInfo:o,interactionStats:s,showInteractionSection:c,canEditProfileMedia:l,shouldPromptLoginOnMediaClick:u,storeIsLogin:d,isMine:f,currentUserId:p,onOpenLoginDialog:m,useLocalPreview:h=!1}){let g=o.userId||``;return i(e,{userInfo:o,interactionStats:s,showInteractionSection:c,canEditProfileMedia:l,shouldPromptLoginOnMediaClick:u,storeIsLogin:d,isMine:f,onOpenLoginDialog:m,actionSlot:g?a(r,{children:[i(t,{userId:g,currentUserId:p,isFollowing:o.isFollowing,useLocalPreview:h}),i(n,{userId:g,currentUserId:p})]}):null})}export{o as VisitorProfileHeader};
@@ -7,6 +7,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
7
7
  * 用户资料主体客户端组件。
8
8
  */
9
9
  declare function UserProfileMainClient({
10
+ contentTypes,
10
11
  id,
11
12
  showCreateAction,
12
13
  requireLogin,
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{profileMainMineTabOptions as r,profileMainProfileTabOptions as i}from"./variants.mjs";import{UserProfileMainShell as a}from"./shell.mjs";import{CollectVideoWaterfall as o}from"./tabs/collect-tab/video-waterfall.mjs";import{CollectTab as s}from"./tabs/collect-tab/client.mjs";import{HistoryTab as c}from"./tabs/history-tab/client.mjs";import{LikeTab as l}from"./tabs/like-tab/client.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";function m(e){return e*1e3}const h=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map((e,t)=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:m(e.createTime),is_more_link:e.isMoreLink,imgType:t%3==1?`long`:`short`,description:`示例文案,用于低代码编辑器预览列表第二行。`}));function g({isMine:e,tab:t}){let n=e?r:i;return t&&n.includes(t)?t:n[0]}function _(e,t){return e&&(t===`collect`||t===`like`)}function v({id:r,showCreateAction:i=!1,requireLogin:m=!1,className:v,currentUserId:y,mode:b=`renderer`,tab:x}){let S=b===`renderer`,C=e(e=>e.userId),[w]=p(`tab`,f),T=b===`editor`?``:y||C||``,E=r==null||!!T&&r===T,D=!E&&!!r,O=E?T:r?String(r):void 0,k=E?[`user-profile`,`mine`]:[`user-profile`,`profile`,r],A=u(()=>g({isMine:E,tab:w??x}),[E,x,w]),j=S&&_(D,A)&&!!r,{data:M}=n([`user-profile`,`privacy`,r,T],async()=>await t({target_user_id:String(r),user_id:T||String(r)}),{staleTime:0,enabled:j}),N=`content`;if(b===`editor`)N=`content`;else if(m&&E&&!T)N=`login-required`;else if(j&&M){let e=M.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;A===`collect`&&!t&&(N=`privacy-collect`),A===`like`&&!n&&(N=`privacy-like`)}let P=N===`content`&&(!j||!!M),F=null;if(b===`editor`)F=d(o,{list:h,loading:!1,hasMore:!1});else if(P)switch(A){case`like`:F=d(l,{mode:b,isMine:E,targetUserId:O,queryKeyPrefix:k});break;case`history`:F=d(c,{mode:b,targetUserId:O,queryKeyPrefix:k});break;default:F=d(s,{mode:b,isMine:E,userId:O,showCreateAction:i&&E,queryKeyPrefix:k});break}return d(a,{profileId:r,currentUserId:T,isMine:E,renderMode:N,className:v,children:F})}export{v as UserProfileMainClient};
2
+ "use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gUserViewUserInfo as t}from"../../../../../service/generated/client.mjs";import{useRequest as n}from"../../../../../hooks/query/use-query.mjs";import{UserProfileMainShell as r}from"./shell.mjs";import{CollectVideoWaterfall as i}from"./tabs/collect-tab/video-waterfall.mjs";import{CollectTab as a}from"./tabs/collect-tab/client.mjs";import{HistoryTab as o}from"./tabs/history-tab/client.mjs";import{LikeTab as s}from"./tabs/like-tab/client.mjs";import{PublishTab as c}from"./tabs/publish-tab/client.mjs";import{getProfileMainTabOptions as l}from"./variants.mjs";import{useMemo as u}from"react";import{jsx as d}from"react/jsx-runtime";import{parseAsString as f,useQueryState as p}from"nuqs";const m=[];function h(e){return e*1e3}const g=[{id:`00d21b841126c976`,title:`朝朝暮暮都是你`,coverImage:`/md-204/uploads/default/other/2024-04-15/2750647625e6193940163169b77fb566.jpg`,duration:192,viewCount:237,createTime:1772175066,isMoreLink:!0},{id:`009f2e1820718add`,title:`狗哥的乡村爱情故事`,coverImage:`/md-204/uploads/default/other/2024-04-11/579bc5eb807d29657828945330b0ac47.jpg`,duration:74,viewCount:191,createTime:1770714221,isMoreLink:!0},{id:`02e2a11f78a3ffbf`,title:`唯爱百分之十二`,coverImage:`/md-204/resource/b6/b689e34f40d0e5baccb8f79630b99425.jpg`,duration:3348,viewCount:214,createTime:1770347155,isMoreLink:!0},{id:`2c19073cbd3c5c5a`,title:`疯狂磕学家`,coverImage:`/md-204/uploads/default/other/2024-08-23/5e174eeb8f2009dd7bb797fcabd5a649.jpg`,duration:2359,viewCount:17,createTime:1769757646,isMoreLink:!0},{id:`07e029915c2a9c96`,title:`我和祖宗做交易`,coverImage:`/md-204/uploads/default/other/2024-05-23/b53e50fa75986b41aac766c253a91fea.jpg`,duration:194,viewCount:75,createTime:1769670600,isMoreLink:!0},{id:`0ae1056a620b286f`,title:`识汝不识丁`,coverImage:`/md-204/uploads/default/other/2024-08-24/8958d46da3087a420d1d55e691dcb10a.jpg`,duration:2053,viewCount:13,createTime:1769651310,isMoreLink:!0},{id:`05564bf1aaf5fad6`,title:`我们的天空`,coverImage:`/md-204/resource/1a/1af6ce7117dcda390cf08db26e832684.jpg`,duration:2737,viewCount:180,createTime:1769566315,isMoreLink:!0},{id:`00f61e5be01409bb`,title:`我初初爱你`,coverImage:`/md-204/resource/bd/bd657a65bc6adc202a94acb8aca33f38.jpg`,duration:2898,viewCount:362,createTime:1769410683,isMoreLink:!0},{id:`062cd69d44fcb772`,title:`料理情缘`,coverImage:`/md-204/uploads/default/other/2023-11-27/de0491f07909b05fa012d15552e02cd0.png`,duration:2726,viewCount:33,createTime:1769157580,isMoreLink:!0},{id:`05751871b640b1a7`,title:`穷小伙被碎玻璃割伤眼睛,却因祸得福获得了一只超能神眼,人生直接开挂,之前欺负他的人统统匍匐在他脚下,征服姐妹花,走向人生巅峰!`,coverImage:`/md-204/dcc-file/29/29a0fdc86f0d756ad8f123e81693d233-small.jpgbnc`,duration:9236,viewCount:137,createTime:1769157575,isMoreLink:!1}].map((e,t)=>({id:e.id,title:e.title,coverImage:e.coverImage,duration:e.duration,authorName:``,viewCount:e.viewCount,publishTime:h(e.createTime),is_more_link:e.isMoreLink,imgType:t%3==1?`long`:`short`,description:`示例文案,用于低代码编辑器预览列表第二行。`}));function _({contentTypes:e,tab:t}){let n=l(e);return t&&n.includes(t)?t:n[0]}function v(e,t){return e&&(t===`collect`||t===`like`)}function y({contentTypes:h=m,id:y,showCreateAction:b=!1,requireLogin:x=!1,className:S,currentUserId:C,mode:w=`renderer`,tab:T}){let E=w===`renderer`,D=e(e=>e.userId),[O]=p(`tab`,f),k=w===`editor`?``:C||D||``,A=y==null||!!k&&y===k,j=!A&&!!y,M=A?k:y?String(y):void 0,N=A?[`user-profile`,`mine`]:[`user-profile`,`profile`,y],P=u(()=>l(h),[h]),F=u(()=>_({contentTypes:h,tab:O??T}),[h,T,O]),I=E&&v(j,F)&&!!y,{data:L}=n([`user-profile`,`privacy`,y,k],async()=>await t({target_user_id:String(y),user_id:k||String(y)}),{staleTime:0,enabled:I}),R=`content`;if(w===`editor`)R=`content`;else if(x&&A&&!k)R=`login-required`;else if(I&&L){let e=L.data??{},t=Number(e.collections_open??1)>0,n=Number(e.like_open??1)>0;F===`collect`&&!t&&(R=`privacy-collect`),F===`like`&&!n&&(R=`privacy-like`)}let z=R===`content`&&(!I||!!L),B=null;if(w===`editor`)B=d(i,{list:g,loading:!1,hasMore:!1});else if(z)switch(F){case`like`:B=d(s,{mode:w,isMine:A,targetUserId:M,queryKeyPrefix:N});break;case`history`:B=d(o,{mode:w,targetUserId:M,queryKeyPrefix:N});break;case`publish`:B=d(c,{mode:w,targetUserId:M,queryKeyPrefix:N,isMine:A});break;default:B=d(a,{mode:w,isMine:A,userId:M,showCreateAction:b&&A,queryKeyPrefix:N});break}return d(r,{profileId:y,currentUserId:k,isMine:A,tabs:P,renderMode:R,className:S,children:B})}export{y as UserProfileMainClient};
@@ -3,6 +3,7 @@ import { ProfileMainInspectorProps, UserProfileMainProps, profileMainInspectorDe
3
3
  import { UserProfileMainClient } from "./client.mjs";
4
4
  import { UserProfileMain } from "./server.mjs";
5
5
  import { profileMainMaterial } from "./material.mjs";
6
+ import { ProfileMainBaseTabKey, ProfileMainContentType, ProfileMainTabKey, getProfileMainTabOptions, profileMainBaseTabOptions, profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainContentTypeOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainPublishTabOption, profileMainTabOptions } from "./variants.mjs";
6
7
  import { UserProfileMainRenderMode, UserProfileMainShell, UserProfileMainShellProps } from "./shell.mjs";
7
8
  import { CollectTab, CollectTabProps } from "./tabs/collect-tab/client.mjs";
8
9
  import { CollectTabServer } from "./tabs/collect-tab/server.mjs";
@@ -12,5 +13,4 @@ import { LikeDetailItem, LikeTab, LikeTabProps } from "./tabs/like-tab/client.mj
12
13
  import { LikeTabServer } from "./tabs/like-tab/server.mjs";
13
14
  import { PublishTab, PublishTabProps, PublishTabUserInfo } from "./tabs/publish-tab/client.mjs";
14
15
  import { PublishTabServer } from "./tabs/publish-tab/server.mjs";
15
- import "./tabs/index.mjs";
16
- import { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions } from "./variants.mjs";
16
+ import "./tabs/index.mjs";
@@ -1,4 +1,5 @@
1
1
 
2
+ import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
2
3
  import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
3
4
  import "../../../../../utils.mjs";
4
5
  import { UserProfileMainClient } from "./client.mjs";
@@ -8,6 +9,8 @@ import * as zod_v4_core0 from "zod/v4/core";
8
9
 
9
10
  //#region components/biz/business/profile/profile-main/material.d.ts
10
11
  declare const profileMainMaterial: DefineMaterialOption<typeof UserProfileMain, typeof UserProfileMainClient, zod.ZodObject<{
12
+ readonly contentTypes: zod.ZodOptional<zod.ZodArray<zod.ZodType<"video" | "novel" | "comic" | "post", unknown, zod_v4_core0.$ZodTypeInternals<"video" | "novel" | "comic" | "post", unknown>>>> & SchemaHasDefaultValue;
13
+ } & {
11
14
  mode: zod.ZodOptional<zod.ZodEnum<{
12
15
  renderer: "renderer";
13
16
  editor: "editor";
@@ -1,20 +1,24 @@
1
1
 
2
- import { InferSchemaProps, MaterialComponentMode } from "../../../../../utils/schema/schema.mjs";
2
+ import { InferSchemaProps, MaterialComponentMode, SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
3
3
  import "../../../../../utils.mjs";
4
4
  import * as zod from "zod";
5
5
  import * as zod_v4_core0 from "zod/v4/core";
6
6
 
7
7
  //#region components/biz/business/profile/profile-main/schema.d.ts
8
8
  /**
9
- * 用户资料主体物料暂不对外开放 inspector 配置。
9
+ * 用户资料主体物料 inspector 配置。
10
10
  */
11
11
  declare const profileMainInspectorPropsSchema: zod.ZodObject<{
12
+ readonly contentTypes: zod.ZodOptional<zod.ZodArray<zod.ZodType<"video" | "novel" | "comic" | "post", unknown, zod_v4_core0.$ZodTypeInternals<"video" | "novel" | "comic" | "post", unknown>>>> & SchemaHasDefaultValue;
13
+ } & {
12
14
  mode: zod.ZodOptional<zod.ZodEnum<{
13
15
  renderer: "renderer";
14
16
  editor: "editor";
15
17
  }>>;
16
18
  }, zod_v4_core0.$strip>;
17
- declare const profileMainInspectorDefaultProps: {};
19
+ declare const profileMainInspectorDefaultProps: {
20
+ readonly contentTypes: ("video" | "novel" | "comic" | "post")[];
21
+ };
18
22
  type ProfileMainInspectorProps = InferSchemaProps<typeof profileMainInspectorPropsSchema>;
19
23
  interface ProfileMainRuntimeTabProps {
20
24
  tab?: string;
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({})),r=t(n);export{r as profileMainInspectorDefaultProps,n as profileMainInspectorPropsSchema};
2
+ import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import{profileMainContentTypeOptions as n}from"./variants.mjs";const r=e(e=>({contentTypes:e.array(e.enum(n),{label:`内容类型配置`,description:`可多选视频、小说、漫画、帖子;仅当选择“帖子”时,内容分类标签额外展示“发布”。`,required:!1,defaultValue:[]})})),i=t(r);export{i as profileMainInspectorDefaultProps,r as profileMainInspectorPropsSchema};
@@ -1,4 +1,5 @@
1
1
 
2
+ import { ProfileMainTabKey } from "./variants.mjs";
2
3
  import { PropsWithChildren } from "react";
3
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
5
 
@@ -11,6 +12,8 @@ interface UserProfileMainShellProps extends PropsWithChildren {
11
12
  currentUserId?: string;
12
13
  /** 是否为本人视角。 */
13
14
  isMine: boolean;
15
+ /** 当前允许展示的主 Tab 列表。 */
16
+ tabs: ProfileMainTabKey[];
14
17
  /** 当前内容区渲染模式。 */
15
18
  renderMode: UserProfileMainRenderMode;
16
19
  /** 主体容器附加类名。 */
@@ -23,6 +26,7 @@ declare function UserProfileMainShell({
23
26
  profileId,
24
27
  currentUserId,
25
28
  isMine,
29
+ tabs,
26
30
  renderMode,
27
31
  className,
28
32
  children
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{Button as n}from"../../../../ui/button.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{trackProfilePageClick as u}from"../tracking.mjs";import{profileMainMineTabOptions as d,profileMainProfileTabOptions as f}from"./variants.mjs";import{useEffect as p,useId as m,useMemo as h,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useTranslations as y}from"next-intl";import{parseAsString as b,useQueryState as x}from"nuqs";function S(e){let t=m();return v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`37`,height:`10`,viewBox:`0 0 37 10`,fill:`none`,...e,children:[_(`path`,{d:`M32.8921 0.212888C34.4317 -0.398985 36.1765 0.353067 36.7886 1.89258C37.4004 3.43219 36.6484 5.17704 35.1089 5.78906L29.9204 7.85058C26.0475 9.38961 21.7156 9.29046 17.9175 7.57519C15.9234 6.67463 13.6771 6.5 11.5679 7.08203L3.79833 9.22656C2.20143 9.66708 0.549808 8.72958 0.108873 7.13281C-0.331916 5.53567 0.605478 3.88317 2.20262 3.44238L9.97118 1.29785C13.431 0.342993 17.1161 0.629191 20.3872 2.10644C22.7028 3.15218 25.3434 3.21271 27.7046 2.27441L32.8921 0.212888Z`,fill:`url(#${t})`}),_(`defs`,{children:v(`linearGradient`,{id:t,x1:`3.00047`,y1:`5.00097`,x2:`34.0005`,y2:`5.00097`,gradientUnits:`userSpaceOnUse`,children:[_(`stop`,{stopColor:`var(--color-brand-tag-gradient-start)`}),_(`stop`,{offset:`1`,stopColor:`var(--color-brand-tag-gradient-end)`})]})})]})}function C(e){return v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,...e,children:[_(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),_(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]})}function w(e){return e?[...d]:[...f]}function T(e,t){let n=w(t);return n.includes(e)?e:n[0]}function E(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function D(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(E(t))return t;t=t.parentElement}return null}function O(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function k(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function A({profileId:d,currentUserId:f,isMine:m,renderMode:E,className:A,children:j}){let M=y(`components.pages.profile`),N=g(null),P=l(e=>e.open),F=t(e=>e.userId),I=g(``),L=w(m),[R,z]=x(`tab`,b.withDefault(`collect`)),B=h(()=>T(R,m),[m,R]),V=f||F||``,H=m?V:d,U=h(()=>`profile-scroll:${H||(m?`mine`:`guest`)}:${B}`,[m,B,H]);p(()=>{R!==B&&z(B,{shallow:!1})},[B,z,R]),p(()=>{if(typeof window>`u`)return;let e=`${m?`mine`:`profile`}:${H||``}:${B}`;I.current!==e&&(I.current=e)},[m,d,V,B,H]),p(()=>{if(typeof window>`u`)return;let e=D(N.current),t=window.sessionStorage.getItem(U),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{k(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(U,String(O(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[U]);let W={collect:M(`client.collect`),like:M(`client.like`),history:M(`client.history`)},G=j;return E===`login-required`?G=v(r,{className:`flex flex-col items-center pt-[132px] text-center`,children:[_(C,{className:`h-[58px] w-[68px]`}),_(a,{className:`mt-[16px] text-[15px] leading-[normal] text-[#54525E]`,children:M(`client.loginToSeeMoreVideos`)}),_(n,{type:`button`,onClick:P,className:`mt-[16px] h-[40px] min-w-[100px] rounded-[8px] border-0 bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] px-[24px] py-0 text-[16px] font-normal leading-[24px] text-white active:opacity-90`,children:M(`client.loginNow`)})]}):E===`privacy-collect`?G=_(i,{type:`no-content`,text:M(`client.collectionNotPublic`)}):E===`privacy-like`&&(G=_(i,{type:`no-content`,text:M(`client.likeNotPublic`)})),v(r,{ref:N,className:e(`relative grow overflow-hidden rounded-t-[24px] bg-[var(--color-surface-panel-dark)]`,A),children:[_(r,{className:`sticky top-0 z-10 bg-[var(--color-surface-panel-dark)] px-4 pt-8`,children:_(o,{value:B,onValueChange:e=>{z(e,{shallow:!1})},className:`h-6 w-full`,children:_(s,{variant:`default`,className:`h-6 w-fit gap-8 px-0`,children:L.map(t=>v(c,{value:t,onClick:e=>{u(e,`${t}_tab`)},className:e(`group/profile-main-tab !flex-none !h-6 min-w-8 !px-0 !py-0 !pb-0 text-[16px] !font-normal leading-6 text-[var(--color-text-secondary)]`,`data-[active]:!text-text1 data-[active]:!font-semibold data-[active]:!text-[18px]`,`data-[state=active]:!text-text1 data-[state=active]:!font-semibold data-[state=active]:!text-[18px]`,`after:hidden`),children:[_(S,{"aria-hidden":`true`,className:e(`pointer-events-none absolute bottom-0 left-1/2 h-[10px] w-[37px] -translate-x-1/2 opacity-0 transition-opacity duration-200`,`group-data-[active]/profile-main-tab:opacity-100`,`group-data-[state=active]/profile-main-tab:opacity-100`)}),_(`span`,{className:`relative z-10`,children:W[t]})]},t))})})}),_(r,{className:`relative px-4 pb-6 pt-7`,children:G})]})}export{A as UserProfileMainShell};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{Button as n}from"../../../../ui/button.mjs";import{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{trackProfilePageClick as u}from"../tracking.mjs";import{useEffect as d,useId as f,useMemo as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import{parseAsString as v,useQueryState as y}from"nuqs";function b(e){let t=f();return g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`37`,height:`10`,viewBox:`0 0 37 10`,fill:`none`,...e,children:[h(`path`,{d:`M32.8921 0.212888C34.4317 -0.398985 36.1765 0.353067 36.7886 1.89258C37.4004 3.43219 36.6484 5.17704 35.1089 5.78906L29.9204 7.85058C26.0475 9.38961 21.7156 9.29046 17.9175 7.57519C15.9234 6.67463 13.6771 6.5 11.5679 7.08203L3.79833 9.22656C2.20143 9.66708 0.549808 8.72958 0.108873 7.13281C-0.331916 5.53567 0.605478 3.88317 2.20262 3.44238L9.97118 1.29785C13.431 0.342993 17.1161 0.629191 20.3872 2.10644C22.7028 3.15218 25.3434 3.21271 27.7046 2.27441L32.8921 0.212888Z`,fill:`url(#${t})`}),h(`defs`,{children:g(`linearGradient`,{id:t,x1:`3.00047`,y1:`5.00097`,x2:`34.0005`,y2:`5.00097`,gradientUnits:`userSpaceOnUse`,children:[h(`stop`,{stopColor:`var(--color-brand-tag-gradient-start)`}),h(`stop`,{offset:`1`,stopColor:`var(--color-brand-tag-gradient-end)`})]})})]})}function x(e){return g(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`68`,height:`58`,viewBox:`0 0 68 58`,fill:`none`,...e,children:[h(`rect`,{x:`0.5`,y:`0.5`,width:`67`,height:`57`,rx:`7.5`,fill:`#1B1829`,stroke:`#322F3E`}),h(`path`,{d:`M27.1175 33.8211L27.118 23.9652C27.1182 21.7159 29.502 20.2667 31.4989 21.3021L40.5835 26.0125C42.6976 27.1086 42.7531 30.1126 40.681 31.2861L31.5959 36.4317C29.596 37.5644 27.1173 36.1195 27.1175 33.8211Z`,fill:`#54525E`})]})}function S(e,t){return t.includes(e)?e:t[0]}function C(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function w(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(C(t))return t;t=t.parentElement}return null}function T(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function E(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function D({profileId:f,currentUserId:C,isMine:D,tabs:O,renderMode:k,className:A,children:j}){let M=_(`components.pages.profile`),N=m(null),P=l(e=>e.open),F=t(e=>e.userId),I=m(``),[L,R]=y(`tab`,v.withDefault(`collect`)),z=p(()=>S(L,O),[L,O]),B=C||F||``,V=D?B:f,H=p(()=>`profile-scroll:${V||(D?`mine`:`guest`)}:${z}`,[D,z,V]);d(()=>{L!==z&&R(z,{shallow:!1})},[z,R,L]),d(()=>{if(typeof window>`u`)return;let e=`${D?`mine`:`profile`}:${V||``}:${z}`;I.current!==e&&(I.current=e)},[D,f,B,z,V]),d(()=>{if(typeof window>`u`)return;let e=w(N.current),t=window.sessionStorage.getItem(H),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{E(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(H,String(T(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[H]);let U={collect:M(`client.collect`),publish:M(`client.publish`),like:M(`client.like`),history:M(`client.history`)},W=j;return k===`login-required`?W=g(r,{className:`flex flex-col items-center pt-[132px] text-center`,children:[h(x,{className:`h-[58px] w-[68px]`}),h(a,{className:`mt-[16px] text-[15px] leading-[normal] text-[#54525E]`,children:M(`client.loginToSeeMoreVideos`)}),h(n,{type:`button`,onClick:P,className:`mt-[16px] h-[40px] min-w-[100px] rounded-[8px] border-0 bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] px-[24px] py-0 text-[16px] font-normal leading-[24px] text-white active:opacity-90`,children:M(`client.loginNow`)})]}):k===`privacy-collect`?W=h(i,{type:`no-content`,text:M(`client.collectionNotPublic`)}):k===`privacy-like`&&(W=h(i,{type:`no-content`,text:M(`client.likeNotPublic`)})),g(r,{ref:N,className:e(`relative grow overflow-hidden rounded-t-[24px] bg-[var(--color-surface-panel-dark)]`,A),children:[h(r,{className:`sticky top-0 z-10 bg-[var(--color-surface-panel-dark)] px-4 pt-8`,children:h(o,{value:z,onValueChange:e=>{R(e,{shallow:!1})},className:`h-6 w-full`,children:h(s,{variant:`default`,className:`h-6 w-fit gap-8 px-0`,children:O.map(t=>g(c,{value:t,onClick:e=>{u(e,`${t}_tab`)},className:e(`group/profile-main-tab !flex-none !h-6 min-w-8 !px-0 !py-0 !pb-0 text-[16px] !font-normal leading-6 text-[var(--color-text-secondary)]`,`data-[active]:!text-text1 data-[active]:!font-semibold data-[active]:!text-[18px]`,`data-[state=active]:!text-text1 data-[state=active]:!font-semibold data-[state=active]:!text-[18px]`,`after:hidden`),children:[h(b,{"aria-hidden":`true`,className:e(`pointer-events-none absolute bottom-0 left-1/2 h-[10px] w-[37px] -translate-x-1/2 opacity-0 transition-opacity duration-200`,`group-data-[active]/profile-main-tab:opacity-100`,`group-data-[state=active]/profile-main-tab:opacity-100`)}),h(`span`,{className:`relative z-10`,children:U[t]})]},t))})})}),h(r,{className:`relative px-4 pb-6 pt-7`,children:W})]})}export{D as UserProfileMainShell};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getHistoryData as ee,likeContentType as p}from"../../utils.mjs";import{toast as m}from"sonner";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as S}from"nuqs";function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n.title||n.text||``,coverImage:n.cover_image_thumbnail||n.cover_image||n.cover_horizontal_image_thumbnail||void 0,publishTime:r}}function te(e){let{detail:t,content_play_progress:n}=e,{user_info:r,info:i,statics_cnt:a,publish_time:o,parent_content_info:s}=t,c=String(i?.img_type||``).trim().toLowerCase(),l=c===`long`||!c&&!!i?.cover_horizontal_image_thumbnail,u=l?i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image_thumbnail||i?.img_y||i?.cover_image||``:i?.cover_image_thumbnail||i?.img_y||i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image||``,d=String(i?.description||``).trim();return{is_more_link:i.is_more_link,id:e.id,title:i.title||i.text||i.name||``,coverImage:u,duration:Number(i.video_duration??0),progress:n?.percent??0,seriesNum:n?.series_num,authorName:r.name,viewCount:i?.play_count??a?.browse_cnt??0,publishTime:o,type:s?.type,imgType:c||(l?`long`:`short`),score:i?.score,description:d}}function w(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}const T=[`video`,`post`];function E({mode:E=`renderer`,targetUserId:D,queryKeyPrefix:O}){let k=b(`components.pages.profile.components.tabs`),A=E===`renderer`,j=O??[],[M,N]=S(`historyTab`,x.withDefault(`video`)),P=g(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-history-video`],H=[...j,`user-history-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return ee({targetUserId:D,page:e,contentType:p.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(te))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:ne,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,content_type:e.contentType,content_ids:e.contentIds}));h(()=>{R(new Set)},[P]),h(()=>{M!==P&&N(P)},[P,M,N]);let re=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ie=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},ae=async()=>{if(!(L.size===0||Q)){if(!z){m.error(k(`historyTab.pleaseLogin`));return}try{let e=Array.from(L),t=await ne({contentIds:e,contentType:Z?1:2});if(t.code===0){m.success(k(`historyTab.historyDeletedSuccess`));let t=new Set(e);B(Z?V:H,e=>w(e,t,e=>e.id)),R(new Set),I(!1)}else m.error(t.message||k(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),m.error(k(`historyTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[v(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?v(d,{text:k(`historyTab.emptyContent`)}):v(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`)}):Y?v(d,{text:k(`historyTab.emptyContent`)}):v(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:re})}),F&&y(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ie}),v(a,{className:`text-sm text-text1`,children:k(`historyTab.selectAll`)})]}),v(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:ae,children:k(Q?`historyTab.processing`:`historyTab.delete`)})]})]})}export{E as HistoryTab};
2
+ "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionBatchClearBrowse as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getHistoryData as p,likeContentType as m}from"../../utils.mjs";import{toast as h}from"sonner";import{useEffect as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{useTranslations as x}from"next-intl";import{parseAsString as S,useQueryState as C}from"nuqs";function w(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n.title||n.text||``,coverImage:n.cover_image_thumbnail||n.cover_image||n.cover_horizontal_image_thumbnail||void 0,publishTime:r}}function ee(e){let{detail:t,content_play_progress:n}=e,{user_info:r,info:i,statics_cnt:a,publish_time:o,parent_content_info:s}=t,c=(Array.isArray(i?.tags)?i.tags:[]).map(e=>typeof e==`string`?e.trim():e&&typeof e==`object`&&`name`in e?String(e.name||``).trim():``).find(Boolean)||``,l=String(i?.img_type||``).trim().toLowerCase(),u=l===`long`||!l&&!!i?.cover_horizontal_image_thumbnail,d=u?i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image_thumbnail||i?.img_y||i?.cover_image||``:i?.cover_image_thumbnail||i?.img_y||i?.cover_horizontal_image_thumbnail||i?.img_x||i?.cover_image||``,f=String(i?.description||``).trim()||c;return{is_more_link:i.is_more_link,id:e.id,title:i.title||i.text||i.name||``,coverImage:d,duration:Number(i.video_duration??0),progress:n?.percent??0,seriesNum:n?.series_num,authorName:r.name,viewCount:i?.play_count??a?.browse_cnt??0,publishTime:o,type:s?.type,imgType:l||(u?`long`:`short`),score:i?.score,description:f}}function T(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}const E=[`video`,`post`];function D({mode:D=`renderer`,targetUserId:O,queryKeyPrefix:te}){let k=x(`components.pages.profile.components.tabs`),A=D===`renderer`,j=te??[],[M,N]=C(`historyTab`,S.withDefault(`video`)),P=_(()=>E.includes(M)?M:`video`,[M]),[F,I]=v(!1),[L,R]=v(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-history-video`],H=[...j,`user-history-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return p({targetUserId:O,page:e,contentType:m.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(ee))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:ne,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,content_type:e.contentType,content_ids:e.contentIds}));g(()=>{R(new Set)},[P]),g(()=>{M!==P&&N(P)},[P,M,N]);let re=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ie=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},ae=async()=>{if(!(L.size===0||Q)){if(!z){h.error(k(`historyTab.pleaseLogin`));return}try{let e=Array.from(L),t=await ne({contentIds:e,contentType:Z?1:2});if(t.code===0){h.success(k(`historyTab.historyDeletedSuccess`));let t=new Set(e);B(Z?V:H,e=>T(e,t,e=>e.id)),R(new Set),I(!1)}else h.error(t.message||k(`historyTab.deleteFailed`))}catch(e){console.error(`删除浏览记录失败`,e),h.error(k(`historyTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return b(r,{children:[y(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?y(d,{text:k(`historyTab.emptyContent`)}):y(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`)}):Y?y(d,{text:k(`historyTab.emptyContent`)}):y(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`historyTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:re})}),F&&b(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[b(r,{className:`flex items-center gap-2`,children:[y(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ie}),y(a,{className:`text-sm text-text1`,children:k(`historyTab.selectAll`)})]}),y(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:ae,children:k(Q?`historyTab.processing`:`historyTab.delete`)})]})]})}export{D as HistoryTab};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionUnifiedBatchLikeDislike as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getLikeData as ee,likeContentType as p}from"../../utils.mjs";import{toast as m}from"sonner";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as te}from"nuqs";function S(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n?.name||n?.text||n?.content||``,coverImage:n?.cover_image_thumbnail||n?.cover_image||n?.cover_horizontal_image_thumbnail||``,publishTime:r??0}}function w(e){let{detail:t}=e,{user_info:n,info:r,statics_cnt:i,publish_time:a,parent_content_info:o}=t,s=String(r?.img_type||``).trim().toLowerCase(),c=s===`long`||!s&&!!r?.cover_horizontal_image_thumbnail,l=c?r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image_thumbnail||r?.img_y||r?.cover_image||``:r?.cover_image_thumbnail||r?.img_y||r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image||``,u=String(r?.description||``).trim();return{id:e.id,is_more_link:r?.is_more_link||!1,title:r?.name||r?.text||r?.content||``,coverImage:l,duration:Number(r?.video_duration??0),progress:e.content_play_progress?.percent??0,seriesNum:e.content_play_progress?.series_num,authorName:n?.name||``,viewCount:r?.play_count??i?.browse_cnt??0,publishTime:a??0,type:o?.type,imgType:s||(c?`long`:`short`),score:r?.score,description:u}}const T=[`video`,`post`];function E({mode:E=`renderer`,targetUserId:D,queryKeyPrefix:O,isMine:ne=!1}){let k=b(`components.pages.profile.components.tabs`),A=E===`renderer`,j=O??[],[M,N]=te(`likeTab`,x.withDefault(`video`)),P=g(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-like-video`],H=[...j,`user-like-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return ee({targetUserId:D,page:e,contentType:p.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,options:{staleTime:0,enabled:A},initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:re,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,action:`cancel_like`,content_ids:e,content_type:Z?1:2}));h(()=>{R(new Set)},[P]),h(()=>{M!==P&&N(P)},[P,M,N]);let ie=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ae=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},oe=async()=>{if(!(L.size===0||Q)){if(!z){m.error(k(`likeTab.pleaseLogin`));return}try{let e=Array.from(L),t=await re(e);if(t.code===0){m.success(k(`likeTab.unlikedSuccess`));let t=new Set(e);B(Z?V:H,e=>S(e,t,e=>e.id)),R(new Set),I(!1)}else m.error(t.message||k(`likeTab.unlikeFailed`))}catch(e){console.error(`取消点赞失败`,e),m.error(k(`likeTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[v(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?v(d,{text:k(`likeTab.emptyContent`)}):v(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`)}):Y?v(d,{text:k(`likeTab.emptyContent`)}):v(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:ie})}),F&&y(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ae}),v(a,{className:`text-sm text-text1`,children:k(`likeTab.selectAll`)})]}),v(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:oe,children:k(Q?`likeTab.processing`:`likeTab.delete`)})]})]})}export{E as LikeTab};
2
+ "use client";import{useUserStore as e}from"../../../../../../../store/modules/user-store.mjs";import{pInteractionUnifiedBatchLikeDislike as t}from"../../../../../../../service/generated/client.mjs";import{Button as n}from"../../../../../../ui/button.mjs";import{Box as r}from"../../../../../../ui/box.mjs";import{Checkbox as i}from"../../../../../../ui/checkbox.mjs";import{Text as a}from"../../../../../../ui/text.mjs";import{useMutation as o,usePaginated as s,useUpdateRequest as c}from"../../../../../../../hooks/query/use-query.mjs";import{PostList as l}from"../../../../../../common/list/post-list/post-list.mjs";import{trackProfilePageClick as u}from"../../../tracking.mjs";import{ProfileMainEmptyState as d}from"../../empty-state.mjs";import{CollectVideoWaterfall as f}from"../collect-tab/video-waterfall.mjs";import{getLikeData as ee,likeContentType as p}from"../../utils.mjs";import{toast as m}from"sonner";import{useEffect as h,useMemo as g,useState as _}from"react";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{parseAsString as x,useQueryState as te}from"nuqs";function S(e,t,n){if(!e)return e;let r=0,i=e.pages.map(e=>({page:e,filteredList:(e.data?.list??[]).filter(e=>{let i=n(e)??``,a=t.has(i);return a&&(r+=1),!a})}));return{...e,pages:i.map(({page:e,filteredList:t})=>{if(!e.data)return e;let n=typeof e.data.total==`number`?Math.max(0,e.data.total-r):e.data.total;return{...e,data:{...e.data,list:t,total:n}}})}}function C(e){let{detail:t}=e,{info:n,publish_time:r}=t;return{id:e.id,title:n?.name||n?.text||n?.content||``,coverImage:n?.cover_image_thumbnail||n?.cover_image||n?.cover_horizontal_image_thumbnail||``,publishTime:r??0}}function w(e){let{detail:t}=e,{user_info:n,info:r,statics_cnt:i,publish_time:a,parent_content_info:o}=t,s=String(r?.img_type||``).trim().toLowerCase(),c=s===`long`||!s&&!!r?.cover_horizontal_image_thumbnail,l=c?r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image_thumbnail||r?.img_y||r?.cover_image||``:r?.cover_image_thumbnail||r?.img_y||r?.cover_horizontal_image_thumbnail||r?.img_x||r?.cover_image||``;console.log(r,222222);let u=String(r?.description||``).trim();return{id:e.id,is_more_link:r?.is_more_link||!1,title:r?.name||r?.text||r?.content||``,coverImage:l,duration:Number(r?.video_duration??0),progress:e.content_play_progress?.percent??0,seriesNum:e.content_play_progress?.series_num,authorName:n?.name||``,viewCount:r?.play_count??i?.browse_cnt??0,publishTime:a??0,type:o?.type,imgType:s||(c?`long`:`short`),score:r?.score,description:u}}const T=[`video`,`post`];function E({mode:E=`renderer`,targetUserId:D,queryKeyPrefix:O,isMine:ne=!1}){let k=b(`components.pages.profile.components.tabs`),A=E===`renderer`,j=O??[],[M,N]=te(`likeTab`,x.withDefault(`video`)),P=g(()=>T.includes(M)?M:`video`,[M]),[F,I]=_(!1),[L,R]=_(()=>new Set),z=e(e=>e.userId),B=c(),V=[...j,`user-like-video`],H=[...j,`user-like-post`],U=s({key:V,initialPageParam:1,async queryFn(e){return ee({targetUserId:D,page:e,contentType:p.video})},options:{staleTime:0,enabled:A},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),W=s({key:H,options:{staleTime:0,enabled:A},initialPageParam:1,async queryFn(e){return{data:{list:[],total:0,has_more:!1}}},getNextPageParam(e,t){if(typeof e?.data?.has_more==`boolean`)return e.data.has_more?t.length+1:void 0;if(!((e?.data?.list??[]).length===0||e?.data?.total===0))return t.length+1}}),G=P===`video`?U:W,K=U.data?.pages.flatMap(e=>(e.data?.list??[]).map(w))??[],q=W.data?.pages.flatMap(e=>(e.data?.list??[]).map(C))??[],J=P===`video`?K:q,Y=P===`video`?K.length===0&&!G.isFetching:q.length===0&&!G.isFetching,X=new Set(J.map(e=>e.id)),Z=P===`video`,{mutateAsync:re,isPending:Q}=o(async e=>await t({app_id:0,user_id:z,action:`cancel_like`,content_ids:e,content_type:Z?1:2}));h(()=>{R(new Set)},[P]),h(()=>{M!==P&&N(P)},[P,M,N]);let ie=e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},ae=()=>{L.size===X.size&&X.size>0?R(new Set):R(new Set(X))},oe=async()=>{if(!(L.size===0||Q)){if(!z){m.error(k(`likeTab.pleaseLogin`));return}try{let e=Array.from(L),t=await re(e);if(t.code===0){m.success(k(`likeTab.unlikedSuccess`));let t=new Set(e);B(Z?V:H,e=>S(e,t,e=>e.id)),R(new Set),I(!1)}else m.error(t.message||k(`likeTab.unlikeFailed`))}catch(e){console.error(`取消点赞失败`,e),m.error(k(`likeTab.operationFailed`))}}},$=async()=>{A&&await G.fetchNextPage()};return y(r,{children:[v(r,{className:``,onClick:e=>{u(e,`content_item`)},children:P===`video`?Y?v(d,{text:k(`likeTab.emptyContent`)}):v(f,{list:K,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`)}):Y?v(d,{text:k(`likeTab.emptyContent`)}):v(l,{list:q,loading:G.isFetching,hasMore:G.hasNextPage??!1,loadMore:$,emptyText:k(`likeTab.emptyContent`),isEditMode:F,selectedIds:L,onToggleSelection:ie})}),F&&y(r,{className:`fixed left-0 z-10 flex w-full items-center justify-between bg-bg1 px-3 py-2 bottom-[var(--tab-bar-occupied-height)]`,children:[y(r,{className:`flex items-center gap-2`,children:[v(i,{checked:L.size===X.size&&X.size>0,onCheckedChange:ae}),v(a,{className:`text-sm text-text1`,children:k(`likeTab.selectAll`)})]}),v(n,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:L.size>0?`default`:`outline`,disabled:L.size===0||Q,onClick:oe,children:k(Q?`likeTab.processing`:`likeTab.delete`)})]})]})}export{E as LikeTab};
@@ -1,9 +1,28 @@
1
1
 
2
2
  //#region components/biz/business/profile/profile-main/variants.d.ts
3
+ /**
4
+ * 内容类型配置项。
5
+ */
6
+ declare const profileMainContentTypeOptions: readonly ["video", "novel", "comic", "post"];
7
+ /**
8
+ * 主内容 Tab 基础项。
9
+ */
10
+ declare const profileMainBaseTabOptions: readonly ["collect", "like", "history"];
11
+ /**
12
+ * 主内容 Tab 中的帖子发布项。
13
+ */
14
+ declare const profileMainPublishTabOption: "publish";
15
+ type ProfileMainContentType = typeof profileMainContentTypeOptions[number];
16
+ type ProfileMainBaseTabKey = typeof profileMainBaseTabOptions[number];
17
+ type ProfileMainTabKey = ProfileMainBaseTabKey | typeof profileMainPublishTabOption;
18
+ /**
19
+ * 根据内容类型配置解析主 Tab。
20
+ */
21
+ declare function getProfileMainTabOptions(contentTypes?: ProfileMainContentType[]): ProfileMainTabKey[];
3
22
  /**
4
23
  * 个人主页主 Tab(本人视角)。
5
24
  */
6
- declare const profileMainMineTabOptions: readonly ["collect", "like", "history"];
25
+ declare const profileMainMineTabOptions: ProfileMainTabKey[];
7
26
  /**
8
27
  * 个人主页主 Tab(他人视角)。
9
28
  */
@@ -11,7 +30,7 @@ declare const profileMainProfileTabOptions: readonly ["collect", "like"];
11
30
  /**
12
31
  * 物料主 Tab 可选项。
13
32
  */
14
- declare const profileMainTabOptions: readonly ["collect", "like", "history"];
33
+ declare const profileMainTabOptions: ProfileMainTabKey[];
15
34
  /**
16
35
  * 点赞子 Tab 可选项。
17
36
  */
@@ -29,4 +48,4 @@ declare const profileMainCollectTabOptions: readonly ["video", "post", "collecti
29
48
  */
30
49
  declare const profileMainCollectCollectionTabOptions: readonly ["created", "subscribed"];
31
50
  //#endregion
32
- export { profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainTabOptions };
51
+ export { ProfileMainBaseTabKey, ProfileMainContentType, ProfileMainTabKey, getProfileMainTabOptions, profileMainBaseTabOptions, profileMainCollectCollectionTabOptions, profileMainCollectTabOptions, profileMainContentTypeOptions, profileMainHistoryTabOptions, profileMainLikeTabOptions, profileMainMineTabOptions, profileMainProfileTabOptions, profileMainPublishTabOption, profileMainTabOptions };
@@ -1,2 +1,2 @@
1
1
 
2
- const e=[`collect`,`like`,`history`],t=[`collect`,`like`],n=e,r=[`video`,`post`],i=[`video`,`post`],a=[`video`,`post`,`collection`],o=[`created`,`subscribed`];export{o as profileMainCollectCollectionTabOptions,a as profileMainCollectTabOptions,i as profileMainHistoryTabOptions,r as profileMainLikeTabOptions,e as profileMainMineTabOptions,t as profileMainProfileTabOptions,n as profileMainTabOptions};
2
+ const e=[`video`,`novel`,`comic`,`post`],t=[`collect`,`like`,`history`],n=`publish`;function r(e){return e?.includes(`post`)??!1?[`collect`,`publish`,`like`,`history`]:[...t]}const i=r(),a=[`collect`,`like`],o=i,s=[`video`,`post`],c=[`video`,`post`],l=[`video`,`post`,`collection`],u=[`created`,`subscribed`];export{r as getProfileMainTabOptions,t as profileMainBaseTabOptions,u as profileMainCollectCollectionTabOptions,l as profileMainCollectTabOptions,e as profileMainContentTypeOptions,c as profileMainHistoryTabOptions,s as profileMainLikeTabOptions,i as profileMainMineTabOptions,a as profileMainProfileTabOptions,n as profileMainPublishTabOption,o as profileMainTabOptions};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{usePathname as u,useSearchParams as d}from"next/navigation";import{useLayoutEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function y(y){let{title:b,rows:x=2,clearText:S,confirmDescription:C,onHistoryClick:w,mode:T=`renderer`}=y,E=T===`editor`,D=b??`搜索历史`,O=S??`清空`,k=C??`确定要清除所有搜索历史吗?`,A=p(()=>[`海市蜃楼`,`迷雾追凶`,`夜行者`,`狂飙`,`三大队`,`破冰行动`],[]),[j,M]=h(!1),[N,P]=h(null),F=m(null),I=m([]),L=m(null),R=r(),z=u(),B=d(),{userInfo:V}=t(),{history:H,addHistory:U,clearHistory:W}=s({storageKey:V?.user_id||`guest`}),G=()=>{W(),M(!1),e.emit(o.SEARCH_HISTORY_UPDATE)},K=p(()=>(H.length?H:T===`editor`?A:[]).slice(0,x*10),[H,T,A,x]);if(f(()=>{if(K.length===0){P(null);return}let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=[];I.current.slice(0,K.length).forEach(e=>{if(!e)return;let r=e.getBoundingClientRect(),i=Math.round(r.top-t.top),a=Math.round(r.bottom-t.top),o=n.find(e=>Math.abs(e.top-i)<=1);if(o){o.bottom=Math.max(o.bottom,a);return}n.push({top:i,bottom:a})}),n.sort((e,t)=>e.top-t.top);let r=n.slice(0,x).reduce((e,t)=>Math.max(e,t.bottom),0);P(e=>e===r?e:r)},n=()=>{L.current!=null&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{L.current=null,t()})};if(n(),typeof ResizeObserver>`u`)return()=>{L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)};let r=new ResizeObserver(()=>{n()});return r.observe(e),I.current.slice(0,K.length).forEach(e=>{e&&r.observe(e)}),()=>{r.disconnect(),L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)}},[K,x]),K.length===0)return null;let q=(e,t)=>{if(n({keyword:e,click_item_id:``,click_item_type_key:``,click_item_type_name:``,click_position:t,search_trace_id:``}),U(e),w){w(e);return}let r=new URLSearchParams(B.toString());r.set(`q`,e);let i=z.includes(`/search-result`)?z:`/search-result`;R.push(`${i}?${r.toString()}`)};return _(i,{className:E?`mt-[24px] px-[16px] py-[16px]`:`mt-[24px] px-[16px] py-0`,children:[_(i,{className:`mb-[15px] flex items-center justify-between`,children:[g(a,{className:`font-['PingFang_SC'] text-[16px] font-medium not-italic leading-normal text-white`,children:D}),g(`button`,{type:`button`,"aria-label":O,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white/50`,onClick:()=>M(!0),children:g(l,{className:`h-[24px] w-[24px]`})})]}),g(i,{ref:F,className:`flex flex-wrap content-start items-center gap-[6px] overflow-hidden`,style:N?{maxHeight:`${N}px`}:void 0,children:K.map((e,t)=>g(i,{ref:e=>{I.current[t]=e},className:`flex min-w-[56px] cursor-pointer items-center justify-center rounded-full px-[8px] py-[4px] ${E?`bg-[#1F1F1F]/10`:`bg-white/20`}`,onClick:()=>q(e,t),children:g(a,{className:`max-w-full whitespace-nowrap font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px] text-white`,children:v(e,8)})},t))}),g(c,{open:j,onOpenChange:M,onConfirm:G,title:``,description:k})]})}export{y as SearchHistoryClient};
2
+ "use client";import e from"../../../../utils/event-bus.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{trackKeywordClick as n}from"../../../../utils/tracking.mjs";import{useRouter as r}from"../../../../utils/use-compatible-router.mjs";import{Box as i}from"../../../ui/box.mjs";import{Text as a}from"../../../ui/text.mjs";import{eventKey as o}from"../../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../../hooks/use-search-history.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{DeleteIcon as l}from"../../../common/icons/delete.mjs";import{useLayoutEffect as u,useMemo as d,useRef as f,useState as p}from"react";import{usePathname as m,useSearchParams as h}from"next/navigation";import{jsx as g,jsxs as _}from"react/jsx-runtime";function v(e,t){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function y(y){let{title:b,rows:x=2,clearText:S,confirmDescription:C,onHistoryClick:w,mode:T=`renderer`}=y,E=T===`editor`,D=b??`搜索历史`,O=S??`清空`,k=C??`确定要清除所有搜索历史吗?`,A=d(()=>[`海市蜃楼`,`迷雾追凶`,`夜行者`,`狂飙`,`三大队`,`破冰行动`],[]),[j,M]=p(!1),[N,P]=p(null),F=f(null),I=f([]),L=f(null),R=r(),z=m(),B=h(),{userInfo:V}=t(),{history:H,addHistory:U,clearHistory:W}=s({storageKey:V?.user_id||`guest`}),G=()=>{W(),M(!1),e.emit(o.SEARCH_HISTORY_UPDATE)},K=d(()=>(H.length?H:T===`editor`?A:[]).slice(0,x*10),[H,T,A,x]);if(u(()=>{if(K.length===0){P(null);return}let e=F.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect(),n=[];I.current.slice(0,K.length).forEach(e=>{if(!e)return;let r=e.getBoundingClientRect(),i=Math.round(r.top-t.top),a=Math.round(r.bottom-t.top),o=n.find(e=>Math.abs(e.top-i)<=1);if(o){o.bottom=Math.max(o.bottom,a);return}n.push({top:i,bottom:a})}),n.sort((e,t)=>e.top-t.top);let r=n.slice(0,x).reduce((e,t)=>Math.max(e,t.bottom),0);P(e=>e===r?e:r)},n=()=>{L.current!=null&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{L.current=null,t()})};if(n(),typeof ResizeObserver>`u`)return()=>{L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)};let r=new ResizeObserver(()=>{n()});return r.observe(e),I.current.slice(0,K.length).forEach(e=>{e&&r.observe(e)}),()=>{r.disconnect(),L.current!=null&&(cancelAnimationFrame(L.current),L.current=null)}},[K,x]),K.length===0)return null;let q=(e,t)=>{if(n({keyword:e,click_item_id:``,click_item_type_key:``,click_item_type_name:``,click_position:t,search_trace_id:``}),U(e),w){w(e);return}let r=new URLSearchParams(B.toString());r.set(`q`,e);let i=z.includes(`/search-result`)?z:`/search-result`;R.push(`${i}?${r.toString()}`)};return _(i,{className:E?`mt-[24px] px-[16px] py-[16px]`:`mt-[24px] px-[16px] py-0`,children:[_(i,{className:`mb-[15px] flex items-center justify-between`,children:[g(a,{className:`font-['PingFang_SC'] text-[16px] font-medium not-italic leading-normal text-white`,children:D}),g(`button`,{type:`button`,"aria-label":O,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white/50`,onClick:()=>M(!0),children:g(l,{className:`h-[24px] w-[24px]`})})]}),g(i,{ref:F,className:`flex flex-wrap content-start items-center gap-[6px] overflow-hidden`,style:N?{maxHeight:`${N}px`}:void 0,children:K.map((e,t)=>g(i,{ref:e=>{I.current[t]=e},className:`flex min-w-[56px] cursor-pointer items-center justify-center rounded-full px-[8px] py-[4px] ${E?`bg-[#1F1F1F]/10`:`bg-white/20`}`,onClick:()=>q(e,t),children:g(a,{className:`max-w-full whitespace-nowrap font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[20px] text-white`,children:v(e,8)})},t))}),g(c,{open:j,onOpenChange:M,onConfirm:G,title:``,description:k})]})}export{y as SearchHistoryClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{usePathname as o,useSearchParams as s}from"next/navigation";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){if(!e||typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>e==null?``:String(e).trim()).filter(Boolean):[]}catch{return[]}}function p(p){let{placeholder:m,defaultPlaceholder:h,searchLabel:g,storageKey:_=`guest`,onSearch:v,mode:y=`renderer`}=p,b=m||(h??`请输入搜索内容`),x=g??`搜索`,S=y===`editor`,[C,w]=l(``),T=e(),E=o(),D=s(),O=`search_history_${_}`,k=c(e=>{if(S)return;let t=e.trim();if(t){try{let e=[t,...f(localStorage.getItem(O)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(O,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(v)v(t);else{let e=new URLSearchParams(D.toString());e.set(`q`,t);let n=E.includes(`/search-result`)?E:`/search-result`;T.push(`${n}?${e.toString()}`)}}},[O,S,v,E,T,D]),A=()=>{S||T.back()};return d(t,{className:`flex h-[66px] w-full items-center gap-[8px] px-[16px] py-[16px]${S?` pointer-events-none`:``}`,children:[u(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white active:opacity-70`,onClick:A,children:u(r,{className:`h-[16px] w-[16px]`})}),d(t,{className:`flex h-[34px] min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border border-[#E62AFF]/90 bg-black/40 backdrop-blur-[2px]`,children:[d(t,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[u(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:u(i,{className:`h-[14px] w-[14px] text-white/60`})}),u(n,{className:`!h-[20px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[22px] !pr-[18px] !py-0 !text-[14px] !leading-[20px] !text-white !caret-white placeholder:!text-white/90 focus-visible:!ring-0`,placeholder:b,value:C,maxLength:128,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(C))}}),C&&u(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:u(a,{className:`h-[15px] w-[15px] shrink-0 cursor-pointer text-white/50 active:opacity-70`,onClick:()=>w(``)})})]}),u(`button`,{type:`button`,className:`mx-[2px] flex h-[30px] w-[56px] shrink-0 items-center justify-center rounded-[100px] bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-[14px] leading-[20px] text-white active:opacity-90`,onClick:()=>k(C),children:x})]})]})}export{p as SearchInputClient};
2
+ "use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Input as n}from"../../../ui/input.mjs";import{LeftArrowIcon as r}from"../../../common/icons/left-arrow.mjs";import i from"../../../../assets/icons/search.mjs";import a from"../../../../assets/icons/clear.mjs";import{useCallback as o,useState as s}from"react";import{usePathname as c,useSearchParams as l}from"next/navigation";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){if(!e||typeof e!=`string`)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>e==null?``:String(e).trim()).filter(Boolean):[]}catch{return[]}}function p(p){let{placeholder:m,defaultPlaceholder:h,searchLabel:g,storageKey:_=`guest`,onSearch:v,mode:y=`renderer`}=p,b=m||(h??`请输入搜索内容`),x=g??`搜索`,S=y===`editor`,[C,w]=s(``),T=e(),E=c(),D=l(),O=`search_history_${_}`,k=o(e=>{if(S)return;let t=e.trim();if(t){try{let e=[t,...f(localStorage.getItem(O)).filter(e=>e!==t)].slice(0,20);localStorage.setItem(O,JSON.stringify(e))}catch(e){console.error(`Failed to save search history`,e)}if(v)v(t);else{let e=new URLSearchParams(D.toString());e.set(`q`,t);let n=E.includes(`/search-result`)?E:`/search-result`;T.push(`${n}?${e.toString()}`)}}},[O,S,v,E,T,D]),A=()=>{S||T.back()};return d(t,{className:`flex h-[66px] w-full items-center gap-[8px] px-[16px] py-[16px]${S?` pointer-events-none`:``}`,children:[u(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white active:opacity-70`,onClick:A,children:u(r,{className:`h-[16px] w-[16px]`})}),d(t,{className:`flex h-[34px] min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border border-[#E62AFF]/90 bg-black/40 backdrop-blur-[2px]`,children:[d(t,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[u(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:u(i,{className:`h-[14px] w-[14px] text-white/60`})}),u(n,{className:`!h-[20px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !pl-[22px] !pr-[18px] !py-0 !text-[14px] !leading-[20px] !text-white !caret-white placeholder:!text-white/90 focus-visible:!ring-0`,placeholder:b,value:C,maxLength:128,onChange:e=>w(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),k(C))}}),C&&u(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:u(a,{className:`h-[15px] w-[15px] shrink-0 cursor-pointer text-white/50 active:opacity-70`,onClick:()=>w(``)})})]}),u(`button`,{type:`button`,className:`mx-[2px] flex h-[30px] w-[56px] shrink-0 items-center justify-center rounded-[100px] bg-[linear-gradient(90deg,#9756E3_0%,#6C43EE_100%)] text-[14px] leading-[20px] text-white active:opacity-90`,onClick:()=>k(C),children:x})]})]})}export{p as SearchInputClient};
@@ -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"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className:`py-3 no-vw-x-16`,"aria-label":`金刚区`,children:s(t,{className:`w-full`,children:[m&&u?.trim()?o(n,{as:`h2`,className:`mb-3 text-[12px] leading-[16px] text-white/45`,children:u}):null,o(t,{className:`grid w-full items-start gap-4`,style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`},children:g.map((a,c)=>{let l=o(t,{className:`relative h-[79px] w-full min-w-0 overflow-visible`,children:s(t,{className:`absolute inset-x-0 bottom-0 h-[63px] w-full overflow-visible`,children:[o(i,{"aria-hidden":!0,className:`absolute inset-0 h-full w-full`}),o(t,{className:`pointer-events-none absolute left-1/2 top-[32px] z-20 -translate-x-1/2`,children:f?o(n,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] text-white/80`,title:a.label||void 0,children:a.label}):null}),o(t,{className:`pointer-events-none absolute right-0 top-[-14px] z-30`,children:o(t,{className:`relative h-[43px] w-[42px] overflow-visible`,"aria-hidden":!a.label,children:a.icon?o(e,{src:a.icon,alt:a.label||`入口图标`,fill:!0,className:`object-contain drop-shadow-[0_10px_18px_rgba(0,0,0,0.3)]`}):o(t,{className:`h-full w-full rounded-full bg-white/12`})})})]})});return o(r,{href:a.href,className:`block w-full min-w-0 transition-transform duration-200 active:scale-[0.98]`,children:l},a.href||a.label||c)})})]})})}export{c as ShortcutGridClient};
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"../../../ui/link.mjs";import i from"../../../../assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs";import{shortcutGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,title:u,shortcutCount:d,isShortcutTitle:f,shortcuts:p}={...a,...c},m=l===`editor`,h=(()=>{let e=d??p.length??0;return Math.min(Math.max(e,3),5)})(),g=(p??[]).slice(0,h);return o(t,{as:`section`,className:m?`pointer-events-none px-4 py-3`:`px-4 py-3`,"aria-label":`金刚区`,children:s(t,{className:`w-full`,children:[m&&u?.trim()?o(n,{as:`h2`,className:`mb-3 text-[12px] leading-[16px] text-white/45`,children:u}):null,o(t,{className:`grid w-full items-start gap-4`,style:{gridTemplateColumns:`repeat(${h}, minmax(0, 1fr))`},children:g.map((a,c)=>{let l=o(t,{className:`relative h-[79px] w-full min-w-0 overflow-visible`,children:s(t,{className:`absolute inset-x-0 bottom-0 h-[63px] w-full overflow-visible`,children:[o(i,{"aria-hidden":!0,className:`absolute inset-0 h-full w-full`}),o(t,{className:`pointer-events-none absolute left-1/2 top-[32px] z-20 -translate-x-1/2`,children:f?o(n,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] text-white/80`,title:a.label||void 0,children:a.label}):null}),o(t,{className:`pointer-events-none absolute right-0 top-[-14px] z-30`,children:o(t,{className:`relative h-[43px] w-[42px] overflow-visible`,"aria-hidden":!a.label,children:a.icon?o(e,{src:a.icon,alt:a.label||`入口图标`,fill:!0,className:`object-contain drop-shadow-[0_10px_18px_rgba(0,0,0,0.3)]`}):o(t,{className:`h-full w-full rounded-full bg-white/12`})})})]})});return o(r,{href:a.href,className:`block w-full min-w-0 transition-transform duration-200 active:scale-[0.98]`,children:l},a.href||a.label||c)})})]})})}export{c as ShortcutGridClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{usePathname as i}from"next/navigation";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.9)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},d={background:`rgba(1, 0, 2, 0.80)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`};function f(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function p(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function m(e,t){let n=f(t);if(e.configType===1){let t=f(p(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function h(e,t){return e.findIndex(e=>m(e,t))}function g(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function _(f){let{items:m=l,mode:_=`renderer`}=f,v=i(),y=a(()=>{if(_===`editor`)return 0;let e=h(m??[],v);return e>=0?e:0},[m,v,_]),b=a(()=>(m??[]).some(e=>g(e)&&e.label.trim()!==``),[m]);if(!m?.length)return null;function x(t,n){_===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let S=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:o(n,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,style:d,children:m.map((e,i)=>{let a=y===i,l=a?e.activeIcon:e.icon,u=e.label,d=g(e)&&u.trim()!==``,f=p(e),m=b?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[--color-text-white80]`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${m}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>x(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${S} bg-[#C043E8]`:S})}),b&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})})})}export{_ as TabBarClient};
2
+ "use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{useMemo as i}from"react";import{usePathname as a}from"next/navigation";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.9)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},d={background:`rgba(1, 0, 2, 0.80)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`};function f(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function p(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function m(e,t){let n=f(t);if(e.configType===1){let t=f(p(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function h(e,t){return e.findIndex(e=>m(e,t))}function g(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function _(f){let{items:m=l,mode:_=`renderer`}=f,v=a(),y=i(()=>{if(_===`editor`)return 0;let e=h(m??[],v);return e>=0?e:0},[m,v,_]),b=i(()=>(m??[]).some(e=>g(e)&&e.label.trim()!==``),[m]);if(!m?.length)return null;function x(t,n){_===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let S=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:o(n,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,style:d,children:m.map((e,i)=>{let a=y===i,l=a?e.activeIcon:e.icon,u=e.label,d=g(e)&&u.trim()!==``,f=p(e),m=b?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#BFBFBF]`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${m}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>x(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${S} bg-[#C043E8]`:S})}),b&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})})})}export{_ as TabBarClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{usePathname as s,useSearchParams as c}from"next/navigation";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useShallow as p}from"zustand/react/shallow";function m(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function h(h){let{title:g,displayCount:_=6,showRefresh:v=!1,onItemClick:y,mode:b=`renderer`}=h,x=b===`editor`,S=n(),C=s(),w=c(),[T,E]=u(0),{userInfo:D}=e(p(e=>({userInfo:e.userInfo}))),O=D?.user_id||`guest`,{data:k}=a([`text-recommend-keyword-list`,O],()=>t({user_id:O}),{enabled:!x}),A=l(()=>(k?.data?.recommend_list??[]).map(e=>({label:e.title??``})).filter(e=>e.label),[k]),j=_*2,M=l(()=>x?Array.from({length:j},(e,t)=>({label:`推荐搜索${t+1}`})):A,[x,A,j]),N=l(()=>m(M,j),[M,T,j]);if(!x&&A.length<2)return null;let P=e=>{e.stopPropagation(),E(e=>e+1)},F=e=>{if(y){y(e);return}let t=new URLSearchParams(w.toString());t.set(`q`,e);let n=C.includes(`/search-result`)?C:`/search-result`;S.push(`${n}?${t.toString()}`)};return f(r,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${x?` pointer-events-none`:``}`,children:[f(r,{className:`flex items-center justify-between w-full`,children:[d(i,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:g}),v&&f(r,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:P,children:[d(i,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),d(o,{className:`w-3 h-3 text-text3`})]})]}),d(r,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:N.map((e,t)=>d(r,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>F(e.label),children:d(i,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${T}-${t}`))})]})}export{h as TextRecommendClient};
2
+ "use client";import{useUserStore as e}from"../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../service/generated/client.mjs";import{useRouter as n}from"../../../../utils/use-compatible-router.mjs";import{Box as r}from"../../../ui/box.mjs";import{Text as i}from"../../../ui/text.mjs";import{useRequest as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/refresh.mjs";import{useMemo as s,useState as c}from"react";import{usePathname as l,useSearchParams as u}from"next/navigation";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useShallow as p}from"zustand/react/shallow";function m(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function h(h){let{title:g,displayCount:_=6,showRefresh:v=!1,onItemClick:y,mode:b=`renderer`}=h,x=b===`editor`,S=n(),C=l(),w=u(),[T,E]=c(0),{userInfo:D}=e(p(e=>({userInfo:e.userInfo}))),O=D?.user_id||`guest`,{data:k}=a([`text-recommend-keyword-list`,O],()=>t({user_id:O}),{enabled:!x}),A=s(()=>(k?.data?.recommend_list??[]).map(e=>({label:e.title??``})).filter(e=>e.label),[k]),j=_*2,M=s(()=>x?Array.from({length:j},(e,t)=>({label:`推荐搜索${t+1}`})):A,[x,A,j]),N=s(()=>m(M,j),[M,T,j]);if(!x&&A.length<2)return null;let P=e=>{e.stopPropagation(),E(e=>e+1)},F=e=>{if(y){y(e);return}let t=new URLSearchParams(w.toString());t.set(`q`,e);let n=C.includes(`/search-result`)?C:`/search-result`;S.push(`${n}?${t.toString()}`)};return f(r,{className:`bg-bg1 p-3 flex flex-col gap-3 w-full${x?` pointer-events-none`:``}`,children:[f(r,{className:`flex items-center justify-between w-full`,children:[d(i,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:g}),v&&f(r,{className:`flex items-center gap-1 cursor-pointer active:opacity-70 transition-opacity`,onClick:P,children:[d(i,{className:`text-[14px] text-text3 leading-[22px]`,children:`换一批`}),d(o,{className:`w-3 h-3 text-text3`})]})]}),d(r,{className:`grid grid-cols-2 gap-x-1 gap-y-1 w-full`,children:N.map((e,t)=>d(r,{className:`flex items-center h-[32px] cursor-pointer active:opacity-70 transition-opacity overflow-hidden`,onClick:()=>F(e.label),children:d(i,{className:`text-[14px] text-text1 leading-[22px] truncate w-full`,children:e.label})},`${T}-${t}`))})]})}export{h as TextRecommendClient};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{usePathname as t}from"next/navigation";import{useEffect as n,useRef as r}from"react";const i=[`zh-CN`,`en`];function a(e){for(let t of i){if(e===`/${t}`)return`/`;if(e.startsWith(`/${t}/`))return e.slice(t.length+1)}return e}function o(e){if(e===`/`||e.startsWith(`/category/`)||e.startsWith(`/domain/`))return{key:`page_home`,name:`首页`,path:e};if(e.startsWith(`/video/`))return{key:`page_video_detail`,name:`详情页`,path:e};if(e.startsWith(`/post/`))return{key:`page_post_detail`,name:`详情页`,path:e};if(e.startsWith(`/search-result`))return{key:`page_search_result`,name:`搜索结果`,path:e};if(e.startsWith(`/search`))return{key:`page_search`,name:`搜索`,path:e};if(e.startsWith(`/profile/`))return{key:`page_user`,name:`个人中心`,path:e};if(e===`/settings`)return{key:`page_settings`,name:`设置`,path:e};if(e===`/edit`)return{key:`page_edit_profile`,name:`编辑资料`,path:e};if(e===`/publish`)return{key:`page_publish`,name:`发布`,path:e};if(e.startsWith(`/feed-series/`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/feedback`)return{key:`page_feedback`,name:`意见反馈`,path:e};if(e===`/collection/add`)return{key:`page_collection_add`,name:`添加到合集`,path:e};if(e===`/collection/create`)return{key:`page_collection_create`,name:`创建合集`,path:e};if(e.startsWith(`/collection/`))return{key:`page_collection_detail`,name:`合集详情`,path:e};if(e===`/fans`)return{key:`page_fans`,name:`粉丝`,path:e};if(e===`/followed`)return{key:`page_followed`,name:`关注`,path:e};if(e===`/user/follow`)return{key:`page_user_follow`,name:`关注`,path:e};if(e===`/user/mine`)return{key:`page_mine`,name:`我的`,path:e};if(e===`/user/message`)return{key:`page_message`,name:`消息`,path:e};if(e.startsWith(`/video-list`))return{key:`page_video_list`,name:`视频列表`,path:e};if(e.startsWith(`/feed-series`))return{key:`page_feed_series`,name:`短剧`,path:e};if(e===`/hot`)return{key:`page_hot`,name:`热门`,path:e};if(e===`/ranking`)return{key:`page_ranking`,name:`排行榜`,path:e};if(e.startsWith(`/tag/`))return{key:`page_tag`,name:`标签`,path:e};let t=e.split(`/`)[1]||`unknown`;return{key:`page_${t}`,name:t,path:e}}function s(){let i=a(t()??`/`),s=r(Date.now()),c=r(null),l=r(!0);return n(()=>{let t=Date.now(),n=c.current,r=o(i);if(n&&n.key!==r.key){let r=Math.floor((t-s.current)/1e3);e({lifecycle_status:`hide`,page_key:n.key,page_name:n.name,page_path:n.path,duration:r})}c.current=r,s.current=t,l.current=typeof document<`u`?document.visibilityState!==`hidden`:!0,e({lifecycle_status:`show`,page_key:r.key,page_name:r.name,page_path:r.path,duration:0});let a=setInterval(()=>{if(!l.current)return;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})},600*1e3);return()=>clearInterval(a)},[i]),n(()=>{function t(){if(!l.current)return;l.current=!1;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`hide`,page_key:t.key,page_name:t.name,page_path:t.path,duration:n})}function n(){if(l.current)return;l.current=!0,s.current=Date.now();let t=c.current;t&&e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,page_path:t.path,duration:0})}function r(){document.visibilityState===`hidden`?t():n()}return document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,t),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`pagehide`,t)}},[]),null}export{s as default};
2
+ "use client";import{trackPageLifecycle as e}from"../../../utils/tracking.mjs";import{useEffect as t,useRef as n}from"react";import{usePathname as r}from"next/navigation";const i=[`zh-CN`,`en`];function a(e){for(let t of i){if(e===`/${t}`)return`/`;if(e.startsWith(`/${t}/`))return e.slice(t.length+1)}return e}function o(e){if(e===`/`||e.startsWith(`/category/`)||e.startsWith(`/domain/`))return{key:`page_home`,name:`首页`};if(e.startsWith(`/video/`))return{key:`page_video_detail`,name:`详情页`};if(e.startsWith(`/post/`))return{key:`page_post_detail`,name:`详情页`};if(e.startsWith(`/search-result`))return{key:`page_search_result`,name:`搜索结果`};if(e.startsWith(`/search`))return{key:`page_search`,name:`搜索`};if(e.startsWith(`/profile/`))return{key:`page_user`,name:`个人中心`};if(e===`/settings`)return{key:`page_settings`,name:`设置`};if(e===`/edit`)return{key:`page_edit_profile`,name:`编辑资料`};if(e===`/publish`)return{key:`page_publish`,name:`发布`};if(e.startsWith(`/feed-series/`))return{key:`page_feed_series`,name:`短剧`};if(e===`/feedback`)return{key:`page_feedback`,name:`意见反馈`};if(e===`/collection/add`)return{key:`page_collection_add`,name:`添加到合集`};if(e===`/collection/create`)return{key:`page_collection_create`,name:`创建合集`};if(e.startsWith(`/collection/`))return{key:`page_collection_detail`,name:`合集详情`};if(e===`/fans`)return{key:`page_fans`,name:`粉丝`};if(e===`/followed`)return{key:`page_followed`,name:`关注`};if(e===`/user/follow`)return{key:`page_user_follow`,name:`关注`};if(e===`/user/mine`)return{key:`page_mine`,name:`我的`};if(e===`/user/message`)return{key:`page_message`,name:`消息`};if(e.startsWith(`/video-list`))return{key:`page_video_list`,name:`视频列表`};if(e.startsWith(`/feed-series`))return{key:`page_feed_series`,name:`短剧`};if(e===`/hot`)return{key:`page_hot`,name:`热门`};if(e===`/ranking`)return{key:`page_ranking`,name:`排行榜`};if(e.startsWith(`/tag/`))return{key:`page_tag`,name:`标签`};let t=e.split(`/`)[1]||`unknown`;return{key:`page_${t}`,name:t}}function s(){let i=a(r()??`/`),s=n(Date.now()),c=n(null),l=n(!0);return t(()=>{let t=Date.now(),n=c.current,r=o(i);if(n&&n.key!==r.key){let r=Math.floor((t-s.current)/1e3);e({lifecycle_status:`hide`,page_key:n.key,page_name:n.name,duration:r})}c.current=r,s.current=t,l.current=typeof document<`u`?document.visibilityState!==`hidden`:!0,e({lifecycle_status:`show`,page_key:r.key,page_name:r.name,duration:0});let a=setInterval(()=>{if(!l.current)return;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,duration:n})},6*1e3);return()=>clearInterval(a)},[i]),t(()=>{function t(){if(!l.current)return;l.current=!1;let t=c.current;if(!t)return;let n=Math.floor((Date.now()-s.current)/1e3);e({lifecycle_status:`hide`,page_key:t.key,page_name:t.name,duration:n})}function n(){if(l.current)return;l.current=!0,s.current=Date.now();let t=c.current;t&&e({lifecycle_status:`show`,page_key:t.key,page_name:t.name,duration:0})}function r(){document.visibilityState===`hidden`?t():n()}return document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,t),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`pagehide`,t)}},[]),null}export{s as default};
@@ -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"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between no-vw-x-16`,titleClassName:u=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,moreLinkClassName:d=`ml-[8px] flex size-[24px] shrink-0 items-center justify-center opacity-50`,containerClassName:f=`relative flex w-full gap-[8px] no-vw-x-16`,overlay:p,footer:g,getItemRef:_,selectionMode:y=!1,selectedIds:b,onToggleSelection:x,onItemClick:S}){return h(t,{className:c,children:[h(t,{className:l,children:[m(n,{className:u,children:e}),o&&i&&m(r,{href:i,"aria-label":`更多`,className:d,onClick:a,children:o}),o&&!i&&a&&m(`button`,{type:`button`,"aria-label":`更多`,className:d,onClick:a,children:o})]}),h(t,{className:f,children:[m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.left.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`left`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.right.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`right`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),p]}),g]})}function v({item:_,selectionMode:v=!1,selectedIds:y,onToggleSelection:b,onItemClick:x}){let S=_.cardKind===`short`?u:d,C=_.selectionId??``,w=!!(C&&y?.has(C)),T=f(_),E=l(T.topLeftBadgeImageUrl);function D(){!v||!C||b?.(C)}let O=h(p,{children:[h(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[#18111f]`,style:{aspectRatio:S},children:[_.coverUrl&&m(e,{src:_.coverUrl,alt:_.title||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover`}),m(t,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:g,"aria-hidden":!0}),v&&m(t,{className:`pointer-events-none absolute left-[8px] top-[8px] z-[2]`,children:m(w?o:a,{})}),!v&&h(p,{children:[E&&m(t,{className:c,children:m(e,{src:E,alt:`角标`,width:96,height:18,className:s})}),T.topRightScoreText&&m(n,{as:`span`,className:`absolute right-[8px] top-[8px] z-[1] shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:T.topRightScoreText}),h(t,{className:`absolute left-[8px] right-[8px] bottom-[10px] z-[1] flex items-end justify-between gap-[8px]`,children:[m(t,{className:`flex min-w-0 items-center gap-[4px]`,children:T.bottomLeftHeatText&&h(p,{children:[m(i,{className:`h-[16px] w-[16px] shrink-0 text-white`}),m(n,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:T.bottomLeftHeatText})]})}),T.bottomRightEpisodeText&&m(n,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:T.bottomRightEpisodeText})]})]})]}),!v&&m(t,{className:`mt-[8px] overflow-hidden`,children:m(n,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:T.title})})]});return v?m(`button`,{type:`button`,className:`mb-[16px] block w-full cursor-pointer border-0 bg-transparent p-0 text-left`,onClick:D,"aria-pressed":w,disabled:!C,children:O}):m(r,{href:_.href,className:`mb-[16px] block w-full`,onClick:()=>x?.(_),children:O})}export{_ as WaterfallRecommend};
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"../../../ui/link.mjs";import i from"../../../../assets/icons/detail/video_flag.mjs";import{CollectionSelectIcon as a,CollectionSelectedIcon as o}from"../collection-list/collection-select-icon.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as s,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as c,normalizeRecommendBadgeUrl as l}from"./recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as u,WATERFALL_TALL_CARD_ASPECT_RATIO as d,buildWaterfallRecommendLegacyDisplay as f}from"./waterfall-recommend-display.mjs";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";const g={backgroundImage:`var(--gradient-card-mask-strong)`};function _({title:e,moreHref:i,onMoreClick:a,moreIcon:o,columns:s,sectionClassName:c=`w-full`,headerClassName:l=`mb-[16px] flex items-center justify-between px-[16px]`,titleClassName:u=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,moreLinkClassName:d=`ml-[8px] flex size-[24px] shrink-0 items-center justify-center opacity-50`,containerClassName:f=`relative flex w-full gap-[15px] px-[16px]`,overlay:p,footer:g,getItemRef:_,selectionMode:y=!1,selectedIds:b,onToggleSelection:x,onItemClick:S}){return h(t,{className:c,children:[h(t,{className:l,children:[m(n,{className:u,children:e}),o&&i&&m(r,{href:i,"aria-label":`更多`,className:d,onClick:a,children:o}),o&&!i&&a&&m(`button`,{type:`button`,"aria-label":`更多`,className:d,onClick:a,children:o})]}),h(t,{className:f,children:[m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.left.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`left`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),m(t,{className:`flex-1 min-w-0 flex flex-col`,children:s.right.map((e,t)=>m(`div`,{ref:_?.({item:e,column:`right`,columnIndex:t}),children:m(v,{item:e,selectionMode:y,selectedIds:b,onToggleSelection:x,onItemClick:S})},e.key))}),p]}),g]})}function v({item:_,selectionMode:v=!1,selectedIds:y,onToggleSelection:b,onItemClick:x}){let S=_.cardKind===`short`?u:d,C=_.selectionId??``,w=!!(C&&y?.has(C)),T=f(_),E=l(T.topLeftBadgeImageUrl);function D(){!v||!C||b?.(C)}let O=h(p,{children:[h(t,{className:`relative w-full overflow-hidden rounded-[8px] bg-[#18111f]`,style:{aspectRatio:S},children:[_.coverUrl&&m(e,{src:_.coverUrl,alt:_.title||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover`}),m(t,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:g,"aria-hidden":!0}),v&&m(t,{className:`pointer-events-none absolute left-[8px] top-[8px] z-[2]`,children:m(w?o:a,{})}),!v&&h(p,{children:[E&&m(t,{className:c,children:m(e,{src:E,alt:`角标`,width:96,height:18,className:s})}),T.topRightScoreText&&m(n,{as:`span`,className:`absolute right-[8px] top-[8px] z-[1] shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:T.topRightScoreText}),h(t,{className:`absolute left-[8px] right-[8px] bottom-[10px] z-[1] flex items-end justify-between gap-[8px]`,children:[m(t,{className:`flex min-w-0 items-center gap-[4px]`,children:T.bottomLeftHeatText&&h(p,{children:[m(i,{className:`h-[16px] w-[16px] shrink-0 text-white`}),m(n,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:T.bottomLeftHeatText})]})}),T.bottomRightEpisodeText&&m(n,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:T.bottomRightEpisodeText})]})]})]}),!v&&m(t,{className:`mt-[8px] overflow-hidden`,children:m(n,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:T.title})})]});return v?m(`button`,{type:`button`,className:`mb-[16px] block w-full cursor-pointer border-0 bg-transparent p-0 text-left`,onClick:D,"aria-pressed":w,disabled:!C,children:O}):m(r,{href:_.href,className:`mb-[16px] block w-full`,onClick:()=>x?.(_),children:O})}export{_ as WaterfallRecommend};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{usePathname as o}from"next/navigation";import{useCallback as s,useEffect as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=o(),[p,m]=l(!1),[h,g]=l(null),[_,v]=l(0),y=s(t=>{if(typeof window>`u`)return 0;let{width:n,height:r}=e(t.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=s(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return c(()=>(t.on(r.SHOW_POPUP_VIDEO,b),()=>{t.off(r.SHOW_POPUP_VIDEO,b)}),[b]),c(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(n,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
2
+ "use client";import{parseResolution as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{Button as n}from"../../ui/button.mjs";import{eventKey as r}from"../../../constants/event-key.mjs";import i from"../video-player/index.mjs";import a from"./popup-video.module.mjs";import{useCallback as o,useEffect as s,useState as c}from"react";import{usePathname as l}from"next/navigation";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(){let f=l(),[p,m]=c(!1),[h,g]=c(null),[_,v]=c(0),y=o(t=>{if(typeof window>`u`)return 0;let{width:n,height:r}=e(t.resolution);return n<=0?0:Math.max(0,r*(window.innerWidth/n))},[]),b=o(({info:e,show:t})=>{if(!e||!t){m(!1),g(null);return}g(e),v(y(e)),m(!0)},[y]);return s(()=>(t.on(r.SHOW_POPUP_VIDEO,b),()=>{t.off(r.SHOW_POPUP_VIDEO,b)}),[b]),s(()=>{m(!1),g(null)},[f]),!p||!h?null:d(`div`,{className:`fixed inset-0 z-[9999] flex items-center justify-center bg-black/95`,children:[u(n,{variant:`ghost`,className:`absolute left-4 top-4 h-10 w-10 rounded-full border border-white/20 text-white`,onClick:()=>{m(!1),g(null)},children:`←`}),u(`div`,{className:a.popupVideo,style:{width:`100%`,maxHeight:`100%`,height:_>0?`${_}px`:`auto`},children:u(i,{plyerId:h.plyerId,resolution:h.resolution,poster:h.poster||``,videoUrl:h.videoUrl||``,hlsList:h.hlsList,mergeConfig:_>0?{}:{fitVideoSize:`fixWidth`}})})]})}export{f as default};
@@ -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 l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";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=[`/nav-page`];function y(y){let{className:b}=y,x=u(),S=g(`tabBar`),[C,w]=f(null),[,T]=p(),[E]=f(0),[D,O]=f(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return d(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),d(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.90)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},children:m(e,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between px-[40px]`,style:{background:`rgba(1, 0, 2, 0.80)`,borderRadius:`100px`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`},children:k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-[--color-text-white80]`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})})})}export{y as TabBar};
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 l from"../../ui/legacy/badge.mjs";import{useEffect as u,useState as d,useTransition as f}from"react";import{usePathname as p}from"next/navigation";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";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=[`/nav-page`];function y(y){let{className:b}=y,x=p(),S=g(`tabBar`),[C,w]=d(null),[,T]=f(),[E]=d(0),[D,O]=d(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return u(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),u(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.90)`,backdropFilter:`blur(4px)`,WebkitBackdropFilter:`blur(4px)`,paddingBottom:`env(safe-area-inset-bottom, 0px)`},children:m(e,{className:`my-[4px] flex h-[56px] w-[358px] items-center justify-between px-[40px]`,style:{background:`rgba(1, 0, 2, 0.80)`,borderRadius:`100px`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`,boxShadow:`0 12px 100px rgba(255, 255, 255, 0.20)`},children:k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-[#BFBFBF]`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})})})}export{y as TabBar};