@funhub/platform 0.1.139 → 0.1.141
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/components/biz/basics/fullscreen-feed/runtime/client.mjs +1 -1
- package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +4 -12
- package/dist/components/biz/business/detail/shared/registry.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/video-detail-actions/material.d.mts +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/material.d.mts +2 -2
- package/dist/components/biz/business/detail/video-detail-info/schema.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/server.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info-title-tags-episodes/material.d.mts +2 -2
- package/dist/components/biz/business/detail/video-detail-player/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.d.mts +2 -2
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/search-bar/variants/detail-search-bar/runtime/client.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/tab-bar/client.mjs +1 -1
- package/dist/components/biz/business/text-recommend/client.mjs +1 -1
- package/dist/components/common/at-element/index.mjs +1 -1
- package/dist/components/common/blocked-dialog/blocked-dialog.mjs +1 -1
- package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
- package/dist/components/common/header-nav/client.mjs +1 -1
- package/dist/components/common/info-card/card-header.mjs +1 -1
- package/dist/components/common/list/user-activity-list/user-activity-list-item.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/pages/(follow)/_components/interaction-tabs/index.mjs +1 -1
- package/dist/components/pages/(follow)/_components/user-list/index.mjs +1 -1
- package/dist/components/pages/collection-create/form.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/feedback/_components/feedback-form.mjs +1 -1
- package/dist/components/pages/fullscreen-feed/page.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/login/auth-guard.mjs +1 -1
- package/dist/components/pages/post-detail/post-detail-client.mjs +1 -1
- package/dist/components/pages/publish/components/collection.mjs +1 -1
- package/dist/components/pages/publish/components/header.mjs +1 -1
- package/dist/components/pages/publish/page-client.mjs +1 -1
- package/dist/components/pages/search/page-client.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/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/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/components/ui/link.mjs +1 -1
- package/dist/hooks/use-card-decoration.mjs +1 -1
- package/dist/hooks/use-content-operate.mjs +1 -1
- package/dist/materials.d.mts +1 -3
- package/dist/materials.mjs +1 -1
- package/dist/utils/login-modal-bridge.mjs +1 -1
- package/dist/utils.d.mts +5 -6
- package/dist/utils.mjs +1 -1
- package/package.json +28 -28
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.d.mts +0 -12
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/client.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/index.d.mts +0 -5
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/material.d.mts +0 -17
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/material.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.d.mts +0 -23
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/schema.mjs +0 -2
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/server.d.mts +0 -11
- package/dist/components/biz/business/detail/video-detail-player-bridge-only/server.mjs +0 -2
- package/dist/utils/use-compatible-router.d.mts +0 -26
- package/dist/utils/use-compatible-router.mjs +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{
|
|
2
|
+
"use client";import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogDescription as r,AlertDialogFooter as i,AlertDialogHeader as a,AlertDialogTitle as o}from"../../ui/alert-dialog.mjs";import{secondToTime as s}from"../../../utils/common.mjs";import{useBlockedModalStore as c}from"../../../store/modules/blocked-modal-store.mjs";import{useLoginModalStore as l}from"../../../store/modules/login-modal-store.mjs";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useRouter as p}from"next/navigation";function m(){let m=p(),h=f(`components.common.blockedDialog`),{isOpen:g,blockedRemark:_,blockedEndTime:v,close:y,setOpen:b}=c(),x=v>0?s(v):h(`unblockTimePermanent`),S=_||h(`remarkDefault`);return u(e,{open:g,onOpenChange:e=>{b(e)},children:d(n,{size:`sm`,children:[d(a,{children:[u(o,{className:`text-[16px]`,children:h(`title`)}),u(r,{className:`text-center text-[14px] leading-6 whitespace-pre-line`,children:h(`description`,{remark:S,unblockTime:x})})]}),d(i,{children:[u(t,{onClick:()=>{l.getState().isOpen&&l.getState().setOpen(!1),y(),m.push(`/feedback`)},children:h(`contactSupport`)}),u(t,{onClick:y,children:h(`gotIt`)})]})]})})}export{m as BlockedDialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{gUserGetUserInfo as t}from"../../../service/generated/client.mjs";import{Toaster as n}from"../../ui/sonner.mjs";import{useRequest as r}from"../../../hooks/query/use-query.mjs";import{MediaPreview as i}from"../media-preview/index.mjs";import{CollectionPopupHost as a}from"../collection-popup/index.mjs";import{IntlProvider as o}from"../intl-provider/intl-provider.mjs";import{BlockedDialog as s}from"../blocked-dialog/blocked-dialog.mjs";import{LoginDialog as c}from"../login-dialog/login-dialog.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{useRouter as h}from"next/navigation";import{QueryClient as g,QueryClientProvider as _}from"@tanstack/react-query";import{NuqsAdapter as v}from"nuqs/adapters/next/app";function y(){let{userId:n,setUserInfo:i}=e(),a={code:0,message:``,data:{}},{data:o}=r([`user-init`,n],()=>n?t({user_id:n}):Promise.resolve(a),{enabled:!!n});return l(()=>{if(!n)return;let e=o?.data;e&&i(e)},[i,n,o]),null}function b(t){let{queryClient:r,intl:b,children:x}=t,[S]=d(()=>new g),C=r??S,w=h(),T=e(e=>e.isLogin&&!!e.token&&!!e.userId),E=u(T);l(()=>{E.current&&!T&&(C.clear(),w.refresh()),E.current=T},[T,C,w]);let D=m(f,{children:[p(y,{}),x,p(s,{}),p(c,{}),p(a,{}),p(n,{position:`top-center`}),p(i,{})]});return p(_,{client:C,children:p(v,{children:p(o,{...b,children:D})})})}export{b as FunhubProvider};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{toast as e}from"../../../ui.mjs";import{LeftArrowIcon as t}from"../icons/left-arrow.mjs";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{useRouter as i}from"next/navigation";function a({title:a,leftChild:o,centerChild:s,className:c,rightChild:l,leftIconCss:u,onBack:d}){let f=i();function p(){if(e.dismiss(),d){d?.();return}window.location.search.split(`from_code=`)[1]?f.push(`/`):f.back()}return n(`nav`,{className:`app-top-nav w-full relative ${c?.includes(`h-`)?(c.match(/h-\[?\d\w+\]?/)||[`h-12`])[0]:`h-12`}`,children:r(`div`,{className:`w-full bg-bg1 flex items-center justify-center fixed h-12 top-0 left-0 right-0 z-50 border-b border-text1/5 ${c}`,style:{willChange:`transform`,transform:`translateZ(0)`},children:[n(`div`,{className:`absolute z-[1] h-full left-0 top-0`,children:o||n(`div`,{onClick:p,className:`cursor-pointer h-full w-12 flex items-center justify-center`,children:n(t,{className:`w-4 h-4 text-text1 ${u}`})})}),s||n(`p`,{className:`text-text1 line-clamp-1 px-12 text-ellipsis text-lg`,children:a}),l&&n(`div`,{className:`absolute h-full right-2 top-0 flex items-center justify-center`,children:l})]})})}export{a as HeaderNav};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
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{Time as r}from"../../ui/time.mjs";import{FollowButton as i}from"../../pages/(follow)/_components/follow-button/index.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useRouter as c}from"next/navigation";function l({className:l,infoData:u,onChangeFollow:d,rightChild:f}){let p=s(),m=c(),h=u?.author?.user_id||``,g=u?.author?.nickname||``,_=u?.show_at||u?.create_time;return a(t,{className:`w-full mb-[8px] pt-[16px] px-[12px] ${l}`,children:o(t,{className:`w-full flex items-center justify-between`,children:[o(t,{className:`flex items-center cursor-pointer`,onClick:e=>{e.stopPropagation(),e.preventDefault();let t=`/profile/${h}`;p!==t&&m.push(t)},children:[a(t,{className:`w-[36px] h-[36px] mr-[8px] rounded-full bg-bg2 overflow-hidden`,children:u?.author?.avatar&&a(e,{width:36,height:36,src:u?.author?.avatar,className:`w-full h-full object-cover`,alt:`avatar`})}),o(t,{className:`flex flex-col`,children:[a(n,{className:`block text-text1 text-[14px] leading-[18px] max-w-[220px] overflow-hidden whitespace-nowrap text-ellipsis`,children:g}),a(t,{className:`mt-[4px] h-[14px] leading-[14px]`,children:a(r,{mode:`relative`,value:_,className:`text-text3 text-[12px]`})})]})]}),a(t,{onClick:e=>{e.stopPropagation(),e.preventDefault()},children:f||(h?a(i,{userId:h,hasFollow:!1,onChange:d}):null)})]})})}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Avatar as t,AvatarFallback as n,AvatarImage as r}from"../../../ui/avatar.mjs";import{Box as i}from"../../../ui/box.mjs";import{Checkbox as a}from"../../../ui/checkbox.mjs";import{Text as o}from"../../../ui/text.mjs";import{Time as s}from"../../../ui/time.mjs";import{useMediaPreview as c}from"../../media-preview/index.mjs";import{useContentOperate as l}from"../../../../hooks/use-content-operate.mjs";import u from"../../../../assets/icons/detail/video_play.mjs";import{ActivityCommentButton as d,ActivityDeleteButton as f,ActivityDislikeButton as p,ActivityLikeButton as ee,ActivityShareButton as m}from"./user-activity-list-actions.mjs";import{useEffect as h,useRef as te,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{useRouter as x}from"next/navigation";const S=[],C={post:2};function w({medias:t=S,className:n=``,onItemClick:r}){let a=b(`components.ui.list.userActivityList`),o=(t||[]).filter(Boolean).slice(0,9);if(!o.length)return null;function s(e){r?.(e)}function c(t,n,o){let{is_video:c,media_url:l,cover_image:d}=t||{},f=!!c,p=f?d||l||``:l||``;return p?v(i,{className:o||`relative w-full h-full`,onClick:e=>{r&&(e.stopPropagation(),e.preventDefault(),s(n))},children:[_(e,{src:p,alt:a(`userActivityListItem.mediaAlt`),fill:!0,className:`object-cover`}),f&&_(i,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-[rgba(0,0,0,0.5)] rounded-full`,children:_(u,{width:36,height:36})})]},n):null}if(o.length===1){let{is_video:e,media_url:t,cover_image:r}=o[0]||{};return _(i,{className:n,children:_(i,{className:`w-full rounded-xl overflow-hidden`,children:c({is_video:e,media_url:t,cover_image:r,__src:e?r||t||``:t||``},0,`relative w-full aspect-square`)})})}return o.length===2?_(i,{className:n,children:_(i,{className:`w-full flex gap-0.5 rounded-xl overflow-hidden`,children:o.map((e,t)=>_(i,{className:`flex-1 aspect-square relative`,children:c(e,t)},t))})}):o.length===3?_(i,{className:n,children:v(i,{className:`w-full h-89.25 flex gap-0.5 rounded-xl overflow-hidden`,children:[_(i,{className:`w-[56.65%] h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 flex flex-col gap-0.5`,children:o.slice(1).map((e,t)=>_(i,{className:`w-full flex-1 relative`,children:c(e,t+1)},t))})]})}):o.length===4?_(i,{className:n,children:_(i,{className:`w-full h-89.25 rounded-xl overflow-hidden grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})}):o.length===5?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-49.5 flex gap-0.5`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-33.5 flex gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t+2)},t))})]})}):o.length===6?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[v(i,{className:`w-full h-67.5 flex gap-0.5`,children:[_(i,{className:`w-67.5 h-full relative`,children:c(o[0],0)}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-2 gap-0.5`,children:o.slice(1,3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+1)},t))})]}),_(i,{className:`w-full h-33.5 grid grid-cols-3 grid-rows-1 gap-0.5`,children:o.slice(3).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+3)},t))})]})}):o.length===7?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex gap-0.5`,children:[_(i,{className:`w-76 h-67.5 grid grid-cols-2 grid-rows-2 gap-0.5`,children:o.slice(0,4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))}),_(i,{className:`flex-1 grid grid-cols-1 grid-rows-3 gap-0.5`,children:o.slice(4).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+4)},t))})]})}):o.length===8?_(i,{className:n,children:v(i,{className:`w-full rounded-xl overflow-hidden flex flex-col gap-0.5`,children:[_(i,{className:`w-full h-33.5 flex gap-0.5 items-center`,children:o.slice(0,2).map((e,t)=>_(i,{className:`flex-1 h-full relative`,children:c(e,t)},t))}),_(i,{className:`w-full h-67.5 grid grid-cols-3 grid-rows-2 gap-0.5`,children:o.slice(2).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t+2)},t))})]})}):_(i,{className:n,children:_(i,{className:`w-full h-101.5 rounded-xl overflow-hidden grid grid-cols-3 grid-rows-3 gap-0.5`,children:o.slice(0,9).map((e,t)=>_(i,{className:`w-full h-full relative`,children:c(e,t)},t))})})}function T(e){let u=b(`components.ui.list.userActivityList`),{content_id:S,author:T,rightSlot:E,create_time:ne,content:D,medias:O,canEdit:re=!1,isDeleting:ie=!1,isEditMode:ae=!1,isSelected:oe=!1,onToggle:k,interaction:A,like_count:j=0,is_liked:M=!1,onLikeSuccess:se,dislike_count:N=0,is_dislike:P=!1,is_collected:ce,onDislikeSuccess:F,comment_count:I=0,onDelete:L,onShare:R,onShareSuccess:z,onActionSuccess:B,onCollectChange:V}=e,H=A?.is_collected??ce??!1,[U,W]=g({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H}),[G,K]=g(!1),[le,q]=g(!1),J=te(null),Y=O?.filter(Boolean)??[],X=T?.nickname||T?.nick_name||``,ue=T?.avatar||T?.avatar_url||``;h(()=>{W({isLiked:M,likeCount:j,isDisliked:P,dislikeCount:N,isCollected:H})},[N,P,M,j,H]),h(()=>{K(!1)},[D]),h(()=>()=>{J.current&&=(clearTimeout(J.current),null)},[]);function de(e){W(t=>({...t,isLiked:e.isLiked,likeCount:e.count,isDisliked:e.isDisliked??t.isDisliked,dislikeCount:e.dislikeCount??t.dislikeCount})),se?.(e)}function fe(e){W(t=>({...t,isDisliked:e.isDisliked,dislikeCount:e.count,isLiked:e.isLiked??t.isLiked,likeCount:e.likeCount??t.likeCount})),F?.(e)}let{handleToCollectionOperate:pe}=l({id:S||``,isLike:U.isLiked,isDislike:U.isDisliked,isCollect:U.isCollected,likeCnt:U.likeCount,dislikeCnt:U.dislikeCount,contentType:C.post});function Z(){J.current&&=(clearTimeout(J.current),null)}function me(e){W(t=>({...t,isCollected:e})),B?.(),S&&V?.(S,e)}function Q(e){if(!S){y.error(u(`userActivityListItem.collectFailed`));return}if(!le){if(q(!0),Z(),!pe({currentCollect:e,onUpdate:({isCollect:e})=>{Z(),me(e),q(!1)}})){y.error(u(`userActivityListItem.collectFailed`)),q(!1);return}J.current=setTimeout(()=>{q(!1),J.current=null},300)}}function he(e){return!!(e&&e.length>180)}function ge(){K(e=>!e)}let $=x(),_e=()=>{$.push(`/post/${S}`)},ve=e=>{e.stopPropagation(),e.preventDefault(),$.push(`/profile/${T?.user_id}`)},ye=()=>{$.push(`/post/${S}?tab=comment`)},be=c();function xe(e){let t=Y.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image}));t.length&&be.open(t,e)}return _(i,{className:`flex items-start gap-2 p-3`,children:v(i,{className:`flex-1 min-w-0`,children:[v(i,{className:`flex items-center gap-2 mb-3`,children:[v(i,{className:`flex items-center gap-2 shrink-0`,children:[ae&&_(a,{checked:oe,onCheckedChange:k}),v(t,{className:`w-10 h-10`,onClick:ve,children:[_(r,{src:ue,alt:X}),_(n,{})]})]}),v(i,{className:`flex-1 min-w-0`,children:[_(o,{as:`p`,className:`text-sm text-text1 line-clamp-1 font-medium`,children:X}),_(i,{className:`h-[1em]`,children:_(s,{value:ne,className:`text-xs text-text3`,format:`YYYY-MM-DD HH:mm`})})]}),E&&_(i,{className:`shrink-0`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:E}),re&&_(f,{onClick:L,disabled:ie})]}),v(i,{onClick:_e,children:[v(i,{className:`mb-3`,children:[D&&v(i,{children:[_(o,{className:`text-sm text-text1 leading-5 whitespace-pre-wrap text-ellipsis ${G?`break-all`:`line-clamp-3`}`,dangerouslySetInnerHTML:{__html:D}}),he(D)&&_(i,{className:`mt-1 text-xs text-text3`,onClick:e=>{e.stopPropagation(),e.preventDefault(),ge()},children:u(G?`userActivityListItem.collapse`:`userActivityListItem.expand`)})]}),Y.length>0&&_(w,{className:`mt-2`,medias:Y,onItemClick:xe})]}),v(i,{className:`flex items-center justify-around text-text3 *:min-w-20`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:[_(ee,{contentId:S||``,count:U.likeCount,isLiked:U.isLiked,isDisliked:U.isDisliked,dislikeCount:U.dislikeCount,onLikeSuccess:de,onSuccess:B}),_(p,{contentId:S||``,count:U.dislikeCount,isDisliked:U.isDisliked,isLiked:U.isLiked,likeCount:U.likeCount,onDislikeSuccess:fe,onSuccess:B}),_(d,{count:I,onClick:ye}),_(m,{isCollected:U.isCollected,contentId:S||``,userId:T?.user_id??``,onShareSuccess:z,onClick:R,onCollect:()=>Q(!1),onUncollect:()=>Q(!0)})]})]})]})})}export{T as UserActivityListItem,w as UserActivityMediaGrid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{useEffect as u,useState as d,useTransition as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";import{usePathname as _}from"next/navigation";function v(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const y=[`/nav-page`];function b(b){let{className:x}=b,S=_(),C=g(`tabBar`),[w,T]=d(null),[,E]=f(),[D]=d(0),[O,k]=d(!1),A=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:22,height:22},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:22,height:22},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:22,height:22}],j=(e,t,n)=>{t!==S&&T(t)};return u(()=>{w&&v(S,w)&&E(()=>{T(null)})},[S,w]),u(()=>{let e=setTimeout(()=>{k(!0)},0);return()=>clearTimeout(e)},[]),S&&y.some(e=>S.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex h-[var(--tab-bar-height)] items-center justify-around border-t border-line1 bg-bg1 ${x||``}`,children:A.map(r=>{let i=O&&S?v(w||S||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(p,{children:[r.badge&&D>0?m(l,{dot:!0,children:m(a,{width:r.width,height:r.height})}):m(a,{width:r.width,height:r.height}),m(t,{className:`text-[10px] mt-[4px] ${i?`text-theme5`:`text-text2`}`,children:C(r.labelKey)})]});return i?m(e,{className:`flex flex-col items-center justify-center flex-1 h-full`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex flex-col items-center justify-center flex-1 h-full`,onClick:e=>{j(e,r.path,r.labelKey)},children:o},r.id)})})}export{b as TabBar};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{Tabs as e,TabsList as t,TabsTrigger as n}from"../../../../ui/tabs.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useTranslations as a}from"next-intl";import{usePathname as o,useRouter as s,useSearchParams as c}from"next/navigation";function l({type:l}){let u=a(`components.pages.follow.components.interactionTabs`),d=s(),f=c(),p=o();return r(e,{value:l,onValueChange:e=>{let t=e===`fans`?`fans`:`followed`,n=p;n=p.replace(/\/(fans|followed)/,`/${t}`);let r=f.get(`user_id`),i=r?`?user_id=${r}`:``;d.replace(`${n}${i}`)},className:`h-full`,children:i(t,{variant:`default`,className:`h-full`,children:[r(n,{value:`followed`,className:`h-full px-3`,children:u(`follow`)}),r(n,{value:`fans`,className:`h-full px-3`,children:u(`fans`)})]})})}export{l as InteractionTabs};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gInteractionGetFollowerList as t,gInteractionGetFollowingList as n}from"../../../../../service/generated/client.mjs";import{Box as r}from"../../../../ui/box.mjs";import{List as i}from"../../../../ui/list.mjs";import{Text as a}from"../../../../ui/text.mjs";import{usePaginated as o,useUpdateRequest as s}from"../../../../../hooks/query/use-query.mjs";import{UserListItem as c}from"./user-list-item.mjs";import{useState as l}from"react";import{jsx as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";import{useRouter as f}from"next/navigation";function p(e,t){return e.map(e=>({user_id:e.user_brief?.user_id??e.user_id??``,name:e.user_brief?.nickname??e.user_brief?.username??``,avatar:e.user_brief?.avatar_url??``,is_mutual:e.is_mutual,signature:e?.user_brief?.signature||``,is_friend:`0`,browse_flag:`0`,self_flag:`0`,follow_flag:t,background:``}))}function m(e,t,n,r){return{code:0,msg:`OK`,data:{page:String(t),page_size:String(n),list:p(e,r)},trace:``}}function h(p){let h=d(`components.pages.follow.components.userList`),{userId:g,type:_,page:v,showAction:y,followText:b}=p,[x,S]=l(!1),C=f(),w=e(e=>e.userId||e.userInfo?.userId||``),T=g||w,E=[`user-list`,_,T,v],D=b||h(_===`fans`?`followBack`:`follow`),{data:O,isFetching:k,fetchNextPage:A}=o({key:E,options:{staleTime:0},initialPageParam:v,async queryFn(e){if(!T)return m([],e,20,_===`followed`?`1`:`0`);let r=(_===`followed`?await n({page:e,page_size:20,user_id:T}):await t({page:e,page_size:20,user_id:T})).data,i=[];_===`followed`&&`following`in r&&(i=r.following??[]),_===`fans`&&`followers`in r&&(i=r.followers??[]);let a=m(i,e,20,_===`followed`?`1`:`0`);return a.data?.list&&a.data.list.length===0&&S(!1),a},getNextPageParam(e,t){if((e?.data?.list??[]).length!==0)return t.length+v}}),j=s();function M(e,t){j(E,n=>{for(let r of n?.pages||[])for(let n of r.data?.list||[])if(n.user_id===e){n.follow_flag=t?`1`:`0`;break}return n&&{...n}})}return u(i,{loading:k,hasMore:x,loadMore:async()=>{await A()},empty:`adduser`,emptyText:h(_===`followed`?`noFollowedUsers`:`noFans`),emptySlot:_===`followed`&&!g?u(r,{className:`w-20.5 mt-6 h-7.5 rounded-[30px] bg-theme5 flex items-center justify-center`,onClick:()=>{C.push(`/`)},children:u(a,{className:`text-[14px] text-white leading-7.5`,children:h(`followNow`)})}):null,children:O?.pages.map(e=>e.data.list.map(e=>u(i.Item,{children:u(c,{showAction:y,data:e,onUpdateFollowStatus:M,followText:e.follow_flag===`1`?h(`follow`):D})},e.user_id)))})}export{h as UserList};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,pCommunityCreateCollection as r,pCommunityUpdateCollection as i}from"../../../service/generated/client.mjs";import{Box as a}from"../../ui/box.mjs";import{InputGroup as o,InputGroupAddon as s,InputGroupTextarea as c}from"../../ui/input-group.mjs";import{Field as l,FieldLabel as u}from"../../ui/field.mjs";import{useDeleteRequest as d,useRequest as f}from"../../../hooks/query/use-query.mjs";import{HeaderNav as p}from"../../common/header-nav/client.mjs";import{useEffect as m,useRef as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as b}from"next-intl";import{useRouter as x}from"next/navigation";function S({mode:S=`create`,collectionId:C}){let w=b(`components.pages.collectionCreate`),T=x(),{userId:E}=t(),D=d();h(null);let O=S===`edit`&&!!C,k=h(!1),[A,j]=g(!1),[M,N]=g(!1),[P,F]=g(``),[I,L]=g({title:``,description:``}),R=f([`collection-detail`,C],()=>n({collection_id:C}),{enabled:!!(O&&C)}).data?.data?.data?.collection;m(()=>{!O||k.current||!R||(L({title:R.title??``,description:R.description??``}),F(R.cover_image??``),k.current=!0)},[R,O]);function z(e,t){L(n=>({...n,[e]:t}))}async function B(){if(A)return;let e=I.title.trim(),t=I.description.trim();if(!e){y.error(w(`form.titleRequired`));return}if(O&&!C){y.error(w(`form.collectionNotFound`));return}try{j(!0);let n=y.loading(w(O?`form.saving`:`form.creating`)),a=O?await i({collection_id:C,title:e,description:t,cover_image:P}):await r({title:e,description:t,cover_image:P});if(a.code===0){y.success(w(O?`form.saveSuccess`:`form.createSuccess`),{id:n}),E&&D([`user-profile`,`mine`,E,`user-collection-created`,E]),O&&C&&D([`collection-detail`,C]),T.back();return}y.error(a.message||w(O?`form.saveFailed`:`form.createFailed`),{id:n})}catch(e){console.error(O?`编辑合集失败`:`创建合集失败`,e),y.error(w(O?`form.saveFailed`:`form.createFailed`))}finally{j(!1)}}return v(a,{className:`min-h-screen !bg-bg2`,children:[_(p,{title:w(O?`form.editTitle`:`form.createTitle`),className:`!bg-bg2`,rightChild:_(e,{onClick:B,disabled:A||M,children:w(A?O?`form.saving`:`form.creating`:O?`form.save`:`form.create`)})}),v(a,{className:`pb-3`,children:[v(l,{className:`!bg-bg2 px-3 border-none`,children:[_(u,{required:!0,children:w(`form.label`)}),v(o,{children:[_(c,{className:`!bg-bg1 p-2.5`,maxLength:50,placeholder:w(`form.titlePlaceholder`),value:I.title,onChange:e=>z(`title`,e.target.value)}),_(s,{className:`!bg-bg1`,align:`block-end`,children:_(`div`,{className:`text-right w-full`,children:v(`span`,{className:`text-xs`,children:[I.title.length,`/50`]})})})]})]}),v(l,{className:`border-none px-3 bg-bg2! `,children:[_(u,{children:w(`form.descriptionLabel`)}),v(o,{children:[_(c,{className:`!bg-bg1 p-2.5`,maxLength:100,placeholder:w(`form.descriptionPlaceholder`),value:I.description,onChange:e=>z(`description`,e.target.value)}),_(s,{className:`!bg-bg1`,align:`block-end`,children:_(`div`,{className:`text-right w-full`,children:v(`span`,{className:`text-xs`,children:[I.description.length,`/100`]})})})]})]})]})]})}export{S as CollectionCreateForm};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{useUserStore as t}from"../../../store/modules/user-store.mjs";import{gCommunityGetCollectionInfo as n,gUserViewUserInfo as r,pCommunityDeleteCollection as i,pCommunityRemoveContentFromCollection as a,pCommunitySubscribeCollection as o,pInteractionBatchDeleteCollects as s}from"../../../service/generated/client.mjs";import{Box as c}from"../../ui/box.mjs";import{Checkbox as ee}from"../../ui/checkbox.mjs";import{Drawer as te,DrawerContent as ne,DrawerDescription as re,DrawerTitle as ie}from"../../ui/drawer.mjs";import{List as ae}from"../../ui/list.mjs";import{Text as l}from"../../ui/text.mjs";import{useLoginModalStore as oe}from"../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as se,useMutation as u,useRequest as d,useUpdateRequest as ce}from"../../../hooks/query/use-query.mjs";import{ShareDrawer as le}from"../../common/share-popup/share-drawer.mjs";import{SharePlatformEnum as f}from"../../../types/share.mjs";import p from"../../../utils/share-manager.mjs";import{DeleteConfirmDialog as m}from"../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as ue}from"../../common/header-nav/client.mjs";import{MoreIcon as de}from"../../common/icons/more.mjs";import{CollectionDetailCard as fe}from"./_components/collection-detail-card.mjs";import{useEffect as pe,useMemo as h,useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{toast as y}from"sonner";import{useTranslations as me}from"next-intl";import{useRouter as b,useSearchParams as he}from"next/navigation";function x(e){if(e.cover_image)return e.cover_image;let t=``;return e.medias?.find(e=>e?(!e.is_video&&!t&&e.media_url&&(t=e.media_url),!!e.cover_image):!1)?.cover_image||t}function S(e){let t=e.detail.info?.video_duration;if(typeof t==`number`&&Number.isFinite(t)&&t>0)return Math.floor(t);let n=e.medias?.find(e=>{let t=e?.video_duration;return typeof t==`number`&&Number.isFinite(t)&&t>0})?.video_duration;return typeof n==`number`&&Number.isFinite(n)&&n>0?Math.floor(n):0}function C(e){let t=e.detail.info?.play_count;if(typeof t==`number`&&Number.isFinite(t))return Math.max(0,Math.floor(t));let n=e.detail.view_count||e.viewCount;return typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.floor(n)):0}function ge(e){let t=e.detail,n=t.info,r=String(n?.cover_image||t.cover_image||x(e)||``),i=String(n?.text||n?.title||t.title||t.content||``),a=t.author_score??0,o=Array.isArray(t.tags)?t.tags:[];return{id:e.content_id?String(e.content_id):String(e.id),title:i,type:typeof e.type==`number`?e.type:0,coverImage:r,score:a,collectedAt:t.create_time==null?void 0:String(t.create_time),tags:o,duration:S(e),viewCount:C(e),publishTime:String(t.create_time??t.update_time??``),is_more_link:e.is_more_link??n?.is_more_link??!1,authorName:``}}function w({id:x}){let S=me(`components.pages.collectionDetail`),C=b(),w=he(),{userId:T,isLogin:E}=t(),{open:D}=oe(),O=se();ce();let k=d([`collection-detail`,x],()=>n({collection_id:x})),A=k.data?.data?.data?.collection?.user_id,j=!!(A&&T&&String(A)===String(T)),_e=d([`user-info`,A],()=>r({target_user_id:A,user_id:A})),[ve,M]=g(!1),[N,P]=g(!1),[F,I]=g(!1),[L,R]=g(!1),[z,B]=g(!1),[V,H]=g(()=>new Set),[U,W]=g(null);pe(()=>{!N&&L&&(I(!0),R(!1))},[N,L]);let G=k.data?.data?.data?.collection,K=G?.contents,q=h(()=>K?K.map(e=>({content_id:e.content_id,is_more_link:e.is_more_link,id:Number(e.content_id),detail:e,type:Number(e.source_type??0),medias:e.medias,cover_image:e.cover_image,viewCount:e.view_count})):[],[K]).map(ge),J=h(()=>new Set(q.map(e=>e.id)),[q]),Y=J.size>0&&V.size===J.size;G?.cover_image,G?.content_count,G?.is_subscribe;let{mutateAsync:ye,isPending:be}=u(async e=>await o({collection_id:x,subscribe:e})),{mutateAsync:xe,isPending:Se}=u(async e=>await a({collection_id:x,content_id:e})),{mutateAsync:Ce,isPending:X}=u(async e=>await i({collection_id:e})),{mutateAsync:we,isPending:Z}=u(async e=>await s({app_id:0,user_id:T,folder_id:x,content_type:1,content_ids:e})),Q=_e.data?.data;Q?.avatar,Q?.nick_name;let Te=j&&G?.is_default===!1;function Ee(e){W({kind:`content`,id:e.id,type:e.type,title:e.title,isCollected:!0}),M(!0)}function De(){if(j){P(!0);return}W({kind:`collection`,id:x}),M(!0)}function Oe(){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!j){y.error(S(`detail.operationFailed`));return}P(!1),H(new Set),B(!0)}function ke(){H(new Set),B(!1)}function Ae(e){H(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function je(){if(Y){H(new Set);return}H(new Set(J))}async function Me(){if(!(V.size===0||Z)){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}try{let e=await we(Array.from(V));if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),H(new Set),B(!1);return}y.error(e.message||S(`detail.uncollectFailed`))}catch(e){console.error(`批量取消收藏失败`,e),y.error(S(`detail.operationFailed`))}}}function Ne(e){if(typeof window>`u`)return``;if(e.kind===`collection`)return`${window.location.origin}/collection/${e.id}`;let t=e.title?encodeURIComponent(e.title):`detail`,n=e.type===1?`/video/${e.id}/${t}`:`/post/${e.id}`;return`${window.location.origin}${n}`}function $(e){if(!U)return;let t=Ne(U);t&&p.showSharePopup({type:e,data:{id:U.id},copyUrl:t})}function Pe(){$(f.WECHAT)}function Fe(){$(f.QQ)}function Ie(){$(f.WECHAT_MOMENTS)}function Le(){if(!Se){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}!U||U.kind!==`content`||xe(U.id).then(e=>{if(e.code===0){y.success(S(`detail.uncollectSuccess`)),O([`collection-detail`,x]),W(e=>e&&{...e,isCollected:!1});return}y.error(e.message||S(`detail.uncollectFailed`))}).catch(e=>{console.error(`取消收藏失败`,e),y.error(S(`detail.operationFailed`))})}}function Re(){let e=new URLSearchParams(w.toString());e.set(`id`,x),e.set(`type`,`edit`),C.push(`/collection/create?${e.toString()}`),P(!1),M(!1)}function ze(){if(!X){if(!E||!T){y.error(S(`detail.pleaseLogin`)),D();return}if(!Te){y.error(S(`detail.defaultCollectionDeleteNotSupported`));return}R(!0),P(!1)}}async function Be(){if(!X)try{let e=await Ce(x);if(e.code===0){y.success(S(`detail.deleteSuccess`)),O([`collection-detail`,x]),O([`user-profile`,`mine`]),O([`user-profile`,`profile`,A]),I(!1),P(!1),M(!1),C.back();return}y.error(e.message||S(`detail.deleteFailed`))}catch(e){console.error(`删除合集失败`,e),y.error(S(`detail.operationFailed`))}}return v(c,{className:`flex flex-col bg-bg1 min-h-screen ${z?`pb-28`:`pb-6`}`,children:[_(ue,{title:G?.title??``,rightChild:j?z?_(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-sm text-text1`,children:S(`detail.done`)}):_(`button`,{type:`button`,onClick:De,className:`p-2`,children:_(de,{})}):void 0}),_(c,{className:`px-4 flex items-start gap-4`,children:v(c,{className:`flex-1 flex flex-col gap-2`,children:[_(c,{className:`flex items-center justify-between`}),_(c,{className:`text-text2 text-sm break-all text-ellipsis line-clamp-1`,children:G?.description})]})}),_(c,{className:`px-4 ${z?`pb-20`:``}`,children:_(ae,{loading:k.isLoading,hasMore:!1,emptyText:S(`detail.emptyContent`),className:`divide-y divide-text1/5`,children:q.map(e=>_(fe,{...e,onOpenShare:Ee,isEditMode:z,isSelected:V.has(e.id),onToggleSelection:Ae},e.id))})}),z&&v(c,{className:`fixed bottom-0 left-0 right-0 z-10 flex items-center justify-between border-t border-text1/10 bg-bg1 px-4 py-3`,children:[v(c,{className:`flex items-center gap-2`,children:[_(ee,{checked:Y,onCheckedChange:je}),_(l,{className:`text-sm text-text1`,children:S(`detail.selectAll`)})]}),_(e,{className:`rounded-full py-2.5 h-auto px-6.5`,variant:V.size>0?`default`:`outline`,disabled:V.size===0||Z,onClick:Me,children:S(Z?`detail.deleting`:`detail.delete`)})]}),v(te,{open:N,onOpenChange:P,children:[_(ie,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),_(re,{className:`hidden`,children:S(`detail.collectionManageTitle`)}),v(ne,{className:`z-[2000]`,children:[v(c,{className:`px-4 py-5`,children:[_(l,{className:`text-base font-bold text-text1 text-center `,children:S(`detail.collectionManageTitle`)}),v(c,{className:`mt-4 border-t border-text1/10`,children:[_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Re,children:_(l,{className:`text-text1`,children:S(`detail.editCollection`)})}),_(`button`,{className:`w-full text-left py-4 border-b border-text1/10`,onClick:Oe,children:_(l,{className:`text-text1`,children:S(`detail.manageCollection`)})}),_(`button`,{className:`w-full text-left py-4 ${X?`opacity-60 cursor-not-allowed`:``}`,onClick:ze,disabled:X,children:_(l,{className:`text-destructive`,children:S(X?`detail.deleting`:`detail.deleteCollection`)})})]})]}),_(e,{className:`w-full h-auto py-4 text-lg text-text1`,size:`lg`,onClick:()=>P(!1),variant:`secondary`,children:S(`detail.cancel`)})]})]}),_(le,{isShowCollect:U?.kind===`content`&&j&&E,isCollected:U?.isCollected,open:ve,onOpenChange:M,onShareWeChat:Pe,onShareQQ:Fe,onShareMoments:Ie,onUncollect:Le}),_(m,{open:F,onOpenChange:I,onConfirm:Be,title:S(`detail.deleteCollection`),isConfirming:X})]})}export{w as CollectionDetail};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserUserFeedback as r}from"../../../../service/generated/client.mjs";import{compressImage as i}from"../../../../utils/image-compression.mjs";import{uploadFile as a}from"../../../../utils/upload-file.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserUserFeedback as r}from"../../../../service/generated/client.mjs";import{compressImage as i}from"../../../../utils/image-compression.mjs";import{uploadFile as a}from"../../../../utils/upload-file.mjs";import{Image as o}from"../../../ui/image.mjs";import{Box as s}from"../../../ui/box.mjs";import{InputGroup as c,InputGroupAddon as l,InputGroupInput as u,InputGroupTextarea as d}from"../../../ui/input-group.mjs";import{Field as f,FieldLabel as p}from"../../../ui/field.mjs";import{Text as m}from"../../../ui/text.mjs";import{HeaderNav as h}from"../../../common/header-nav/client.mjs";import{AddIcon as g}from"../../../common/icons/add.mjs";import{useRef as _,useState as v}from"react";import{XIcon as y}from"lucide-react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{toast as S}from"sonner";import{useTranslations as C}from"next-intl";import{useRouter as w}from"next/navigation";const T=new Set([`image/jpeg`,`image/jpg`,`image/png`]),E=new Set([`jpg`,`jpeg`,`png`]);function D(e){let t=e.type.toLowerCase(),n=e.name.split(`.`).pop()?.toLowerCase()||``;return t?T.has(t):E.has(n)}function O({className:T}={}){let E=C(`components.pages.feedback.components`),O=w(),{userId:k}=n(),A=_(null),[j,M]=v({content:``,contact:``}),[N,P]=v([]),[F,I]=v(!1),[L,R]=v(!1),z=!j.content.trim();function B(e,t){M(n=>({...n,[e]:t}))}function V(){L||F||N.length>=3||A.current?.click()}async function H(e){let t=Array.from(e.target.files??[]);if(!t.length)return;let n=3-N.length;if(n<=0){e.target&&(e.target.value=``);return}let r=t.slice(0,n),o=r.filter(D);if(!o.length){S.error(E(`feedbackForm.imageTypeInvalid`)),e.target&&(e.target.value=``);return}o.length!==r.length&&S.error(E(`feedbackForm.imageTypeInvalid`));try{R(!0);let e=[],t=!1;for(let n of o)try{let t=await a(await i(n),1);e.push(t.objectKey)}catch(e){console.error(`上传截图失败`,e),t=!0}e.length&&P(t=>[...t,...e].slice(0,3)),t&&S.error(E(`feedbackForm.screenshotUploadFailed`))}catch(e){console.error(`上传截图失败`,e),S.error(E(`feedbackForm.screenshotUploadFailed`))}finally{R(!1),e.target&&(e.target.value=``)}}function U(e){L||F||P(t=>t.filter((t,n)=>n!==e))}async function W(){let e=j.content.trim(),t=j.contact.trim();if(!e){S.error(E(`feedbackForm.missingFeedback`));return}if(e.length<4){S.error(E(`feedbackForm.contentMinLength`));return}if(F)return;let n=S.loading(E(`feedbackForm.loading`));try{I(!0);let i=await r({user_id:k,feedback_content:e,feedback_screenshots:N.length?N:void 0,contact_info:t||void 0});if(i.code===0){M({content:``,contact:``}),P([]),O.push(`/settings`),S.success(E(`feedbackForm.submitsuccess`),{id:n});return}S.error(i.message||E(`feedbackForm.message`),{id:n})}catch(e){console.error(`提交反馈失败`,e),S.error(e.message||E(`feedbackForm.message`),{id:n})}finally{I(!1)}}return x(s,{className:e(`min-h-screen bg-bg2`,T),children:[b(h,{title:E(`feedbackForm.title`),className:`!bg-bg2`,rightChild:b(t,{onClick:W,disabled:F||L||z,children:E(F?`feedbackForm.loading`:`feedbackForm.submit`)})}),x(s,{className:`pb-3`,children:[x(f,{className:`bg-bg2 px-3 border-none`,children:[b(p,{required:!0,children:E(`feedbackForm.label`)}),x(c,{children:[b(d,{className:`!bg-bg1 p-2.5 rounded-md`,maxLength:500,placeholder:E(`feedbackForm.placeholder`),value:j.content,onChange:e=>B(`content`,e.target.value)}),b(l,{className:`!bg-bg1`,align:`block-end`,children:b(`div`,{className:`text-right w-full`,children:x(`span`,{className:`text-xs`,children:[j.content.length,`/500`]})})})]})]}),x(f,{className:`bg-bg2 px-3 border-none`,children:[b(p,{children:E(`feedbackForm.screenshotLabel`)}),b(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/jpeg,image/jpg,image/png,.jpg,.jpeg,.png`,className:`hidden`,onChange:H}),x(s,{className:`mt-2 grid grid-cols-3 gap-2`,children:[N.map((e,n)=>x(s,{className:`relative overflow-hidden rounded-lg border border-line1 !bg-bg1 aspect-square`,children:[b(o,{src:e,alt:E(`feedbackForm.alt`),fill:!0,className:`object-cover`}),b(t,{size:`icon-xs`,variant:`secondary`,className:`absolute right-1 top-1 rounded-full bg-bg1/85`,onClick:()=>U(n),"aria-label":E(`feedbackForm.delete`),children:b(y,{})})]},`${e}-${n}`)),N.length<3&&x(s,{className:`flex flex-col aspect-square items-center justify-center gap-2 rounded-lg border border-dashed border-text1/10 !bg-bg1 py-3 text-center`,onClick:V,children:[b(g,{}),b(m,{className:`text-xs text-text3`,children:E(L?`feedbackForm.uploading`:`feedbackForm.addScreenshot`)})]})]})]}),x(f,{className:`bg-bg2 px-3 border-none `,children:[b(p,{children:E(`feedbackForm.contactLabel`)}),b(c,{children:b(u,{className:`!bg-bg1 p-2.5 h-auto rounded-md`,placeholder:E(`feedbackForm.placeholder1_6d0242`),value:j.contact,onChange:e=>B(`contact`,e.target.value)})})]})]})]})}export{O as FeedbackForm};
|
|
@@ -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{useCallback as i,useEffect as a,useMemo as o}from"react";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";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{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";import{usePathname as d}from"next/navigation";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=u(`components.pages.fullscreenFeed`),O=d(),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?c(`div`,{className:`flex h-screen w-full items-center justify-center bg-black text-white/70`,children:D(`page.missingParams`)}):l(s,{children:[c(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&&c(r,{title:D(`page.episodeSelectorTitle`),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{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{gContentGetAppChannelBlock as e,gContentGetAppChannelBlockData as t,gContentListVisibleFloatingBall as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as o}from"../../../hooks/use-auth.mjs";import{queryKey as s}from"../../../constants/query-key.mjs";import{useKeepAliveState as c}from"../../common/keep-scroll-position/index.mjs";import{extractDataByComponentType as l}from"../../biz/utils/transformers/data.mjs";import{useEffect as u,useLayoutEffect as d,useMemo as f,useRef as p}from"react";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{useRouter as _}from"next/navigation";function v(){if(typeof document>`u`)return 0;let e=document.querySelector(`[data-top-nav-root="true"]`);return e&&e.getBoundingClientRect().height||0}function y({currentChannelId:y,isPGC:b}){let x=_(),S=o(),{data:C}=a(s.GET_CONTENT_LIST(y),()=>e({channel_id:y})),{data:w}=a([s.FLOATING_BALL],()=>n()),T=f(()=>C?.data?.blocks||[],[C?.data?.blocks]),E=f(()=>{let e=T.findIndex(e=>e.type===4),t=e>=0?T[e]:null;return{index:e,block:t,blockId:t?.id||``}},[T]),{data:D}=a([s.GUESS_YOU_LIKE_USER_DATA,E.blockId],()=>t({block_id:E.blockId}),{enabled:!!E.blockId}),O=f(()=>{if(E.index<0)return T;let e=D?.data.block?.data?.users||[];return T.map((t,n)=>n===E.index?{...t,data:{...t.data||{},users:e}}:t)},[T,D,E.index]),[k,A]=c(`home-scroll-top-${y}`,0),j=p({restored:!1,lastScrollTop:k,key:y,rafId:null}),M=p(A),N=p(k);u(()=>{M.current=A},[A]),u(()=>{N.current=k},[k]),u(()=>{j.current.key!==y&&(j.current.restored=!1,j.current.lastScrollTop=k,N.current=k,j.current.key=y)},[y,k]);let P=O.length>0;d(()=>{if(!P||j.current.restored||k<=0)return;let e=v(),t=Math.max(0,k+e);window.requestAnimationFrame(()=>{window.scrollTo({top:t}),j.current.restored=!0,j.current.lastScrollTop=t})},[P,y,k]),u(()=>{let e=j.current;function t(){e.restored=!0,e.rafId!==null&&window.cancelAnimationFrame(e.rafId),e.rafId=window.requestAnimationFrame(()=>{e.rafId=null;let t=window.scrollY??document.documentElement.scrollTop??0,n=v(),r=Math.max(0,t-n);Math.abs(t-e.lastScrollTop)>1&&(e.lastScrollTop=t,M.current(r))})}return window.addEventListener(`scroll`,t,{passive:!0}),()=>{e.rafId!==null&&(window.cancelAnimationFrame(e.rafId),e.rafId=null),window.removeEventListener(`scroll`,t)}},[y]);let F=f(()=>l(O,b),[O,b]),I=f(()=>w?.data?.ball_infos?.find(e=>e.channel_id===y),[w?.data?.ball_infos,y]);return g(m,{children:[I&&h(i,{className:`fixed right-[20px] bottom-[80px] w-[52px] h-[52px] z-30 rounded-[16px] cursor-move select-none bg-[#FD4C5E33] overflow-hidden`,onClick:()=>{S(()=>{I?.jump_url&&x.push(I.jump_url)})},children:h(r,{src:I.material_url||``,alt:I.name||``,fill:!0,priority:!0,fetchPriority:`high`,sizes:`52px`,unoptimized:!0})}),F.map(e=>{let t=e.component,n=e.data.block_id||`block-${e.data.title||``}`;return h(t,{data:e.data},n)})]})}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{useIsLoggedIn as t,useLoginModalOpen as n,useOpenLogin as r}from"../../../hooks/use-auth.mjs";import{useEffect as i,useRef as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useRouter as c}from"next/navigation";function l({children:l}){let u=t(),d=n(),f=r(),p=c(),m=a(null);return i(()=>{u||f()},[u,f]),i(()=>{let t=m.current;if(m.current=d,t===!0&&d===!1){let t=setTimeout(()=>{e.getState().isLogin||p.back()},0);return()=>clearTimeout(t)}},[d,p]),u?s(o,{children:l}):null}export{l as AuthGuard};
|
|
@@ -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 ae from"../../common/info-card/card-text.mjs";import{useCallback as oe,useEffect as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useSearchParams as se}from"next/navigation";import{useTranslations as S}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=S(`components.pages.postDetail`),k=se(),{isLogin:ue,userInfo:A,userId:de}=t(),j=de||A?.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 x(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[b(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:b(m,{data:{list:e(ye?.data)}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[L&&!$&&b(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&x(y,{children:[U&&b(h,{information:L,isVideo:!0}),x(`article`,{className:`w-full`,children:[b(ie,{infoData:L,rightChild:b(te,{information:L,onUpdate:Q})}),b(ae,{infoData:L,isEllipsis:!1}),!U&&b(`div`,{className:`mt-[12px]`,children:b(h,{information:L,isVideo:!1})})]}),b(ne,{information:L,onUpdate:Q}),x(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[x(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[b(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),x(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),b(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&&b(re,{information:L,initRecommendList:z})]}),!L&&b(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{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";import{useSearchParams as S}from"next/navigation";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=S(),{isLogin:ue,userInfo:A,userId:de}=t(),j=de||A?.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 x(`div`,{className:`w-full min-h-screen bg-bg2 text-text1 pt-11`,children:[b(`div`,{className:`fixed top-0 left-0 right-0 z-40`,children:b(m,{data:{list:e(ye?.data)}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[L&&!$&&b(s,{type:`no-content`,text:O(`postDetailClient.postOffline`)}),L&&$&&x(y,{children:[U&&b(h,{information:L,isVideo:!0}),x(`article`,{className:`w-full`,children:[b(ie,{infoData:L,rightChild:b(te,{information:L,onUpdate:Q})}),b(ae,{infoData:L,isEllipsis:!1}),!U&&b(`div`,{className:`mt-[12px]`,children:b(h,{information:L,isVideo:!1})})]}),b(ne,{information:L,onUpdate:Q}),x(`div`,{id:`detail-comments`,className:`w-full border-t-[8px] border-bg2 mt-[12px]`,children:[x(`div`,{className:`w-full px-[16px] h-[40px] flex items-center justify-between border-b-[1px] border-line1`,children:[b(`p`,{className:`text-[16px] text-text1 font-bold`,children:O(`postDetailClient.comment`)}),x(`p`,{className:`text-[12px] text-text3`,children:[ve,O(`postDetailClient.reactions`)]})]}),b(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&&b(re,{information:L,initRecommendList:z})]}),!L&&b(s,{type:`no-content`,text:O(`postDetailClient.postDeleted`)})]})})]})}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gCommunityGetUserCollections as e}from"../../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{gCommunityGetUserCollections as e}from"../../../../service/generated/client.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/legacy/button.mjs";import{useRequest as i}from"../../../../hooks/query/use-query.mjs";import a from"../../../../assets/icons/publish/publish_collection.mjs";import{CollectionCard as o}from"./collection-card.mjs";import{CollectionPopup as s}from"./collection-popup.mjs";import{useMemo as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useRouter as p}from"next/navigation";function m({active:m,setActive:h}){let g=f(`components.pages.publish.components`),[_,v]=l([]),[y,b]=l(!1),x=p(),{data:S=[]}=i([`publish`,`collection-list`,`preview`,3],async()=>(await e({page:1,page_size:3})).data?.data?.collections??[]);function C(e){v(t=>t.some(t=>t.collection_id===e.collection_id)?t:[e,...t]),h(e.collection_id??``)}let w=c(()=>{let e=new Set,t=[];for(let n of[..._,...S]){let r=n.collection_id??``;if(!(!r||e.has(r))&&(e.add(r),t.push(n),t.length>=3))break}return t},[_,S]);return d(t,{children:[d(t,{className:`flex justify-between items-center px-[16px] py-[12px]`,children:[u(n,{className:`text-[14px] text-text1`,children:g(`collection.syncToCollection`)}),u(r,{type:`button`,className:`!text-[12px] text-theme5 bg-[rgba(253,76,94,.1)] rounded-[20px] w-[64px] h-[24px] px-[8px] py-[4px]`,onClick:()=>b(!0),children:g(`collection.moreCollections`)})]}),d(t,{className:`flex gap-[8px] px-[16px] pb-[12px] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden`,children:[w.map(e=>u(o,{item:e,active:e.collection_id===m,onClick:()=>h(e.collection_id===m?``:e.collection_id??``)},e.collection_id)),d(r,{className:`flex w-[226px] h-[70px] shrink-0 items-center gap-[12px] rounded-[8px] px-[12px] py-[10px] bg-bg1`,onClick:()=>x.push(`/collection/create?type=publish`),children:[u(a,{width:52,height:52}),u(t,{className:`flex flex-1 flex-col overflow-hidden gap-[4px]`,children:u(n,{className:`text-[14px] text-text2 text-left`,children:g(`collection.createCollection`)})})]})]}),u(s,{open:y,onOpenChange:b,onSelect:C})]})}export{m as Collection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../../ui/button.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../ui/button.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../../assets/icons/close.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{useTranslations as a}from"next-intl";import{useRouter as o}from"next/navigation";function s({onPublish:s,isEmpty:c}){let l=a(`components.pages.publish.components`),u=o();return i(t,{className:`flex h-[60px] w-full items-center justify-between px-[16px]`,children:[r(e,{type:`button`,className:`p-3 text-text1 bg-transparent`,onClick:()=>u.back(),children:r(n,{className:`h-[16px] w-[16px]`})}),r(e,{className:`h-[32px] rounded-[8px] bg-linear-to-r from-[#FD4C5E] to-[#F05D19] px-[12px] text-[16px] text-white font-normal`,disabled:c,onClick:s,children:l(`header.publish`)})]})}export{s as PublishHeader};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../utils/cn.mjs";import{AlertDialog as t,AlertDialogAction as n,AlertDialogCancel as r,AlertDialogContent as ee,AlertDialogDescription as te,AlertDialogFooter as ne,AlertDialogHeader as re,AlertDialogTitle as
|
|
2
|
+
"use client";import{cn as e}from"../../../utils/cn.mjs";import{AlertDialog as t,AlertDialogAction as n,AlertDialogCancel as r,AlertDialogContent as ee,AlertDialogDescription as te,AlertDialogFooter as ne,AlertDialogHeader as re,AlertDialogTitle as ie}from"../../ui/alert-dialog.mjs";import{getAtUserElement as i}from"../../../utils/common.mjs";import ae from"../../../utils/event-bus.mjs";import{pCommunityPublishContent as oe}from"../../../service/generated/client.mjs";import{Box as se}from"../../ui/box.mjs";import{useKeyboardOpen as ce}from"../../../hooks/use-keyboard-open.mjs";import{eventKey as a}from"../../../constants/event-key.mjs";import{useMediaPreview as o}from"../../common/media-preview/index.mjs";import s from"../../ui/popup.mjs";import{UploadProgress as c}from"./components/upload-progress.mjs";import{ContactList as l}from"../../biz/business/contact/contact-list.mjs";import{Collection as u}from"./components/collection.mjs";import{MAX_MATERIAL_COUNT as d}from"./constants.mjs";import{filterAtUserNames as le}from"./utils/publish-utils.mjs";import{PublishEditor as ue}from"./components/editor.mjs";import{PublishHeader as de}from"./components/header.mjs";import{MaterialGrid as fe}from"./components/material-grid.mjs";import{Toolbar as pe}from"./components/toolbar.mjs";import{useFileUpload as me}from"./hooks/use-file-upload.mjs";import{useCallback as f,useEffect as he,useMemo as ge,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{toast as _}from"sonner";import{useTranslations as _e}from"next-intl";import{useRouter as v}from"next/navigation";function y({className:y}={}){let b=_e(`components.pages.publish`),ve=v(),x=p(null),[ye,S]=m(!1),[C,w]=m(`0`),{isOpen:T}=ce(),[E,D]=m(null),[O,k]=m([]),[A,j]=m(``),[M,N]=m(``),[P,F]=m(``),[I,L]=m(0),[be,R]=m(``),[z,B]=m(``),[xe,V]=m(0),[H,U]=m(``),[W,G]=m([]),[Se,K]=m(!1),[Ce,q]=m(!1),[we,Te]=m(``),J=p(null);he(()=>()=>{ae.emit(a.WAIT_LOADING_SHOW,{show:!1})},[]);let Y=f(e=>(Te(e),q(!0),new Promise(e=>{J.current=e})),[]),{selectFile:X}=me({onProgressUpdate:(e,t,n,r)=>{D(r>0?{currentFiles:e,totalFiles:t,currentTasks:n,totalTasks:r}:null)}}),Z=f(async()=>{if(A){if(!await Y(b(`pageClient.switchToPostConfirm`)))return;j(``),N(``),F(``),L(0),V(0),R(``),B(``)}if(O.length>=d){_.error(b(`pageClient.maxMaterialCount`));return}let e=await X(`material`,{maxMaterialCount:d-O.length});!e||e.type!==`material`||(e.errors.length>0&&_.error(e.errors.length===1?e.errors[0]:b(`pageClient.uploadFailedCount`,{count:e.errors.length})),e.items.length>0&&k(t=>[...t,...e.items].slice(0,d)))},[Y,O.length,X,B,N,F,k,R,L,V,j,b,A]),Ee=f(async()=>{if(O.length>0){if(!await Y(b(`pageClient.switchToVideoConfirm`)))return;k([])}let e=await X(`video`);!e||e.type!==`video`||(j(e.videoUrl),N(e.coverUrl),F(e.coverUrl),R(e.resolution),B(e.coverImageResolution),L(e.videoDuration),V(e.videoSize))},[Y,O.length,X,B,N,F,k,R,L,V,j,b]);function De(e){S(e)}function Oe(){S(!1)}let Q=ge(()=>(H.trim()===``||H.trim()===`<br>`)&&O.length===0&&!A,[H,O.length,A]),$=o(),ke=f(()=>{$.open(O.map(e=>({src:e.media_url,type:e.is_video?`video`:`image`,cover:e.cover_image})))},[O,$]),Ae=f(e=>{k(t=>t.filter((t,n)=>n!==e))},[k]),je=f(()=>{j(``),N(``),F(``),L(0),V(0),R(``),B(``)},[N,F,B,R,L,V,j]),Me=f(async()=>{let e=await X(`cover`);!e||e.type!==`cover`||(N(e.coverUrl),B(e.coverImageResolution))},[X,B,N]),Ne=f(e=>{S(!1),G(t=>[...t,e]),x.current?.restoreSelection();let t=`${i(e)} `;x.current?.insertHtml(t)},[G]),Pe=f(()=>{x.current?.saveSelection(),S(!0)},[]);return g(se,{className:e(`relative min-h-screen max-w-full bg-bg2 overflow-hidden flex flex-col`,y),children:[h(de,{onPublish:async()=>{if(!Se){K(!0);try{if(Q){_.error(b(`pageClient.editContentFirst`));return}let e=H;if(e=e.replace(/<br>/g,``),!e&&O.length===0&&!A){_.error(b(`pageClient.editContentFirst`));return}let t=le(e,W),n={content:e,mentioned_users:t,collection_ids:C===`0`?[]:[C]};O.length>0?(n.medias=O.map(e=>(delete e.index,e)),n.type=1):A?(n.medias=[{media_url:A,is_video:!0,cover_image:M,video_resolution:be,cover_image_resolution:z,video_duration:I,video_size:xe}],n.type=2):n.type=3,await oe(n),_.success(b(`pageClient.publishSuccess`)),k([]),j(``),N(``),F(``),L(0),V(0),R(``),B(``),U(``),G([]),w(`0`),ve.back()}catch(e){console.error(e),_.error(b(`pageClient.publishFailed`))}finally{K(!1)}}},isEmpty:Q}),h(ue,{ref:x,content:H,onContentChange:U,atUsers:W,onAtUsersChange:G}),E&&h(c,{currentFiles:E.currentFiles,totalFiles:E.totalFiles,currentTasks:E.currentTasks,totalTasks:E.totalTasks}),(O.length>0||A)&&h(fe,{materialList:O,videoUrl:A,videoDuration:I,coverUrl:M,originCoverUrl:P,isKeyboardOpen:T,onMaterialDelete:Ae,onVideoDelete:je,onMaterialAdd:Z,onCoverClick:Me,onPreview:ke}),h(pe,{isKeyboardOpen:T,onMaterialClick:()=>void Z(),onVideoClick:()=>void Ee(),onAtUserClick:Pe}),h(u,{active:C,setActive:w}),h(t,{open:Ce,onOpenChange:e=>{q(e),e||(J.current?.(!1),J.current=null)},children:g(ee,{children:[g(re,{children:[h(ie,{children:b(`pageClient.title`)}),h(te,{children:we})]}),g(ne,{children:[h(r,{onClick:()=>{q(!1),J.current?.(!1),J.current=null},children:b(`pageClient.cancel`)}),h(n,{onClick:()=>{q(!1),J.current?.(!0),J.current=null},children:b(`pageClient.resume`)})]})]})}),h(s,{open:ye,onOpenChange:De,showCloseButton:!1,className:`w-full rounded-[8px] bg-bg2`,children:h(l,{onSelect:Ne,onClose:Oe})})]})}export{y as PublishPageClient};
|
|
@@ -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{
|
|
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{Text as i}from"../../ui/text.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{eventKey as o}from"../../../constants/event-key.mjs";import{useSearchHistory as s}from"../../../hooks/use-search-history.mjs";import{SearchHistoryClient as c}from"../../biz/business/search-history/client.mjs";import l from"./hot-recommend.mjs";import u from"./hot-search.mjs";import d from"./search-result/index.mjs";import f from"./top-header.mjs";import{memo as p,useEffect as m,useMemo as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{useTranslations as b}from"next-intl";import{usePathname as x,useRouter as S,useSearchParams as C}from"next/navigation";const w=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],T=p(({searchType:e,onChange:t,tabList:n})=>v(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>v(i,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${e===n.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{e!==n.value&&t(n.value)},children:n.label},n.value))}));function E(){let i=b(`components.pages.search.pageClient`),{userInfo:p}=n(),E=p?.user_id||`guest`,D=C(),O=x(),k=S(),A=D.get(`q`)?.toString()||``,{data:j,refetch:M}=a([`hotSearchKey`],()=>r({user_id:E})),N=h(()=>j?.data?.recommend_list??[],[j]),[P,F]=g(A),I=h(()=>w.map(e=>({value:e.value,label:i(e.labelKey)})),[i]),[L,R]=g(A),[z,B]=g(0),[V,H]=g(w[0].value),[,U]=g([]),{history:W,addHistory:G}=s({storageKey:E}),K=h(()=>P.trim()===``?N.length>0||W.length>0||P.trim()===``:!1,[N,P,W]),q=h(()=>P.trim()!==``&&!K,[P,K]);return m(()=>(t.on(o.EXCHANGE_SEARCH_TYPE,H),()=>{t.off(o.EXCHANGE_SEARCH_TYPE,H)}),[H]),y(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[v(f,{setSearchInputVal:t=>{t!==P&&(U([]),F(t),e({q:t}))},initInputVal:L,initInputVersion:z,addSearchHistory:G}),K&&y(`div`,{className:`w-full pt-[8px]`,children:[W.length>0&&v(c,{title:i(`searchHistory`),rows:2,storageKey:E,onHistoryClick:e=>{R(e),B(e=>e+1);let t=new URLSearchParams(D.toString());t.set(`q`,e),k.push(`${O}?${t.toString()}`)}}),v(u,{initHotSearchKeywordList:N,onRefreshHotKey:async()=>(await M()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{R(e.title||``),B(e=>e+1),G(e.title)}})]}),v(l,{isShow:P.trim()===``}),q&&y(_,{children:[v(T,{searchType:V,tabList:I,onChange:e=>{H(e),U([])}}),v(d,{inputVal:P,searchType:V},`${V}-${P}`)]})]})}export{E as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Input as e}from"../../ui/input.mjs";import{useKeepAliveEffect as t,useKeepAliveState as n}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as r}from"../../../utils/tools.mjs";import{HeaderNav as i}from"../../common/header-nav/client.mjs";import a from"../../../assets/icons/search.mjs";import o from"../../../assets/icons/clear.mjs";import s from"./style.module.mjs";import{memo as c,useCallback as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{
|
|
2
|
+
"use client";import{Input as e}from"../../ui/input.mjs";import{useKeepAliveEffect as t,useKeepAliveState as n}from"../../common/keep-scroll-position/index.mjs";import{isPCEnv as r}from"../../../utils/tools.mjs";import{HeaderNav as i}from"../../common/header-nav/client.mjs";import a from"../../../assets/icons/search.mjs";import o from"../../../assets/icons/clear.mjs";import s from"./style.module.mjs";import{memo as c,useCallback as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useTranslations as f}from"next-intl";import{useSearchParams as p}from"next/navigation";function m(){}const h=c(({setSearchInputVal:c,initInputVal:h,initInputVersion:g,addSearchHistory:_,clearCallback:v=m})=>{let y=f(`components.pages.search`),[b,x]=n(`search-input-val`,``),S=p().get(`q`),C=e=>{let t=e.target.value;x(t)},w=l(e=>{c(e),_(e)},[_,c]);return t(()=>{h&&(x(h),w(h))},[h,g],`search-init-input-effect`),t(()=>{S&&(x(S),w(S))},[S],`search-url-params-effect`),u(i,{className:`h-[55px]`,rightChild:u(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>{b&&w(b)},children:u(`span`,{className:`text-[16px] text-text1`,children:y(`topHeader.search`)})}),centerChild:d(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[u(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),u(a,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),u(e,{placeholder:y(`topHeader.placeholder`),maxLength:20,value:b,className:s.searchInput,onChange:C,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!b)return;w(b)}}}),b&&u(o,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px]`,onClick:()=>{r()||(x(``),c(``),v())}})]})})});export{h 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{
|
|
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{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useRouter as v,useSearchParams as y}from"next/navigation";const b=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function x(){let x=v(),{userInfo:S}=n(),C=S?.user_id||`guest`,w=y().get(`q`)?.toString()||``,[T,E]=m(w),[D,O]=m(0);f(()=>{E(w),O(e=>e+1)},[w]);let[k,A]=m(b[0].value),[j,M]=m(u[0].value),[N,P]=m(0),[,F]=m([]),{addHistory:I}=a({storageKey:C}),L=p(()=>T.trim()!==``,[T]);f(()=>(t.on(i.EXCHANGE_SEARCH_TYPE,A),()=>{t.off(i.EXCHANGE_SEARCH_TYPE,A)}),[A]);function R(){x.back()}return _(r,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[g(o,{setSearchInputVal:t=>{t!==T&&(F([]),E(t),e({q:t}))},initInputVal:w,initInputVersion:D,addSearchHistory:I,clearCallback:R}),g(d,{searchType:k,tabList:b,onChange:e=>{A(e),F([])},sort:j,onSortChange:e=>{M(e),P(e=>e+1)}}),L&&_(h,{children:[k===`user`&&g(s,{mode:`user`,inputVal:T,sort:j,refreshVersion:N}),k===`all`&&g(l,{searchInputVal:T,sort:j,refreshVersion:N}),k===`video`&&g(c,{mode:`video`,inputVal:T,sort:j,refreshVersion:N})]}),!L&&g(r,{className:`w-full pt-[12px]`})]})}export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as r}from"../../../../service/generated/client.mjs";import{Box as i}from"../../../ui/box.mjs";import{List as a}from"../../../ui/list.mjs";import{useLoginModalStore as o}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as s,useRequest as c}from"../../../../hooks/query/use-query.mjs";import{locales as l}from"../../../../i18n.mjs";import{DeleteConfirmDialog as u}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as d}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as f}from"./reset-password-drawer.mjs";import{useEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as r}from"../../../../service/generated/client.mjs";import{Box as i}from"../../../ui/box.mjs";import{List as a}from"../../../ui/list.mjs";import{useLoginModalStore as o}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as s,useRequest as c}from"../../../../hooks/query/use-query.mjs";import{locales as l}from"../../../../i18n.mjs";import{DeleteConfirmDialog as u}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{HeaderNav as d}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as f}from"./reset-password-drawer.mjs";import{useEffect as p,useRef as m,useState as h}from"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";import{useRouter as x}from"next/navigation";function S(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 C({className:C}={}){let w=y(`components.pages.settings.components`),T=v(),{open:E}=o(),D=n(e=>e.isLogin),O=n(e=>e.token),k=n(e=>e.logout),A=n(e=>e.userId),j=(D||!!O)&&!!A,M=S(),[N,P]=h(M),F=m(M),[I,L]=h(!1),[R,z]=h(!1);s();let B=[`user-privacy-settings`,A],V=T===`zh-CN`?`en`:`zh-CN`;l.find(e=>e.code===V)?.name;let{data:H}=c(B,()=>r({user_id:A}),{enabled:!!A}),U=H?.data;p(()=>{if(!U)return;let e=S(U);P(e),F.current=e},[U]),p(()=>{F.current=N},[N]);let W=s(),G=x();function K(){W([`user-profile`,`mine`]),k(),G.push(`/user/mine`),setTimeout(()=>{window.location.reload()},250)}function q(e){z(e)}function J(){z(!0)}function Y(){z(!1)}function X(){K()}function Z(e){L(e)}function Q(){if(!j){E();return}L(!0)}function $(e){j||(e.preventDefault(),e.stopPropagation(),E())}return _(i,{className:e(C),children:[g(d,{className:`!bg-bg2`,title:w(`settings.title`)}),g(f,{open:I,onOpenChange:Z}),_(i,{className:`flex flex-col gap-2 `,children:[g(a,{className:`bg-bg2 py-2`,children:g(b,{href:`/feedback`,onClick:$,children:g(a.Item,{title:w(`settings.feedbackTitle`),arrow:!0})})}),g(a,{className:`bg-bg2 py-2`,children:g(a.Item,{title:w(`settings.resetPasswordTitle`),arrow:!0,onClick:Q})})]}),I||!j?null:g(i,{className:`fixed bottom-0 w-full left-0`,children:g(t,{className:`h-auto text-base py-4 w-full`,variant:`secondary`,onClick:J,children:w(`settings.button`)})}),g(u,{open:R,onOpenChange:q,onCancel:Y,onConfirm:X,title:``,description:w(`settings.logoutConfirmMessage`),confirmText:w(`settings.confirm`),cancelText:w(`settings.cancel`)})]})}export{C 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{
|
|
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{EmptyState as i}from"../../ui/empty.mjs";import{notifyBridgeEpisodeChanged as ee}from"../../../utils/login-modal-bridge.mjs";import{useRequest as a}from"../../../hooks/query/use-query.mjs";import{queryKey as o}from"../../../constants/query-key.mjs";import{useKeepAliveEffect as s,useKeepAliveState as c}from"../../common/keep-scroll-position/index.mjs";import{apiCollectClick as l}from"../../../utils/api-collect.mjs";import u from"../../biz/business/search-bar/variants/detail-search-bar/index.mjs";import{VideoDetailMaterialRuntimeProvider as d}from"../../biz/business/detail/shared/runtime-context-provider.mjs";import{useVideoDetailWebViewBridge as f}from"../../biz/business/detail/shared/use-video-detail-webview-bridge.mjs";import{resolveMaterialProps as p,videoDetailMaterials as m}from"../../biz/business/detail/shared/registry.mjs";import{DetailHero as h}from"../../biz/business/detail/shared/video-hero.mjs";import{Fragment as te,useCallback as g,useEffect as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import{useTranslations as ne}from"next-intl";import{useParams as re,useRouter as ie,useSearchParams as ae}from"next/navigation";const S=[{id:`detail-info`,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:l,initialInformation:w,isWebView:T=!1,materialConfig:E}){let D=ne(`components.pages.videoDetail`),O=ie(),oe=re(),se=ae(),k=oe.level,A=Array.isArray(k)?k:typeof k==`string`?[k]:[],j=A.findIndex(e=>e===`episode`),ce=j>=0?A[j+1]:A[2],M=Math.max(1,Number(ce)||1),[le,N]=c(`detail-current-series-num-${l}`,M);_(()=>{N(M)},[M,N]);let P=Math.max(1,Number(le)||1),F=Math.max(0,P-1),{data:I,isPending:L,isFetching:R,isError:z,isSuccess:B}=a(v(()=>[`video-detail`,l],[l]),async()=>l?await r({id:l}):null,{enabled:!!l}),V=v(()=>{let e=I?.data?.video;return!e||typeof e!=`object`?null:{...e,content_type:1,episode_cnt:e.links?.length||0}},[I?.data?.video]),H=w??V??null,[U,W]=c(`detail-information-${l}`,H),ue=U?.links?.[F]?.id||``,G=!!l&&!U&&(L||R),K=!l||!!U||z||B,[de,fe]=c(`info-detail-active-tab-${l}`,`video`),[q,J]=c(`info-detail-comment-add-count-${l}`,0),[Y,pe]=c(`info-detail-comment-total-${l}`,void 0);_(()=>{!U&&V&&W(V)},[U,V,W]),f({detailId:l,information:U,episodeIndex:F,currentSeriesNum:P});let X=g(e=>{W(t=>t&&{...t,...e})},[W]);s(()=>{U?.id&&U.id},[U?.id],`detail-page-report-${l}`),_(()=>{!U||typeof window>`u`||window.sensors?.track?.(`detail_page_view`,{object_id:U.id||l,author_id:U.up_user,object_type:U.content_type,object_category:U.content_type,object_tags:U.tags?.map(e=>e.name),block_id:``,page_source:window.location?.pathname||``})},[l,U]),_(()=>{J(0)},[ue,J]),v(()=>(typeof Y==`number`?Y:0)+q,[q,Y]);let me=g(()=>{},[!1,fe]);g(()=>{J(e=>e+1)},[J]),_(()=>{},[!1,me,U?.id,se]);let Z=g(e=>{let t=Math.max(1,Math.floor(Number(e)||1));if(typeof window>`u`)return;let n=String(U?.id||l||``).trim();if(!n)return;let r=encodeURIComponent(U?.name||``),i=`${T?`/webview`:`/video`}/${n}/${r}/episode/${t}`,{search:a,hash:o,pathname:s}=window.location,c=`${i}${a}${o}`,u=`${s}${a}${o}`,d=C(s,n);if(u!==c){T&&ee({detailId:n,seriesNum:t,nextPath:i}),d&&typeof window.history?.replaceState==`function`?(window.history.replaceState(window.history.state,``,c),N(t)):O.replace(c,{scroll:!1});return}P!==t&&N(t)},[P,l,U?.id,U?.name,T,O,N]),Q=U?.status===`1`,{data:he}=a([o.CHANNEL],()=>n()),ge=e(he?.data),$=v(()=>{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]),_e=v(()=>({information:U??void 0,currentSeriesNum:P,onEpisodeChange:Z,onUpdateInformation:X,detailId:l,episodeIndex:F,isShow:!0,isWebView:T,isInformationLoading:G,isInformationResolved:K}),[P,l,F,Z,X,U,G,K,T,!0]),ve=g(e=>{if(!U)return null;let t=m[e.componentName];if(!t)return null;let n=t.clientComponent,r=p(t,e.props);return r.isValid?b(n,{...r.props}):b(`div`,{children:`组件配置错误`})},[U]);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(u,{data:{list:ge}})}),b(`div`,{className:`mx-auto w-full max-w-[840px] pb-6`,children:x(y,{children:[U&&!Q&&b(i,{type:`no-content`,text:D(`videoDetailClient.videoUnavailable`)}),U&&Q&&x(y,{children:[!T&&b(h,{isVideo:!0,information:U,episodeIndex:F}),b(`div`,{id:`selectPopupPosition`,className:`w-full`}),!1,x(`div`,{className:t(`w-full`,!1),children:[b(d,{value:_e,children:$.map(e=>b(te,{children:ve(e)},e.id))}),!1]}),!1]}),!U&&b(i,{type:`no-content`,text:D(`videoDetailClient.videoDeleted`)})]})})]})}export{w as default};
|