@funhub/platform 0.1.25 → 0.1.27
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/README.md +5 -0
- package/dist/biz.d.mts +11 -5
- package/dist/biz.mjs +1 -1
- package/dist/common.d.mts +2 -1
- package/dist/common.mjs +1 -1
- package/dist/components/biz/business/comment/comment-list.mjs +1 -1
- package/dist/components/biz/business/comment/reply-detail.mjs +1 -1
- package/dist/components/biz/business/contact/contact-list.mjs +1 -1
- package/dist/components/biz/business/detail/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-actions/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/material.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.mjs +1 -1
- package/dist/components/biz/business/home-recommend/index.d.mts +6 -0
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.d.mts +4 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.d.mts +18 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/inspector-schema.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +14 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/component.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/schema/props.schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.d.mts +17 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/server.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.d.mts +4 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/index.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.d.mts +18 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/inspector-schema.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +14 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs +2 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/component.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/schema/props.schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.d.mts +17 -0
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/server.mjs +2 -0
- package/dist/components/biz/business/index.d.mts +11 -5
- package/dist/components/biz/business/index.mjs +1 -1
- package/dist/components/biz/business/marquee/client.d.mts +2 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/material.d.mts +5 -3
- package/dist/components/biz/business/marquee/material.mjs +1 -1
- package/dist/components/biz/business/marquee/schema.d.mts +10 -6
- package/dist/components/biz/business/marquee/schema.mjs +1 -1
- package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/{search-history2 → search-history}/client.d.mts +6 -5
- package/dist/components/biz/business/search-history/client.mjs +2 -0
- package/dist/components/biz/business/search-history/index.d.mts +5 -0
- package/dist/components/biz/business/{search-history2 → search-history}/material.d.mts +4 -4
- package/dist/components/biz/business/search-history/material.mjs +2 -0
- package/dist/components/biz/business/{search-history2 → search-history}/schema.d.mts +9 -6
- package/dist/components/biz/business/{search-history2 → search-history}/schema.mjs +1 -1
- package/dist/components/biz/business/{search-history2 → search-history}/server.d.mts +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-input/material.mjs +1 -1
- package/dist/components/biz/business/tab-bar/material.mjs +1 -1
- package/dist/components/biz/business/text-recommend/material.mjs +1 -1
- package/dist/components/biz/business/video-horizontal-list/material.mjs +1 -1
- package/dist/components/biz/example/button/client.mjs +1 -1
- package/dist/components/common/collection-popup/collection-create-modal.mjs +1 -1
- package/dist/components/common/funhub-provider/funhub-provider.d.mts +4 -0
- package/dist/components/common/funhub-provider/funhub-provider.mjs +1 -1
- package/dist/components/common/intl-provider/index.d.mts +2 -0
- package/dist/components/common/{intl-provider.d.mts → intl-provider/intl-provider.d.mts} +1 -1
- package/dist/components/common/intl-provider/intl-provider.mjs +2 -0
- package/dist/components/common/media-preview/index.mjs +1 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/share-popup/share-popup.mjs +1 -1
- package/dist/components/pages/(follow)/fans/page.mjs +1 -1
- package/dist/components/pages/(follow)/followed/page.mjs +1 -1
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/feed-series/feed-series-client.mjs +1 -1
- package/dist/components/pages/feed-series/page.mjs +1 -1
- package/dist/components/pages/login/index.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/history-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/like-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/tabs/publish-tab/client.mjs +1 -1
- package/dist/components/pages/profile/_components/user-profile-header/client.mjs +1 -1
- package/dist/components/pages/publish/components/collection-popup.mjs +1 -1
- package/dist/components/pages/publish/components/collection.mjs +1 -1
- package/dist/components/pages/publish/page-client.mjs +1 -1
- package/dist/components/pages/search/hot-recommend.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/pages/user-follow/_components/follow-no-login.mjs +1 -1
- package/dist/components/pages/user-follow/page.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/hooks/use-search-history.d.mts +19 -0
- package/dist/hooks/use-search-history.mjs +2 -0
- package/dist/hooks.d.mts +2 -1
- package/dist/hooks.mjs +1 -1
- package/dist/materials.d.mts +3 -2
- package/dist/materials.mjs +1 -1
- package/dist/utils/share-manager.mjs +1 -1
- package/package.json +1 -1
- package/dist/components/biz/business/search-history/index.mjs +0 -2
- package/dist/components/biz/business/search-history/use-search-history.mjs +0 -2
- package/dist/components/biz/business/search-history2/client.mjs +0 -2
- package/dist/components/biz/business/search-history2/index.d.mts +0 -5
- package/dist/components/biz/business/search-history2/material.mjs +0 -2
- package/dist/components/common/intl-provider.mjs +0 -2
- /package/dist/components/biz/business/{search-history2 → search-history}/server.mjs +0 -0
|
@@ -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{Text as i}from"../../ui/text.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{useSearchHistory as o}from"../../../hooks/use-search-history.mjs";import{SearchHistory2Server as s}from"../../biz/business/search-history/server.mjs";import{eventKey as c}from"../../../constants/event-key.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{useSearchParams as p}from"next/navigation";import{memo as m,useEffect as h,useMemo as g,useState as _}from"react";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{useTranslations as x}from"next-intl";const S=[{labelKey:`tabs.all`,value:`all`},{labelKey:`tabs.video`,value:`video`},{labelKey:`tabs.post`,value:`info`},{labelKey:`tabs.user`,value:`user`}],C=m(({searchType:e,onChange:t,tabList:n})=>y(`nav`,{className:`w-full h-[42px] bg-bg1 flex items-center px-[3px] sticky top-[53px] left-0 z-50`,children:n.map(n=>y(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 w(){let i=x(`components.pages.search.pageClient`),{userInfo:m}=n(),w=m?.user_id||`guest`,T=p().get(`q`)?.toString()||``,E=T?decodeURIComponent(T):``,{data:D,refetch:O}=a([`hotSearchKey`],()=>r({user_id:w})),k=g(()=>D?.data?.recommend_list??[],[D]),[A,j]=_(E),M=g(()=>S.map(e=>({value:e.value,label:i(e.labelKey)})),[i]),[N,P]=_(E),[F,I]=_(0),[L,R]=_(S[0].value),[,z]=_([]),{history:B,addHistory:V}=o({storageKey:w}),H=g(()=>A.trim()===``?k.length>0||B.length>0||A.trim()===``:!1,[k,A,B]),U=g(()=>A.trim()!==``&&!H,[A,H]);return h(()=>(t.on(c.EXCHANGE_SEARCH_TYPE,R),()=>{t.off(c.EXCHANGE_SEARCH_TYPE,R)}),[R]),b(`div`,{className:`w-full min-h-screen bg-bg1 pb-[12px]`,children:[y(f,{setSearchInputVal:t=>{t!==A&&(z([]),j(t),e({q:t}))},initInputVal:N,initInputVersion:F,addSearchHistory:V}),H&&b(`div`,{className:`w-full pt-[8px]`,children:[B.length>0&&y(s,{title:i(`searchHistory`),rows:`2`,onHistoryClick:e=>{P(e),I(e=>e+1)}}),y(u,{initHotSearchKeywordList:k,onRefreshHotKey:async()=>(await O()).data??{code:0,message:``,data:{recommend_list:[]}},onClick:e=>{P(e.title||``),I(e=>e+1)}})]}),y(l,{isShow:A.trim()===``}),U&&b(v,{children:[y(C,{searchType:L,tabList:M,onChange:e=>{R(e),z([])}}),y(d,{inputVal:A,searchType:L},`${L}-${A}`)]})]})}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{EmptyState as r}from"../../../ui/empty.mjs";import{
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../../service/generated/client.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{EmptyState as r}from"../../../ui/empty.mjs";import{usePaginated as i,useRefetchQuery as a,useUpdateRequest as o}from"../../../../hooks/query/use-query.mjs";import{getPostDetailPagePath as s}from"../../../../utils/tools.mjs";import{UserActivityList as c}from"../../../common/list/user-activity-list/user-activity-list.mjs";import{apiCollectCustom as l}from"../../../../utils/api-collect.mjs";import{VideoListItemSkeleton as u}from"../../../common/skeleton/video-list-item-skeleton.mjs";import{useCardDecoration as d}from"../../../../hooks/use-card-decoration.mjs";import f from"../../../ui/rate.mjs";import{mapRecommendContentToUserActivityItem as p}from"../search-utils.mjs";import{memo as m,useCallback as h,useMemo as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useTranslations as y}from"next-intl";import b from"next/link";const x=m(()=>_(n,{className:`w-full px-[12px] pt-[12px]`,children:Array.from({length:3}).map((e,t)=>_(u,{},`search-video-skeleton-${t}`))}));x.displayName=`SearchVideoListSkeleton`;const S=m(({item:e})=>{let{getCalculationScore:r}=d();return v(b,{className:`w-full flex items-center justify-between mb-[12px] pb-[12px] border-b border-line1 cursor-pointer px-[12px]`,href:s({id:e.video_id,contentType:0}),onClick:()=>{e.video_id},children:[_(n,{className:`w-[76px] h-[102px] shrink-0 rounded-[8px] overflow-hidden relative bg-bg2`,children:_(t,{src:e.img_y||e.img_x||``,fill:!0,objectFit:`cover`,alt:e.name||``})}),v(n,{className:`flex-1 min-w-0 flex flex-col ml-[12px]`,children:[_(`span`,{className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name||``}),v(n,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[_(f,{allowHalf:!0,value:r({score:String(e.score??0)})}),_(`span`,{className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),v(n,{className:`w-full mt-[4px] flex items-center shrink-0 pr-[12px]`,children:[_(n,{className:`w-fit h-[20px] leading-[20px] px-[6px] text-text3 text-[12px] bg-line1 rounded-[4px] shrink-0 mr-[10px]`,children:e.group_name}),_(`span`,{className:`text-text2 text-[14px] leading-[22px] flex-1 min-w-0 line-clamp-1`,children:e.description})]})]})]})});S.displayName=`VideoItem`;const C=m(({list:e})=>_(n,{className:`w-full px-[12px] pt-[12px]`,children:e.map((e,t)=>_(S,{item:e},String(e.video_id??t)))}));C.displayName=`VideoList`;const w=m(({list:e,onUpdate:t,onActionSuccess:n})=>{let r=h(n=>{let r=e.findIndex(e=>e.content_id===n.content_id);if(r!==-1){let i=[...e];i[r]=n,t(i)}},[e,t]);return _(c,{list:g(()=>e.map(e=>({...p(e),onLikeSuccess(t){r({...e,like_count:String(t.count),dislike_count:t.dislikeCount===void 0?e.dislike_count:String(t.dislikeCount),interaction:{...e.interaction,is_liked:t.isLiked,is_dislike:t.isDisliked??e.interaction?.is_dislike}})},onDislikeSuccess(t){r({...e,like_count:t.likeCount===void 0?e.like_count:String(t.likeCount),dislike_count:String(t.count),interaction:{...e.interaction,is_dislike:t.isDisliked,is_liked:t.isLiked??e.interaction?.is_liked}})}})),[r,e]),showGroupHeaders:!1,onActionSuccess:n})});w.displayName=`InfoList`;const T=m(({searchType:t,inputVal:s})=>{let l=y(`components.pages.search.searchResult`),u=h(async n=>await e({data_type:2,extra_params:JSON.stringify({type:t===`video`?3:2,keywords:s}),page:n||1,page_size:20}),[s,20,t]),d=g(()=>[`searchByKeyForVideoInfo`,s,t===`video`?3:2],[s,t]),f=i({key:d,initialPageParam:1,async queryFn(e){let n=await u(e);return(t===`video`?n?.data?.videos:n?.data?.contents)??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),m=g(()=>{let e=f.data?.pages??[],t=[];for(let n of e){let e=n.list??[];t.push(...e)}return t},[f.data?.pages]),v=g(()=>m,[m,t]),b=o(),S=a(),w=h(e=>{b(d,t=>{if(!t)return t;let n=t.pages.map(t=>({...t,list:(t.list??[]).map(t=>t.content_id===e.content_id?e:t)}));return{...t,pages:n}})},[d,b]),T=h(()=>{S(d)},[d,S]),E=h(e=>({...p(e),onLikeSuccess(t){w({...e,like_count:String(t.count),dislike_count:t.dislikeCount===void 0?e.dislike_count:String(t.dislikeCount),interaction:{...e.interaction,is_liked:t.isLiked,is_dislike:t.isDisliked??e.interaction?.is_dislike}})},onDislikeSuccess(t){w({...e,like_count:t.likeCount===void 0?e.like_count:String(t.likeCount),dislike_count:String(t.count),interaction:{...e.interaction,is_dislike:t.isDisliked,is_liked:t.isLiked??e.interaction?.is_liked}})}}),[w]),D=g(()=>v.map(E),[E,v]),O=f.isPending||f.isFetching,k=t===`video`&&O&&v.length===0;return _(n,{className:`w-full`,children:t===`video`?k?_(x,{}):v.length>0?_(C,{list:v}):_(r,{type:`no-content`,text:l(`searchVideoInfo.noRelevantContent`),className:`mt-[12px]`}):_(c,{list:D,loading:O,hasMore:f.hasNextPage??!1,loadMore:async e=>{if(e!==!1)try{f&&await f.fetchNextPage()}catch(e){console.error(`获取内容列表失败`,e)}},showGroupHeaders:!1,emptyText:l(`searchVideoInfo.noRelevantContent`),onActionSuccess:T})})});T.displayName=`SearchInfoOrVideoList`;export{C as VideoList,T as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../assets/icons/clear.mjs";import{Input as t}from"../../ui/input.mjs";import n from"
|
|
2
|
+
"use client";import e from"../../../assets/icons/clear.mjs";import{Input as t}from"../../ui/input.mjs";import{useKeepAliveEffect as n,useKeepAliveState as r}from"../../common/keep-scroll-position/index.mjs";import i from"../../../assets/icons/search.mjs";import{isPCEnv as a}from"../../../utils/tools.mjs";import{HeaderNav as o}from"../../common/header-nav/client.mjs";import s from"./style.module.mjs";import{useSearchParams as c}from"next/navigation";import{memo as l,useCallback as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";const m=l(({setSearchInputVal:l,initInputVal:m,initInputVersion:h,addSearchHistory:g})=>{let _=p(`components.pages.search`),[v,y]=r(`search-input-val`,``),b=c().get(`q`),x=e=>{let t=e.target.value;y(t)},S=u(e=>{l(e),g(e)},[g,l]);return n(()=>{m&&(y(m),S(m))},[m,h],`search-init-input-effect`),n(()=>{b&&(y(b),S(b))},[b],`search-url-params-effect`),d(o,{className:`h-[55px]`,rightChild:d(`div`,{className:`cursor-pointer w-[52px] flex items-center justify-center`,onClick:()=>{v&&S(v)},children:d(`span`,{className:`text-[16px] text-text1`,children:_(`topHeader.search`)})}),centerChild:f(`header`,{className:`w-[calc(100%-52px-48px)] ml-[-15px] h-[35px] rounded-[20px] flex items-center justify-center relative overflow-hidden border-line1 border-[1px]`,children:[d(`div`,{className:`absolute left-0 top-0 w-full h-full bg-bg2 opacity-50`}),d(i,{className:`w-[16px] h-[16px] text-text3 absolute left-[12px] top-[9px] z-[1]`}),d(t,{placeholder:_(`topHeader.placeholder`),maxLength:20,value:v,className:s.searchInput,onChange:x,onKeyDown:e=>{if(e.key===`Enter`){if(e.preventDefault(),!v)return;S(v)}}}),v&&d(e,{className:`w-[15px] h-[15px] text-text3 z-10 absolute right-[12px]`,onClick:()=>{a()||(y(``),l(``))}})]})})});export{m 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{AlertDialog as n,AlertDialogAction as r,AlertDialogCancel as i,AlertDialogContent as a,AlertDialogDescription as ee,AlertDialogFooter as o,AlertDialogHeader as s}from"../../../ui/alert-dialog.mjs";import{useUserStore as c}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as l,pUserUserPrivacySettings as u}from"../../../../service/generated/client.mjs";import{Box as d}from"../../../ui/box.mjs";import{List as f}from"../../../ui/list.mjs";import{Switch as p}from"../../../ui/switch.mjs";import{
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{AlertDialog as n,AlertDialogAction as r,AlertDialogCancel as i,AlertDialogContent as a,AlertDialogDescription as ee,AlertDialogFooter as o,AlertDialogHeader as s}from"../../../ui/alert-dialog.mjs";import{useUserStore as c}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as l,pUserUserPrivacySettings as u}from"../../../../service/generated/client.mjs";import{Box as d}from"../../../ui/box.mjs";import{List as f}from"../../../ui/list.mjs";import{Switch as p}from"../../../ui/switch.mjs";import{useDeleteRequest as m,useRequest as h}from"../../../../hooks/query/use-query.mjs";import{useLoginModalStore as g}from"../../../../store/modules/login-modal-store.mjs";import{locales as _,persistLocalePreference as v}from"../../../../i18n.mjs";import{HeaderNav as y}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as b}from"./reset-password-drawer.mjs";import{useEffect as x,useRef as S,useState as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{useLocale as te,useTranslations as E}from"next-intl";import ne from"next/link";function D(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 O(e){return{collections_open:e.collection?1:0,follower_open:e.follower?1:0,following_open:e.following?1:0,like_open:e.like?1:0}}function k({className:k}={}){let A=E(`components.pages.settings.components`),j=te(),{open:M}=g(),N=c(e=>e.isLogin),P=c(e=>e.token),F=c(e=>e.logout),I=c(e=>e.userId),L=(N||!!P)&&!!I,R=D(),[z,B]=C(R),V=S(R),[H,U]=C(!1),[W,G]=C(!1),K=m(),q=[`user-privacy-settings`,I],J=j===`zh-CN`?`en`:`zh-CN`,Y=_.find(e=>e.code===J)?.name||J,{data:X}=h(q,()=>l({user_id:I}),{enabled:!!I}),Z=X?.data;x(()=>{if(!Z)return;let e=D(Z);B(e),V.current=e},[Z]),x(()=>{V.current=z},[z]);async function re(e){let t=await u({user_id:I,...O(e)});if(t.code!==0)throw Error(t.message||`隐私设置更新失败`);K(q)}async function Q(e,t){let n=V.current,r={...n,[e]:t};B(r);try{await re(r)}catch(e){console.error(`update settings failed:`,e),B(n)}}let ie=m();function ae(){ie([`user-profile`,`mine`]),F(),window.location.href=`/user/mine`}function oe(e){G(e)}function se(){G(!0)}function ce(){G(!1)}function le(){G(!1),ae()}function $(e){U(e)}function ue(){if(!L){M();return}U(!0)}function de(e){L||(e.preventDefault(),e.stopPropagation(),M())}function fe(){v(J),window.location.reload()}function pe(e){Q(`collection`,e)}function me(e){Q(`like`,e)}function he(e){Q(`following`,e)}function ge(e){Q(`follower`,e)}return T(d,{className:e(k),children:[w(y,{className:`!bg-bg2`,title:A(`settings.title`)}),w(b,{open:H,onOpenChange:$}),T(d,{className:`flex flex-col gap-2 `,children:[w(f,{className:`bg-bg2 py-2`,children:w(ne,{href:`/feedback`,onClick:de,children:w(f.Item,{title:A(`settings.feedbackTitle`),arrow:!0})})}),w(f,{className:`bg-bg2 py-2`,children:w(f.Item,{title:A(`settings.resetPasswordTitle`),arrow:!0,onClick:ue})}),w(f,{className:`bg-bg2 py-2`,children:w(f.Item,{title:A(`settings.languageTitle`),extra:T(t,{size:`sm`,variant:`outline`,onClick:fe,children:[A(`settings.switchTo`),` `,Y]})})}),L?T(f,{className:`bg-bg2 py-2`,children:[w(f.Item,{title:A(`settings.privacySettingsTitle`),extra:T(`span`,{className:`text-xs`,children:[A(`settings.whenOff`),`,`,A(`settings.listPrivateHint`)]})}),w(f.Item,{className:`pl-8 mt-2`,title:A(`settings.collectionsTitle`),extra:w(p,{checked:z.collection,onCheckedChange:pe})}),w(f.Item,{className:`pl-8`,title:A(`settings.like`),extra:w(p,{checked:z.like,onCheckedChange:me})}),w(f.Item,{className:`pl-8`,title:A(`settings.follow`),extra:w(p,{checked:z.following,onCheckedChange:he})}),w(f.Item,{className:`pl-8`,title:A(`settings.followersTitle`),extra:w(p,{checked:z.follower,onCheckedChange:ge})})]}):null]}),H||!L?null:w(d,{className:`fixed bottom-0 w-full left-0`,children:w(t,{className:`h-auto text-base py-4 w-full`,variant:`secondary`,onClick:se,children:A(`settings.button`)})}),w(n,{open:W,onOpenChange:oe,children:T(a,{size:`sm`,children:[w(s,{children:w(ee,{children:A(`settings.logoutConfirmMessage`)})}),T(o,{children:[w(i,{onClick:ce,children:A(`settings.cancel`)}),w(r,{onClick:le,children:A(`settings.confirm`)})]})]})})]})}export{k as Settings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useOpenLoginAsync as r}from"../../../../hooks/use-auth.mjs";import i from"../../../ui/legacy/button.mjs";import{memo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";const l=a(({className:a}={})=>{let l=c(`components.pages.userFollow.components`),u=r();return s(t,{className:e(`w-full bg-bg1 py-[20px] flex flex-col items-center justify-center relative z-[1]`,a),children:[s(n,{className:`text-[16px] leading-[22px] text-text1`,children:[l(`followNoLogin.notLoggedIn`),`~`]}),o(i,{className:`mt-[13px] w-[130px] h-[36px] leading-[36px] rounded-[8px] bg-theme5 text-[16px] text-white`,onClick:async()=>{await u()&&console.warn(`login success`)},children:l(`followNoLogin.login`)})]})});l.displayName=`FollowNoLogin`;export{l as FollowNoLogin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{cn as e}from"../../../utils/cn.mjs";import{gContentGetAppChannels as t,gInteractionGetFollowingContentList as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Text as i}from"../../ui/text.mjs";import{
|
|
2
|
+
import{cn as e}from"../../../utils/cn.mjs";import{gContentGetAppChannels as t,gInteractionGetFollowingContentList as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Text as i}from"../../ui/text.mjs";import{HydrationBoundary as a}from"../../../hooks/query/hydration-boundary.mjs";import{defaultLocale as o,isValidLocale as s,resolveLocaleByPriority as c,resolveLocaleFromAcceptLanguage as l}from"../../../i18n.mjs";import{queryKey as u}from"../../../constants/query-key.mjs";import{getTranslator as d}from"../../../i18n/translator.mjs";import{FollowTopHeader as f}from"./_components/follow-top-header.mjs";import{PostTab as p}from"./_components/post-tab.mjs";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{cookies as g,headers as _}from"next/headers";function v(e){return s(e)?e:o}async function y({userId:e,page:t,pageSize:r,authConfig:i}){let a=await n({app_id:0,user_id:e,page:t,page_size:r,content_type:2},i),o=a.data?.post_infos??[];return{data:{list:o,total:a.data?.total??o.length,has_more:!!a.data?.has_more}}}async function b({className:n}={}){let s=await g(),b=await _(),x=s.get(`token`)?.value||``,S=d(v(c(s.get(`NEXT_LOCALE`)?.value,l(b.get(`accept-language`)),o))),C=s.get(`userId`)?.value||``,w=x?{headers:{Authorization:`Bearer ${x}`}}:void 0,T=[],E=[];return E.push({queryKey:[u.CHANNEL],queryFn:()=>t()}),C&&E.push({type:`infinite`,queryKey:[...T,`user-follow-post`,C],initialPageParam:1,async queryFn(e){return y({userId:C,page:e,pageSize:10,authConfig:w})}}),m(a,{prefetch:E,children:h(r,{className:e(`w-full h-full overflow-y-auto `,n),children:[m(f,{}),m(r,{className:`w-full px-[16px] py-[12px] g-scroll-box-x scrollbar-hide flex items-center min-w-max`,children:[{key:`posts`,label:S(`components.pages.userFollow.page.tabs.posts`)}].map(e=>m(r,{className:`h-full px-[9px] shrink-0 flex items-center justify-center`,children:m(i,{className:`leading-[24px] transition-all duration-100 !text-theme5 !text-[20px] font-bold`,children:e.label})},e.key))}),m(r,{className:`w-full bg-bg2`,children:m(p,{queryKeyPrefix:T,cookieUserId:C||void 0})})]})})}export{b as UserFollowPage};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
|
|
11
11
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import
|
|
4
|
+
import NextImage from "next/image";
|
|
5
5
|
|
|
6
6
|
//#region components/ui/image.d.ts
|
|
7
7
|
/** BaseImageProps 属性定义。 */
|
|
8
|
-
type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof
|
|
8
|
+
type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof NextImage>, 'className' | 'src' | 'alt' | 'width' | 'height' | 'loading' | 'priority' | 'fill' | 'style'>;
|
|
9
9
|
type CommonImageProps = BaseImageProps & {
|
|
10
10
|
/** 图片地址,支持普通 URL、默认资源路径和加密地址。 */src: string; /** 图片替代文本。 */
|
|
11
11
|
alt?: string; /** 图片类名。 */
|
|
@@ -27,6 +27,6 @@ type ImagePropsWithSize = CommonImageProps & {
|
|
|
27
27
|
/** ImageProps 属性定义。 */
|
|
28
28
|
type ImageProps = ImagePropsWithFill | ImagePropsWithSize;
|
|
29
29
|
/** 图片组件:支持 bnc 解密、默认资源域名拼接与错误占位。 */
|
|
30
|
-
declare function Image
|
|
30
|
+
declare function Image(props: ImageProps): react_jsx_runtime0.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { BaseImageProps, CommonImageProps, Image
|
|
32
|
+
export { BaseImageProps, CommonImageProps, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
//#region hooks/use-search-history.d.ts
|
|
3
|
+
interface UseSearchHistoryOptions {
|
|
4
|
+
storageKey: string;
|
|
5
|
+
maxCount?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 搜索历史管理 Hook
|
|
9
|
+
*/
|
|
10
|
+
declare function useSearchHistory({
|
|
11
|
+
storageKey,
|
|
12
|
+
maxCount
|
|
13
|
+
}: UseSearchHistoryOptions): {
|
|
14
|
+
history: string[];
|
|
15
|
+
addHistory: (keyword: string) => void;
|
|
16
|
+
clearHistory: () => void;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useSearchHistory };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{useEffect as e,useState as t}from"react";function n({storageKey:n,maxCount:r=20}){let[i,a]=t([]),o=`search_history_${n}`;return e(()=>{let e=localStorage.getItem(o);if(e)try{a(JSON.parse(e))}catch(e){console.error(`Failed to parse search history`,e)}},[o]),{history:i,addHistory:e=>{if(!e.trim())return;let t=[e,...i.filter(t=>t!==e)].slice(0,r);a(t),localStorage.setItem(o,JSON.stringify(t))},clearHistory:()=>{a([]),localStorage.removeItem(o)}}}export{n as useSearchHistory};
|
package/dist/hooks.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ import { useFollow } from "./hooks/use-follow.mjs";
|
|
|
10
10
|
import { useFullscreenGestures } from "./hooks/use-fullscreen-gestures.mjs";
|
|
11
11
|
import { useKeyboardOpen } from "./hooks/use-keyboard-open.mjs";
|
|
12
12
|
import { LikeableItem, useLikeDislike } from "./hooks/use-like-dislike.mjs";
|
|
13
|
+
import { useSearchHistory } from "./hooks/use-search-history.mjs";
|
|
13
14
|
import { useSticky } from "./hooks/use-sticky.mjs";
|
|
14
15
|
import { useKeepAliveEffect, useKeepAliveState } from "./components/common/keep-scroll-position/index.mjs";
|
|
15
|
-
export { AppContextValue, AuthFields, HydrationBoundary, LikeableItem, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryItem, UseBrowseReportOptions, appContextCookieKey, appContextValues, defaultAppContextValue, getAppContext, getAppContextResolved, getLockedAppContext, lockAppContext, normalizeAppContextValue, useAppContext, useAuth, useBrowseReport, useCloseLogin, useDeleteRequest, useExpireTime, useFollow, useFullscreenGestures, useIsLoggedIn, useKeepAliveEffect, useKeepAliveState, useKeyboardOpen, useLikeDislike, useLoginModalOpen, useLogout, useMutation, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useRequireLogin, useSetAuthFields, useSticky, useToken, useUpdateRequest, useUserId, useUserInfo };
|
|
16
|
+
export { AppContextValue, AuthFields, HydrationBoundary, LikeableItem, PrefetchInfiniteItem, PrefetchItem, PrefetchQueryItem, UseBrowseReportOptions, appContextCookieKey, appContextValues, defaultAppContextValue, getAppContext, getAppContextResolved, getLockedAppContext, lockAppContext, normalizeAppContextValue, useAppContext, useAuth, useBrowseReport, useCloseLogin, useDeleteRequest, useExpireTime, useFollow, useFullscreenGestures, useIsLoggedIn, useKeepAliveEffect, useKeepAliveState, useKeyboardOpen, useLikeDislike, useLoginModalOpen, useLogout, useMutation, useOpenLogin, useOpenLoginAsync, useOpenResetPassword, usePaginated, usePrefetchQuery, useRefetchQuery, useRequest, useRequireLogin, useSearchHistory, useSetAuthFields, useSticky, useToken, useUpdateRequest, useUserId, useUserInfo };
|
package/dist/hooks.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{appContextCookieKey as e,appContextValues as t,defaultAppContextValue as n,getLockedAppContext as r,lockAppContext as i,normalizeAppContextValue as a}from"./hooks/app-context.mjs";import{getAppContext as o,getAppContextResolved as s}from"./hooks/get-app-context.mjs";import{
|
|
2
|
+
import{appContextCookieKey as e,appContextValues as t,defaultAppContextValue as n,getLockedAppContext as r,lockAppContext as i,normalizeAppContextValue as a}from"./hooks/app-context.mjs";import{getAppContext as o,getAppContextResolved as s}from"./hooks/get-app-context.mjs";import{HydrationBoundary as c}from"./hooks/query/hydration-boundary.mjs";import{useDeleteRequest as l,useMutation as u,usePaginated as d,usePrefetchQuery as f,useRefetchQuery as p,useRequest as m,useUpdateRequest as h}from"./hooks/query/use-query.mjs";import{useAppContext as g}from"./hooks/use-app-context/index.mjs";import{useAuth as _,useCloseLogin as v,useExpireTime as y,useIsLoggedIn as b,useLoginModalOpen as x,useLogout as S,useOpenLogin as C,useOpenLoginAsync as w,useOpenResetPassword as T,useRequireLogin as E,useSetAuthFields as D,useToken as O,useUserId as k,useUserInfo as A}from"./hooks/use-auth.mjs";import{useBrowseReport as j}from"./hooks/use-browse-report.mjs";import{useFollow as M}from"./hooks/use-follow.mjs";import{useFullscreenGestures as N}from"./hooks/use-fullscreen-gestures.mjs";import{useKeyboardOpen as P}from"./hooks/use-keyboard-open.mjs";import{useLikeDislike as F}from"./hooks/use-like-dislike.mjs";import{useSearchHistory as I}from"./hooks/use-search-history.mjs";import{useSticky as L}from"./hooks/use-sticky.mjs";import{useKeepAliveEffect as R,useKeepAliveState as z}from"./components/common/keep-scroll-position/index.mjs";export{c as HydrationBoundary,e as appContextCookieKey,t as appContextValues,n as defaultAppContextValue,o as getAppContext,s as getAppContextResolved,r as getLockedAppContext,i as lockAppContext,a as normalizeAppContextValue,g as useAppContext,_ as useAuth,j as useBrowseReport,v as useCloseLogin,l as useDeleteRequest,y as useExpireTime,M as useFollow,N as useFullscreenGestures,b as useIsLoggedIn,R as useKeepAliveEffect,z as useKeepAliveState,P as useKeyboardOpen,F as useLikeDislike,x as useLoginModalOpen,S as useLogout,u as useMutation,C as useOpenLogin,w as useOpenLoginAsync,T as useOpenResetPassword,d as usePaginated,f as usePrefetchQuery,p as useRefetchQuery,m as useRequest,E as useRequireLogin,I as useSearchHistory,D as useSetAuthFields,L as useSticky,O as useToken,h as useUpdateRequest,k as useUserId,A as useUserInfo};
|
package/dist/materials.d.mts
CHANGED
|
@@ -12,7 +12,8 @@ import "./components/biz/business/detail/materials/video-detail-actions/index.mj
|
|
|
12
12
|
import { videoDetailRecommendMaterial } from "./components/biz/business/detail/materials/video-detail-recommend/material.mjs";
|
|
13
13
|
import "./components/biz/business/detail/materials/video-detail-recommend/index.mjs";
|
|
14
14
|
import { basicBannerMaterial } from "./components/biz/business/banner/variants/basic-banner/material.mjs";
|
|
15
|
-
import {
|
|
15
|
+
import { homeRecommendGridMaterial } from "./components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs";
|
|
16
|
+
import { homeRecommendWaterfallMaterial } from "./components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs";
|
|
16
17
|
import { channelListMaterial } from "./components/biz/business/channel-list/material.mjs";
|
|
17
18
|
import { floatingBallMaterial } from "./components/biz/business/floating-ball/material.mjs";
|
|
18
19
|
import { headerAvatarIconMaterial } from "./components/biz/business/header-search/header-avatar-icon/material.mjs";
|
|
@@ -25,4 +26,4 @@ import { largeFeatureGridMaterial } from "./components/biz/business/large-featur
|
|
|
25
26
|
import { profileHeaderMaterial } from "./components/biz/business/profile/profile-header/material.mjs";
|
|
26
27
|
import { profileMainMaterial } from "./components/biz/business/profile/profile-main/material.mjs";
|
|
27
28
|
import { shortcutGridMaterial } from "./components/biz/business/shortcut-grid/material.mjs";
|
|
28
|
-
export { basicBannerMaterial, channelListMaterial,
|
|
29
|
+
export { basicBannerMaterial, channelListMaterial, floatingBallMaterial, headerAvatarIconMaterial, headerAvatarLogoSearchIconMaterial, headerAvatarLogoSearchMaterial, headerLogoSearchMaterial, headerSearchMaterial, homeRecommendGridMaterial, homeRecommendWaterfallMaterial, largeFeatureGridMaterial, profileHeaderMaterial, profileMainMaterial, shortcutGridMaterial, videoDetailActionsMaterial, videoDetailInfoMaterial, videoDetailInfoTitleMaterial, videoDetailInfoTitleTagsEpisodesMaterial, videoDetailPlayerMaterial, videoDetailRecommendMaterial };
|
package/dist/materials.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{__exportAll as e}from"./_virtual/_rolldown/runtime.mjs";import{basicBannerMaterial as t}from"./components/biz/business/banner/variants/basic-banner/material.mjs";import{
|
|
2
|
+
import{__exportAll as e}from"./_virtual/_rolldown/runtime.mjs";import{basicBannerMaterial as t}from"./components/biz/business/banner/variants/basic-banner/material.mjs";import{homeRecommendGridMaterial as n}from"./components/biz/business/home-recommend/variants/home-recommend-grid/material.mjs";import{homeRecommendWaterfallMaterial as r}from"./components/biz/business/home-recommend/variants/home-recommend-waterfall/material.mjs";import{channelListMaterial as i}from"./components/biz/business/channel-list/material.mjs";import{videoDetailInfoMaterial as a}from"./components/biz/business/detail/materials/video-detail-info/material.mjs";import{videoDetailInfoTitleMaterial as o}from"./components/biz/business/detail/materials/video-detail-info-title/material.mjs";import{videoDetailInfoTitleTagsEpisodesMaterial as s}from"./components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.mjs";import{videoDetailPlayerMaterial as c}from"./components/biz/business/detail/materials/video-detail-player/material.mjs";import{videoDetailRecommendMaterial as l}from"./components/biz/business/detail/materials/video-detail-recommend/material.mjs";import{videoDetailActionsMaterial as u}from"./components/biz/business/detail/materials/video-detail-actions/material.mjs";import{floatingBallMaterial as d}from"./components/biz/business/floating-ball/material.mjs";import{headerAvatarIconMaterial as f}from"./components/biz/business/header-search/header-avatar-icon/material.mjs";import{headerAvatarLogoSearchMaterial as p}from"./components/biz/business/header-search/header-avatar-logo-search/material.mjs";import{headerAvatarLogoSearchIconMaterial as m}from"./components/biz/business/header-search/header-avatar-logo-search-icon/material.mjs";import{headerLogoSearchMaterial as h}from"./components/biz/business/header-search/header-logo-search/material.mjs";import{headerSearchMaterial as g}from"./components/biz/business/header-search/header-search/material.mjs";import{largeFeatureGridMaterial as _}from"./components/biz/business/large-feature-grid/material.mjs";import{profileHeaderMaterial as v}from"./components/biz/business/profile/profile-header/material.mjs";import{profileMainMaterial as y}from"./components/biz/business/profile/profile-main/material.mjs";import{shortcutGridMaterial as b}from"./components/biz/business/shortcut-grid/material.mjs";var x=e({basicBannerMaterial:()=>t,channelListMaterial:()=>i,floatingBallMaterial:()=>d,headerAvatarIconMaterial:()=>f,headerAvatarLogoSearchIconMaterial:()=>m,headerAvatarLogoSearchMaterial:()=>p,headerLogoSearchMaterial:()=>h,headerSearchMaterial:()=>g,homeRecommendGridMaterial:()=>n,homeRecommendWaterfallMaterial:()=>r,largeFeatureGridMaterial:()=>_,profileHeaderMaterial:()=>v,profileMainMaterial:()=>y,shortcutGridMaterial:()=>b,videoDetailActionsMaterial:()=>u,videoDetailInfoMaterial:()=>a,videoDetailInfoTitleMaterial:()=>o,videoDetailInfoTitleTagsEpisodesMaterial:()=>s,videoDetailPlayerMaterial:()=>c,videoDetailRecommendMaterial:()=>l});export{t as basicBannerMaterial,i as channelListMaterial,d as floatingBallMaterial,f as headerAvatarIconMaterial,m as headerAvatarLogoSearchIconMaterial,p as headerAvatarLogoSearchMaterial,h as headerLogoSearchMaterial,g as headerSearchMaterial,n as homeRecommendGridMaterial,r as homeRecommendWaterfallMaterial,_ as largeFeatureGridMaterial,x as materials_exports,v as profileHeaderMaterial,y as profileMainMaterial,b as shortcutGridMaterial,u as videoDetailActionsMaterial,a as videoDetailInfoMaterial,o as videoDetailInfoTitleMaterial,s as videoDetailInfoTitleTagsEpisodesMaterial,c as videoDetailPlayerMaterial,l as videoDetailRecommendMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{Dialog as e,DialogContent as t}from"../components/ui/dialog.mjs";import{defaultLocale as n,getMessages as r,isValidLocale as i}from"../i18n.mjs";import{IntlProvider as a}from"../components/common/intl-provider.mjs";import o from"../components/common/share-popup/share-content.mjs";import{SharePlatformEnum as s}from"../types/share.mjs";import{jsx as c}from"react/jsx-runtime";import{createRoot as l}from"react-dom/client";const u=`session_share_config`;function d(){return{domain:``,[s.QQ]:!0,[s.SAVE]:!0,[s.SHARE_LINK]:!0,[s.WECHAT]:!0,[s.WECHAT_MOMENTS]:!0}}function f(n){let{visible:r,onClose:i,type:a,data:s,copyUrl:l}=n;function u(e){e||i()}return c(e,{open:r,onOpenChange:u,children:c(t,{showCloseButton:!1,className:`z-[2000] w-[calc(100%-48px)] max-w-[360px] overflow-hidden rounded-[16px] bg-bg1 p-0 text-text1`,children:c(o,{type:a,data:s,copyUrl:l,onClose:i})})})}function p(){if(typeof document>`u`)return n;let e=document.documentElement?.lang||``;return i(e)?e:n}function m(e){let t=p();return c(a,{locale:t,messages:r(t),children:c(f,{...e})})}let h=null,g=null;var _=class e{static async initShareConfig(){let e=d();try{let t=sessionStorage.getItem(u);t?e=JSON.parse(t):sessionStorage.setItem(u,JSON.stringify(e))}catch(e){console.error(`获取分享配置失败:`,e)}return e}static showSharePopup({type:t,data:n,copyUrl:r}){h||(h=document.createElement(`div`),h.style.zIndex=`2001`,document.body.appendChild(h),g=l(h)),g?.render(c(m,{visible:!1,type:t,data:n,copyUrl:r,onClose:()=>{e.clear()}})),requestAnimationFrame(()=>{g?.render(c(m,{visible:!0,type:t,data:n,copyUrl:r,onClose:()=>{e.clear()}}))})}static clear(){g&&h&&(g.render(c(m,{visible:!1,type:s.SHARE_LINK,data:{id:``},copyUrl:``,onClose:()=>{e.clear()}})),setTimeout(()=>{g?.unmount(),g=null,h?.parentNode&&h.parentNode.removeChild(h),h=null},300))}};export{_ as default};
|
|
2
|
+
import{Dialog as e,DialogContent as t}from"../components/ui/dialog.mjs";import{defaultLocale as n,getMessages as r,isValidLocale as i}from"../i18n.mjs";import{IntlProvider as a}from"../components/common/intl-provider/intl-provider.mjs";import o from"../components/common/share-popup/share-content.mjs";import{SharePlatformEnum as s}from"../types/share.mjs";import{jsx as c}from"react/jsx-runtime";import{createRoot as l}from"react-dom/client";const u=`session_share_config`;function d(){return{domain:``,[s.QQ]:!0,[s.SAVE]:!0,[s.SHARE_LINK]:!0,[s.WECHAT]:!0,[s.WECHAT_MOMENTS]:!0}}function f(n){let{visible:r,onClose:i,type:a,data:s,copyUrl:l}=n;function u(e){e||i()}return c(e,{open:r,onOpenChange:u,children:c(t,{showCloseButton:!1,className:`z-[2000] w-[calc(100%-48px)] max-w-[360px] overflow-hidden rounded-[16px] bg-bg1 p-0 text-text1`,children:c(o,{type:a,data:s,copyUrl:l,onClose:i})})})}function p(){if(typeof document>`u`)return n;let e=document.documentElement?.lang||``;return i(e)?e:n}function m(e){let t=p();return c(a,{locale:t,messages:r(t),children:c(f,{...e})})}let h=null,g=null;var _=class e{static async initShareConfig(){let e=d();try{let t=sessionStorage.getItem(u);t?e=JSON.parse(t):sessionStorage.setItem(u,JSON.stringify(e))}catch(e){console.error(`获取分享配置失败:`,e)}return e}static showSharePopup({type:t,data:n,copyUrl:r}){h||(h=document.createElement(`div`),h.style.zIndex=`2001`,document.body.appendChild(h),g=l(h)),g?.render(c(m,{visible:!1,type:t,data:n,copyUrl:r,onClose:()=>{e.clear()}})),requestAnimationFrame(()=>{g?.render(c(m,{visible:!0,type:t,data:n,copyUrl:r,onClose:()=>{e.clear()}}))})}static clear(){g&&h&&(g.render(c(m,{visible:!1,type:s.SHARE_LINK,data:{id:``},copyUrl:``,onClose:()=>{e.clear()}})),setTimeout(()=>{g?.unmount(),g=null,h?.parentNode&&h.parentNode.removeChild(h),h=null},300))}};export{_ as default};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";import{useSearchHistory as e}from"./use-search-history.mjs";import{useImperativeHandle as t}from"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{useTranslations as i}from"next-intl";function a({ref:a,storageKey:o,maxItems:s=10,onHistoryClick:c,onHistoryDelete:l,className:u=``,showClearButton:d=!0}){let f=i(`components.biz.business.searchHistory`),{history:p,addHistory:m,removeHistory:h,clearHistory:g}=e({storageKey:o,maxItems:s});t(a,()=>({addHistory:m,removeHistory:h,clearHistory:g,getHistory:()=>p}),[m,h,g,p]);let _=e=>{c?.(e)},v=e=>{h(e),l?.(e)};return p.length===0?null:r(`div`,{className:`w-full bg-bg1 pt-[8px] ${u}`,children:[n(`ul`,{className:`list-none m-0 p-0 w-full`,children:p.map((e,t)=>r(`li`,{className:`w-full h-[40px] px-[40px] relative`,children:[n(`svg`,{className:`w-[16px] h-[16px] text-text1 absolute left-[16px] top-[0] bottom-[0] m-auto`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:n(`path`,{d:`M8 16C3.58171 16 0 12.4183 0 8C0 3.58171 3.58171 0 8 0C12.4183 0 16 3.58171 16 8C16 12.4183 12.4183 16 8 16ZM8 14.5714C11.6293 14.5714 14.5714 11.6293 14.5714 8C14.5714 4.37071 11.6293 1.42857 8 1.42857C4.37071 1.42857 1.42857 4.37071 1.42857 8C1.42857 11.6293 4.37071 14.5714 8 14.5714ZM11.1138 10.5351C11.3705 10.8347 11.3358 11.2856 11.0363 11.5423C10.7368 11.7991 10.2858 11.7644 10.0291 11.4649L7.45768 8.46486C7.34671 8.3354 7.28571 8.17051 7.28571 8V3.71429C7.28571 3.3198 7.60552 3 8 3C8.39448 3 8.71429 3.3198 8.71429 3.71429V7.73577L11.1138 10.5351Z`,fill:`currentColor`})}),n(`div`,{onClick:()=>{_(e)},className:`w-full leading-[40px] text-text1 text-[16px] line-clamp-1`,children:e}),n(`div`,{onClick:()=>{v(e)},className:`w-[40px] h-full px-[12px] absolute right-[0] top-[0] flex items-center`,children:n(`svg`,{xmlns:`http://www.w3.org/2000/svg`,className:`w-[12px] h-[12px] text-text2 pointer-events-none`,viewBox:`0 0 16 16`,fill:`currentColor`,children:n(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})})]},`${e}-${t}`))}),d&&p.length>0&&r(`div`,{className:`w-[fit-content] mx-auto px-[16px] py-[8px] leading-[24px] text-text3 text-[14px]`,onClick:()=>{g()},children:[n(`span`,{children:f(`clearAllHistory`)}),n(`svg`,{className:`hidden`,viewBox:`0 0 1024 1024`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"p-id":`9397`,width:`200`,height:`200`,children:n(`path`,{d:`M720.596674 189.629047V75.854767C720.596674 28.711163 691.05125 0 642.805792 0H381.225689c-48.166754 0-77.743659 28.711163-77.743659 75.854767v113.77428H75.854767v75.854766h75.854767v644.741907c0 68.34642 42.783411 113.77428 113.774279 113.77428H758.531927c69.353829 0 113.77428-42.169521 113.77428-113.77428v-644.741907h75.839026v-75.854766zM379.258093 75.854767h265.483814l-1.574077 113.77428H379.258093z m417.130384 872.290466H227.54856V265.483813h568.90288z m-341.275617-606.806653H381.225689l-1.904633 493.032373h75.854767z m189.629047 0h-75.854767v493.032373h75.854767z m0 0`,"p-id":`9398`,fill:`currentColor`})})]})]})}a.displayName=`SearchHistory`;export{a as SearchHistory};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import{useCallback as e,useEffect as t,useState as n}from"react";function r(r){let{storageKey:i,maxItems:a=10}=r,[o,s]=n([]),c=`search-history-${i}`,l=e(()=>{if(typeof window>`u`)return[];try{let e=localStorage.getItem(c);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t.keywords)?t.keywords.slice(0,a):[]}catch(e){return console.error(`读取搜索历史失败:`,e),[]}},[c,a]),u=e(e=>{if(!(typeof window>`u`))try{let t={keywords:e,timestamp:Date.now()};localStorage.setItem(c,JSON.stringify(t))}catch(e){console.error(`保存搜索历史失败:`,e)}},[c]);return t(()=>{s(l())},[l]),t(()=>{let e=e=>{e.key===c&&s(l())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[c,l]),t(()=>{let e=()=>{s(l())};return window.addEventListener(`search-history-change`,e),()=>window.removeEventListener(`search-history-change`,e)},[l]),{history:o,addHistory:e(e=>{if(!e||typeof e!=`string`)return;let t=e.trim();if(!t)return;let n=[t,...l().filter(e=>e!==t)].slice(0,a);u(n),window.dispatchEvent(new CustomEvent(`search-history-change`)),s(n)},[a,u,l]),removeHistory:e(e=>{e&&s(t=>{let n=t.filter(t=>t!==e);return u(n),window.dispatchEvent(new CustomEvent(`search-history-change`)),n})},[u]),clearHistory:e(()=>{s([]),u([]),window.dispatchEvent(new CustomEvent(`search-history-change`))},[u])}}export{r as useSearchHistory};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../../utils/common.mjs";import{useUserStore as t}from"../../../../store/modules/user-store.mjs";import{DeleteConfirmDialog as n}from"../../../common/delete-confirm-dialog/delete-confirm-dialog.mjs";import{useSearchHistory as r}from"../search-history/use-search-history.mjs";import{useRouter as i}from"next/navigation";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({rows:c,title:l,clearText:u,confirmDescription:d}){let{userInfo:f}=t(),p=f?.user_id||`guest`,m=i(),[h,g]=a(!1),{history:_,clearHistory:v}=r({storageKey:p});return _.length===0?null:s(`div`,{className:`w-full bg-transparent pt-[12px] px-[12px] relative z-0`,children:[s(`div`,{className:`w-full flex items-center justify-between mb-[12px]`,children:[o(`span`,{className:`text-[16px] font-bold text-text1`,children:l}),s(`div`,{onClick:()=>g(!0),className:`cursor-pointer flex items-center gap-[4px]`,children:[o(`span`,{className:`text-text2 text-[14px] font-normal leading-[22px] text-right`,style:{fontFamily:`"Source Code Pro"`},children:u}),o(`svg`,{className:`w-[12px] h-[12px] text-text3`,viewBox:`0 0 12 12`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:o(`path`,{d:`M4.8295 0C4.71306 0 4.60139 0.0511359 4.51905 0.142158C4.43671 0.233181 4.39046 0.356633 4.39046 0.485358V2.5889H0.439046C0.322604 2.5889 0.210931 2.64004 0.128594 2.73106C0.0462565 2.82208 0 2.94553 0 3.07426V5.66316C0 5.79189 0.0462565 5.91534 0.128594 6.00636C0.210931 6.09738 0.322604 6.14852 0.439046 6.14852H0.878092V11.5146C0.878092 11.6434 0.924348 11.7668 1.00669 11.8578C1.08902 11.9489 1.2007 12 1.31714 12H10.6829C10.7993 12 10.911 11.9489 10.9933 11.8578C11.0757 11.7668 11.1219 11.6434 11.1219 11.5146V6.14852H11.561C11.6774 6.14852 11.7891 6.09738 11.8714 6.00636C11.9537 5.91534 12 5.79189 12 5.66316V3.07426C12 2.94553 11.9537 2.82208 11.8714 2.73106C11.7891 2.64004 11.6774 2.5889 11.561 2.5889H7.60954V0.485358C7.60954 0.356633 7.56328 0.233181 7.48095 0.142158C7.39861 0.0511359 7.28694 0 7.1705 0H4.8295ZM10.2438 11.0293H8.78092V9.54603C8.78092 9.4173 8.73466 9.29385 8.65232 9.20283C8.56999 9.1118 8.45831 9.06067 8.34187 9.06067C8.22543 9.06067 8.11376 9.1118 8.03142 9.20283C7.94908 9.29385 7.90282 9.4173 7.90282 9.54603V11.0293H6.43905V9.54117C6.43905 9.41245 6.39279 9.289 6.31045 9.19797C6.22812 9.10695 6.11644 9.05582 6 9.05582C5.88356 9.05582 5.77188 9.10695 5.68955 9.19797C5.60721 9.289 5.56095 9.41245 5.56095 9.54117V11.0303H4.09718V9.547C4.09718 9.41827 4.05092 9.29482 3.96858 9.2038C3.88624 9.11278 3.77457 9.06164 3.65813 9.06164C3.54169 9.06164 3.43001 9.11278 3.34768 9.2038C3.26534 9.29482 3.21908 9.41827 3.21908 9.547V11.0303H1.75618V6.17667H10.2438V11.0303V11.0293ZM5.26855 3.07426V0.970717H6.73145V3.07426C6.73145 3.20298 6.77771 3.32644 6.86004 3.41746C6.94238 3.50848 7.05405 3.55962 7.1705 3.55962H11.1219V5.1778H0.878092V3.55962H4.8295C4.94595 3.55962 5.05762 3.50848 5.13996 3.41746C5.22229 3.32644 5.26855 3.20298 5.26855 3.07426Z`,fill:`currentColor`})})]})]}),o(`div`,{className:`w-full overflow-hidden ${c===`1`?`h-[30px]`:c===`2`?`h-[72px]`:`h-[114px]`}`,children:o(`ul`,{className:`list-none m-0 p-0 w-full flex flex-wrap gap-[12px]`,children:_.map((t,n)=>o(`li`,{className:`h-[30px] px-[12px] bg-bg2 rounded-[4px] flex items-center justify-center cursor-pointer`,onClick:()=>{e({q:t}),m.push(`${window.location.pathname}?q=${encodeURIComponent(t)}`)},children:o(`div`,{className:`text-text1 text-[14px] max-w-[124px] truncate`,children:t.length>8?`${t.slice(0,8)}...`:t})},`${t}-${n}`))})}),o(n,{open:h,onOpenChange:g,onConfirm:()=>{v(),g(!1)},title:``,description:d})]})}export{c as SearchHistory2Client};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { SearchHistory2InspectorProps, SearchHistory2Props, searchHistory2InspectorDefaultProps, searchHistory2InspectorPropsSchema } from "./schema.mjs";
|
|
3
|
-
import { SearchHistory2Server } from "./server.mjs";
|
|
4
|
-
import { searchHistory2Material } from "./material.mjs";
|
|
5
|
-
import { SearchHistory2Client } from "./client.mjs";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{searchHistory2InspectorPropsSchema as t}from"./schema.mjs";import{SearchHistory2Server as n}from"./server.mjs";const r=e({type:`search-history2`,name:`搜索历史`,icon:`https://cdn.example.com/icons/search-history.png`,category:`CENTER`,serverComponent:n,clientComponent:n,propsSchema:t});export{r as searchHistory2Material};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
"use client";import{defaultTimeZone as e}from"../../i18n.mjs";import{jsx as t}from"react/jsx-runtime";import{NextIntlClientProvider as n}from"next-intl";function r({locale:r,messages:i,timeZone:a,children:o}){return t(n,{locale:r,messages:i,timeZone:a??e,children:o})}export{r as IntlProvider};
|
|
File without changes
|