@funhub/platform 0.2.28 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/biz.d.mts +6 -4
- package/dist/biz.mjs +1 -1
- package/dist/cli/init/create-client.mjs +1 -1
- package/dist/cli/init/shared/constants.mjs +1 -1
- package/dist/cli/init/shared/create-project.mjs +1 -1
- package/dist/cli/init/shared/prompts.mjs +1 -1
- package/dist/cli/init/shared/template.mjs +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
- package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.d.mts +0 -7
- package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +0 -3
- package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +0 -6
- package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/runtime-context-provider.mjs +1 -1
- package/dist/components/biz/business/detail/shared/use-video-detail-webview-bridge.mjs +1 -1
- package/dist/components/biz/business/detail/shared/video-hero.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/index.d.mts +5 -3
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/profile/index.d.mts +5 -3
- package/dist/components/biz/business/profile/profile-header/client.d.mts +4 -2
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/index.d.mts +4 -2
- package/dist/components/biz/business/profile/profile-header/material.d.mts +48 -6
- package/dist/components/biz/business/profile/profile-header/material.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/my-client.d.mts +12 -0
- package/dist/components/biz/business/profile/profile-header/my-client.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/my-profile-actions.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/my-profile-header.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/schema.d.mts +15 -5
- package/dist/components/biz/business/profile/profile-header/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/shared.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/visitor-client.d.mts +12 -0
- package/dist/components/biz/business/profile/profile-header/visitor-client.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/visitor-profile-actions.mjs +2 -0
- package/dist/components/biz/business/profile/profile-header/visitor-profile-header.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/client.d.mts +2 -0
- package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/index.d.mts +2 -2
- package/dist/components/biz/business/profile/profile-main/material.d.mts +3 -0
- package/dist/components/biz/business/profile/profile-main/schema.d.mts +9 -3
- package/dist/components/biz/business/profile/profile-main/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/shell.d.mts +7 -0
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.d.mts +5 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/editor-preview-waterfall.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.d.mts +5 -1
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.d.mts +3 -0
- package/dist/components/biz/business/profile/profile-main/tabs/publish-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/variants.d.mts +28 -3
- package/dist/components/biz/business/profile/profile-main/variants.mjs +1 -1
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/common/analytics-init/page-lifecycle-tracker.mjs +1 -1
- package/dist/components/common/background-preview-modal/background-preview-modal.mjs +1 -1
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +1 -1
- package/dist/components/common/popup-video/index.mjs +1 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/common/top-nav-bar/client.mjs +1 -1
- package/dist/components/common/video-player/style.module.mjs +0 -4
- package/dist/components/common/video-player/video-blind-ad-overlay.mjs +1 -1
- package/dist/components/common/video-player/video-preroll-ad-overlay.mjs +1 -1
- package/dist/components/pages/collection-add/page.mjs +1 -1
- package/dist/components/pages/edit/page.mjs +1 -1
- package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
- package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
- package/dist/components/pages/profile/layout.d.mts +2 -0
- package/dist/components/pages/profile/page.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/hot-search.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/top-header.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/video-detail/video-detail-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-recommend-item.mjs +1 -1
- package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/empty.d.mts +1 -1
- package/dist/components/ui/item.d.mts +2 -2
- package/dist/components/ui/toggle.d.mts +1 -1
- package/dist/hooks/use-content-operate.mjs +1 -1
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/materials.d.mts +2 -2
- package/dist/materials.mjs +1 -1
- package/dist/service/advertisement.d.mts +0 -4
- package/dist/service/advertisement.mjs +1 -1
- package/dist/utils/common.mjs +1 -1
- package/dist/utils/http.mjs +1 -1
- package/dist/utils/tracking.d.mts +11 -3
- package/dist/utils/tracking.mjs +1 -1
- package/dist/utils/use-compatible-router.mjs +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/theme.css +0 -47
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetContentList as t,pCommunityAddContentToCollection as n}from"../../../service/generated/client.mjs";import{Button as r}from"../../ui/button.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{toast as u}from"sonner";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetContentList as t,pCommunityAddContentToCollection as n}from"../../../service/generated/client.mjs";import{Button as r}from"../../ui/button.mjs";import{Box as i}from"../../ui/box.mjs";import{useDeleteRequest as a,useMutation as o,usePaginated as s}from"../../../hooks/query/use-query.mjs";import{HeaderNav as c}from"../../common/header-nav/client.mjs";import{UserActivityList as l}from"../../common/list/user-activity-list/user-activity-list.mjs";import{toast as u}from"sonner";import{useMemo as d,useState as f}from"react";import{useRouter 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){return{type:e.type,content_id:e.content_id||``,author:{nick_name:e.author?.nickname||``,nickname:e.author?.nickname||``,avatar:e.author?.avatar_url||``},content:e.content||``,medias:e.medias||[],like_count:e.like_count||0,is_liked:e.interaction?.is_liked||!1,dislike_count:e.dislike_count||0,is_dislike:e.interaction?.is_dislike||!1,comment_count:e.comment_count||0}}function v({id:v}){let{userId:y}=e(),b=v,[x,S]=f(()=>new Set),C=a(),{mutateAsync:w,isPending:T}=o(async e=>await n({collection_id:b,content_id:e})),{data:E,isFetching:D,fetchNextPage:O,hasNextPage:k}=s({key:[`collection-add`,b,y],initialPageParam:1,async queryFn(e){if(!y)return{data:{list:[],total:0}};let n=await t({user_id:y,page:e,collection_id:b,page_size:10}),r=n.data?.data?.contents??[];return{data:{list:r,total:n.data?.data?.total??r.length,has_more:n.data?.data?.has_more?!0:void 0}}},getNextPageParam(e,t){let n=e?.data||{},r=n.list||[];if(typeof n.has_more==`boolean`)return n.has_more?t.length+1:void 0;if(!(r.length===0||n.total===0))return t.length+1}}),A=g(`components.pages.collectionAdd`),j=d(()=>E?.pages.flatMap(e=>((e?.data).list||[]).map(e=>_(e)))??[],[E]);function M(e){T||S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function N(){if(T)return;if(!b){u.error(A(`page.collectionNotFound`));return}if(!y){u.error(A(`page.userNotFound`));return}let e=Array.from(x);if(e.length===0){u.error(A(`page.selectPostFirst`));return}let t=u.loading(A(`page.submitting`));try{await Promise.all(e.map(e=>w(e))),u.success(A(`page.submitSuccess`),{id:t}),S(new Set),C([`collection-add`,b,y]),C([`collection-detail`,b])}catch(e){console.error(`添加合集失败`,e),u.error(A(`page.submitFailed`),{id:t})}}let P=p(),F=x.size;return h(i,{className:`bg-bg2 !min-h-screen`,children:[m(c,{onBack:()=>P.back(),className:`!bg-bg2`,title:A(`page.title`),rightChild:h(r,{onClick:N,disabled:T||F===0,children:[A(`page.done`),`(`,F,`)`]})}),m(l,{list:j,loading:D,hasMore:k,loadMore:async()=>{O()},emptyText:A(`page.emptyPublish`),showGroupHeaders:!1,isEditMode:!0,selectedIds:x,onToggleSelection:M})]})}export{v as CollectionAddPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as re,InputGroupAddon as ie,InputGroupTextarea as ae}from"../../ui/input-group.mjs";import{Text as o}from"../../ui/text.mjs";import{useDeleteRequest as oe,useMutation as se,useRequest as ce}from"../../../hooks/query/use-query.mjs";import{HeaderNav as le}from"../../common/header-nav/client.mjs";import{PickerDrawer as s}from"../../common/picker/picker-drawer/picker-drawer.mjs";import{GenderPicker as ue}from"../../common/picker/gender-picker/gender-picker.mjs";import{ImageCropModal as de}from"../../common/image-crop-modal/image-crop-modal.mjs";import{toast as c}from"sonner";import{useEffect as l,useRef as u,useState as d}from"react";import{ChevronDown as fe}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as pe}from"next-intl";import{produce as me}from"immer";const m={0:`secret`,1:`male`,2:`female`},h={male:1,female:2,secret:0},g=[`image/jpeg`,`image/png`],he=/^[\u4E00-\u9FFF\w.-]+$/;function ge(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return g.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function _(e){return e?h[e]===void 0?m[e]??`secret`:e:`secret`}function v(e){if(!e)return;if(h[e]!==void 0)return h[e];let t=Number(e);return Number.isNaN(t)?void 0:t}function _e(e){return{nickname:e?.nick_name??``,gender:_(e?.gender?.toString()),signature:e?.signature??``,avatar:e?.avatar??``}}function ve(e){if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}function ye({id:m}){let h=pe(`components.pages.edit`),{userId:g,userInfo:_,setUserInfo:ye}=e(),y=m??g,b=oe(),be={male:h(`page.genderMale`),female:h(`page.genderFemale`),secret:h(`page.genderSecret`)},xe=u(null),x=u(null),S=u(null),C=u(null),[w,T]=d(()=>_e()),[E,D]=d(!1),[Se,O]=d(null),[Ce,k]=d(!1),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(``),[we,I]=d(!1),[L,R]=d(`secret`),[z,Te]=d(!1),[B,V]=d(``),Ee={code:0,message:``,data:{}},De={code:0,message:``,data:{}},{data:Oe,isLoading:H}=ce([`user-edit-info`,y],()=>y?t({user_id:y}):Promise.resolve(Ee)),{data:ke}=ce([`user-info-basic`,y],()=>y?n({user_id:y}):Promise.resolve(De)),{mutateAsync:Ae,isPending:je}=se(async e=>r(e)),Me=E||je||Se!==null,U=H||Me,W=U?`cursor-not-allowed opacity-60`:`cursor-pointer`,Ne=ke?.data?.display_id||_?.display_id||`--`,G=w.gender||`secret`,Pe=U||P.trim()===w.nickname,Fe=U||L===G,Ie=U||B===w.signature,K=`flex h-12 w-full items-center rounded-md bg-[var(--color-surface-field-bg)] px-4`,q=`text-sm leading-6 text-text3`,J=`block min-w-0 flex-1 truncate text-sm leading-5 text-text3`;l(()=>{let e=Oe?.data;e&&T(_e(e))},[Oe]),l(()=>{if(!M)return;let e=window.setTimeout(()=>{ve(x.current)},250);return()=>{window.clearTimeout(e)}},[M]),l(()=>{if(!z)return;let e=window.setTimeout(()=>{ve(S.current)},250);return()=>{window.clearTimeout(e)}},[z]),l(()=>()=>{A&&URL.revokeObjectURL(A)},[A]);function Y(e,t){T(me(n=>{n[e]=t}))}function Le(){A&&(URL.revokeObjectURL(A),j(``))}function Re(){y&&(b([`user-edit-info`,y]),b([`user-info-basic`,y]),b([`user-profile`,`mine`]),b([`user-profile`,`mine`,y]),b([`user-profile`,`profile`,y]))}function X(e){!y||y!==g||ye({..._,user_id:y,...e})}function ze(){c.info(h(`page.editBlockedWhileSaving`))}function Z(){return H?!0:Me?(ze(),!0):!1}function Be(e){return C.current?(ze(),!1):(C.current=e,O(e),!0)}function Ve(e){C.current===e&&(C.current=null,O(null))}async function Q(e,t){if(!Be(e))return!1;let n=c.loading(h(`page.savingInProgress`));try{return await t()}finally{c.dismiss(n),Ve(e)}}function He(e,t){let n={...w,...t},r={nickname:[`nick_name`,n.nickname||void 0],avatar:[`avatar`,n.avatar||void 0],signature:[`signature`,n.signature||void 0],gender:[`gender`,v(n.gender)]},i=Object.keys(r).filter(t=>t!==e).map(e=>r[e]);return i.push(r[e]),Object.fromEntries(i)}async function $(e,t){if(!y)return c.error(h(`page.userNotFound`)),!1;let n=He(e,t);try{return await Ae({user_id:y,...n}),Re(),!0}catch(e){return console.error(`更新用户信息失败`,e),c.error(h(`page.updateFailed`)),!1}}function Ue(){Z()||E||xe.current?.click()}function We(e){if(Z()){e.target&&(e.target.value=``);return}let t=e.target.files?.[0];if(t){if(!ge(t)){c.error(h(`page.imageTypeInvalid`)),e.target&&(e.target.value=``);return}j(URL.createObjectURL(t)),k(!0),e.target&&(e.target.value=``)}}async function Ge(e){await Q(`avatar`,async()=>{try{D(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);return await $(`avatar`,{avatar:t.objectKey})?(Y(`avatar`,t.objectKey),X({avatar:t.objectKey}),Ke(),c.success(h(`page.avatarUpdateSuccess`)),!0):!1}catch(e){return console.error(`上传头像失败`,e),c.error(h(`page.avatarUploadFailed`)),!1}finally{D(!1)}})}function Ke(){k(!1),Le()}function qe(){Z()||(F(w.nickname),N(!0))}function Je(e){let t=e.target.value;F(t)}function Ye(e){return e?e.length<2?h(`page.nicknameTooShort`):he.test(e)?``:h(`page.nicknameInvalidChars`):h(`page.nicknameRequired`)}async function Xe(e){if(Pe)return!1;let t=e.trim(),n=Ye(t);return n?(c.error(n),!1):await Q(`nickname`,async()=>$(`nickname`,{nickname:t}))?(Y(`nickname`,t),X({nick_name:t}),F(t),c.success(h(`page.nicknameUpdateSuccess`)),!0):!1}function Ze(){Z()||(R(G),I(!0))}function Qe(){I(!1)}function $e(e){R(e)}async function et(e){let t=e||L||`secret`;if(t===G)return!1;let n=v(t);return await Q(`gender`,async()=>$(`gender`,{gender:t}))?(Y(`gender`,t),X({gender:n}),R(t),c.success(h(`page.genderUpdateSuccess`)),!0):!1}function tt(){Z()||(V(w.signature),Te(!0))}function nt(e){let t=e.target.value;V(t)}function rt(e){let t=e.trim();return t.length>0&&t.length<2?h(`page.signatureTooShort`):``}async function it(e){if(Ie)return!1;let t=rt(e);return t?(c.error(t),!1):await Q(`signature`,async()=>$(`signature`,{signature:e}))?(Y(`signature`,e),X({signature:e}),V(e),c.success(h(`page.signatureUpdateSuccess`)),!0):!1}return p(a,{className:`min-h-screen bg-[var(--color-surface-panel-dark)]`,children:[f(le,{className:`h-11 !border-none !bg-[var(--color-surface-panel-dark)]`,title:h(`page.title`)}),p(a,{className:`mx-auto flex w-full max-w-[390px] flex-col px-8 pb-10 pt-17`,children:[p(`button`,{type:`button`,onClick:Ue,className:`flex flex-col items-center gap-4 pb-10 ${W}`,children:[f(`input`,{ref:xe,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:We}),f(a,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:p(ee,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[f(ne,{src:w.avatar}),f(te,{})]})}),p(o,{className:`text-base leading-5 text-text3`,children:[`ID:`,` `,H?h(`page.loading`):E?h(`page.avatarUploading`):`${Ne}`]})]}),p(a,{className:`flex flex-col gap-6`,children:[p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.label`)}),f(`button`,{type:`button`,onClick:qe,className:`${K} ${W}`,children:f(o,{className:J,children:w.nickname||h(`page.nicknamePlaceholder`)})})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.genderLabel`)}),p(`button`,{type:`button`,onClick:Ze,className:`${K} justify-between gap-3 ${W}`,children:[f(o,{className:J,children:be[G]||h(`page.genderSecret`)}),f(fe,{className:`h-5 w-5 shrink-0 text-text3`,strokeWidth:1.75})]})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.signatureLabel`)}),f(`button`,{type:`button`,onClick:tt,className:`${K} ${W}`,children:f(o,{className:J,children:w.signature||h(`page.signaturePlaceholder`)})})]})]})]}),f(s,{open:M,onClose:()=>N(!1),title:h(`page.label`),confirmText:h(`page.submit`),onConfirm:e=>Xe(String(e)),confirmDisabled:Pe,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:x,className:`!bg-bg1 p-2.5`,rows:4,maxLength:24,placeholder:h(`page.nicknamePlaceholder`),value:P,onChange:t=>{Je(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[P.length,`/`,24]})})})]})})}),f(ue,{open:we,onClose:Qe,value:L,onValueChange:$e,onConfirm:et,confirmDisabled:Fe}),f(s,{open:z,onClose:()=>Te(!1),title:h(`page.signatureLabel`),confirmText:h(`page.submit`),onConfirm:e=>it(String(e)),confirmDisabled:Ie,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:S,className:`!bg-bg1 p-2.5`,rows:4,maxLength:100,placeholder:h(`page.signaturePlaceholder`),value:B,onChange:t=>{nt(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[B.length,`/`,100]})})})]})})}),f(de,{open:Ce,onClose:Ke,imageSrc:A,onConfirm:Ge,cropShape:`round`})]})}export{ye as EditClient};
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserEditInfo as t,gUserGetUserInfo as n,pUserEditUserInfo as r}from"../../../service/generated/client.mjs";import{uploadFile as i}from"../../../utils/upload-file.mjs";import{Avatar as ee,AvatarFallback as te,AvatarImage as ne}from"../../ui/avatar.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as re,InputGroupAddon as ie,InputGroupTextarea as ae}from"../../ui/input-group.mjs";import{Text as o}from"../../ui/text.mjs";import{useDeleteRequest as oe,useMutation as se,useRequest as ce}from"../../../hooks/query/use-query.mjs";import{HeaderNav as le}from"../../common/header-nav/client.mjs";import{PickerDrawer as s}from"../../common/picker/picker-drawer/picker-drawer.mjs";import{GenderPicker as ue}from"../../common/picker/gender-picker/gender-picker.mjs";import{ImageCropModal as de}from"../../common/image-crop-modal/image-crop-modal.mjs";import{toast as c}from"sonner";import{useEffect as l,useRef as u,useState as d}from"react";import{ChevronDown as fe}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as pe}from"next-intl";import{produce as me}from"immer";const m={0:`secret`,1:`male`,2:`female`},h={male:1,female:2,secret:0},g=[`image/jpeg`,`image/png`],he=/^[\u4E00-\u9FFF\w.-]+$/;function ge(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return g.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function _(e){return e?h[e]===void 0?m[e]??`secret`:e:`secret`}function v(e){if(!e)return;if(h[e]!==void 0)return h[e];let t=Number(e);return Number.isNaN(t)?void 0:t}function _e(e){return{nickname:e?.nick_name??``,gender:_(e?.gender?.toString()),signature:e?.signature??``,avatar:e?.avatar??``}}function ve(e){if(!e)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}function ye({id:m}){let h=pe(`components.pages.edit`),{userId:g,userInfo:_,setUserInfo:ye}=e(),y=m??g,b=oe(),be={male:h(`page.genderMale`),female:h(`page.genderFemale`),secret:h(`page.genderSecret`)},xe=u(null),x=u(null),S=u(null),C=u(null),[w,T]=d(()=>_e()),[E,D]=d(!1),[Se,O]=d(null),[Ce,k]=d(!1),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(``),[we,I]=d(!1),[L,R]=d(`secret`),[z,Te]=d(!1),[B,V]=d(``),Ee={code:0,message:``,data:{}},De={code:0,message:``,data:{}},{data:Oe,isLoading:H}=ce([`user-edit-info`,y],()=>y?t({user_id:y}):Promise.resolve(Ee)),{data:ke}=ce([`user-info-basic`,y],()=>y?n({user_id:y}):Promise.resolve(De)),{mutateAsync:Ae,isPending:je}=se(async e=>r(e)),Me=E||je||Se!==null,U=H||Me,W=U?`cursor-not-allowed opacity-60`:`cursor-pointer`,Ne=ke?.data?.display_id||_?.display_id||`--`,G=w.gender||`secret`,Pe=U||P.trim()===w.nickname,Fe=U||L===G,Ie=U||B===w.signature,K=`flex h-12 w-full items-center rounded-md bg-[var(--color-surface-field-bg)] px-4`,q=`text-sm leading-6 text-text3`,J=`block min-w-0 flex-1 truncate text-sm leading-5 text-text3`;l(()=>{let e=Oe?.data;e&&T(_e(e))},[Oe]),l(()=>{if(!M)return;let e=window.setTimeout(()=>{ve(x.current)},250);return()=>{window.clearTimeout(e)}},[M]),l(()=>{if(!z)return;let e=window.setTimeout(()=>{ve(S.current)},250);return()=>{window.clearTimeout(e)}},[z]),l(()=>()=>{A&&URL.revokeObjectURL(A)},[A]);function Y(e,t){T(me(n=>{n[e]=t}))}function Le(){A&&(URL.revokeObjectURL(A),j(``))}function Re(){y&&(b([`user-edit-info`,y]),b([`user-info-basic`,y]),b([`user-profile`,`mine`]),b([`user-profile`,`mine`,y]),b([`user-profile`,`profile`,y]))}function X(e){!y||y!==g||ye({..._,user_id:y,...e})}function ze(){c.info(h(`page.editBlockedWhileSaving`))}function Z(){return H?!0:Me?(ze(),!0):!1}function Be(e){return C.current?(ze(),!1):(C.current=e,O(e),!0)}function Ve(e){C.current===e&&(C.current=null,O(null))}async function Q(e,t){if(!Be(e))return!1;let n=c.loading(h(`page.savingInProgress`));try{return await t()}finally{c.dismiss(n),Ve(e)}}function He(e,t){let n={...w,...t},r={nickname:[`nick_name`,n.nickname||void 0],avatar:[`avatar`,n.avatar||void 0],signature:[`signature`,n.signature||void 0],gender:[`gender`,v(n.gender)]},i=Object.keys(r).filter(t=>t!==e).map(e=>r[e]);return i.push(r[e]),Object.fromEntries(i)}async function $(e,t){if(!y)return c.error(h(`page.userNotFound`)),!1;let n=He(e,t);try{return await Ae({user_id:y,...n}),Re(),!0}catch(e){return console.error(`更新用户信息失败`,e),c.error(h(`page.updateFailed`)),!1}}function Ue(){Z()||E||xe.current?.click()}function We(e){if(Z()){e.target&&(e.target.value=``);return}let t=e.target.files?.[0];if(t){if(!ge(t)){c.error(h(`page.imageTypeInvalid`)),e.target&&(e.target.value=``);return}j(URL.createObjectURL(t)),k(!0),e.target&&(e.target.value=``)}}async function Ge(e){await Q(`avatar`,async()=>{try{D(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);return await $(`avatar`,{avatar:t.objectKey})?(Y(`avatar`,t.objectKey),X({avatar:t.objectKey}),Ke(),c.success(h(`page.avatarUpdateSuccess`)),!0):!1}catch(e){return console.error(`上传头像失败`,e),c.error(h(`page.avatarUploadFailed`)),!1}finally{D(!1)}})}function Ke(){k(!1),Le()}function qe(){Z()||(F(w.nickname),N(!0))}function Je(e){let t=e.target.value;t.length>24||F(t)}function Ye(e){return e?e.length<2?h(`page.nicknameTooShort`):he.test(e)?``:h(`page.nicknameInvalidChars`):h(`page.nicknameRequired`)}async function Xe(e){if(Pe)return!1;let t=e.trim(),n=Ye(t);return n?(c.error(n),!1):await Q(`nickname`,async()=>$(`nickname`,{nickname:t}))?(Y(`nickname`,t),X({nick_name:t}),F(t),c.success(h(`page.nicknameUpdateSuccess`)),!0):!1}function Ze(){Z()||(R(G),I(!0))}function Qe(){I(!1)}function $e(e){R(e)}async function et(e){let t=e||L||`secret`;if(t===G)return!1;let n=v(t);return await Q(`gender`,async()=>$(`gender`,{gender:t}))?(Y(`gender`,t),X({gender:n}),R(t),c.success(h(`page.genderUpdateSuccess`)),!0):!1}function tt(){Z()||(V(w.signature),Te(!0))}function nt(e){let t=e.target.value;t.length>100||V(t)}function rt(e){let t=e.trim();return t.length>0&&t.length<2?h(`page.signatureTooShort`):``}async function it(e){if(Ie)return!1;let t=rt(e);return t?(c.error(t),!1):await Q(`signature`,async()=>$(`signature`,{signature:e}))?(Y(`signature`,e),X({signature:e}),V(e),c.success(h(`page.signatureUpdateSuccess`)),!0):!1}return p(a,{className:`min-h-screen bg-[var(--color-surface-panel-dark)]`,children:[f(le,{className:`h-11 !border-none !bg-[var(--color-surface-panel-dark)]`,title:h(`page.title`)}),p(a,{className:`mx-auto flex w-full max-w-[390px] flex-col px-8 pb-10 pt-17`,children:[p(`button`,{type:`button`,onClick:Ue,className:`flex flex-col items-center gap-4 pb-10 ${W}`,children:[f(`input`,{ref:xe,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:We}),f(a,{className:`flex h-[72px] w-[72px] items-center justify-center rounded-full bg-[var(--color-surface-white20)]`,children:p(ee,{className:`h-[60px] w-[60px] border-[3px] border-[var(--color-surface-white20)]`,children:[f(ne,{src:w.avatar}),f(te,{})]})}),p(o,{className:`text-base leading-5 text-text3`,children:[`ID:`,` `,H?h(`page.loading`):E?h(`page.avatarUploading`):`${Ne}`]})]}),p(a,{className:`flex flex-col gap-6`,children:[p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.label`)}),f(`button`,{type:`button`,onClick:qe,className:`${K} ${W}`,children:f(o,{className:J,children:w.nickname||h(`page.nicknamePlaceholder`)})})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.genderLabel`)}),p(`button`,{type:`button`,onClick:Ze,className:`${K} justify-between gap-3 ${W}`,children:[f(o,{className:J,children:be[G]||h(`page.genderSecret`)}),f(fe,{className:`h-5 w-5 shrink-0 text-text3`,strokeWidth:1.75})]})]}),p(a,{className:`flex flex-col gap-2`,children:[f(o,{as:`p`,className:q,children:h(`page.signatureLabel`)}),f(`button`,{type:`button`,onClick:tt,className:`${K} ${W}`,children:f(o,{className:J,children:w.signature||h(`page.signaturePlaceholder`)})})]})]})]}),f(s,{open:M,onClose:()=>N(!1),title:h(`page.label`),confirmText:h(`page.submit`),onConfirm:e=>Xe(String(e)),confirmDisabled:Pe,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:x,className:`!bg-bg1 p-2.5`,rows:4,maxLength:24,placeholder:h(`page.nicknamePlaceholder`),value:P,onChange:t=>{Je(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[P.length,`/`,24]})})})]})})}),f(ue,{open:we,onClose:Qe,value:L,onValueChange:$e,onConfirm:et,confirmDisabled:Fe}),f(s,{open:z,onClose:()=>Te(!1),title:h(`page.signatureLabel`),confirmText:h(`page.submit`),onConfirm:e=>it(String(e)),confirmDisabled:Ie,children:({onValueChange:e})=>f(a,{className:`px-4 py-4 min-h-[230px]`,children:p(re,{children:[f(ae,{ref:S,className:`!bg-bg1 p-2.5`,rows:4,maxLength:100,placeholder:h(`page.signaturePlaceholder`),value:B,onChange:t=>{nt(t),e(t.target.value)},disabled:U}),f(ie,{className:`!bg-bg1`,align:`block-end`,children:f(`div`,{className:`text-right w-full`,children:p(`span`,{className:`text-xs`,children:[B.length,`/`,100]})})})]})})}),f(de,{open:Ce,onClose:Ke,imageSrc:A,onConfirm:Ge,cropShape:`round`})]})}export{ye as EditClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{
|
|
2
|
+
"use client";import e from"../../biz/basics/fullscreen-feed/runtime/client.mjs";import{useMixedFeedController as t}from"../../biz/basics/fullscreen-feed/runtime/use-mixed-feed-controller.mjs";import{useSeriesFeedController as n}from"../../biz/basics/fullscreen-feed/runtime/use-series-feed-controller.mjs";import{SeriesEpisodes as r}from"../../common/series-episodes/index.mjs";import{useCallback as i,useEffect as a,useMemo as o}from"react";import{usePathname as s}from"next/navigation";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";function f({blockId:f,seriesId:p,initialContents:m,videoConfig:h,hasBottom:g,pageSize:_=6,initialActiveIndex:v=0,items:y,onSwipeTo:b,onEpisodeNavigate:x,onGoToEpisode:S,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}){let D=d(`components.pages.fullscreenFeed`),O=s(),k=o(()=>{let e=p?`series:${p}`:`block:${f||``}`;return`${O||`unknown`}:fullscreen-feed:${e}:pageSize:${_}`},[f,_,O,p]),A=`${k}:series-controller`,j=`${k}:mixed-controller`,M=n({seriesId:p||``,initialContents:m,initialActiveIndex:v,onEpisodeNavigate:x,keepAliveKey:A}),N=t({blockId:f||``,initialContents:m,initialActiveIndex:v,pageSize:_,keepAliveKey:j}),P=p?M:N,F=y||P.items,I=P.activeIndex,L=P.userInteracted,R=i((e,t)=>{P.setActiveIndex(e,t),p||N.maybeLoadMore(e),b?.({activeIndex:e,items:F,direction:t})},[P,F,b,p,N]),z=i((e,t)=>{P.updateItemData(e,t)},[P]),B=i(e=>P.getNavigationInfo(e),[P]);return a(()=>{S&&S(e=>{R(e,`jump`)})},[S,R]),!f&&!p?l(`div`,{className:`flex h-screen w-full items-center justify-center bg-black text-white/70`,children:D(`page.missingParams`)}):u(c,{children:[l(e,{items:F,activeIndex:I,bottom:g?56:void 0,videoConfig:h,userInteracted:L,onUserInteracted:P.setUserInteracted,onActiveIndexChange:R,onDataUpdate:z,getNavigationInfo:B,currentUserId:C,followIds:w,onFollowIdsChange:T,onRequireLogin:E}),p&&M.isSeriesSelectorOpen&&l(r,{title:D(`page.episodeSelectorTitle`),videoTitle:M.seriesMeta.seriesTitle,mode:`selector`,variant:`sheet`,open:M.isSeriesSelectorOpen,seriesList:M.seriesMeta.seriesList,activeEpisodeId:M.activeEpisodeId,onClose:M.closeSeriesSelector,onSelectEpisode:M.onSelectEpisode})]})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import _ from"../../common/info-card/card-text.mjs";import{useSearchParams as ae}from"next/navigation";import{useCallback as oe,useEffect as v,useMemo as y}from"react";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=se(`components.pages.postDetail`),k=ae(),{isLogin:ue,userInfo:de,userId:A}=t(),j=A||de?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(y(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=y(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(y(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=y(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=y(()=>L?.content_type===0,[L?.content_type]),W=y(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=y(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=y(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=y(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);v(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=y(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=y(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});v(()=>{!L&&N&&R(N)},[L,N,R]),v(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),v(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),v(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),v(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),v(()=>{H(0)},[L?.id,H]);let ve=y(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);v(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return S(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[x(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:x(m,{data:{list:e(ye?.data)}})}),x(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:S(b,{children:[L&&!$&&x(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&S(b,{children:[U&&x(h,{information:L,isVideo:!0}),S(`article`,{className:`w-full`,children:[x(ie,{infoData:L,rightChild:x(te,{information:L,onUpdate:Q})}),x(_,{infoData:L,isEllipsis:!1}),!U&&x(`div`,{className:`mt-[12px]`,children:x(h,{information:L,isVideo:!1})})]}),x(ne,{information:L,onUpdate:Q}),S(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[S(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[x(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),S(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),x(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&x(re,{information:L,initRecommendList:z})]}),!L&&x(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
|
|
2
|
+
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetComments as n,gCommunityGetContentInfo as r,gCommunityGetContentList as i,gContentGetAppChannels as a}from"../../../service/generated/client.mjs";import{checkFollowStatus as o}from"../../../utils/follow-service.mjs";import{EmptyState as s}from"../../ui/empty.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../hooks/use-browse-report.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as ee,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import{batchQueryContentInteractions as p}from"../../../hooks/use-content-operate.mjs";import m from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{DetailFollowAction as te}from"../../biz/business/detail/shared/detail-follow-action.mjs";import{DetailOperate as ne}from"../../biz/business/detail/shared/detail-operate.mjs";import{PostRecommendList as re}from"../../biz/business/detail/shared/post-recommend-list.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import g from"../../biz/business/comment/comment-list.mjs";import ie from"../../common/info-card/card-header.mjs";import ae from"../../common/info-card/card-text.mjs";import{useCallback as oe,useEffect as _,useMemo as v}from"react";import{useSearchParams as y}from"next/navigation";import{Fragment as b,jsx as x,jsxs as S}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";function C(e){if(!e||typeof e!=`object`||!e.content_id)return null;let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1),r=t.filter(e=>e&&e.is_video===!0),i=n.map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),a=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),o=i.length?i:a,s=r.map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),c=o[0]||``,l=e.cover_image||s||c||``,u=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name));return{...t.length?{medias:t}:{},id:e.content_id,mid:e.content_id,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:l,img_y:l,img_width:``,img_height:``,preview_images:o,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:u,source_tags:u.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,static:{like_cnt:e.like_count||0,comment_cnt:e.comment_count||0,share_cnt:e.share_count||0,browse_cnt:e.view_count||0},info:{text:e.content||``,images:o}}}function ce(e){let t=Array.isArray(e.medias)?e.medias:[],n=t.filter(e=>e&&e.is_video===!1).map(e=>e.media_url).filter(e=>typeof e==`string`&&e.length>0),r=(Array.isArray(e.images)?e.images:[]).map(e=>typeof e==`string`?e:e&&typeof e==`object`&&(e.url||e.image_url||e.media_url)||``).filter(e=>typeof e==`string`&&e.length>0),i=n.length?n:r,a=t.filter(e=>e&&e.is_video===!0).map(e=>e.cover_image).find(e=>typeof e==`string`&&e.length>0),o=e.cover_image||a||i[0]||``,s=(Array.isArray(e.tags)?e.tags:[]).map(e=>{if(e&&typeof e==`object`){let t=e.id??e.name??``,n=e.name??e.id??``,r=e.group??``;return{id:String(t),name:String(n),group:String(r)}}return{id:String(e),name:String(e),group:``}}).filter(e=>!!(e.id||e.name)),c=t.length?t:i.filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}));return{...c.length?{medias:c}:{},id:e.content_id||``,mid:e.content_id||``,name:e.title||``,cat_id:``,cat_name:``,status:String(e.status||`2`),status_text:``,create_time:e.create_time,show_at:e.create_time,position:``,img_type:``,img_x:o,img_y:o,img_width:``,img_height:``,preview_images:i,score:``,duration:``,is_more_link:`n`,update_status:`1`,description:e.content||``,language:``,director:``,actor:``,area:``,issue_date:``,publisher:``,series:``,number:``,tags:s,source_tags:s.map(e=>e.name).filter(Boolean).join(`,`),source_actor:[],links:[],money:``,up_user:e.user_id||e.author?.user_id||``,source_username:e.author?.nickname||e.author?.username||``,task_id:``,file_status:``,content_type:2,author:{...e.author,avatar:e.author.avatar_url},like:e.interaction?.is_liked||!1,dislike:e.interaction?.is_dislike||!1,collect:e.interaction?.is_collected||!1,is_followed:e.interaction?.is_followed||!1,statics_cnt:{like_cnt:String(e.like_count||0),dislike_cnt:String(e.dislike_count||0),comment_cnt:String(e.comment_count||0),share_cnt:String(e.share_count||0),browse_cnt:String(e.view_count||0),collect_cnt:String(e.collect_count||0)}}}function w({detailId:f,initialInformation:w,initialRecommendList:le,initialCommentList:T,initialCommentTotal:E,initialCommentHasMore:D}){let O=se(`components.pages.postDetail`),k=y(),{isLogin:ue,userInfo:de,userId:A}=t(),j=A||de?.userId||``;l({contentId:f,contentType:2,enabled:!!f,enableIntervalReport:!1,enableExitReport:!1});let{data:M}=c(v(()=>[`post-detail`,f],[f]),async()=>f?await r({content_id:f}):null,{enabled:!!f}),N=v(()=>{let e=M?.data?.data;return C(e)},[M?.data?.data]),fe=w??N??null,{data:P}=c(v(()=>[`post-detail-recommend`,f],[f]),async()=>f?await i({page:1,page_size:6,sort_by:`recommend`}):null,{enabled:!!f}),F=v(()=>(P?.data?.data?.contents??[]).filter(e=>e.content_id!==f).slice(0,4).map(e=>ce(e)),[f,P?.data?.data?.contents]),I=le??F??[],[L,R]=d(`detail-information-${f}`,fe),[z,B]=d(`detail-recommend-${f}`,I),[V,H]=d(`info-detail-comment-add-count-${f}`,0),U=v(()=>L?.content_type===0,[L?.content_type]),W=v(()=>[`post-detail-comments`,f,1,5],[5,f]),{data:G}=c(W,async()=>f?await n({content_id:f,page:1,page_size:5,sort_by:`latest`}):null,{enabled:!!f}),pe=v(()=>{if(T?.length)return T;let e=G?.data?.data?.comments??[];if(e.length>0)return e},[G?.data?.data?.comments,T]),K=v(()=>{if(typeof E==`number`)return E;if(G?.data?.data)return typeof G?.data?.data?.total==`number`?G.data.data.total:void 0},[G?.data?.data,E]),me=v(()=>{if(typeof D==`boolean`)return D;if(G?.data?.data)return G?.data?.data?.has_more??!1},[G?.data?.data,D]),[q,J]=d(`post-detail-comment-total-${f}`,typeof E==`number`?E:void 0);_(()=>{typeof K==`number`&&J(e=>typeof e==`number`?Math.max(e,K):K)},[K,J]);let he=v(()=>[`detail-interaction`,L?.id,L?.content_type],[L?.content_type,L?.id]),Y=L?.up_user||``,ge=!!(j&&Y&&j===Y),_e=v(()=>[`detail-follow-status`,j,Y],[j,Y]),{data:X}=c(he,async()=>!L?.id||typeof L.content_type!=`number`?null:await p([L.id],2),{enabled:!!L?.id}),{data:Z}=c(_e,async()=>!j||!Y?null:await o({app_id:0,follower_id:j,followee_ids:[Y]}),{enabled:!!ue&&!!j&&!!Y&&!ge});_(()=>{!L&&N&&R(N)},[L,N,R]),_(()=>{z.length===0&&F.length>0&&B(F)},[z.length,F,B]),_(()=>{if(!X?.interaction_list?.[0])return;let e=X.interaction_list[0];R(t=>{if(!t)return t;let n=t.static?.like_cnt,r=typeof n==`number`?n:Number(n||0),i=!!e.is_liked&&r===0;return{...t,like:e.is_liked||!1,dislike:e.is_disliked||!1,collect:e.is_collected||!1,static:i?{...t.static||{},like_cnt:1}:t.static}})},[X,R]),_(()=>{if(!Z?.data||!Y)return;let e=!!Z.data?.is_following_map?.[Y];R(t=>!t||t.is_followed===e?t:{...t,is_followed:e})},[Z?.data,Y,R]);let Q=oe(e=>{R(t=>t&&{...t,...e})},[R]);ee(()=>{L?.id&&L.id},[L?.id],`detail-page-report-${f}`),_(()=>{!L||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:L.id||f,author_id:L.up_user,object_type:L.content_type,object_category:L.content_type,object_tags:L.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,L]),_(()=>{H(0)},[L?.id,H]);let ve=v(()=>(typeof q==`number`?q:typeof K==`number`?K:0)+V,[V,q,K]);_(()=>{k?.get(`tab`)===`comment`&&(typeof window>`u`||window.requestAnimationFrame(()=>{document.getElementById(`detail-comments`)?.scrollIntoView({behavior:`smooth`,block:`start`})}))},[L?.id,k]);let $=L?.status===`2`,{data:ye}=c([u.CHANNEL],()=>a());return S(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[x(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:x(m,{data:{list:e(ye?.data)}})}),x(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:S(b,{children:[L&&!$&&x(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&S(b,{children:[U&&x(h,{information:L,isVideo:!0}),S(`article`,{className:`w-full`,children:[x(ie,{infoData:L,rightChild:x(te,{information:L,onUpdate:Q})}),x(ae,{infoData:L,isEllipsis:!1}),!U&&x(`div`,{className:`mt-[12px]`,children:x(h,{information:L,isVideo:!1})})]}),x(ne,{information:L,onUpdate:Q}),S(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[S(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[x(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),S(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),x(g,{listQueryKey:W,contentId:L.id,information:L,isShow:!1,isClickLoad:!0,initialComments:pe,initialTotal:K,initialHasMore:me,addCommentCount:()=>{H(e=>e+1)},onTotalChange:e=>{J(t=>typeof t==`number`?Math.max(t,e):e)}})]}),z.length>0&&x(re,{information:L,initRecommendList:z})]}),!L&&x(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{UserProfileHeaderClient as e}from"../../biz/business/profile/profile-header/client.mjs";import{UserProfileMain as t}from"../../biz/business/profile/profile-main/server.mjs";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{id:o,
|
|
2
|
+
import{UserProfileHeaderClient as e}from"../../biz/business/profile/profile-header/client.mjs";import{UserProfileMain as t}from"../../biz/business/profile/profile-main/server.mjs";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";function a(a){let{id:o,isMine:s=!1,showCreateAction:c,showBackButton:l,requireLogin:u,tab:d,likeTab:f,historyTab:p,collectTab:m,collectCollectionTab:h}=a;return i(n,{children:[r(e,{id:o,isMine:s,showBackButton:l,requireLogin:u}),r(t,{id:o,isMine:s,showCreateAction:c,requireLogin:u,tab:d,likeTab:f,historyTab:p,collectTab:m,collectCollectionTab:h})]})}export{a as UserProfilePage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetHotContentList as t,gContentGetHotVideoList as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{Text as a}from"../../ui/text.mjs";import{Skeleton as o}from"../../ui/skeleton.mjs";import{useRequest as s}from"../../../hooks/query/use-query.mjs";import{getPostDetailPagePath as c}from"../../../utils/tools.mjs";import l from"../../common/at-element/index.mjs";import{useCardDecoration as u}from"../../../hooks/use-card-decoration.mjs";import d from"../../ui/rate.mjs";import f from"./style.module.mjs";import{trackSearchMediaRecommendClick as p}from"./tracking.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";const y=m(({list:e})=>{let t=_(`components.pages.search`),{getCalculationScore:n}=u();return e.length===0?h(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:g(i,{children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]})}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),e.map((e,t)=>g(v,{className:`w-full flex items-center justify-between mt-[12px] shrink-0`,href:c({id:e.video_id,contentType:0}),onClick:()=>{p(String(e.video_id??``))},children:[g(i,{className:`w-[76px] h-[102px] rounded-[8px] overflow-hidden relative bg-bg2`,children:[h(r,{src:e.cover||``,fill:!0,alt:e.name||``,objectFit:`cover`}),h(i,{className:`w-[18px] h-[18px] rounded-tl-[8px] rounded-br-[8px] flex items-center justify-center overflow-hidden absolute left-0 top-0 z-[1]`,style:{background:t>2?`linear-gradient( 218deg, #909BB7 0%, #5D7198 100%)`:`linear-gradient( 175deg, #FD4C5E 0%, #F05D19 100%)`},children:h(a,{className:`text-[12px] leading-[12px] text-white`,children:t+1})})]}),g(i,{className:`flex-1 flex flex-col ml-[12px]`,children:[h(a,{className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name}),g(i,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[h(d,{allowHalf:!0,value:n({score:String(e.score??0)})}),h(a,{className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),h(i,{className:`w-fit mt-[4px] h-[20px] leading-[20px] px-[6px] text-text2 text-[12px] bg-line1 rounded-[4px]`,children:e.cat_name})]})]},String(e.video_id??t)))]})}),b=m(({list:e})=>{let t=_(`components.pages.search`);return e.length===0?g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),e.map((e,t)=>g(v,{className:`w-full h-[48px] mt-[8px] flex items-center`,href:c({id:e.content_id,contentType:1}),onClick:()=>{p(String(e.content_id??``))},children:[g(a,{className:`text-[16px] leading-[24px] font-bold ${t<3?`text-theme1`:`text-text3`}`,children:[t+1,`.`]}),h(a,{className:`ml-[8px] text-[16px] text-text1 leading-[24px] line-clamp-1 max-w-[260px] ${f.hotInfoTitle}`,children:h(l,{text:e.title??``,atUsers:[]})})]},String(e.content_id??t)))]})});function x({isShow:r}){let{userInfo:a}=e(),{data:o}=s([`hotVideo`],()=>n({user_id:a.user_id})),c=o?.data?.hot_video_list??[],{data:l}=s([`hotContent`],()=>t({user_id:a.user_id})),u=l?.data?.hot_content_list??[];return r?g(i,{className:`w-full
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gCommunityGetHotContentList as t,gContentGetHotVideoList as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{Text as a}from"../../ui/text.mjs";import{Skeleton as o}from"../../ui/skeleton.mjs";import{useRequest as s}from"../../../hooks/query/use-query.mjs";import{getPostDetailPagePath as c}from"../../../utils/tools.mjs";import l from"../../common/at-element/index.mjs";import{useCardDecoration as u}from"../../../hooks/use-card-decoration.mjs";import d from"../../ui/rate.mjs";import f from"./style.module.mjs";import{trackSearchMediaRecommendClick as p}from"./tracking.mjs";import{memo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import v from"next/link";const y=m(({list:e})=>{let t=_(`components.pages.search`),{getCalculationScore:n}=u();return e.length===0?h(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:g(i,{children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]})}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(254,201,207,0.5) 0%, rgba(254,201,207,0.1) 100%)`,borderColor:`rgba(255,119,131,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme5 text-[18px] font-bold`,children:t(`hotRecommend.hotVideosTitle`)}),e.map((e,t)=>g(v,{className:`w-full flex items-center justify-between mt-[12px] shrink-0`,href:c({id:e.video_id,contentType:0}),onClick:()=>{p(String(e.video_id??``))},children:[g(i,{className:`w-[76px] h-[102px] rounded-[8px] overflow-hidden relative bg-bg2`,children:[h(r,{src:e.cover||``,fill:!0,alt:e.name||``,objectFit:`cover`}),h(i,{className:`w-[18px] h-[18px] rounded-tl-[8px] rounded-br-[8px] flex items-center justify-center overflow-hidden absolute left-0 top-0 z-[1]`,style:{background:t>2?`linear-gradient( 218deg, #909BB7 0%, #5D7198 100%)`:`linear-gradient( 175deg, #FD4C5E 0%, #F05D19 100%)`},children:h(a,{className:`text-[12px] leading-[12px] text-white`,children:t+1})})]}),g(i,{className:`flex-1 flex flex-col ml-[12px]`,children:[h(a,{className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name}),g(i,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[h(d,{allowHalf:!0,value:n({score:String(e.score??0)})}),h(a,{className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),h(i,{className:`w-fit mt-[4px] h-[20px] leading-[20px] px-[6px] text-text2 text-[12px] bg-line1 rounded-[4px]`,children:e.cat_name})]})]},String(e.video_id??t)))]})}),b=m(({list:e})=>{let t=_(`components.pages.search`);return e.length===0?g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),g(`div`,{className:`flex flex-col gap-[8px]`,children:[h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`}),h(o,{className:`w-full h-[28px] mt-[8px]`})]})]}):g(i,{className:`w-[324px] h-auto border rounded-[12px] shrink-0 p-[12px]`,style:{background:`linear-gradient( 156deg, rgba(153,215,255,0.5) 0%, rgba(153,215,255,0.1) 100%)`,borderColor:`rgba(31,167,255,0.2)`},children:[h(a,{className:`leading-[26px] block text-theme1 text-[18px] font-bold mb-[4px]`,children:t(`hotRecommend.hotPostsTitle`)}),e.map((e,t)=>g(v,{className:`w-full h-[48px] mt-[8px] flex items-center`,href:c({id:e.content_id,contentType:1}),onClick:()=>{p(String(e.content_id??``))},children:[g(a,{className:`text-[16px] leading-[24px] font-bold ${t<3?`text-theme1`:`text-text3`}`,children:[t+1,`.`]}),h(a,{className:`ml-[8px] text-[16px] text-text1 leading-[24px] line-clamp-1 max-w-[260px] ${f.hotInfoTitle}`,children:h(l,{text:e.title??``,atUsers:[]})})]},String(e.content_id??t)))]})});function x({isShow:r}){let{userInfo:a}=e(),{data:o}=s([`hotVideo`],()=>n({user_id:a.user_id})),c=o?.data?.hot_video_list??[],{data:l}=s([`hotContent`],()=>t({user_id:a.user_id})),u=l?.data?.hot_content_list??[];return r?g(i,{className:`w-full px-[12px] flex gap-x-[12px] flex-nowrap pb-[24px] ${f.gScrollBoxX}`,children:[h(y,{list:c}),h(b,{list:u})]}):null}export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Skeleton as e}from"../../ui/skeleton.mjs";import t from"../../../assets/icons/refresh.mjs";import{useCallback as n,useEffect as r,useMemo as i,useReducer as a,useState as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(){return c(s,{children:Array.from({length:6}).map((t,n)=>c(`div`,{className:`w-[50%] ${n%2==0?`pr-[4px]`:`pl-[4px]`}`,children:c(e,{className:`w-[70%] h-[22px]`})},`hot-search-skeleton-${n}`))})}function f(e,t){return t}function p({initHotSearchKeywordList:e,onClick:s,onRefreshHotKey:p}){let m=u(`components.pages.search`),[h,g]=a(f,e),[_,v]=o(!1),y=n(async()=>{v(!0),g((await p?.())?.data?.recommend_list??[]),v(!1)},[p]),b=i(()=>_||h.length===0,[_,h]);return r(()=>{g(e)},[e]),l(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[l(`div`,{className:`w-full
|
|
2
|
+
"use client";import{Skeleton as e}from"../../ui/skeleton.mjs";import t from"../../../assets/icons/refresh.mjs";import{useCallback as n,useEffect as r,useMemo as i,useReducer as a,useState as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(){return c(s,{children:Array.from({length:6}).map((t,n)=>c(`div`,{className:`w-[50%] ${n%2==0?`pr-[4px]`:`pl-[4px]`}`,children:c(e,{className:`w-[70%] h-[22px]`})},`hot-search-skeleton-${n}`))})}function f(e,t){return t}function p({initHotSearchKeywordList:e,onClick:s,onRefreshHotKey:p}){let m=u(`components.pages.search`),[h,g]=a(f,e),[_,v]=o(!1),y=n(async()=>{v(!0),g((await p?.())?.data?.recommend_list??[]),v(!1)},[p]),b=i(()=>_||h.length===0,[_,h]);return r(()=>{g(e)},[e]),l(`div`,{className:`w-full mb-[24px] pt-[8px]`,children:[l(`div`,{className:`w-full pl-[12px] h-[24px] mb-[12px] flex items-center justify-between`,children:[c(`span`,{className:`leading-[24px] text-[16px] text-text1 font-semibold`,children:m(`hotSearch.recommendedSearches`)}),c(`div`,{className:`h-full px-[12px] flex items-center`,onClick:y,children:c(t,{className:`w-[16px] h-[16px] text-text2`})})]}),c(`div`,{className:`w-full px-[12px] flex gap-y-[16px] flex-wrap`,children:b?c(d,{}):h.map((e,t)=>c(`div`,{className:`w-[50%] ${t%2==0?`pr-[4px]`:`pl-[4px]`}`,onClick:()=>s?.(e),children:c(`span`,{className:`text-text1 text-[14px] leading-[22px] max-w-[90%] line-clamp-1`,children:e.title})},String(e.title??t)))})]})}export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{Box as a}from"../../ui/box.mjs";import{Popover as o,PopoverContent as s,PopoverTrigger as c}from"../../ui/popover.mjs";import{useRequest as l}from"../../../hooks/query/use-query.mjs";import{eventKey as u}from"../../../constants/event-key.mjs";import{useSearchHistory as d}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as f}from"../../biz/business/search-history/client.mjs";import p from"../../../assets/icons/search/filter.mjs";import{trackSearchResultPageView as m}from"../search-result/tracking.mjs";import{trackSearchPageView as h,trackSearchTextRecommendClick as g}from"./tracking.mjs";import
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as r}from"../../../service/generated/client.mjs";import{useRouter as i}from"../../../utils/use-compatible-router.mjs";import{Box as a}from"../../ui/box.mjs";import{Popover as o,PopoverContent as s,PopoverTrigger as c}from"../../ui/popover.mjs";import{useRequest as l}from"../../../hooks/query/use-query.mjs";import{eventKey as u}from"../../../constants/event-key.mjs";import{useSearchHistory as d}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as f}from"../../biz/business/search-history/client.mjs";import p from"../../../assets/icons/search/filter.mjs";import{trackSearchResultPageView as m}from"../search-result/tracking.mjs";import{trackSearchPageView as h,trackSearchTextRecommendClick as g}from"./tracking.mjs";import _ from"./hot-recommend.mjs";import v from"./hot-search.mjs";import{SEARCH_RESULT_SORT_OPTIONS as y}from"./search-result/shared.mjs";import ee from"./search-result/index.mjs";import te from"./top-header.mjs";import{memo as b,useEffect as x,useMemo as S,useRef as C,useState as w}from"react";import{usePathname as T,useSearchParams as E}from"next/navigation";import{jsx as D,jsxs as O}from"react/jsx-runtime";import{useTranslations as ne}from"next-intl";const k=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.user`,value:`user`}],A=b(({searchType:e,sort:t,tabList:n,onChange:r,onSortChange:i})=>{let[l,u]=w(!1);return O(a,{as:`nav`,className:`sticky top-[66px] z-40 flex items-center justify-between bg-[linear-gradient(180deg,rgba(6,3,21,0.98)_0%,rgba(6,3,21,0.88)_100%)] px-[16px] pb-[24px] pt-[23px] backdrop-blur-[16px]`,children:[D(a,{className:`flex items-center gap-[10px]`,children:n.map(t=>D(`button`,{type:`button`,className:`text-[16px] leading-[22px] transition-colors ${e===t.value?`font-medium text-white`:`font-normal text-white/80`}`,onClick:()=>{e!==t.value&&r(t.value)},children:t.label},t.value))}),O(o,{open:l,onOpenChange:u,children:[D(c,{"aria-label":`排序筛选`,className:`flex size-[24px] items-center justify-center text-white/70`,children:D(p,{className:`size-[20px]`})}),D(s,{side:`bottom`,align:`end`,sideOffset:8,className:`w-[132px] border border-white/10 bg-[#10071E]/95 p-[8px] backdrop-blur-[18px]`,children:D(a,{className:`flex flex-col gap-[4px]`,children:y.map(e=>D(`button`,{type:`button`,className:`rounded-[8px] px-[12px] py-[8px] text-left text-[14px] leading-[20px] ${e.value===t?`bg-white/10 text-white`:`text-white/70`}`,onClick:()=>{i(e.value),u(!1)},children:e.label},e.value))})})]})]})});A.displayName=`SearchResultTabs`;function j(){let o=ne(`components.pages.search.pageClient`),{userInfo:s}=n(),c=s?.user_id||`guest`,p=E(),b=T(),j=i(),M=p.get(`q`)?.toString()||``,{data:N,refetch:P}=l([`hotSearchKey`],()=>r({user_id:c})),F=S(()=>N?.data?.recommend_list??[],[N]),[I,L]=w(M),[R,z]=w(M),[B,V]=w(0),[H,U]=w(k[0].value),[W,G]=w(y[0].value),[K,q]=w(0),{history:J,addHistory:Y}=d({storageKey:c}),X=S(()=>k.map(e=>({value:e.value,label:o(e.labelKey)})),[o]),Z=S(()=>I.trim()===``?F.length>0||J.length>0||I.trim()===``:!1,[J.length,F.length,I]),Q=S(()=>I.trim()!==``&&!Z,[I,Z]);x(()=>(t.on(u.EXCHANGE_SEARCH_TYPE,U),()=>{t.off(u.EXCHANGE_SEARCH_TYPE,U)}),[]),x(()=>{h()},[]);let $=C(I);return $.current=I,x(()=>{Q&&m(H,$.current)},[Q,H]),O(a,{className:`min-h-screen w-full bg-[radial-gradient(79.9%_42.18%_at_50%_0%,rgba(71,20,126,0.95)_0%,rgba(14,6,32,0.98)_42%,#05010F_100%)] pb-[24px]`,children:[D(te,{setSearchInputVal:t=>{t!==I&&(L(t),e({q:t}))},initInputVal:R,initInputVersion:B,addSearchHistory:Y}),Z&&O(a,{className:`w-full pt-[8px]`,children:[J.length>0&&D(f,{title:o(`searchHistory`),rows:2,storageKey:c,onHistoryClick:e=>{z(e),V(e=>e+1);let t=new URLSearchParams(p.toString());t.set(`q`,e),j.push(`${b}?${t.toString()}`)}}),D(v,{initHotSearchKeywordList:F,onRefreshHotKey:async()=>(await P()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{g(e.title||``,e.trace_id||``,e.trace_info||``),z(e.title||``),V(e=>e+1),Y(e.title)}})]}),D(_,{isShow:I.trim()===``}),Q&&O(a,{className:`relative mt-[8px] min-h-[calc(100vh-74px)] overflow-hidden rounded-t-[16px] bg-[linear-gradient(180deg,rgba(6,3,21,0.9)_19.905%,rgba(6,3,21,0)_100%)] backdrop-blur-[2px]`,children:[D(A,{searchType:H,sort:W,tabList:X,onChange:e=>{U(e)},onSortChange:e=>{G(e),q(e=>e+1)}}),D(ee,{inputVal:I,searchType:H,sort:W,refreshVersion:K},`${H}-${I}-${W}-${K}`)]})]})}export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as n}from"../../../../service/generated/tanstack.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{Skeleton as o}from"../../../ui/skeleton.mjs";import{useRequest as s}from"../../../../hooks/query/use-query.mjs";import{eventKey as c}from"../../../../constants/event-key.mjs";import{SearchUserRowCard as l}from"./search-user.mjs";import{SearchVideoWaterfall as u}from"./search-video-info.mjs";import{useEffect as d,useMemo as f,useState as p}from"react";import{ChevronDown as m}from"lucide-react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";function v(e,t){return JSON.stringify({type:1,keywords:e,sort:t})}function y(){return g(r,{className:`w-full`,children:[h(r,{className:`
|
|
2
|
+
"use client";import e from"../../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as n}from"../../../../service/generated/tanstack.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{Skeleton as o}from"../../../ui/skeleton.mjs";import{useRequest as s}from"../../../../hooks/query/use-query.mjs";import{eventKey as c}from"../../../../constants/event-key.mjs";import{SearchUserRowCard as l}from"./search-user.mjs";import{SearchVideoWaterfall as u}from"./search-video-info.mjs";import{useEffect as d,useMemo as f,useState as p}from"react";import{ChevronDown as m}from"lucide-react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";function v(e,t){return JSON.stringify({type:1,keywords:e,sort:t})}function y(){return g(r,{className:`w-full`,children:[h(r,{className:`px-[16px]`,children:h(r,{className:`flex flex-col gap-[12px]`,children:Array.from({length:2}).map((e,t)=>g(r,{className:`flex h-[88px] items-center gap-[8px] rounded-[8px] bg-white/8 px-[12px] py-[8px]`,children:[h(o,{className:`size-[56px] rounded-full bg-white/10`}),g(r,{className:`min-w-0 flex-1`,children:[h(o,{className:`h-[20px] w-[96px] rounded-[4px] bg-white/10`}),h(o,{className:`mt-[6px] h-[20px] w-full rounded-[4px] bg-white/10`}),h(o,{className:`mt-[6px] h-[20px] w-[120px] rounded-[4px] bg-white/10`})]}),h(o,{className:`h-[24px] w-[64px] rounded-full bg-white/10`})]},`search-all-user-skeleton-${t}`))})}),g(r,{className:`mt-[32px] flex w-full gap-[15px] px-[16px]`,children:[g(r,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[h(o,{className:`h-[218px] w-full rounded-[8px] bg-white/8`}),h(o,{className:`h-[120px] w-full rounded-[8px] bg-white/8`})]}),g(r,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[h(o,{className:`h-[120px] w-full rounded-[8px] bg-white/8`}),h(o,{className:`h-[218px] w-full rounded-[8px] bg-white/8`})]})]})]})}function b({searchInputVal:o,sort:b,refreshVersion:x}){let S=_(`components.pages.search.searchResult`),[C,w]=p(!1),[T,E]=p({});d(()=>{w(!1),E({})},[x,o,b]);let D=f(()=>v(o,b),[o,b]),{data:O,isFetching:k,isLoading:A}=s(f(()=>[...n({data_type:2,extra_params:D,page:1,page_size:10}),x],[x,D]),async()=>(await t({data_type:2,extra_params:D,page:1,page_size:10})).data??{}),j=f(()=>O?.users?.list??[],[O]),M=f(()=>j.map(e=>{let t=String(e.user_id||``).trim();return!t||T[t]===void 0?e:{...e,is_following:T[t]}}),[T,j]),N=f(()=>O?.videos?.list??[],[O]),P=f(()=>C?M:M.slice(0,2),[C,M]),F=!C&&M.length>2,I=!!((A||k)&&M.length===0&&N.length===0),L=!k&&M.length===0&&N.length===0;return I?h(y,{}):L?h(i,{type:`nodata`,text:S(`searchAll.emptyResult`),className:`!pt-[72px]`}):g(r,{className:`w-full pb-[24px]`,children:[P.length>0&&g(r,{className:`px-[16px]`,children:[h(r,{className:`flex flex-col gap-[12px]`,children:P.map((e,t)=>h(l,{item:e,onFollowChange:t=>{let n=String(e.user_id||``).trim();n&&E(e=>({...e,[n]:t?1:0}))}},String(e.user_id??t)))}),F&&g(`button`,{type:`button`,className:`mt-[12px] flex h-[48px] w-full items-center justify-center gap-[4px] rounded-[8px] bg-[linear-gradient(180deg,#15041B_8.824%,#250561_113.72%)] text-white/70 backdrop-blur-[4px]`,onClick:()=>w(!0),children:[h(a,{className:`text-[14px] leading-[20px]`,children:`展开全部`}),h(m,{className:`size-[16px]`,strokeWidth:1.5})]})]}),N.length>0&&h(u,{list:N,title:`相似推荐`,onMoreClick:()=>{e.emit(c.EXCHANGE_SEARCH_TYPE,`video`)},sectionClassName:P.length>0?`mt-[32px] w-full`:`w-full`})]})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{Box as t}from"../../../ui/box.mjs";import{EmptyState as n}from"../../../ui/empty.mjs";import{InfiniteScroll as r}from"../../../ui/infinite-scroll.mjs";import{Skeleton as i}from"../../../ui/skeleton.mjs";import{usePaginated as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/common/right_arrow_thin.mjs";import{WaterfallRecommend as s}from"../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{trackSearchResultClick as c}from"../../search-result/tracking.mjs";import{buildSearchVideoWaterfallColumns as l}from"./shared.mjs";import{memo as u,useCallback as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(){return m(t,{className:`flex w-full gap-[15px] px-[16px]`,children:[m(t,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`})]}),m(t,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`})]})]})}const _=u(({list:e,title:t,onMoreClick:n,sectionClassName:r=`w-full`})=>{let i=f(()=>l(e),[e]),a=!!t;return e.length===0?null:p(s,{title:t||``,columns:i,sectionClassName:r,headerClassName:a?`mb-[16px] flex items-center justify-between
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{Box as t}from"../../../ui/box.mjs";import{EmptyState as n}from"../../../ui/empty.mjs";import{InfiniteScroll as r}from"../../../ui/infinite-scroll.mjs";import{Skeleton as i}from"../../../ui/skeleton.mjs";import{usePaginated as a}from"../../../../hooks/query/use-query.mjs";import o from"../../../../assets/icons/common/right_arrow_thin.mjs";import{WaterfallRecommend as s}from"../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{trackSearchResultClick as c}from"../../search-result/tracking.mjs";import{buildSearchVideoWaterfallColumns as l}from"./shared.mjs";import{memo as u,useCallback as d,useMemo as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(){return m(t,{className:`flex w-full gap-[15px] px-[16px]`,children:[m(t,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`})]}),m(t,{className:`flex min-w-0 flex-1 flex-col gap-[16px]`,children:[p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[218px] w-full rounded-[8px] bg-white/8`}),p(i,{className:`h-[120px] w-full rounded-[8px] bg-white/8`})]})]})}const _=u(({list:e,title:t,onMoreClick:n,sectionClassName:r=`w-full`})=>{let i=f(()=>l(e),[e]),a=!!t;return e.length===0?null:p(s,{title:t||``,columns:i,sectionClassName:r,headerClassName:a?`mb-[16px] flex items-center justify-between px-[16px]`:`hidden`,titleClassName:`min-w-0 flex-1 text-[18px] leading-[24px] font-medium text-white`,moreLinkClassName:`ml-[8px] flex size-[24px] shrink-0 items-center justify-center text-white/50`,moreIcon:a&&n?p(o,{className:`size-[16px]`}):void 0,onMoreClick:n,containerClassName:`relative flex w-full gap-[15px] px-[16px]`,onItemClick:e=>{e.selectionId&&c(null,e.selectionId,`video`)}})});_.displayName=`SearchVideoWaterfall`;const v=u(({inputVal:i,sort:o,refreshVersion:s})=>{let c=h(`components.pages.search.searchResult`),l=d(async t=>await e({data_type:2,extra_params:JSON.stringify({type:3,keywords:i,sort:o}),page:t||1,page_size:20}),[i,o]),u=a({key:f(()=>[`search-result`,`video`,i,o,s],[i,s,o]),initialPageParam:1,async queryFn(e){return(await l(e))?.data?.videos??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),v=f(()=>(u.data?.pages??[]).flatMap(e=>e.list??[]),[u.data?.pages]),y=!!((u.isPending||u.isFetching)&&v.length===0),b=d(async()=>{try{await u.fetchNextPage()}catch(e){console.error(`获取视频搜索结果失败`,e)}},[u]);return y?p(g,{}):v.length===0?p(n,{type:`nodata`,text:c(`searchVideoInfo.noRelevantContent`),className:`!pt-[72px]`}):m(t,{className:`w-full pb-[24px]`,children:[p(_,{list:v}),u.hasNextPage&&p(r,{loadMore:async e=>b(),hasMore:u.hasNextPage,className:`w-full`})]})});v.displayName=`SearchVideoInfo`;export{_ as SearchVideoWaterfall,v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as a}from"../../../utils/tools.mjs";import{LeftArrowIcon as o}from"../../common/icons/left-arrow.mjs";import s from"../../../assets/icons/search.mjs";import c from"../../../assets/icons/clear.mjs";import{
|
|
2
|
+
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as a}from"../../../utils/tools.mjs";import{LeftArrowIcon as o}from"../../common/icons/left-arrow.mjs";import s from"../../../assets/icons/search.mjs";import c from"../../../assets/icons/clear.mjs";import{memo as l,useCallback as u}from"react";import{useSearchParams as d}from"next/navigation";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useTranslations as m}from"next-intl";function h(){}const g=l(({setSearchInputVal:l,initInputVal:g,initInputVersion:_,addSearchHistory:v,clearCallback:y=h})=>{let b=m(`components.pages.search`),x=e(),[S,C]=i(`search-input-val`,``),w=d().get(`q`),T=e=>{C(e.target.value)},E=u(e=>{l(e),v(e)},[v,l]);r(()=>{g&&(C(g),E(g))},[E,g,_,C],`search-init-input-effect`),r(()=>{w&&(C(w),E(w))},[E,C,w],`search-url-params-effect`);function D(){if(n.dismiss(),window.location.search.split(`from_code=`)[1]){x.push(`/`);return}x.back()}return f(`div`,{className:`app-top-nav relative h-[66px] w-full`,children:f(`header`,{className:`fixed left-0 right-0 top-0 z-50`,style:{willChange:`transform`,transform:`translateZ(0)`},children:p(`div`,{className:`mx-auto flex h-[66px] items-end gap-[8px] px-[16px] pb-[16px] pt-[16px]`,children:[f(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white`,onClick:D,children:f(o,{className:`h-[16px] w-[16px]`})}),p(`div`,{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:[p(`div`,{className:`relative flex h-full min-w-0 flex-1 items-center pl-[12px] pr-[10px]`,children:[f(`span`,{className:`pointer-events-none absolute inset-y-0 left-[12px] flex items-center justify-center`,children:f(s,{className:`h-[14px] w-[14px] text-white/60`})}),f(t,{placeholder:b(`topHeader.placeholder`),maxLength:20,value:S,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 placeholder:!text-white/90`,onChange:T,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!S.trim())return;E(S.trim())}}}),S&&f(`span`,{className:`absolute inset-y-0 right-0 flex items-center justify-center`,children:f(c,{className:`h-[15px] w-[15px] text-white/50`,onClick:()=>{a()||(C(``),l(``),y())}})})]}),f(`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`,onClick:()=>{S.trim()&&E(S.trim())},children:b(`topHeader.search`)})]})]})})})});g.displayName=`SearchTopHeader`;export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{Box as i}from"../../ui/box.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useSearchHistory as o}from"../../../hooks/use-search-history.mjs";import{trackSearchResultPageView as s}from"./tracking.mjs";import{SEARCH_RESULT_SORT_OPTIONS as c}from"./shared.mjs";import l from"./search-user.mjs";import u from"./search-video-info.mjs";import d from"./search-all.mjs";import{SearchTab as f}from"./search-tab.mjs";import p from"./top-header.mjs";import{
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{useRouter as r}from"../../../utils/use-compatible-router.mjs";import{Box as i}from"../../ui/box.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useSearchHistory as o}from"../../../hooks/use-search-history.mjs";import{trackSearchResultPageView as s}from"./tracking.mjs";import{SEARCH_RESULT_SORT_OPTIONS as c}from"./shared.mjs";import l from"./search-user.mjs";import u from"./search-video-info.mjs";import d from"./search-all.mjs";import{SearchTab as f}from"./search-tab.mjs";import p from"./top-header.mjs";import{useEffect as m,useMemo as h,useState as g}from"react";import{useSearchParams as _}from"next/navigation";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";const x=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.user`,value:`user`}];function S(){r();let S=b(`components.pages.search.pageClient`),{userInfo:C}=n(),w=C?.user_id||`guest`,T=_().get(`q`)?.toString()||``,[E,D]=g(T),[O,k]=g(0);m(()=>{D(T),k(e=>e+1)},[T]);let[A,j]=g(x[0].value),[M,N]=g(c[0].value),[P,F]=g(0),{addHistory:I}=o({storageKey:w}),L=h(()=>x.map(e=>({value:e.value,label:S(e.labelKey)})),[S]),R=h(()=>E.trim()!==``,[E]);return m(()=>(t.on(a.EXCHANGE_SEARCH_TYPE,j),()=>{t.off(a.EXCHANGE_SEARCH_TYPE,j)}),[j]),m(()=>{E.trim()&&s(A,E)},[A,E]),y(i,{className:`flex h-dvh w-full flex-col`,children:[v(i,{className:`shrink-0`,children:v(p,{setSearchInputVal:t=>{t!==E&&(D(t),e({q:t}))},initInputVal:T,initInputVersion:O,addSearchHistory:I})}),v(i,{className:`mt-[16px] min-h-0 flex-1 overflow-hidden rounded-t-[16px]`,children:R&&y(i,{className:`flex h-full flex-col bg-[linear-gradient(180deg,rgba(6,3,21,0.9)_0%,rgba(6,3,21,0)_100%)] backdrop-blur-[2px]`,children:[v(f,{searchType:A,tabList:L,onChange:e=>{j(e)},sort:M,onSortChange:e=>{N(e),F(e=>e+1)}}),y(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-[24px]`,children:[A===`user`&&v(l,{inputVal:E,sort:M,refreshVersion:P}),A===`all`&&v(d,{searchInputVal:E,sort:M,refreshVersion:P}),A===`video`&&v(u,{inputVal:E,sort:M,refreshVersion:P})]})]})})]})}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as n}from"../../../service/generated/tanstack.mjs";import{Box as r}from"../../ui/box.mjs";import{Text as i}from"../../ui/text.mjs";import{Skeleton as a}from"../../ui/skeleton.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{eventKey as s}from"../../../constants/event-key.mjs";import{SearchResultEmpty as c}from"./search-empty.mjs";import{SearchUserRowCard as l}from"./search-user.mjs";import{SearchVideoWaterfall as u}from"./search-video-info.mjs";import{useEffect as d,useMemo as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _({className:e}){return m(`svg`,{viewBox:`0 0 12.728 7.778`,fill:`currentColor`,"aria-hidden":!0,className:e,children:m(`path`,{d:`M6.36391 4.94972L11.3137 0L12.7279 1.41421L6.36391 7.77822L0 1.41421L1.41421 0L6.36391 4.94972Z`})})}function v(e,t){return JSON.stringify({type:1,keywords:e,sort:t})}function y(){return h(r,{className:`w-full`,children:[m(r,{className:`px-[16px]`,children:h(r,{className:`overflow-hidden rounded-[8px] bg-white/8`,children:[m(r,{className:`flex flex-col gap-[16px] px-[15px] pt-[16px]`,children:Array.from({length:3}).map((e,t)=>h(r,{className:`flex h-[66px] items-center gap-[8px]`,children:[m(a,{className:`size-[56px] rounded-full bg-white/10`}),h(r,{className:`min-w-0 flex-1`,children:[m(a,{className:`h-[20px] w-[96px] rounded-[4px] bg-white/10`}),m(a,{className:`mt-[2px] h-[20px] w-full rounded-[4px] bg-white/10`}),m(a,{className:`mt-[2px] h-[20px] w-[120px] rounded-[4px] bg-white/10`})]}),m(a,{className:`h-[24px] w-[64px] rounded-full bg-white/10`})]},`search-all-user-skeleton-${t}`))}),m(r,{className:`flex h-[48px] items-center justify-center`,children:m(a,{className:`h-[20px] w-[88px] rounded-[4px] bg-white/10`})})]})}),h(r,{className:`mt-[24px] flex w-full justify-between gap-[16px] px-[16px]`,children:[h(r,{className:`flex w-[171px] shrink-0 flex-col gap-[16px]`,children:[m(a,{className:`h-[218px] w-[171px] rounded-[8px] bg-white/8`}),m(a,{className:`h-[120px] w-[171px] rounded-[8px] bg-white/8`})]}),h(r,{className:`flex w-[171px] shrink-0 flex-col gap-[16px]`,children:[m(a,{className:`h-[120px] w-[171px] rounded-[8px] bg-white/8`}),m(a,{className:`h-[218px] w-[171px] rounded-[8px] bg-white/8`})]})]})]})}function b({searchInputVal:a,sort:b,refreshVersion:x}){let S=g(`components.pages.search.searchResult`),[C,w]=p(!1),[T,E]=p({});d(()=>{w(!1),E({})},[x,a,b]);let D=f(()=>v(a,b),[a,b]),{data:O,isFetching:k,isLoading:A}=o(f(()=>[...n({data_type:2,extra_params:D,page:1,page_size:10}),x],[x,D]),async()=>(await t({data_type:2,extra_params:D,page:1,page_size:10})).data??{}),j=f(()=>O?.users?.list??[],[O]),M=f(()=>j.map(e=>{let t=String(e.user_id||``).trim();return!t||T[t]===void 0?e:{...e,is_following:T[t]}}),[T,j]),N=f(()=>O?.videos?.list??[],[O]),P=f(()=>C?M:M.slice(0,3),[C,M]),F=!C&&M.length>3,I=!!((A||k)&&M.length===0&&N.length===0),L=!k&&M.length===0&&N.length===0;return I?m(y,{}):L?m(c,{text:S(`searchAll.emptyResult`)}):h(r,{className:`w-full pb-[24px]`,children:[P.length>0&&m(r,{className:`
|
|
2
|
+
"use client";import e from"../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as t}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as n}from"../../../service/generated/tanstack.mjs";import{Box as r}from"../../ui/box.mjs";import{Text as i}from"../../ui/text.mjs";import{Skeleton as a}from"../../ui/skeleton.mjs";import{useRequest as o}from"../../../hooks/query/use-query.mjs";import{eventKey as s}from"../../../constants/event-key.mjs";import{SearchResultEmpty as c}from"./search-empty.mjs";import{SearchUserRowCard as l}from"./search-user.mjs";import{SearchVideoWaterfall as u}from"./search-video-info.mjs";import{useEffect as d,useMemo as f,useState as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _({className:e}){return m(`svg`,{viewBox:`0 0 12.728 7.778`,fill:`currentColor`,"aria-hidden":!0,className:e,children:m(`path`,{d:`M6.36391 4.94972L11.3137 0L12.7279 1.41421L6.36391 7.77822L0 1.41421L1.41421 0L6.36391 4.94972Z`})})}function v(e,t){return JSON.stringify({type:1,keywords:e,sort:t})}function y(){return h(r,{className:`w-full`,children:[m(r,{className:`px-[16px]`,children:h(r,{className:`overflow-hidden rounded-[8px] bg-white/8`,children:[m(r,{className:`flex flex-col gap-[16px] px-[15px] pt-[16px]`,children:Array.from({length:3}).map((e,t)=>h(r,{className:`flex h-[66px] items-center gap-[8px]`,children:[m(a,{className:`size-[56px] rounded-full bg-white/10`}),h(r,{className:`min-w-0 flex-1`,children:[m(a,{className:`h-[20px] w-[96px] rounded-[4px] bg-white/10`}),m(a,{className:`mt-[2px] h-[20px] w-full rounded-[4px] bg-white/10`}),m(a,{className:`mt-[2px] h-[20px] w-[120px] rounded-[4px] bg-white/10`})]}),m(a,{className:`h-[24px] w-[64px] rounded-full bg-white/10`})]},`search-all-user-skeleton-${t}`))}),m(r,{className:`flex h-[48px] items-center justify-center`,children:m(a,{className:`h-[20px] w-[88px] rounded-[4px] bg-white/10`})})]})}),h(r,{className:`mt-[24px] flex w-full justify-between gap-[16px] px-[16px]`,children:[h(r,{className:`flex w-[171px] shrink-0 flex-col gap-[16px]`,children:[m(a,{className:`h-[218px] w-[171px] rounded-[8px] bg-white/8`}),m(a,{className:`h-[120px] w-[171px] rounded-[8px] bg-white/8`})]}),h(r,{className:`flex w-[171px] shrink-0 flex-col gap-[16px]`,children:[m(a,{className:`h-[120px] w-[171px] rounded-[8px] bg-white/8`}),m(a,{className:`h-[218px] w-[171px] rounded-[8px] bg-white/8`})]})]})]})}function b({searchInputVal:a,sort:b,refreshVersion:x}){let S=g(`components.pages.search.searchResult`),[C,w]=p(!1),[T,E]=p({});d(()=>{w(!1),E({})},[x,a,b]);let D=f(()=>v(a,b),[a,b]),{data:O,isFetching:k,isLoading:A}=o(f(()=>[...n({data_type:2,extra_params:D,page:1,page_size:10}),x],[x,D]),async()=>(await t({data_type:2,extra_params:D,page:1,page_size:10})).data??{}),j=f(()=>O?.users?.list??[],[O]),M=f(()=>j.map(e=>{let t=String(e.user_id||``).trim();return!t||T[t]===void 0?e:{...e,is_following:T[t]}}),[T,j]),N=f(()=>O?.videos?.list??[],[O]),P=f(()=>C?M:M.slice(0,3),[C,M]),F=!C&&M.length>3,I=!!((A||k)&&M.length===0&&N.length===0),L=!k&&M.length===0&&N.length===0;return I?m(y,{}):L?m(c,{text:S(`searchAll.emptyResult`)}):h(r,{className:`w-full pb-[24px]`,children:[P.length>0&&m(r,{className:`px-[16px]`,children:h(r,{className:`overflow-hidden rounded-[8px] bg-white/10`,children:[m(r,{className:`flex flex-col gap-[16px] px-[15px] pt-[16px] ${F?``:`pb-[16px]`}`.trim(),children:P.map((e,t)=>m(l,{item:e,onFollowChange:t=>{let n=String(e.user_id||``).trim();n&&E(e=>({...e,[n]:t?1:0}))}},String(e.user_id??t)))}),F&&h(`button`,{type:`button`,className:`flex h-[48px] w-full items-center justify-center gap-[4px] rounded-bl-[8px] rounded-br-[8px] text-[rgba(255,255,255,0.7)]`,onClick:()=>w(!0),children:[m(i,{className:`text-[14px] leading-[20px] font-normal`,children:`展开全部`}),m(r,{className:`flex size-[24px] items-center justify-center`,children:m(_,{className:`h-[7.778px] w-[12.728px] text-[rgba(255,255,255,0.7)]`})})]})]})}),N.length>0&&m(u,{list:N,title:`相似推荐`,onMoreClick:()=>{e.emit(s.EXCHANGE_SEARCH_TYPE,`video`)},sectionClassName:P.length>0?`mt-[24px] w-full`:`w-full`})]})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../ui/box.mjs";import{Popover as t,PopoverContent as n,PopoverTrigger as r}from"../../ui/popover.mjs";import{SEARCH_RESULT_SORT_OPTIONS as i}from"./shared.mjs";import{memo as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({className:e}){return c(`svg`,{viewBox:`0 0 22 15`,fill:`currentColor`,"aria-hidden":!0,className:e,children:[s(`rect`,{x:`0`,y:`0`,width:`13.5`,height:`2`,rx:`1`}),s(`rect`,{x:`0`,y:`6.5`,width:`13.5`,height:`2`,rx:`1`}),s(`rect`,{x:`0`,y:`13`,width:`13.5`,height:`2`,rx:`1`}),s(`path`,{d:`M15 1C15 0.447715 15.4477 0 16 0C16.5523 0 17 0.447715 17 1V11.2969L18.2412 9.84961C18.6006 9.43028 19.2311 9.38179 19.6504 9.74121C20.0697 10.1006 20.1182 10.7311 19.7588 11.1504L16.7588 14.6504C16.4865 14.9681 16.0458 15.0826 15.6533 14.9375C15.2608 14.7923 15 14.4185 15 14V1Z`})]})}const u=a(({searchType:a,onChange:u,tabList:d,sort:f,onSortChange:p})=>{let[m,h]=o(!1);return s(e,{as:`nav`,className:`sticky top-0 z-40
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{Popover as t,PopoverContent as n,PopoverTrigger as r}from"../../ui/popover.mjs";import{SEARCH_RESULT_SORT_OPTIONS as i}from"./shared.mjs";import{memo as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({className:e}){return c(`svg`,{viewBox:`0 0 22 15`,fill:`currentColor`,"aria-hidden":!0,className:e,children:[s(`rect`,{x:`0`,y:`0`,width:`13.5`,height:`2`,rx:`1`}),s(`rect`,{x:`0`,y:`6.5`,width:`13.5`,height:`2`,rx:`1`}),s(`rect`,{x:`0`,y:`13`,width:`13.5`,height:`2`,rx:`1`}),s(`path`,{d:`M15 1C15 0.447715 15.4477 0 16 0C16.5523 0 17 0.447715 17 1V11.2969L18.2412 9.84961C18.6006 9.43028 19.2311 9.38179 19.6504 9.74121C20.0697 10.1006 20.1182 10.7311 19.7588 11.1504L16.7588 14.6504C16.4865 14.9681 16.0458 15.0826 15.6533 14.9375C15.2608 14.7923 15 14.4185 15 14V1Z`})]})}const u=a(({searchType:a,onChange:u,tabList:d,sort:f,onSortChange:p})=>{let[m,h]=o(!1);return s(e,{as:`nav`,className:`sticky top-0 z-40 px-[16px] pb-[16px] pt-[12px]`,children:c(e,{className:`flex h-[24px] items-center justify-between`,children:[s(e,{className:`flex items-center gap-[10px]`,children:d.map(e=>s(`button`,{type:`button`,className:`text-[16px] leading-[24px] transition-colors ${a===e.value?`font-medium text-white`:`font-normal text-white/80`}`,onClick:()=>{a!==e.value&&u(e.value)},children:e.label},e.value))}),c(t,{open:m,onOpenChange:h,children:[s(r,{"aria-label":`排序筛选`,className:`flex size-[24px] items-center justify-center`,children:s(l,{className:`h-[15px] w-[20px] text-white/40`})}),s(n,{side:`bottom`,align:`end`,sideOffset:8,className:`w-[132px] border border-white/10 bg-[#10071E]/95 p-[8px] backdrop-blur-[18px]`,children:s(e,{className:`flex flex-col gap-[4px]`,children:i.map(e=>s(`button`,{type:`button`,className:`rounded-[8px] px-[12px] py-[8px] text-left text-[14px] leading-[20px] ${e.value===f?`bg-white/10 text-white`:`text-white/70`}`,onClick:()=>{p(e.value),h(!1)},children:e.label},e.value))})})]})]})})});u.displayName=`SearchTab`;export{u as SearchTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as t,pInteractionFollow as n,pInteractionUnfollow as r}from"../../../service/generated/client.mjs";import{Image as i}from"../../ui/image.mjs";import{Box as a}from"../../ui/box.mjs";import{InfiniteScroll as o}from"../../ui/infinite-scroll.mjs";import{Text as s}from"../../ui/text.mjs";import{Skeleton as c}from"../../ui/skeleton.mjs";import{usePaginated as l}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as u}from"../../../hooks/use-auth.mjs";import d from"../../../assets/images/user/default_avatar.mjs";import{SearchResultEmpty as f}from"./search-empty.mjs";import{formatSearchFollowerCount as p,resolveSearchUserDescription as m,resolveSearchUserName as h}from"./shared.mjs";import{toast as g}from"sonner";import{memo as _,useCallback as v,useEffect as y,useMemo as b,useState as x}from"react";import{Check as S,Plus as C}from"lucide-react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{useTranslations as E}from"next-intl";import D from"next/link";const O=typeof d==`string`?d:d.src;function k(e,t){return String(t||e?.user_id||e?.userId||``).trim()}function A({src:e,alt:t,variant:n}){let r=n===`row`?`size-[56px] p-[4.375px]`:`size-[40px] p-[3px]`,o=n===`row`?`border-[3px]`:`border-[2px]`;return w(a,{className:`rounded-full bg-white/20 ${r}`,children:w(a,{className:`relative size-full overflow-hidden rounded-full border-solid border-white/40 ${o}`,children:w(i,{src:e||O,fill:!0,objectFit:`cover`,alt:t})})})}function j({item:t,variant:i,onFollowChange:a}){let o=u(),{userInfo:c,userId:l}=e(),[d,f]=x(!1),p=k(c,l),m=p!==``&&p===String(t.user_id||``).trim(),h=!!t.is_following,_=v(()=>{!t.user_id||d||o(()=>{let i=k(e.getState().userInfo,e.getState().userId);if(!i){g.error(`请先登录`);return}(async()=>{f(!0);try{let e=h?await r({follower_id:i,followee_id:t.user_id}):await n({follower_id:i,followee_id:t.user_id});if(e.code!==0){g.error(e.message||(h?`取消关注失败`:`关注失败`));return}a?.(!h)}catch(e){console.error(`切换关注状态失败`,e),g.error(h?`取消关注失败`:`关注失败`)}finally{f(!1)}})()})},[h,t.user_id,a,d,o]);return m?null:i===`grid`?w(`button`,{type:`button`,"aria-label":h?`取消关注`:`关注`,className:`flex size-[24px] shrink-0 items-center justify-center rounded-full transition-opacity ${h?`bg-white/15 text-white`:`bg-black/30 text-white/75`} ${d?`opacity-50`:``}`,onClick:_,children:w(h?S:C,{className:`size-[14px]`})}):T(`button`,{type:`button`,className:`flex h-[24px] shrink-0 items-center justify-center rounded-full transition-opacity ${h?`border border-white/25 bg-white/10 px-[8px] text-white/85`:`w-[64px] border border-white/60 bg-black/20 text-white/60`} ${d?`opacity-50`:``}`,onClick:_,children:[!h&&w(C,{className:`mr-[2px] size-[16px]`}),w(s,{className:h?`text-[12px] leading-[18px]`:`text-[14px] leading-[20px]`,children:h?`已关注`:`关注`})]})}const M=_(({item:e,onFollowChange:t})=>{let n=h(e),r=m(e),i=p(e.follower_count);return T(a,{className:`flex w-full items-center gap-[8px]`,children:[T(D,{href:`/profile/${e.user_id||``}`,className:`flex min-w-0 flex-1 items-center gap-[8px]`,children:[w(A,{src:e.avatar,alt:n||`用户头像`,variant:`row`}),T(a,{className:`min-w-0 max-w-[194px] flex-1`,children:[w(s,{className:`block truncate text-[14px] leading-[20px] font-normal text-white`,children:n}),w(s,{className:`mt-[2px] block truncate text-[14px] leading-[20px] text-white/60`,children:r}),T(s,{className:`mt-[2px] block truncate text-[14px] leading-[20px] text-white/60`,children:[`粉丝:`,i]})]})]}),w(j,{item:e,variant:`row`,onFollowChange:t})]})});M.displayName=`SearchUserRowCard`;const N=_(({item:e,onFollowChange:t})=>{let n=h(e),r=m(e);return T(a,{className:`h-[170px] rounded-[8px] bg-white/10 px-[16px] py-[16px]`,children:[T(a,{className:`flex items-start justify-between`,children:[w(D,{href:`/profile/${e.user_id||``}`,className:`flex items-center`,children:w(A,{src:e.avatar,alt:n||`用户头像`,variant:`grid`})}),w(j,{item:e,variant:`grid`,onFollowChange:t})]}),T(D,{href:`/profile/${e.user_id||``}`,className:`mt-[16px] block`,children:[w(s,{className:`block truncate text-[14px] leading-[20px] font-medium text-white`,children:n}),w(s,{className:`mt-[8px] block text-[14px] leading-[20px] text-white/60 line-clamp-4`,children:r})]})]})});N.displayName=`SearchUserGridCard`;const P={background:`linear-gradient(180deg, rgba(255,30,255,0.8) 0%, rgba(108,67,238,0) 100%), linear-gradient(145deg, rgba(255,30,172,0.6) 2.9%, rgba(108,67,238,0) 100%), linear-gradient(180deg, rgba(151,86,227,1) 0%, rgba(108,67,238,1) 100%)`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,maskComposite:`exclude`,padding:`0.5px`},F=_(({item:e,isFirst:t,onFollowChange:n})=>T(a,{className:`relative flex h-[88px] items-center rounded-[8px] bg-white/10 px-[12px] py-[8px]`,children:[t&&w(a,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:P}),w(M,{item:e,onFollowChange:n})]}));F.displayName=`SearchUserCard`;function I(){return w(a,{className:`flex flex-col gap-[12px] px-[16px]`,children:Array.from({length:6}).map((e,t)=>T(a,{className:`flex h-[88px] items-center gap-[8px] rounded-[8px] bg-white/8 px-[12px] py-[8px]`,children:[w(c,{className:`size-[56px] shrink-0 rounded-full bg-white/10`}),T(a,{className:`min-w-0 flex-1`,children:[w(c,{className:`h-[20px] w-[100px] rounded-[4px] bg-white/10`}),w(c,{className:`mt-[4px] h-[20px] w-[160px] rounded-[4px] bg-white/10`}),w(c,{className:`mt-[4px] h-[20px] w-[80px] rounded-[4px] bg-white/10`})]}),w(c,{className:`h-[24px] w-[64px] shrink-0 rounded-full bg-white/10`})]},`search-user-row-skeleton-${t}`))})}const L=_(({inputVal:e,sort:n,refreshVersion:r})=>{let i=E(`components.pages.search.searchResult`),[s,c]=x({});y(()=>{c({})},[e,r,n]);let u=v(async r=>await t({data_type:2,extra_params:JSON.stringify({type:4,keywords:e,sort:n}),page:r||1,page_size:20}),[e,n]),d=l({key:b(()=>[`search-result`,`user`,e,n,r],[e,r,n]),initialPageParam:1,async queryFn(e){return(await u(e))?.data?.users??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),p=b(()=>(d.data?.pages??[]).flatMap(e=>e.list??[]).map(e=>{let t=String(e.user_id||``).trim();return!t||s[t]===void 0?e:{...e,is_following:s[t]}}),[s,d.data?.pages]),m=!!((d.isPending||d.isFetching)&&p.length===0),h=v((e,t)=>{e&&c(n=>({...n,[e]:t?1:0}))},[]),g=v(async()=>{try{await d.fetchNextPage()}catch(e){console.error(`获取用户搜索结果失败`,e)}},[d]);return m?w(I,{}):p.length===0?w(f,{text:i(`searchUser.emptyResult`)}):T(a,{className:`w-full pb-[24px]`,children:[w(a,{className:`flex flex-col gap-[12px]
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as t,pInteractionFollow as n,pInteractionUnfollow as r}from"../../../service/generated/client.mjs";import{Image as i}from"../../ui/image.mjs";import{Box as a}from"../../ui/box.mjs";import{InfiniteScroll as o}from"../../ui/infinite-scroll.mjs";import{Text as s}from"../../ui/text.mjs";import{Skeleton as c}from"../../ui/skeleton.mjs";import{usePaginated as l}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as u}from"../../../hooks/use-auth.mjs";import d from"../../../assets/images/user/default_avatar.mjs";import{SearchResultEmpty as f}from"./search-empty.mjs";import{formatSearchFollowerCount as p,resolveSearchUserDescription as m,resolveSearchUserName as h}from"./shared.mjs";import{toast as g}from"sonner";import{memo as _,useCallback as v,useEffect as y,useMemo as b,useState as x}from"react";import{Check as S,Plus as C}from"lucide-react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{useTranslations as E}from"next-intl";import D from"next/link";const O=typeof d==`string`?d:d.src;function k(e,t){return String(t||e?.user_id||e?.userId||``).trim()}function A({src:e,alt:t,variant:n}){let r=n===`row`?`size-[56px] p-[4.375px]`:`size-[40px] p-[3px]`,o=n===`row`?`border-[3px]`:`border-[2px]`;return w(a,{className:`rounded-full bg-white/20 ${r}`,children:w(a,{className:`relative size-full overflow-hidden rounded-full border-solid border-white/40 ${o}`,children:w(i,{src:e||O,fill:!0,objectFit:`cover`,alt:t})})})}function j({item:t,variant:i,onFollowChange:a}){let o=u(),{userInfo:c,userId:l}=e(),[d,f]=x(!1),p=k(c,l),m=p!==``&&p===String(t.user_id||``).trim(),h=!!t.is_following,_=v(()=>{!t.user_id||d||o(()=>{let i=k(e.getState().userInfo,e.getState().userId);if(!i){g.error(`请先登录`);return}(async()=>{f(!0);try{let e=h?await r({follower_id:i,followee_id:t.user_id}):await n({follower_id:i,followee_id:t.user_id});if(e.code!==0){g.error(e.message||(h?`取消关注失败`:`关注失败`));return}a?.(!h)}catch(e){console.error(`切换关注状态失败`,e),g.error(h?`取消关注失败`:`关注失败`)}finally{f(!1)}})()})},[h,t.user_id,a,d,o]);return m?null:i===`grid`?w(`button`,{type:`button`,"aria-label":h?`取消关注`:`关注`,className:`flex size-[24px] shrink-0 items-center justify-center rounded-full transition-opacity ${h?`bg-white/15 text-white`:`bg-black/30 text-white/75`} ${d?`opacity-50`:``}`,onClick:_,children:w(h?S:C,{className:`size-[14px]`})}):T(`button`,{type:`button`,className:`flex h-[24px] shrink-0 items-center justify-center rounded-full transition-opacity ${h?`border border-white/25 bg-white/10 px-[8px] text-white/85`:`w-[64px] border border-white/60 bg-black/20 text-white/60`} ${d?`opacity-50`:``}`,onClick:_,children:[!h&&w(C,{className:`mr-[2px] size-[16px]`}),w(s,{className:h?`text-[12px] leading-[18px]`:`text-[14px] leading-[20px]`,children:h?`已关注`:`关注`})]})}const M=_(({item:e,onFollowChange:t})=>{let n=h(e),r=m(e),i=p(e.follower_count);return T(a,{className:`flex w-full items-center gap-[8px]`,children:[T(D,{href:`/profile/${e.user_id||``}`,className:`flex min-w-0 flex-1 items-center gap-[8px]`,children:[w(A,{src:e.avatar,alt:n||`用户头像`,variant:`row`}),T(a,{className:`min-w-0 max-w-[194px] flex-1`,children:[w(s,{className:`block truncate text-[14px] leading-[20px] font-normal text-white`,children:n}),w(s,{className:`mt-[2px] block truncate text-[14px] leading-[20px] text-white/60`,children:r}),T(s,{className:`mt-[2px] block truncate text-[14px] leading-[20px] text-white/60`,children:[`粉丝:`,i]})]})]}),w(j,{item:e,variant:`row`,onFollowChange:t})]})});M.displayName=`SearchUserRowCard`;const N=_(({item:e,onFollowChange:t})=>{let n=h(e),r=m(e);return T(a,{className:`h-[170px] rounded-[8px] bg-white/10 px-[16px] py-[16px]`,children:[T(a,{className:`flex items-start justify-between`,children:[w(D,{href:`/profile/${e.user_id||``}`,className:`flex items-center`,children:w(A,{src:e.avatar,alt:n||`用户头像`,variant:`grid`})}),w(j,{item:e,variant:`grid`,onFollowChange:t})]}),T(D,{href:`/profile/${e.user_id||``}`,className:`mt-[16px] block`,children:[w(s,{className:`block truncate text-[14px] leading-[20px] font-medium text-white`,children:n}),w(s,{className:`mt-[8px] block text-[14px] leading-[20px] text-white/60 line-clamp-4`,children:r})]})]})});N.displayName=`SearchUserGridCard`;const P={background:`linear-gradient(180deg, rgba(255,30,255,0.8) 0%, rgba(108,67,238,0) 100%), linear-gradient(145deg, rgba(255,30,172,0.6) 2.9%, rgba(108,67,238,0) 100%), linear-gradient(180deg, rgba(151,86,227,1) 0%, rgba(108,67,238,1) 100%)`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,maskComposite:`exclude`,padding:`0.5px`},F=_(({item:e,isFirst:t,onFollowChange:n})=>T(a,{className:`relative flex h-[88px] items-center rounded-[8px] bg-white/10 px-[12px] py-[8px]`,children:[t&&w(a,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:P}),w(M,{item:e,onFollowChange:n})]}));F.displayName=`SearchUserCard`;function I(){return w(a,{className:`flex flex-col gap-[12px] px-[16px]`,children:Array.from({length:6}).map((e,t)=>T(a,{className:`flex h-[88px] items-center gap-[8px] rounded-[8px] bg-white/8 px-[12px] py-[8px]`,children:[w(c,{className:`size-[56px] shrink-0 rounded-full bg-white/10`}),T(a,{className:`min-w-0 flex-1`,children:[w(c,{className:`h-[20px] w-[100px] rounded-[4px] bg-white/10`}),w(c,{className:`mt-[4px] h-[20px] w-[160px] rounded-[4px] bg-white/10`}),w(c,{className:`mt-[4px] h-[20px] w-[80px] rounded-[4px] bg-white/10`})]}),w(c,{className:`h-[24px] w-[64px] shrink-0 rounded-full bg-white/10`})]},`search-user-row-skeleton-${t}`))})}const L=_(({inputVal:e,sort:n,refreshVersion:r})=>{let i=E(`components.pages.search.searchResult`),[s,c]=x({});y(()=>{c({})},[e,r,n]);let u=v(async r=>await t({data_type:2,extra_params:JSON.stringify({type:4,keywords:e,sort:n}),page:r||1,page_size:20}),[e,n]),d=l({key:b(()=>[`search-result`,`user`,e,n,r],[e,r,n]),initialPageParam:1,async queryFn(e){return(await u(e))?.data?.users??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),p=b(()=>(d.data?.pages??[]).flatMap(e=>e.list??[]).map(e=>{let t=String(e.user_id||``).trim();return!t||s[t]===void 0?e:{...e,is_following:s[t]}}),[s,d.data?.pages]),m=!!((d.isPending||d.isFetching)&&p.length===0),h=v((e,t)=>{e&&c(n=>({...n,[e]:t?1:0}))},[]),g=v(async()=>{try{await d.fetchNextPage()}catch(e){console.error(`获取用户搜索结果失败`,e)}},[d]);return m?w(I,{}):p.length===0?w(f,{text:i(`searchUser.emptyResult`)}):T(a,{className:`w-full pb-[24px]`,children:[w(a,{className:`flex flex-col gap-[12px] px-[16px]`,children:p.map((e,t)=>w(F,{item:e,isFirst:t===0,onFollowChange:t=>{h(String(e.user_id||``),t)}},String(e.user_id??t)))}),d.hasNextPage&&w(o,{loadMore:async e=>g(),hasMore:d.hasNextPage,className:`w-full`})]})});L.displayName=`SearchUser`;export{M as SearchUserRowCard,L as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{LeftArrowIcon as a}from"../../common/icons/left-arrow.mjs";import{
|
|
2
|
+
"use client";import{useRouter as e}from"../../../utils/use-compatible-router.mjs";import{Input as t}from"../../ui/input.mjs";import{toast as n}from"../../../ui.mjs";import{useKeepAliveEffect as r,useKeepAliveState as i}from"../../common/keep-scroll-position/index.mjs";import{LeftArrowIcon as a}from"../../common/icons/left-arrow.mjs";import{memo as o,useCallback as s}from"react";import{useSearchParams as c}from"next/navigation";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";const f=o(({setSearchInputVal:o,initInputVal:f,initInputVersion:p,addSearchHistory:m})=>{let h=d(`components.pages.search`),g=e(),[_,v]=i(`search-input-val`,``),y=c().get(`q`),b=e=>{v(e.target.value)},x=s(e=>{o(e),m(e)},[m,o]);r(()=>{f&&(v(f),x(f))},[x,f,p,v],`search-init-input-effect`),r(()=>{y&&(v(y),x(y))},[x,v,y],`search-url-params-effect`);function S(){if(n.dismiss(),window.location.search.split(`from_code=`)[1]){g.push(`/`);return}g.back()}return l(`div`,{className:`app-top-nav w-full`,children:u(`header`,{className:`flex h-[60px] items-center gap-[8px] px-[16px] pb-[10px] pt-[16px]`,children:[l(`button`,{type:`button`,"aria-label":`返回`,className:`flex size-[24px] shrink-0 items-center justify-center text-white`,onClick:S,children:l(a,{className:`h-[16px] w-[16px]`})}),l(`div`,{className:`relative h-[34px] min-w-0 flex-1`,children:u(`div`,{className:`flex h-full min-w-0 flex-1 items-center overflow-hidden rounded-[100px] border-[0.5px] border-[rgba(230,42,255,0.9)] bg-black/40 backdrop-blur-[2px]`,children:[l(`div`,{className:`flex h-full min-w-0 flex-1 items-center pl-[20px] pr-[8px]`,children:l(t,{placeholder:h(`topHeader.placeholder`),maxLength:20,value:_,className:`!h-[24px] !w-full !rounded-none !border-0 !bg-transparent !px-0 !py-0 !text-[14px] !leading-[24px] !text-white/90 placeholder:!text-white/90`,onChange:b,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!_.trim())return;x(_.trim())}}})}),l(`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`,onClick:()=>{_.trim()&&x(_.trim())},children:h(`topHeader.search`)})]})})]})})});f.displayName=`SearchTopHeader`;export{f as default};
|
|
@@ -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{gUserGetUserPrivacySettings as n}from"../../../../service/generated/client.mjs";import{Box as r}from"../../../ui/box.mjs";import{useLoginModalStore as i}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a,useRequest as o}from"../../../../hooks/query/use-query.mjs";import{locales as s}from"../../../../i18n.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as l}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as u}from"./reset-password-drawer.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as n}from"../../../../service/generated/client.mjs";import{Box as r}from"../../../ui/box.mjs";import{useLoginModalStore as i}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as a,useRequest as o}from"../../../../hooks/query/use-query.mjs";import{locales as s}from"../../../../i18n.mjs";import{DeleteConfirmDialog as c}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as l}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as u}from"./reset-password-drawer.mjs";import{useEffect as d,useRef as f,useState as p}from"react";import{useRouter as m}from"next/navigation";import{ChevronRight as h}from"lucide-react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useLocale as v,useTranslations as y}from"next-intl";import b from"next/link";function x(e){return{collection:Number(e?.collections_open??0)>0,follower:Number(e?.follower_open??0)>0,following:Number(e?.following_open??0)>0,like:Number(e?.like_open??0)>0}}function S({className:h}={}){let S=y(`components.pages.settings.components`),w=v(),{open:T}=i(),E=t(e=>e.isLogin),D=t(e=>e.token),O=t(e=>e.logout),k=t(e=>e.userId),A=(E||!!D)&&!!k,j=x(),[M,N]=p(j),P=f(j),[F,I]=p(!1),[L,R]=p(!1);a();let z=[`user-privacy-settings`,k],B=w===`zh-CN`?`en`:`zh-CN`;s.find(e=>e.code===B)?.name;let{data:V}=o(z,()=>n({user_id:k}),{enabled:!!k}),H=V?.data;d(()=>{if(!H)return;let e=x(H);N(e),P.current=e},[H]),d(()=>{P.current=M},[M]);let U=a(),W=m();function G(){U([`user-profile`,`mine`]),O(),W.push(`/user/mine`)}function K(e){R(e)}function q(){R(!0)}function J(){R(!1)}function Y(){G()}function X(e){I(e)}function Z(){if(!A){T();return}I(!0)}function Q(e){A||(e.preventDefault(),e.stopPropagation(),T())}return _(r,{className:e(`min-h-dvh bg-[var(--color-surface-panel-dark)]`,h),children:[g(l,{className:`!bg-[var(--color-surface-panel-dark)] !border-transparent`,title:S(`settings.title`)}),g(u,{open:F,onOpenChange:X}),_(r,{className:`mx-4 mt-4 flex flex-col`,children:[g(`button`,{type:`button`,className:`block w-full text-left`,onClick:Z,children:g(C,{title:S(`settings.resetPasswordTitle`)})}),g(b,{href:`/feedback`,onClick:Q,className:`block`,children:g(C,{title:S(`settings.feedbackTitle`)})})]}),F||!A?null:g(r,{className:`fixed inset-x-0 bottom-0 z-40 flex flex-col pb-[env(safe-area-inset-bottom)]`,children:g(`div`,{className:`flex flex-col items-center px-4 py-2`,style:{background:`var(--color-overlay-panel-fade-start90)`,backdropFilter:`blur(var(--effect-backdrop-blur-detail-hero))`},children:g(`button`,{type:`button`,className:`flex h-12 w-full items-center justify-center rounded-[8px] text-base text-[var(--color-text-primary)] transition-opacity active:opacity-80`,style:{background:`var(--color-surface-white10)`},onClick:q,children:S(`settings.button`)})})}),g(c,{open:L,onOpenChange:K,onCancel:J,onConfirm:Y,title:``,description:S(`settings.logoutConfirmMessage`),confirmText:S(`settings.confirm`),cancelText:S(`settings.cancel`)})]})}function C({title:e}){return _(`div`,{className:`flex h-14 items-center justify-between px-4`,children:[g(`span`,{className:`text-base text-[var(--color-text-primary)]`,children:e}),g(h,{className:`size-6 shrink-0 opacity-50 text-[var(--color-text-primary)]`})]})}export{S as Settings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{cn as t}from"../../../utils/cn.mjs";import{gContentGetAppChannels as n,gContentGetVideoDetail as r}from"../../../service/generated/client.mjs";import{trackAppPageView as i}from"../../../utils/tracking.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{EmptyState as o}from"../../ui/empty.mjs";import{buildVideoPlayerSrc as
|
|
2
|
+
"use client";import{getChannelList as e}from"../../biz/utils/helpers/get-channel-list.mjs";import{cn as t}from"../../../utils/cn.mjs";import{gContentGetAppChannels as n,gContentGetVideoDetail as r}from"../../../service/generated/client.mjs";import{trackAppPageView as i}from"../../../utils/tracking.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{EmptyState as o}from"../../ui/empty.mjs";import{buildVideoPlayerSrc as ee}from"../../common/video-player/process-m3u8-cache.mjs";import{notifyBridgeEpisodeChanged as s}from"../../../utils/login-modal-bridge.mjs";import{useRequest as c}from"../../../hooks/query/use-query.mjs";import{queryKey as l}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as u,useKeepAliveState as d}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as f}from"../../../utils/api-collect.mjs";import p from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{VideoDetailMaterialRuntimeProvider as te}from"../../biz/business/detail/shared/runtime-context-provider.mjs";import{resolveMaterialProps as ne,videoDetailMaterials as m}from"../../biz/business/detail/shared/registry.mjs";import{DetailHero as re}from"../../biz/business/detail/shared/video-hero.mjs";import{Fragment as ie,useCallback as h,useEffect as g,useMemo as _,useRef as v}from"react";import{useParams as ae,useSearchParams as oe}from"next/navigation";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";const S=[{id:`detail-info`,componentName:`video-detail-info`,props:{}},{id:`detail-info-title-tags-episodes`,componentName:`video-detail-info-title-tags-episodes`,props:{}},{id:`detail-actions`,componentName:`video-detail-actions`,props:{}},{id:`detail-recommend`,componentName:`video-detail-recommend`,props:{title:`猜你喜欢`,rows:2,columns:3,smartTagEnabled:!1,smartTagIds:[`腐剧`],showPlayCount:!0,playCountDelta:0,showEpisode:!0,enableInfinite:!1,items:[{contentId:`d6a35ba3279e6f0d`,contentName:`贺总的私宠罪妻`,titleMode:`custom`,title:`贺总的私宠罪妻`,description:`简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百简介多少字是不是两百`,coverMode:`upload`,coverUrl:`/truss/20260227/69a136457d10f.jpgxxx`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`b0f42fed731239a7`,contentName:`少年江湖物语`,titleMode:`custom`,title:`少年江湖物语`,description:`网剧《少年江湖物语》讲述了一个江湖中邪不压正,青春正好,有情有爱的温暖故事。剧中有魔教教主,有天下第一剑客,有身世成谜的江湖大夫,有忠心耿耿的小丫鬟,更有艳压秦淮的当红花魁,众多看似完全没有交集的人物纷纷亮相登场,搅乱江湖一池春水。`,coverMode:`content`,coverUrl:`/md-204/uploads/default/other/2024-08-26/14664d2c31e61c201a29cd4abba267c5.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`c2304e94ec0ba208`,contentName:`王的男人`,titleMode:`custom`,title:`王的男人`,description:`朝鲜第十代王燕山王君时期,艺人长生(甘宇成饰)和孔吉(李俊基饰)因为不肯加入当地的艺人团,来到京城汉阳谋生。此时暴君燕山君(郑镇荣饰)沉迷于宠妾张绿水(姜成妍饰),朝纲混乱,民不聊生。长生与孔吉二人在街头开始表演讽刺君主的喜剧,大受欢迎,却遭逮捕。后要求到王面前表演,求得一笑。结果,多亏孔吉的急中生智,燕山君才笑了出来。两人随即被留在宫中取乐,孔吉更是因为美色令王倍加宠爱。他们不停表演,大臣们却各自心怀鬼胎,导致了杀戮局面。最终,君王和艺人的命运又将如何呢?`,coverMode:`content`,coverUrl:`/md-204/resource/8c/8cb28f46831558fbeb2f34b2076c3b4e.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`c7ffc6a558ae8683`,contentName:`怒`,titleMode:`custom`,title:`怒`,description:`炎炎夏日,东京八王子郊外社区,一对夫妇惨遭杀害。事后凶手用血在墙上写下大大的“怒”字,随后逃亡,销声匿迹长达一年之久。而在此期间,三个身份不明的男子和身边的人相遇了。曾自甘堕落的爱子(宫崎葵饰)被父亲(渡边谦饰)领回海滨小镇,邂逅了不善言辞的哲也(松山研一饰)。在东京工作的同性恋优马(妻夫木聪饰)将柔情似水的直人(绫野刚饰)带回了家,他不相信对方,却又尝试去相信。随母亲搬到冲绳的小泉(广濑铃饰)跟着同学辰哉(佐久本宝饰)登上一座荒岛,在废墟中遇到了背包客田中(森山未来饰),他们短暂成为朋友,而可怕的命运突然降临泉的头上。不久之后,通缉令遍布全国,三个男子的真实身份引人生疑……本片根据吉田修一的同名原作改编。`,coverMode:`content`,coverUrl:`/md-204/resource/24/24ef267eef2c35b5e4cf12dac8b55c14.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`98217427ed96ec51`,contentName:`熔炉`,titleMode:`custom`,title:`熔炉`,description:`来自首尔的哑语美术老师仁浩(孔宥饰)来到雾津,应聘慈爱聋哑人学校。天降大雾,他意外撞车,维修时邂逅了人权组织成员柔珍(郑有美饰)。仁浩妻子早亡,8岁女儿天生哮喘由祖母照看,所以他不辞辛苦谋职养家。然而,双胞胎的校长与教导主任竟逼仁浩索贿5千万韩元。同时,仁浩逐渐发现学校笼罩着一种紧张压抑的气氛,令人窒息。有三个孩子引人关注:聪颖的金妍斗(金贤秀饰)、贪吃的陈宥利(郑仁絮饰)和弟弟自杀身亡的全民秀(白承焕饰),民秀总是满脸淤青。下课后,仁浩还听到女厕所中有呼喊与哭泣,在门卫的阻拦下他未深究。之后。他意外目睹了校长行贿警察,教导员毒打民秀,宿导溺罚妍斗的行径。一个惊天的隐秘被慢慢揭开,真相令韩国震惊……本片取材于2005年光州一所聋哑障碍人学校的真实事件,改编自韩国作家孔枝泳的同名小说。`,coverMode:`content`,coverUrl:`/md-204/resource/b4/b410ccdcd86936455b9460a9152aaa47.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0},{contentId:`caa2b4eb4eb40de0`,contentName:`再次来寻我`,titleMode:`custom`,title:`再次来寻我`,description:`在宇回到曾经与初恋志勋相遇的303号房,这里即将被拆迁,他在房间里回忆和志勋的点点滴滴,突然被书桌上的电话所吸引,一拿起话筒听到的竟是志勋的声音!在房子主人的同意下,在宇带着电话离开了303室,在回家的途中他发现自己像走在一个陌生的地方,而对面走来的竟是已消失已久的志勋…`,coverMode:`content`,coverUrl:`/md-204/resource/2b/2b43375f2248c1a012847d4507fd21a3.jpg`,showPlayCount:!0,playCountDelta:0,showEpisode:!0}]}}];function C(e,t){let n=String(e||``).split(`/`).filter(Boolean),r=n.findIndex(e=>e===`video`||e===`webview`);return r<0?!1:n[r+1]===t}function w({detailId:f,initialInformation:w,isWebView:T=!1,materialConfig:E}){let D=se(`components.pages.videoDetail`),O=a(),k=ae(),ce=oe(),A=v(!1),j=k.level,M=Array.isArray(j)?j:typeof j==`string`?[j]:[],N=M.findIndex(e=>e===`episode`),le=N>=0?M[N+1]:M[2],P=Math.max(1,Number(le)||1),[ue,F]=d(`detail-current-series-num-${f}`,P);g(()=>{F(P)},[P,F]);let I=Math.max(1,Number(ue)||1),L=Math.max(0,I-1),{data:R,isPending:z,isFetching:B,isError:V,isSuccess:H}=c(_(()=>[`video-detail`,f],[f]),async()=>f?await r({id:f}):null,{enabled:!!f}),U=_(()=>{let e=R?.data?.video;return!e||typeof e!=`object`?null:{...e,content_type:1,episode_cnt:e.links?.length||0}},[R?.data?.video]),de=w??U??null,[W,G]=d(`detail-information-${f}`,de);g(()=>{!W?.id||A.current||(A.current=!0,i({page_key:`page_video_detail`,page_name:`详情页`}))},[W?.id]);let fe=W?.links?.[L]?.id||``,K=!!f&&!W&&(z||B),q=!f||!!W||V||H,[pe,me]=d(`info-detail-active-tab-${f}`,`video`),[J,Y]=d(`info-detail-comment-add-count-${f}`,0),[X,he]=d(`info-detail-comment-total-${f}`,void 0);g(()=>{!W&&U&&G(U)},[W,U,G]);let Z=h(e=>{G(t=>t&&{...t,...e})},[G]);u(()=>{W?.id&&W.id},[W?.id],`detail-page-report-${f}`),g(()=>{!W||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:W.id||f,author_id:W.up_user,object_type:W.content_type,object_category:W.content_type,object_tags:W.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[f,W]),g(()=>{Y(0)},[fe,Y]),_(()=>(typeof X==`number`?X:0)+J,[J,X]);let ge=h(()=>{},[!1,me]);h(()=>{Y(e=>e+1)},[Y]),g(()=>{},[!1,ge,W?.id,ce]);let Q=h(e=>{let t=Math.max(1,Math.floor(Number(e)||1));if(typeof window>`u`)return;let n=String(W?.id||f||``).trim();if(!n)return;let r=T||window.isWebView===!0,i=`/${r?`webview`:`video`}/${n}/${encodeURIComponent(W?.name||``)}/episode/${t}`,{search:a,hash:o,pathname:c}=window.location,l=`${i}${a}${o}`,u=`${c}${a}${o}`,d=C(c,n);if(u!==l){if(r){let e=W?.links?.[Math.max(0,t-1)],r=ee(String(e?.m3u8_url||e?.preview_m3u8_url||``).trim());s({poster:String(W?.img_y||W?.img_x||W?.preview_images?.[0]||``).trim(),src:r,title:String(W?.title||W?.name||``).trim(),contentId:n,episode:t}),I!==t&&F(t);return}d&&typeof window.history?.replaceState==`function`?(window.history.replaceState(window.history.state,``,l),F(t)):O.replace(l,{scroll:!1});return}I!==t&&F(t)},[I,f,W?.id,W?.img_x,W?.img_y,W?.links,W?.name,W?.preview_images,W?.title,T,O,F]);g(()=>{let e=Array.isArray(W?.links)?W.links.length:0;e<=0||I<=e||Q(1)},[I,Q,W?.links]);let $=W?.status===`1`,{data:_e}=c([l.CHANNEL],()=>n()),ve=e(_e?.data),ye=_(()=>{if(E!==void 0){let e=new Map(S.map(e=>[e.componentName,e]));return E.map(t=>{let n=e.get(t.componentName);return{...n,...t,props:{...n?.props??{},...t.props??{}}}})}return S},[E]),be=_(()=>({information:W??void 0,currentSeriesNum:I,onEpisodeChange:Q,onUpdateInformation:Z,detailId:f,episodeIndex:L,isShow:!0,isWebView:T,isInformationLoading:K,isInformationResolved:q}),[I,f,L,Q,Z,W,K,q,T,!0]),xe=h(e=>{if(!W)return null;let t=m[e.componentName];if(!t)return null;let n=t.clientComponent,r=ne(t,e.props);return r.isValid?b(n,{...r.props}):b(`div`,{children:`组件配置错误`})},[W]);return x(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 ${T?``:`pt-11`}`,children:[!T&&b(`div`,{className:`fixed bg-black top-0 left-0 right-0 z-[1000]`,children:b(p,{data:{list:ve}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[W&&!$&&b(o,{type:`no-content`,text:D(`videoDetailClient.videoUnavailable`)}),W&&$&&x(y,{children:[!T&&b(re,{isVideo:!0,information:W,episodeIndex:L}),b(`div`,{id:`selectPopupPosition`,className:`w-full`}),!1,x(`div`,{className:t(`w-full`,!1),children:[b(te,{value:be,children:ye.map(e=>b(ie,{children:xe(e)},e.id))}),!1]}),!1]}),!W&&b(o,{type:`no-content`,text:D(`videoDetailClient.videoDeleted`)})]})})]})}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../utils/cn.mjs";import{pContentGetNewstVideoList as t,pContentGetTopRatedVideoList as n}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as r,pContentGetTopRatedVideoListKey as i}from"../../../service/generated/tanstack.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Button as o}from"../../ui/button.mjs";import{Box as s}from"../../ui/box.mjs";import{InfiniteScroll as c}from"../../ui/infinite-scroll.mjs";import{Text as l}from"../../ui/text.mjs";import{usePaginated as u}from"../../../hooks/query/use-query.mjs";import d from"../../../assets/icons/left_arrow.mjs";import{getNextVideoListPageParam as f,resolveNextCursor as p}from"./types.mjs";import{VideoListRecommendItem as m}from"./video-list-recommend-item.mjs";import{VideoListSkeleton as h}from"./video-list-skeleton.mjs";import{useEffect as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x=[];function S({title:S=`列表页`,tags:C=x}){let w=a(),[T,E]=v(`hot`),D=_(()=>({page_size:10,tags:C.length?C:void 0}),[C]),{data:O,fetchNextPage:k,hasNextPage:A,isPending:j,isFetching:M}=u({key:_(()=>T===`hot`?i(D):r(D),[D,T]),queryFn:async e=>{let r={page_size:10,cursor:e||void 0,tags:C.length?C:void 0},i=(T===`hot`?await n(r):await t(r)).data,a=Array.isArray(i?.videos)?i.videos:[];return{list:a,nextCursor:a.length<10?``:p(i)}},getNextPageParam:f,initialPageParam:``,options:{staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}),N=_(()=>O?.pages?.flatMap(e=>e.list)??[],[O?.pages]),P=(O?.pages?.length??0)>0,F=_(()=>P?A??!1:!0,[P,A]),I=N.length===0&&(!P||j||M);g(()=>{typeof window>`u`||window.scrollTo({top:0,behavior:`auto`})},[T]);function L(){w.back()}let R=_(()=>N.map(e=>{let t=e.id??e.mid??``;return y(m,{item:e,href:`/video/${t}/${e.name??``}`},t)}),[N]);return I?y(h,{}):b(s,{as:`main`,className:`min-h-[100dvh] bg-[linear-gradient(180deg,#160320_0%,#2a0a56_100%)] text-white`,children:[b(s,{className:`sticky top-0 z-20 bg-[linear-gradient(180deg,rgba(22,3,32,0.98)_0%,rgba(22,3,32,0.92)_100%)]
|
|
2
|
+
"use client";import{cn as e}from"../../../utils/cn.mjs";import{pContentGetNewstVideoList as t,pContentGetTopRatedVideoList as n}from"../../../service/generated/client.mjs";import{pContentGetNewstVideoListKey as r,pContentGetTopRatedVideoListKey as i}from"../../../service/generated/tanstack.mjs";import{useRouter as a}from"../../../utils/use-compatible-router.mjs";import{Button as o}from"../../ui/button.mjs";import{Box as s}from"../../ui/box.mjs";import{InfiniteScroll as c}from"../../ui/infinite-scroll.mjs";import{Text as l}from"../../ui/text.mjs";import{usePaginated as u}from"../../../hooks/query/use-query.mjs";import d from"../../../assets/icons/left_arrow.mjs";import{getNextVideoListPageParam as f,resolveNextCursor as p}from"./types.mjs";import{VideoListRecommendItem as m}from"./video-list-recommend-item.mjs";import{VideoListSkeleton as h}from"./video-list-skeleton.mjs";import{useEffect as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x=[];function S({title:S=`列表页`,tags:C=x}){let w=a(),[T,E]=v(`hot`),D=_(()=>({page_size:10,tags:C.length?C:void 0}),[C]),{data:O,fetchNextPage:k,hasNextPage:A,isPending:j,isFetching:M}=u({key:_(()=>T===`hot`?i(D):r(D),[D,T]),queryFn:async e=>{let r={page_size:10,cursor:e||void 0,tags:C.length?C:void 0},i=(T===`hot`?await n(r):await t(r)).data,a=Array.isArray(i?.videos)?i.videos:[];return{list:a,nextCursor:a.length<10?``:p(i)}},getNextPageParam:f,initialPageParam:``,options:{staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1,refetchOnReconnect:!1}}),N=_(()=>O?.pages?.flatMap(e=>e.list)??[],[O?.pages]),P=(O?.pages?.length??0)>0,F=_(()=>P?A??!1:!0,[P,A]),I=N.length===0&&(!P||j||M);g(()=>{typeof window>`u`||window.scrollTo({top:0,behavior:`auto`})},[T]);function L(){w.back()}let R=_(()=>N.map(e=>{let t=e.id??e.mid??``;return y(m,{item:e,href:`/video/${t}/${e.name??``}`},t)}),[N]);return I?y(h,{}):b(s,{as:`main`,className:`min-h-[100dvh] bg-[linear-gradient(180deg,#160320_0%,#2a0a56_100%)] text-white`,children:[b(s,{className:`sticky top-0 z-20 bg-[linear-gradient(180deg,rgba(22,3,32,0.98)_0%,rgba(22,3,32,0.92)_100%)] px-[16px] pb-[12px] pt-[10px] backdrop-blur-[16px]`,children:[b(s,{as:`header`,className:`flex items-center justify-between`,children:[y(o,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:L,className:`h-[24px] w-[24px] rounded-none p-0 text-white hover:bg-transparent`,children:y(d,{className:`h-[16px] w-[16px]`})}),y(l,{as:`h1`,className:`min-w-0 flex-1 truncate px-[16px] text-center text-[18px] font-medium leading-[22px] text-white`,children:S}),y(s,{className:`h-[24px] w-[24px] shrink-0 opacity-0`,"aria-hidden":!0})]}),b(s,{as:`nav`,className:`mt-[12px] flex gap-[14px]`,children:[y(o,{type:`button`,variant:`ghost`,onClick:()=>E(`hot`),className:e(`h-[28px] min-w-[64px] rounded-[100px] px-[16px] text-[14px] font-normal leading-[20px] text-white`,T===`hot`?`bg-[linear-gradient(90deg,#9756e3_0%,#6c43ee_100%)] shadow-[0_8px_20px_rgba(122,76,255,0.35)] hover:bg-transparent`:`bg-white/20 hover:bg-white/25`),children:`最热`}),y(o,{type:`button`,variant:`ghost`,onClick:()=>E(`latest`),className:e(`h-[28px] min-w-[64px] rounded-[100px] px-[16px] text-[14px] font-normal leading-[20px] text-white`,T===`latest`?`bg-[linear-gradient(90deg,#9756e3_0%,#6c43ee_100%)] shadow-[0_8px_20px_rgba(122,76,255,0.35)] hover:bg-transparent`:`bg-white/20 hover:bg-white/25`),children:`最新`})]})]}),y(c,{loadMore:()=>k().then(()=>void 0),hasMore:F,noMoreText:`没有更多了`,threshold:300,className:`px-[16px] pb-[24px]`,children:y(s,{as:`section`,className:`flex flex-col gap-[16px]`,children:R})},T)]})}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{memo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){return e.img_x??e.img_y??``}function c(e){return!Number.isFinite(e)||e==null||e<=0?``:(e>10?e/10:e).toFixed(1)}function l(e){return Array.isArray(e.tags)?e.tags.map(e=>String(e?.name??``).trim()).filter(Boolean):[]}function u(
|
|
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{memo as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){return e.img_x??e.img_y??``}function c(e){return!Number.isFinite(e)||e==null||e<=0?``:(e>10?e/10:e).toFixed(1)}function l(e){return Array.isArray(e.tags)?e.tags.map(e=>String(e?.name??``).trim()).filter(Boolean).slice(0,5):[]}function u({item:i,href:u=``}){let d=i.name,f=s(i),p=c(i.score),m=l(i);return o(r,{href:u,className:`block cursor-pointer rounded-[16px] border-[0.5px] border-[#ff1eff] bg-[rgba(255,255,255,0.1)] p-4`,"aria-label":d,children:[a(t,{className:`relative aspect-[326/207] w-full overflow-hidden rounded-[8px] bg-[linear-gradient(180deg,#2d1147_0%,#13031f_100%)]`,children:f?a(e,{src:f,alt:d,fill:!0,className:`object-cover`}):null}),o(t,{className:`mt-2 flex flex-col gap-2`,children:[o(t,{className:`flex items-center justify-between gap-3`,children:[a(n,{as:`h3`,className:`min-w-0 flex-1 truncate text-[14px] font-medium leading-normal text-white`,children:d}),p?a(n,{className:`shrink-0 font-mono text-[18px] font-bold leading-5 text-[#ffc039] tabular-nums`,children:p}):null]}),m.length>0?a(t,{className:`flex flex-wrap gap-[6px]`,children:m.map(e=>a(t,{className:`flex h-[18px] shrink-0 items-center justify-center rounded bg-[rgba(217,217,217,0.2)] px-1 py-0.5`,children:a(n,{className:`text-[12px] leading-[14px] text-white`,children:e})},e))}):null]})]})}const d=i(u);d.displayName=`VideoListRecommendItem`;export{d as VideoListRecommendItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../ui/box.mjs";import{Skeleton as t}from"../../ui/skeleton.mjs";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({count:i=3}){return r(e,{as:`main`,className:`min-h-[100dvh] bg-[linear-gradient(180deg,#160320_0%,#2a0a56_100%)] text-white`,children:[r(e,{className:`sticky top-0 z-20 bg-[linear-gradient(180deg,rgba(22,3,32,0.98)_0%,rgba(22,3,32,0.92)_100%)]
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{Skeleton as t}from"../../ui/skeleton.mjs";import{jsx as n,jsxs as r}from"react/jsx-runtime";function i({count:i=3}){return r(e,{as:`main`,className:`min-h-[100dvh] bg-[linear-gradient(180deg,#160320_0%,#2a0a56_100%)] text-white`,children:[r(e,{className:`sticky top-0 z-20 bg-[linear-gradient(180deg,rgba(22,3,32,0.98)_0%,rgba(22,3,32,0.92)_100%)] px-[16px] pb-[12px] pt-[10px] backdrop-blur-[16px]`,children:[r(e,{as:`header`,className:`flex items-center justify-between`,children:[n(t,{className:`h-[24px] w-[24px] rounded-sm !bg-[rgba(255,255,255,0.12)]`,"aria-label":`back-icon-skeleton`}),n(e,{className:`flex flex-1 justify-center px-[16px]`,children:n(t,{className:`h-[22px] w-[96px] !bg-[rgba(255,255,255,0.12)]`,"aria-label":`video-list-title-skeleton`})}),n(e,{className:`h-[24px] w-[24px] shrink-0`})]}),r(e,{as:`nav`,className:`mt-[12px] flex gap-[14px]`,children:[n(t,{className:`h-[28px] w-[64px] rounded-[100px] !bg-[rgba(255,255,255,0.16)]`,"aria-label":`hot-tab-skeleton`}),n(t,{className:`h-[28px] w-[64px] rounded-[100px] !bg-[rgba(255,255,255,0.12)]`,"aria-label":`latest-tab-skeleton`})]})]}),n(e,{className:`flex flex-col gap-[16px] px-[16px] pb-[24px]`,children:Array.from({length:i}).map((i,a)=>r(e,{className:`rounded-[16px] border-[0.5px] border-[#ff1eff] bg-[rgba(255,255,255,0.1)] p-4`,children:[n(t,{className:`aspect-[326/207] w-full rounded-[8px] !bg-[rgba(255,255,255,0.12)]`,"aria-label":`video-cover-skeleton`}),r(e,{className:`mt-2 flex flex-col gap-2`,children:[r(e,{className:`flex items-center justify-between gap-3`,children:[n(t,{className:`h-[14px] min-h-[14px] flex-1 rounded-sm !bg-[rgba(255,255,255,0.12)]`,"aria-label":`video-title-skeleton`}),n(t,{className:`h-5 w-9 shrink-0 rounded-sm !bg-[rgba(255,255,255,0.12)]`,"aria-label":`video-score-skeleton`})]}),r(e,{className:`flex flex-wrap gap-[6px]`,children:[n(t,{className:`h-[18px] w-14 shrink-0 rounded !bg-[rgba(217,217,217,0.2)]`,"aria-label":`video-tag-skeleton-1`}),n(t,{className:`h-[18px] w-9 shrink-0 rounded !bg-[rgba(217,217,217,0.2)]`,"aria-label":`video-tag-skeleton-2`}),n(t,{className:`h-[18px] w-12 shrink-0 rounded !bg-[rgba(217,217,217,0.2)]`,"aria-label":`video-tag-skeleton-3`}),n(t,{className:`h-[18px] w-16 shrink-0 rounded !bg-[rgba(217,217,217,0.2)]`,"aria-label":`video-tag-skeleton-4`})]})]})]},`video-list-skeleton-${a}`))})]})}export{i as VideoListSkeleton};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,8 +7,8 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
11
|
-
size?: "
|
|
10
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
11
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|