@funhub/platform 0.2.3-beta.0 → 0.2.3
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/assets/icons/channel-list/channel-active-indicator.mjs +2 -0
- package/dist/assets/icons/common/header-menu.mjs +2 -0
- package/dist/assets/icons/common/header-search-icon.mjs +2 -0
- package/dist/assets/icons/common/right_arrow_thin.mjs +2 -0
- package/dist/assets/icons/eye-off-icon.mjs +1 -1
- package/dist/assets/icons/marquee-close.mjs +2 -0
- package/dist/assets/icons/marquee-speaker.mjs +2 -0
- package/dist/assets/images/shortcut-grid/shortcut-grid-card-bg-primary.mjs +2 -0
- package/dist/biz.d.mts +11 -4
- package/dist/biz.mjs +1 -1
- package/dist/common.d.mts +5 -2
- package/dist/common.mjs +1 -1
- package/dist/components/biz/basics/fullscreen-feed/runtime/user-action.mjs +1 -1
- package/dist/components/biz/basics/logo/variants/basic-logo/runtime/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/ad-match.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/material.d.mts +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/banner-ad/schema.d.mts +3 -3
- package/dist/components/biz/business/advertisement/banner-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/feed-ad/index.d.mts +1 -31
- package/dist/components/biz/business/advertisement/feed-ad/index.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/floating-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/icon-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/index.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/client.mjs +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/index.d.mts +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/material.d.mts +2 -2
- package/dist/components/biz/business/advertisement/popup-ad/material.mjs +1 -1
- package/dist/components/biz/business/advertisement/popup-ad/schema.d.mts +5 -14
- package/dist/components/biz/business/advertisement/popup-ad/schema.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/client.mjs +1 -1
- package/dist/components/biz/business/advertisement/text-ad/material.mjs +1 -1
- package/dist/components/biz/business/banner/variants/basic-banner/runtime/client.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/client.d.mts +2 -1
- package/dist/components/biz/business/banner-carousel/client.mjs +1 -1
- package/dist/components/biz/business/banner-carousel/default-props.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/channel-list/default-props.mjs +1 -1
- package/dist/components/biz/business/detail/shared/detail-operate.mjs +1 -1
- package/dist/components/biz/business/detail/shared/editor-preview.mjs +1 -1
- package/dist/components/biz/business/detail/shared/registry.d.mts +36 -1
- package/dist/components/biz/business/detail/shared/registry.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-actions/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-info/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/client.d.mts +1 -13
- package/dist/components/biz/business/detail/video-detail-recommend/client.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/material.mjs +1 -1
- package/dist/components/biz/business/detail/video-detail-recommend/shared.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.d.mts +8 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/client.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/index.d.mts +5 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.d.mts +45 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/material.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.d.mts +9 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/detail/video-detail-waterfall-recommend/server.mjs +2 -0
- package/dist/components/biz/business/header-search/header-avatar-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.d.mts +4 -3
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-search/client.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/avatar.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/header-action.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/header-search-icon.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/header-shell.mjs +2 -0
- package/dist/components/biz/business/header-search/shared/logo.mjs +1 -1
- package/dist/components/biz/business/header-search/shared/search.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-grid/material.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs +1 -1
- package/dist/components/biz/business/home-recommend/home-recommend-waterfall/material.d.mts +0 -8
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-preview.mjs +1 -1
- package/dist/components/biz/business/hot-recommend/client.d.mts +17 -0
- package/dist/components/biz/business/hot-recommend/client.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/index.d.mts +5 -0
- package/dist/components/biz/business/hot-recommend/material.d.mts +24 -0
- package/dist/components/biz/business/hot-recommend/material.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/schema.d.mts +23 -0
- package/dist/components/biz/business/hot-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/hot-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/hot-recommend/server.mjs +2 -0
- package/dist/components/biz/business/index.d.mts +12 -3
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/marquee.module.mjs +2 -6
- package/dist/components/biz/business/nav-bar/variants/basic-nav-bar/runtime/client.mjs +1 -1
- package/dist/components/biz/business/profile/index.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/client.d.mts +2 -1
- package/dist/components/biz/business/profile/profile-header/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/index.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/empty-state.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/collect-tab/video-waterfall.mjs +2 -0
- package/dist/components/biz/business/profile/profile-main/tabs/history-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.d.mts +5 -1
- package/dist/components/biz/business/profile/profile-main/tabs/like-tab/client.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/utils.mjs +1 -1
- package/dist/components/biz/business/ranking-recommend/client.d.mts +17 -0
- package/dist/components/biz/business/ranking-recommend/client.mjs +70 -0
- package/dist/components/biz/business/ranking-recommend/material.d.mts +35 -0
- package/dist/components/biz/business/ranking-recommend/material.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/schema.d.mts +35 -0
- package/dist/components/biz/business/ranking-recommend/schema.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/server.d.mts +11 -0
- package/dist/components/biz/business/ranking-recommend/server.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/shared/query.mjs +2 -0
- package/dist/components/biz/business/ranking-recommend/shared.d.mts +15 -0
- package/dist/components/biz/business/ranking-recommend/shared.mjs +2 -0
- package/dist/components/biz/business/search-history/client.mjs +1 -1
- package/dist/components/biz/business/search-history/schema.mjs +1 -1
- package/dist/components/biz/business/search-input/client.mjs +1 -1
- package/dist/components/biz/business/search-waterfall-recommend/client.d.mts +9 -0
- package/dist/components/biz/business/search-waterfall-recommend/client.mjs +2 -0
- package/dist/components/biz/business/search-waterfall-recommend/index.d.mts +4 -0
- package/dist/components/biz/business/search-waterfall-recommend/material.d.mts +40 -0
- package/dist/components/biz/business/search-waterfall-recommend/material.mjs +2 -0
- package/dist/components/biz/business/search-waterfall-recommend/server.d.mts +8 -0
- package/dist/components/biz/business/search-waterfall-recommend/server.mjs +2 -0
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/common/collection-popup/create-collection-sheet.d.mts +41 -0
- package/dist/components/common/collection-popup/create-collection-sheet.mjs +2 -0
- package/dist/components/common/collection-popup/index.d.mts +1 -0
- package/dist/components/common/collection-popup/index.mjs +1 -1
- package/dist/components/common/icons/setting.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list-item.d.mts +8 -0
- package/dist/components/common/list/collection-list/collection-list-item.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-list.d.mts +6 -0
- package/dist/components/common/list/collection-list/collection-list.mjs +1 -1
- package/dist/components/common/list/collection-list/collection-select-icon.mjs +2 -0
- package/dist/components/common/list/waterfall-recommend/index.d.mts +2 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.d.mts +99 -0
- package/dist/components/common/list/waterfall-recommend/waterfall-recommend.mjs +2 -0
- package/dist/components/common/series-episodes/index.d.mts +3 -1
- package/dist/components/common/series-episodes/index.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/pages/collection-detail/_components/collection-detail-video-card.mjs +2 -0
- package/dist/components/pages/collection-detail/detail.mjs +1 -1
- package/dist/components/pages/edit/page.mjs +1 -1
- package/dist/components/pages/home/client.mjs +1 -1
- package/dist/components/pages/login/auth-page-styles.mjs +6 -0
- package/dist/components/pages/login/login-client.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -4
- package/dist/components/pages/publish/components/collection.mjs +1 -1
- package/dist/components/pages/search/page-client.mjs +1 -1
- package/dist/components/pages/search/search-result/index.mjs +1 -1
- package/dist/components/pages/search/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search/search-result/search-video-info.mjs +1 -1
- package/dist/components/pages/search/search-result/shared.mjs +2 -0
- package/dist/components/pages/search/top-header.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-empty.mjs +2 -0
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video-info.mjs +2 -0
- package/dist/components/pages/search-result/shared.mjs +2 -0
- package/dist/components/pages/search-result/top-header.mjs +2 -0
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +2 -2
- 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/video-list/video-list-client.mjs +1 -1
- package/dist/components/pages/video-list/video-list-recommend-item.mjs +2 -0
- package/dist/components/pages/video-list/video-list-skeleton.d.mts +2 -3
- package/dist/components/pages/video-list/video-list-skeleton.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/box.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/dist/i18n/locales/en.mjs +2 -2
- package/dist/i18n/locales/zh-CN.mjs +2 -2
- package/dist/materials.d.mts +6 -1
- package/dist/materials.mjs +1 -1
- package/dist/service/generated/client.d.mts +38 -2
- package/dist/service/generated/client.mjs +1 -1
- package/dist/service/generated/tanstack.d.mts +47 -2
- package/dist/service/generated/tanstack.mjs +1 -1
- package/dist/service.d.mts +3 -3
- package/dist/service.mjs +1 -1
- package/dist/theme-tokens.d.mts +9 -0
- package/dist/theme-tokens.mjs +2 -0
- package/dist/types.d.mts +662 -9
- package/dist/utils/helper.d.mts +1 -1
- package/dist/utils/helper.mjs +1 -1
- package/package.json +7 -2
- package/theme.css +170 -59
- package/dist/assets/icons/detail/collect_nor.mjs +0 -2
- package/dist/assets/icons/detail/collect_sel.mjs +0 -2
- package/dist/assets/icons/detail/share.mjs +0 -2
- package/dist/assets/icons/marquee-enter.mjs +0 -2
- package/dist/assets/icons/right_arrow.mjs +0 -2
- package/dist/assets/icons/search/avatar.mjs +0 -2
- package/dist/assets/images/marquee.mjs +0 -2
- package/dist/components/biz/business/detail/shared/detail-introduction.mjs +0 -2
- package/dist/components/common/collection-popup/collection-create-modal.mjs +0 -2
- package/dist/components/common/skeleton/search-video-card-skeleton.mjs +0 -2
- package/dist/components/pages/search/search-utils.mjs +0 -2
- package/dist/components/pages/search-result/search-result-skeleton.mjs +0 -2
- package/dist/components/pages/search-result/search-video.mjs +0 -2
- package/dist/components/pages/video-list/video-list-item.mjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"../../../../ui/loading.mjs";import{WaterfallRecommend as n}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{useVideoDetailRecommendData as r}from"../video-detail-recommend/shared.mjs";import{useCallback as i,useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){let t=[],n=[],r=0,i=0;return e.forEach(e=>{let a=(e.cardKind===`short`?120:218)+16;r<=i?(t.push(e),r+=a):(n.push(e),i+=a)}),{left:t,right:n}}function l(l){let{uiItems:u,shouldShowLoading:d,isPreview:f,resolvedModuleTitle:p,triggerIndex:m,triggerMarker:h}=r(l),g=a(()=>u.map((e,t)=>({key:e.info.id?`detail-waterfall-${e.info.id}-${t}`:`detail-waterfall-${t}`,sourceIndex:e.sourceIndex,href:e.detailPath||`#`,cardKind:e.cardKind,coverUrl:e.coverUrl,title:e.title,metaPrimaryText:e.showEpisode?e.videoInfoText:``,heatText:e.showPlayCount?e.playCountText:``,score:e.score})),[u]),_=a(()=>c(g),[g]),v=!!p,y=i(({item:e})=>{if(!(e.sourceIndex!==m||!h))return e=>{e&&e.setAttribute(`data-detail-recommend-trigger`,h)}},[m,h]);return g.length?s(e,{className:f?`mt-[16px] w-full pointer-events-none`:`mt-[16px] w-full`,children:[o(n,{title:p,columns:_,sectionClassName:`w-full`,headerClassName:v?`mb-[8px] flex items-center justify-between px-[12px]`:`hidden`,titleClassName:`flex-1 min-w-0 text-[18px] leading-[26px] font-bold line-clamp-1 text-text1`,containerClassName:`relative flex w-full gap-[15px] px-[12px]`,getItemRef:y}),d&&o(e,{className:`w-full flex justify-center py-[12px]`,children:o(t,{size:`medium`,showLabel:!1,className:`text-theme5`})})]}):null}export{l as VideoDetailWaterfallRecommendClient};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { VideoDetailWaterfallRecommendProps } from "./schema.mjs";
|
|
3
|
+
import { VideoDetailWaterfallRecommendClient } from "./client.mjs";
|
|
4
|
+
import { VideoDetailWaterfallRecommend } from "./server.mjs";
|
|
5
|
+
import { videoDetailWaterfallRecommendMaterial } from "./material.mjs";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../../utils/schema/schema.mjs";
|
|
3
|
+
import { DefineMaterialOption } from "../../../../../utils/schema/material.mjs";
|
|
4
|
+
import { VideoDetailWaterfallRecommendClient } from "./client.mjs";
|
|
5
|
+
import { VideoDetailWaterfallRecommend } from "./server.mjs";
|
|
6
|
+
import "../../../../../utils.mjs";
|
|
7
|
+
import * as zod from "zod";
|
|
8
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
9
|
+
|
|
10
|
+
//#region components/biz/business/detail/video-detail-waterfall-recommend/material.d.ts
|
|
11
|
+
declare const videoDetailWaterfallRecommendMaterial: DefineMaterialOption<typeof VideoDetailWaterfallRecommend, typeof VideoDetailWaterfallRecommendClient, zod.ZodObject<{
|
|
12
|
+
readonly rows: zod.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
readonly columns: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
readonly smartTagEnabled: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
15
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
16
|
+
readonly showPlayCount: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
17
|
+
readonly playCountDelta: zod.ZodNumber & SchemaHasDefaultValue;
|
|
18
|
+
readonly showEpisode: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
19
|
+
readonly enableInfinite: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
20
|
+
readonly smartTagIds: zod.ZodOptional<zod.ZodArray<zod.ZodString>>;
|
|
21
|
+
readonly items: zod.ZodOptional<zod.ZodArray<zod.ZodObject<{
|
|
22
|
+
contentId: zod.ZodString;
|
|
23
|
+
coverMode: zod.ZodOptional<zod.ZodEnum<{
|
|
24
|
+
content: "content";
|
|
25
|
+
upload: "upload";
|
|
26
|
+
}>>;
|
|
27
|
+
coverUrl: zod.ZodOptional<zod.ZodString>;
|
|
28
|
+
titleMode: zod.ZodOptional<zod.ZodEnum<{
|
|
29
|
+
content: "content";
|
|
30
|
+
custom: "custom";
|
|
31
|
+
}>>;
|
|
32
|
+
title: zod.ZodOptional<zod.ZodString>;
|
|
33
|
+
description: zod.ZodOptional<zod.ZodString>;
|
|
34
|
+
showPlayCount: zod.ZodOptional<zod.ZodBoolean>;
|
|
35
|
+
playCountDelta: zod.ZodOptional<zod.ZodNumber>;
|
|
36
|
+
showEpisode: zod.ZodOptional<zod.ZodBoolean>;
|
|
37
|
+
}, zod_v4_core0.$strip>>>;
|
|
38
|
+
} & {
|
|
39
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
40
|
+
renderer: "renderer";
|
|
41
|
+
editor: "editor";
|
|
42
|
+
}>>;
|
|
43
|
+
}, zod_v4_core0.$strip>, "video-detail-waterfall-recommend", "详情页">;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { videoDetailWaterfallRecommendMaterial };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineMaterial as e}from"../../../../../utils/schema/material.mjs";import{VideoDetailWaterfallRecommendClient as t}from"./client.mjs";import{videoDetailWaterfallRecommendInspectorPropsSchema as n}from"./schema.mjs";import{VideoDetailWaterfallRecommend as r}from"./server.mjs";const i=e({type:`video-detail-waterfall-recommend`,name:`详情页-瀑布流`,icon:`/static/components-thumb/grid_waterfall_two_column.png`,category:`详情页`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as videoDetailWaterfallRecommendMaterial};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
import { VideoDetailRecommendProps } from "../video-detail-recommend/schema.mjs";
|
|
3
|
+
import "../../../../../utils.mjs";
|
|
4
|
+
import "zod";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/detail/video-detail-waterfall-recommend/schema.d.ts
|
|
7
|
+
type VideoDetailWaterfallRecommendProps = VideoDetailRecommendProps;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { VideoDetailWaterfallRecommendProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { VideoDetailWaterfallRecommendProps } from "./schema.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/detail/video-detail-waterfall-recommend/server.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 详情页瀑布流推荐物料服务端组件。
|
|
8
|
+
*/
|
|
9
|
+
declare function VideoDetailWaterfallRecommend(props: VideoDetailWaterfallRecommendProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { VideoDetailWaterfallRecommend };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{normalizeRecommendRuntimeProps as e}from"../video-detail-recommend/utils.mjs";import{VideoDetailWaterfallRecommendClient as t}from"./client.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{mode:i=`renderer`,...a}=r;return n(t,{...e(a),mode:i})}export{r as VideoDetailWaterfallRecommend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{UserAvatar as e}from"../shared/avatar.mjs";import{HeaderSearchIcon as t}from"../shared/header-search-icon.mjs";import{HeaderShell as n}from"../shared/header-shell.mjs";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({mode:a=`renderer`}){return i(n,{mode:a,className:`justify-between gap-[16px]`,children:[r(e,{}),r(t,{})]})}export{a as HeaderAvatarIconClient};
|
|
@@ -5,7 +5,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
5
5
|
//#region components/biz/business/header-search/header-avatar-logo-search/client.d.ts
|
|
6
6
|
type HeaderAvatarLogoSearchClientProps = HeaderAvatarLogoSearchInspectorProps;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 顶部功能样式3:头像、搜索条、菜单。
|
|
9
9
|
*/
|
|
10
10
|
declare function HeaderAvatarLogoSearchClient(props: HeaderAvatarLogoSearchClientProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as n}from"../../../../../service/generated/client.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Avatar as i,AvatarFallback as a,AvatarImage as o}from"../../../../ui/avatar.mjs";import{Box as s}from"../../../../ui/box.mjs";import{Text as c}from"../../../../ui/text.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{useRequest as u}from"../../../../../hooks/query/use-query.mjs";import d from"../../../../../assets/icons/common/header-menu.mjs";import f from"../../../../../assets/icons/common/header-search-icon.mjs";import{headerAvatarLogoSearchInspectorDefaultProps as p}from"./schema.mjs";import{useMemo as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import _ from"next/link";import{useShallow as v}from"zustand/react/shallow";function y(){let{isLogin:n,userInfo:r}=t(v(e=>({isLogin:e.isLogin,userInfo:e.userInfo}))),c=l(e=>e.open),u=h(s,{className:`relative flex h-[38px] w-[38px] items-center justify-center rounded-full bg-white/20`,children:h(s,{className:`flex h-[32px] w-[32px] items-center justify-center overflow-hidden rounded-full border-2 border-white/20 bg-[#2A1C18]`,children:g(i,{className:`h-full w-full`,children:[h(o,{src:r?.avatar_url||r?.avatar||void 0,alt:`用户头像`,className:`object-cover`}),h(a,{className:`bg-[radial-gradient(circle_at_35%_30%,#f4b1ad_0%,#915f72_42%,#3b2442_100%)]`})]})})});return n?h(_,{href:`/user/mine`,"aria-label":`打开个人主页`,className:`shrink-0`,children:u}):h(e,{onClick:c,"aria-label":`登录`,className:`m-0 inline-flex h-auto w-auto shrink-0 bg-transparent p-0 hover:bg-transparent`,children:u})}function b({isEditor:e}){let{userInfo:r}=t(v(e=>({userInfo:e.userInfo}))),i=r?.user_id||`guest`,{data:a}=u([`header-search-hot-keyword`,i],()=>n({user_id:i}),{enabled:!e}),o=m(()=>{let e=(a?.data?.recommend_list??[])[0]?.title;return typeof e==`string`&&e.trim()?e.trim():`请输入搜索关键字`},[a]);return h(_,{href:`/search`,"aria-label":`打开搜索页`,className:`flex h-[34px] flex-1 items-center justify-center overflow-hidden rounded-full bg-black/40 px-[14px] backdrop-blur-[2px]`,children:g(s,{className:`flex h-[20px] items-center gap-[4px] text-white/50`,children:[h(f,{className:`h-[20px] w-[20px] shrink-0`,"aria-hidden":!0}),h(c,{as:`span`,className:`block text-[14px] leading-none text-white/50`,children:o})]})})}function x({logoHref:e,logoSrc:t}){return h(_,{href:e,"aria-label":`打开功能菜单`,className:`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-white`,children:t?h(s,{className:`relative h-[24px] w-[24px] overflow-hidden rounded-full`,children:h(r,{src:t,alt:`menu`,fill:!0,sizes:`24px`,className:`object-cover`})}):h(d,{className:`h-[24px] w-[24px]`})})}function S(e){let{mode:t=`renderer`,...n}=e,r=t===`editor`,{logoSrc:i,logoHref:a}={...p,...n};return g(s,{as:`header`,className:r?`flex items-center justify-between gap-[12px] px-[12px] py-[8px] pointer-events-none`:`flex items-center justify-between gap-[12px] px-[12px] py-[8px]`,children:[h(y,{}),h(b,{isEditor:r}),h(x,{logoSrc:i,logoHref:a})]})}export{S as HeaderAvatarLogoSearchClient};
|
|
@@ -6,9 +6,10 @@ import * as zod_v4_core0 from "zod/v4/core";
|
|
|
6
6
|
|
|
7
7
|
//#region components/biz/business/header-search/header-avatar-logo-search/schema.d.ts
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* - logoSrc
|
|
11
|
-
* -
|
|
9
|
+
* 顶部-头像&搜索词&菜单:
|
|
10
|
+
* - 为兼容历史数据,沿用 logoSrc / logoHref 字段名
|
|
11
|
+
* - logoSrc:可配置右侧菜单图标地址(为空时仅保留占位)
|
|
12
|
+
* - logoHref:可配置右侧菜单点击跳转地址
|
|
12
13
|
*/
|
|
13
14
|
declare const headerAvatarLogoSearchInspectorPropsSchema: zod.ZodObject<{
|
|
14
15
|
readonly logoSrc: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(``,{label:`菜单图标地址`,required:!1}),logoHref:e.string(`/`,{label:`菜单跳转地址`,required:!1})})),r=t(n);export{r as headerAvatarLogoSearchInspectorDefaultProps,n as headerAvatarLogoSearchInspectorPropsSchema};
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../../ui/box.mjs";import t from"
|
|
2
|
+
"use client";import{Box as e}from"../../../../ui/box.mjs";import{UserAvatar as t}from"../shared/avatar.mjs";import{HeaderSearchIcon as n}from"../shared/header-search-icon.mjs";import{HeaderShell as r}from"../shared/header-shell.mjs";import{Logo as i}from"../shared/logo.mjs";import{headerAvatarLogoSearchIconInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(c){let{mode:l=`renderer`,...u}=c,{logoSrc:d,logoHref:f}={...a,...u};return s(r,{mode:l,className:`gap-[16px]`,children:[o(t,{}),o(e,{className:`flex-1`}),o(n,{}),o(i,{logoSrc:d,logoHref:f,variant:`action`})]})}export{c as HeaderAvatarLogoSearchIconClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{HeaderShell as e}from"../shared/header-shell.mjs";import{Logo as t}from"../shared/logo.mjs";import{Search as n}from"../shared/search.mjs";import{headerLogoSearchInspectorDefaultProps as r}from"./schema.mjs";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(o){let{mode:s=`renderer`,...c}=o,{logoSrc:l,logoHref:u}={...r,...c};return a(e,{mode:s,className:`gap-[8px]`,children:[i(t,{logoSrc:l,logoHref:u}),i(n,{mode:s})]})}export{o as HeaderLogoSearchClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{HeaderShell as e}from"../shared/header-shell.mjs";import{Search as t}from"../shared/search.mjs";import{jsx as n}from"react/jsx-runtime";function r({mode:r=`renderer`}){return n(e,{mode:r,children:n(t,{mode:r})})}export{r as HeaderSearchClient};
|
|
@@ -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{Avatar as n,AvatarFallback as r,AvatarImage as i}from"../../../../ui/avatar.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../../../ui/button.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{Avatar as n,AvatarFallback as r,AvatarImage as i}from"../../../../ui/avatar.mjs";import{Box as a}from"../../../../ui/box.mjs";import{useLoginModalStore as o}from"../../../../../store/modules/login-modal-store.mjs";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"next/link";import{useShallow as u}from"zustand/react/shallow";function d(){let{isLogin:d,userInfo:f}=t(u(e=>({isLogin:e.isLogin,userInfo:e.userInfo}))),p=o(e=>e.open),m=s(a,{className:`relative flex h-[38px] w-[38px] items-center justify-center rounded-full bg-white/20`,children:s(a,{className:`flex h-[32px] w-[32px] items-center justify-center overflow-hidden rounded-full border-2 border-white/20 bg-[#2A1C18]`,children:c(n,{className:`h-full w-full`,children:[s(i,{src:f?.avatar_url||f?.avatar||void 0,alt:`用户头像`,className:`object-cover`}),s(r,{className:`bg-[radial-gradient(circle_at_35%_30%,#f4b1ad_0%,#915f72_42%,#3b2442_100%)]`})]})})});return d?s(l,{href:`/user/mine`,"aria-label":`打开个人主页`,className:`shrink-0`,children:m}):s(e,{onClick:p,"aria-label":`登录`,className:`m-0 inline-flex h-auto w-auto shrink-0 bg-transparent p-0 hover:bg-transparent`,children:m})}export{d as UserAvatar};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Image as t}from"../../../../ui/image.mjs";import{jsx as n}from"react/jsx-runtime";import r from"next/link";function i(i){let{ariaLabel:a,fallbackIcon:o,href:s,imageAlt:c=`header-action`,imageClassName:l,imageSrc:u,className:d}=i;return n(r,{href:s,"aria-label":a,className:e(`relative flex shrink-0 items-center justify-center text-text1`,d),children:u?n(t,{src:u,alt:c,fill:!0,sizes:`40px`,className:e(`object-cover`,l)}):o})}export{i as HeaderAction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import t from"../../../../../assets/icons/common/header-search-icon.mjs";import{jsx as n}from"react/jsx-runtime";import r from"next/link";function i(i){let{ariaLabel:a=`打开搜索页`,href:o=`/search`,className:s,iconClassName:c}=i;return n(r,{href:o,"aria-label":a,className:e(`flex h-[24px] w-[24px] shrink-0 items-center justify-center text-text1`,s),children:n(t,{className:e(`h-[24px] w-[24px]`,c),"aria-hidden":!0})})}export{i as HeaderSearchIcon};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Box as t}from"../../../../ui/box.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{children:i,className:a,mode:o=`renderer`}=r;return n(t,{as:`header`,className:e(`flex items-center px-[12px] py-[8px]`,o===`editor`&&`pointer-events-none`,a),children:i})}export{r as HeaderShell};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import
|
|
2
|
+
"use client";import e from"../../../../../assets/icons/search/video.mjs";import{HeaderAction as t}from"./header-action.mjs";import{jsx as n}from"react/jsx-runtime";function r(r){let{logoHref:i,logoSrc:a,variant:o=`default`}=r,s=o===`action`;return n(t,{href:i,ariaLabel:`打开 logo 入口`,imageSrc:a,imageAlt:`logo`,className:s?`h-[24px] w-[24px] text-white`:`h-[40px] w-[40px]`,imageClassName:s?`rounded-full object-cover`:`object-cover`,fallbackIcon:n(e,{className:s?`h-[24px] w-[24px]`:`h-[40px] w-[40px]`})})}export{r as Logo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{gContentGetRecommendSearchList as t}from"../../../../../service/generated/client.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import{useRequest as i}from"../../../../../hooks/query/use-query.mjs";import a from"../../../../../assets/icons/common/header-search-icon.mjs";import{useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"next/link";import{useShallow as u}from"zustand/react/shallow";function d(d){let{mode:f=`renderer`}=d,p=f===`editor`,{userInfo:m}=e(u(e=>({userInfo:e.userInfo}))),h=m?.user_id||`guest`,{data:g}=i([`header-search-hot-keyword`,h],()=>t({user_id:h}),{enabled:!p}),_=o(()=>{let e=(g?.data?.recommend_list??[])[0]?.title;return typeof e==`string`&&e.trim()?e.trim():`请输入搜索关键字`},[g]);return s(l,{href:`/search`,"aria-label":`打开搜索页`,className:`flex h-[34px] flex-1 items-center justify-center overflow-hidden rounded-full bg-black/40 px-[14px] backdrop-blur-[2px]`,children:c(n,{className:`flex h-[20px] items-center gap-[4px] text-white/50`,children:[s(a,{className:`h-[20px] w-[20px] shrink-0`,"aria-hidden":!0}),s(r,{as:`span`,className:`block text-[14px] leading-none text-white/50`,children:_})]})})}export{d as Search};
|
package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.d.mts
CHANGED
|
@@ -28,14 +28,6 @@ declare const homeRecommendGridInspectorPropsSchema: z$1.ZodObject<{
|
|
|
28
28
|
}>>;
|
|
29
29
|
coverUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
30
30
|
is_ad: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
31
|
-
ad: z$1.ZodOptional<z$1.ZodObject<{
|
|
32
|
-
ad_code: z$1.ZodOptional<z$1.ZodString>;
|
|
33
|
-
ad_advertise_url: z$1.ZodOptional<z$1.ZodString>;
|
|
34
|
-
ad_advertise_icon: z$1.ZodOptional<z$1.ZodString>;
|
|
35
|
-
ad_advertise_type: z$1.ZodOptional<z$1.ZodNumber>;
|
|
36
|
-
ad_advertise_desc: z$1.ZodOptional<z$1.ZodString>;
|
|
37
|
-
ad_ext_data: z$1.ZodOptional<z$1.ZodString>;
|
|
38
|
-
}, z$1.core.$strip>>;
|
|
39
31
|
ad_advertise_url: z$1.ZodOptional<z$1.ZodString>;
|
|
40
32
|
ad_advertise_icon: z$1.ZodOptional<z$1.ZodString>;
|
|
41
33
|
badge_url: z$1.ZodOptional<z$1.ZodString>;
|
package/dist/components/biz/business/home-recommend/home-recommend-grid/inspector-schema.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as n,HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as r,HOME_RECOMMEND_DEFAULT_GRID_ROWS as i,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as a,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as o,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as s,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as c,HOME_RECOMMEND_DEFAULT_TITLE as l}from"../shared/home-recommend-default-config.mjs";import u from"zod";const d=e(e=>({rows:e.number(i,{label:`行数`}),columns:e.number(r,{label:`列数`}),smartTagEnabled:e.boolean(c,{fieldType:`switch`,label:`智能铺设`}),title:e.string(l,{label:`推荐位名称`}),showPlayCount:e.boolean(s,{fieldType:`switch`,label:`显示播放量`}),playCountDelta:e.number(a,{label:`播放量浮动`}),showEpisode:e.boolean(o,{fieldType:`switch`,label:`显示集数`}),enableInfinite:e.boolean(n,{fieldType:`switch`,label:`无限下拉`,required:!1}),moreLink:e.string(``,{label:`更多`,description:``,required:!1}),smartTagIds:u.array(u.string()).optional(),catId:e.string(``,{label:`分类 ID`,description:`透传热门接口 cat_id`,required:!1}),items:u.array(u.object({contentId:u.string(),coverMode:u.enum([`upload`,`content`]).optional(),coverUrl:u.string().optional(),is_ad:u.boolean().optional(),
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as n,HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as r,HOME_RECOMMEND_DEFAULT_GRID_ROWS as i,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as a,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as o,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as s,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as c,HOME_RECOMMEND_DEFAULT_TITLE as l}from"../shared/home-recommend-default-config.mjs";import u from"zod";const d=e(e=>({rows:e.number(i,{label:`行数`}),columns:e.number(r,{label:`列数`}),smartTagEnabled:e.boolean(c,{fieldType:`switch`,label:`智能铺设`}),title:e.string(l,{label:`推荐位名称`}),showPlayCount:e.boolean(s,{fieldType:`switch`,label:`显示播放量`}),playCountDelta:e.number(a,{label:`播放量浮动`}),showEpisode:e.boolean(o,{fieldType:`switch`,label:`显示集数`}),enableInfinite:e.boolean(n,{fieldType:`switch`,label:`无限下拉`,required:!1}),moreLink:e.string(``,{label:`更多`,description:``,required:!1}),smartTagIds:u.array(u.string()).optional(),catId:e.string(``,{label:`分类 ID`,description:`透传热门接口 cat_id`,required:!1}),items:u.array(u.object({contentId:u.string(),coverMode:u.enum([`upload`,`content`]).optional(),coverUrl:u.string().optional(),is_ad:u.boolean().optional(),ad_advertise_url:u.string().optional(),ad_advertise_icon:u.string().optional(),badge_url:u.string().optional(),titleMode:u.enum([`custom`,`content`]).optional(),title:u.string().optional(),description:u.string().optional(),showPlayCount:u.boolean().optional(),playCountDelta:u.number().optional(),showEpisode:u.boolean().optional()})).optional()})),f={...t(d),smartTagIds:[],items:[]},p={rows:{type:`number`,title:`行数`,default:f.rows},columns:{type:`number`,title:`列数`,default:f.columns},smartTagEnabled:{type:`boolean`,title:`智能铺设`,default:f.smartTagEnabled},title:{type:`string`,title:`推荐位名称`,default:f.title},showPlayCount:{type:`boolean`,title:`显示播放量`,default:f.showPlayCount},playCountDelta:{type:`number`,title:`播放量浮动`,default:f.playCountDelta},showEpisode:{type:`boolean`,title:`显示集数`,default:f.showEpisode},enableInfinite:{type:`boolean`,title:`无限下拉`,default:f.enableInfinite},moreLink:{type:`string`,title:`更多`,description:``,default:f.moreLink},smartTagIds:{type:`array`,title:`智能铺设标签`,default:f.smartTagIds,items:{type:`string`,title:`标签 ID`}},catId:{type:`string`,title:`分类 ID`,description:`透传热门接口 cat_id`,default:f.catId},items:{type:`array`,title:`推荐项`,default:f.items,items:{type:`object`,title:`推荐项`,properties:{contentId:{type:`string`,title:`内容 ID`},coverMode:{type:`string`,title:`封面模式`},coverUrl:{type:`string`,title:`封面地址`},is_ad:{type:`boolean`,title:`是否广告`},ad_advertise_url:{type:`string`,title:`广告跳转地址`},ad_advertise_icon:{type:`string`,title:`广告素材地址`},badge_url:{type:`string`,title:`角标地址`},titleMode:{type:`string`,title:`标题模式`},title:{type:`string`,title:`标题`},description:{type:`string`,title:`简介`},showPlayCount:{type:`boolean`,title:`显示播放量`},playCountDelta:{type:`number`,title:`播放量浮动`},showEpisode:{type:`boolean`,title:`显示集数`}}}}};export{f as homeRecommendGridInspectorDefaultProps,d as homeRecommendGridInspectorPropsSchema,p as homeRecommendGridPropsSchema};
|
|
@@ -28,14 +28,6 @@ declare const homeRecommendGridMaterial: DefineMaterialOption<typeof HomeRecomme
|
|
|
28
28
|
}>>;
|
|
29
29
|
coverUrl: zod.ZodOptional<zod.ZodString>;
|
|
30
30
|
is_ad: zod.ZodOptional<zod.ZodBoolean>;
|
|
31
|
-
ad: zod.ZodOptional<zod.ZodObject<{
|
|
32
|
-
ad_code: zod.ZodOptional<zod.ZodString>;
|
|
33
|
-
ad_advertise_url: zod.ZodOptional<zod.ZodString>;
|
|
34
|
-
ad_advertise_icon: zod.ZodOptional<zod.ZodString>;
|
|
35
|
-
ad_advertise_type: zod.ZodOptional<zod.ZodNumber>;
|
|
36
|
-
ad_advertise_desc: zod.ZodOptional<zod.ZodString>;
|
|
37
|
-
ad_ext_data: zod.ZodOptional<zod.ZodString>;
|
|
38
|
-
}, zod_v4_core0.$strip>>;
|
|
39
31
|
ad_advertise_url: zod.ZodOptional<zod.ZodString>;
|
|
40
32
|
ad_advertise_icon: zod.ZodOptional<zod.ZodString>;
|
|
41
33
|
badge_url: zod.ZodOptional<zod.ZodString>;
|
package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.d.mts
CHANGED
|
@@ -26,14 +26,6 @@ declare const homeRecommendWaterfallInspectorPropsSchema: z$1.ZodObject<{
|
|
|
26
26
|
}>>;
|
|
27
27
|
coverUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
28
28
|
is_ad: z$1.ZodOptional<z$1.ZodBoolean>;
|
|
29
|
-
ad: z$1.ZodOptional<z$1.ZodObject<{
|
|
30
|
-
ad_code: z$1.ZodOptional<z$1.ZodString>;
|
|
31
|
-
ad_advertise_url: z$1.ZodOptional<z$1.ZodString>;
|
|
32
|
-
ad_advertise_icon: z$1.ZodOptional<z$1.ZodString>;
|
|
33
|
-
ad_advertise_type: z$1.ZodOptional<z$1.ZodNumber>;
|
|
34
|
-
ad_advertise_desc: z$1.ZodOptional<z$1.ZodString>;
|
|
35
|
-
ad_ext_data: z$1.ZodOptional<z$1.ZodString>;
|
|
36
|
-
}, z$1.core.$strip>>;
|
|
37
29
|
ad_advertise_url: z$1.ZodOptional<z$1.ZodString>;
|
|
38
30
|
ad_advertise_icon: z$1.ZodOptional<z$1.ZodString>;
|
|
39
31
|
badge_url: z$1.ZodOptional<z$1.ZodString>;
|
package/dist/components/biz/business/home-recommend/home-recommend-waterfall/inspector-schema.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as n,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as r,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as i,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as a,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as o,HOME_RECOMMEND_DEFAULT_TITLE as s}from"../shared/home-recommend-default-config.mjs";import c from"zod";const l=e(e=>({smartTagEnabled:e.boolean(o,{fieldType:`switch`,label:`智能铺设`}),title:e.string(s,{label:`推荐位名称`}),showPlayCount:e.boolean(a,{fieldType:`switch`,label:`显示播放量`}),playCountDelta:e.number(r,{label:`播放量浮动`}),showEpisode:e.boolean(i,{fieldType:`switch`,label:`显示集数`}),enableInfinite:e.boolean(n,{fieldType:`switch`,label:`无限下拉`}),moreLink:e.string(``,{label:`更多`,description:``,required:!1}),smartTagIds:c.array(c.string()).optional(),catId:e.string(``,{label:`分类 ID`,description:`透传热门接口 cat_id`,required:!1}),items:c.array(c.object({contentId:c.string(),coverMode:c.enum([`upload`,`content`]).optional(),coverUrl:c.string().optional(),is_ad:c.boolean().optional(),
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";import{HOME_RECOMMEND_DEFAULT_ENABLE_INFINITE as n,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as r,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as i,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as a,HOME_RECOMMEND_DEFAULT_SMART_TAG_ENABLED as o,HOME_RECOMMEND_DEFAULT_TITLE as s}from"../shared/home-recommend-default-config.mjs";import c from"zod";const l=e(e=>({smartTagEnabled:e.boolean(o,{fieldType:`switch`,label:`智能铺设`}),title:e.string(s,{label:`推荐位名称`}),showPlayCount:e.boolean(a,{fieldType:`switch`,label:`显示播放量`}),playCountDelta:e.number(r,{label:`播放量浮动`}),showEpisode:e.boolean(i,{fieldType:`switch`,label:`显示集数`}),enableInfinite:e.boolean(n,{fieldType:`switch`,label:`无限下拉`}),moreLink:e.string(``,{label:`更多`,description:``,required:!1}),smartTagIds:c.array(c.string()).optional(),catId:e.string(``,{label:`分类 ID`,description:`透传热门接口 cat_id`,required:!1}),items:c.array(c.object({contentId:c.string(),coverMode:c.enum([`upload`,`content`]).optional(),coverUrl:c.string().optional(),is_ad:c.boolean().optional(),ad_advertise_url:c.string().optional(),ad_advertise_icon:c.string().optional(),badge_url:c.string().optional(),titleMode:c.enum([`custom`,`content`]).optional(),title:c.string().optional(),showPlayCount:c.boolean().optional(),playCountDelta:c.number().optional(),showEpisode:c.boolean().optional()})).optional()})),u={...t(l),smartTagIds:[],items:[]},d={smartTagEnabled:{type:`boolean`,title:`智能铺设`,default:u.smartTagEnabled},title:{type:`string`,title:`推荐位名称`,default:u.title},showPlayCount:{type:`boolean`,title:`显示播放量`,default:u.showPlayCount},playCountDelta:{type:`number`,title:`播放量浮动`,default:u.playCountDelta},showEpisode:{type:`boolean`,title:`显示集数`,default:u.showEpisode},enableInfinite:{type:`boolean`,title:`无限下拉`,default:u.enableInfinite},moreLink:{type:`string`,title:`更多`,description:``,default:u.moreLink},smartTagIds:{type:`array`,title:`智能铺设标签`,default:u.smartTagIds,items:{type:`string`,title:`标签 ID`}},catId:{type:`string`,title:`分类 ID`,description:`透传热门接口 cat_id`,default:u.catId},items:{type:`array`,title:`推荐项`,default:u.items,items:{type:`object`,title:`推荐项`,properties:{contentId:{type:`string`,title:`内容 ID`},coverMode:{type:`string`,title:`封面模式`},coverUrl:{type:`string`,title:`封面地址`},is_ad:{type:`boolean`,title:`是否广告`},ad_advertise_url:{type:`string`,title:`广告跳转地址`},ad_advertise_icon:{type:`string`,title:`广告素材地址`},badge_url:{type:`string`,title:`角标地址`},titleMode:{type:`string`,title:`标题模式`},title:{type:`string`,title:`标题`},showPlayCount:{type:`boolean`,title:`显示播放量`},playCountDelta:{type:`number`,title:`播放量浮动`},showEpisode:{type:`boolean`,title:`显示集数`}}}}};export{u as homeRecommendWaterfallInspectorDefaultProps,l as homeRecommendWaterfallInspectorPropsSchema,d as homeRecommendWaterfallPropsSchema};
|
|
@@ -26,14 +26,6 @@ declare const homeRecommendWaterfallMaterial: DefineMaterialOption<typeof HomeRe
|
|
|
26
26
|
}>>;
|
|
27
27
|
coverUrl: zod.ZodOptional<zod.ZodString>;
|
|
28
28
|
is_ad: zod.ZodOptional<zod.ZodBoolean>;
|
|
29
|
-
ad: zod.ZodOptional<zod.ZodObject<{
|
|
30
|
-
ad_code: zod.ZodOptional<zod.ZodString>;
|
|
31
|
-
ad_advertise_url: zod.ZodOptional<zod.ZodString>;
|
|
32
|
-
ad_advertise_icon: zod.ZodOptional<zod.ZodString>;
|
|
33
|
-
ad_advertise_type: zod.ZodOptional<zod.ZodNumber>;
|
|
34
|
-
ad_advertise_desc: zod.ZodOptional<zod.ZodString>;
|
|
35
|
-
ad_ext_data: zod.ZodOptional<zod.ZodString>;
|
|
36
|
-
}, zod_v4_core0.$strip>>;
|
|
37
29
|
ad_advertise_url: zod.ZodOptional<zod.ZodString>;
|
|
38
30
|
ad_advertise_icon: zod.ZodOptional<zod.ZodString>;
|
|
39
31
|
badge_url: zod.ZodOptional<zod.ZodString>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{pContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{useRouter as t}from"../../../../../utils/use-compatible-router.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import a from"../../../../ui/loading.mjs";import o from"../../../../ui/link.mjs";import{useGridFirstRowHeight as s,useWaterfallFirstRowHeight as c}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as l}from"../../../../../hooks/use-min-duration-loading.mjs";import u from"../../../../../assets/icons/detail/video_flag.mjs";import{getFeedAdIcon as ee,getFeedAdJumpUrl as d,isFeedAdItem as f}from"../../advertisement/feed-ad/index.mjs";import{MiniThreeCard as p}from"../../../../common/cards/mini-three-card.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as m,HOME_RECOMMEND_DEFAULT_GRID_ROWS as te,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as h,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as ne,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as g,HOME_RECOMMEND_MAX_GRID_COLUMNS as re,HOME_RECOMMEND_MAX_GRID_ROWS as ie}from"./home-recommend-default-config.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as _}from"./home-recommend-preview.mjs";import{enrichHomeRecommendItemsWithVideoDetails as v}from"./home-recommend-video-detail.mjs";import{useCallback as y,useEffect as b,useLayoutEffect as ae,useMemo as x,useRef as S,useState as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";const oe={},se={list:[]},ce=new Map;function E({variant:n,props:o=oe,data:u=se,mode:ee=`renderer`}){let d=ee===`editor`,f=t(),{list:p,title:_,cursor:E}=u,D=x(()=>Array.isArray(p)?p:[],[p]),O=x(()=>Array.isArray(u.icons)?u.icons:[],[u.icons]),{rows:pe,columns:me,moreLink:he,title:ge,smartTagEnabled:_e,smartTagIds:k,catId:A,showPlayCount:ve,playCountDelta:ye,showEpisode:xe,enableInfinite:Se,items:M}=o,N=_e===!0,Ce=Se===!0&&N,P=!d&&Ce&&D.length>=16,F=x(()=>Array.isArray(k)?k.map(e=>String(e||``).trim()).filter(Boolean):[],[k]),I=typeof A==`string`?A.trim():``,L=x(()=>N||!Array.isArray(M)?``:M.map(e=>String(e?.contentId||``).trim()).filter(Boolean).join(`,`),[N,M]),[we,Te]=C(0),[R,z]=C(D),[B,Ee]=C(O),[V,H]=C(()=>typeof E==`string`?E:void 0),[De,Oe]=C(!1),ke=S(null),Ae=S(null),U=S(null),je=S([]),W=S({left:null,right:null}),Me=S(!1),G=S(``),{isLoading:Ne,show:Pe,hide:Fe}=l(600),Ie=de(pe,te,ie),K=de(me,m,re),q=Ce?16:n===`grid`?Ie*K:16,J=x(()=>[n,N?`smart`:`manual:${L}`,F.join(`,`),I,String(q)].join(`|`),[N,L,I,q,F,n]);b(()=>{let e=ce.get(J);if(e){z(e.items),Ee(e.icons),H(e.cursor),G.current=J;return}G.current!==J&&(z(D),Ee(O),H(typeof E==`string`?E:void 0))},[E,O,D,J]),b(()=>{d||ce.set(J,{items:R,icons:B,cursor:V})},[d,V,J,B,R]);let Le=Ie*K,Re=d&&n===`grid`,Y=Re?R.slice(0,Le):R,ze=Re?B.slice(0,Le):B,Be=n===`waterfall`?6:4,X=Y.length>0?Math.max(0,Y.length-Be):-1,Ve=!!V,He=ge&&ge.trim()||_||``,Ue=ve??g,We=Number(ye??h),Ge=xe??ne,Ke=!Ce,Z=Ke?ue(he):``,qe=Ke&&!!Z,Je=s({enabled:!d&&n===`grid`,containerRef:Ae,firstRowItemRef:je,columns:K,itemsCount:Y.length,deps:[n]}),Ye=c({enabled:!d&&n===`waterfall`,containerRef:ke,firstRowRef:W,deps:[n,Y.length]}),Xe=n===`grid`?Je:Ye,Ze=y(async()=>{if(d)return;if(G.current===J){G.current=J;return}let t=N||!!L;if(G.current=J,t)try{if(Pe(),!N){if(!L)return;z(await v(R));return}let t=await e({page_size:q,tags:F.length>0?F:void 0,cat_id:I||void 0},{cache:`no-store`}),n=Array.isArray(t.data?.videos)?t.data.videos:[],r=t.data?.cursor;z(n),H(r)}catch(e){console.error(`推荐位刷新首屏失败(client)`,e)}finally{Fe()}},[Fe,d,N,L,J,I,q,F,R,Pe]);b(()=>{Ze()},[Ze]);let Qe=y(async()=>{let t=V;if(!(!P||!t||Me.current)){Me.current=!0,Oe(!0);try{let n=await e({cursor:t,page_size:q,tags:F.length>0?F:void 0,cat_id:I||void 0}),r=Array.isArray(n.data?.videos)?n.data.videos:[],i=n.data?.cursor;r.length>0&&z(e=>e.concat(r)),H(e=>{if(!(!r.length||!i))return i===e?void 0:i})}catch(e){console.error(`推荐位加载下一页失败(client)`,e),H(void 0)}finally{Me.current=!1,Oe(!1)}}},[V,I,q,F,P]),$e=y(()=>{if(Z){if(Z.startsWith(`http`)){window.location.href=Z;return}f.push(Z)}},[Z,f]);b(()=>{let e=U.current;if(!e||!P||!Ve)return;let t=new IntersectionObserver(e=>{!e[0]?.isIntersecting||De||Qe()},{root:null,threshold:0});return t.observe(e),()=>{t.disconnect()}},[Qe,Ve,De,Y.length,q,P,X]),ae(()=>{let e=ke.current;if(!e||n!==`waterfall`)return;let t=()=>{let t=e.clientWidth||0;Te(t>0?(t-12)/2:0)};t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect()}},[n]);let Q=x(()=>n===`waterfall`?be(Y,ze,we):{left:[],right:[]},[we,ze,Y,n]);if(b(()=>{n===`waterfall`&&(Q.left.length||(W.current.left=null),Q.right.length||(W.current.right=null))},[n,Q.left.length,Q.right.length]),!Y.length)return null;let $=!d&&Ne,et=!d&&De,tt=Xe>0?Xe/2:160;return T(r,{className:`w-full mt-[16px]`,children:[T(r,{className:`flex items-center justify-between px-[12px] mb-[8px]`,children:[w(i,{className:`flex-1 min-w-0 text-text1 text-[18px] leading-[26px] font-bold line-clamp-1`,children:He}),qe&&w(i,{className:`text-text3 text-[12px] leading-[18px] cursor-pointer`,onClick:$e,children:`更多`})]}),n===`grid`&&T(r,{ref:Ae,className:`w-full flex flex-wrap px-[12px] relative`,children:[Y.map((e,t)=>{let r=ze[t],i=fe(e),a=Ue&&(i?.showPlayCount??!0),o=i?.playCountDelta??We,s=i?.showEpisode??Ge,c=t%K,l=K>1?{paddingLeft:12*c/K,paddingRight:12*(K-c-1)/K}:void 0;return w(`div`,{ref:e=>{t===X&&(U.current=e),t<K&&(je.current[t]=e)},className:`min-w-0`,style:{width:`${100/K}%`,...l||{}},children:w(le,{variant:n,item:e,icon:r,index:t,showPlayCount:a,playCountDelta:o,showEpisode:s,widthStyle:{width:`100%`}})},j(e,t))}),$&&w(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),$&&w(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:tt},"aria-hidden":!0,children:w(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),n===`waterfall`&&T(r,{ref:ke,className:`w-full px-[12px] flex gap-[12px] relative`,children:[w(r,{className:`flex-1 min-w-0 flex flex-col`,children:Q.left.map((e,t)=>{let r=fe(e.item),i=Ue&&(r?.showPlayCount??!0),a=r?.playCountDelta??We,o=r?.showEpisode??Ge;return w(`div`,{ref:n=>{e.index===X&&(U.current=n),t===0&&(W.current.left=n)},children:w(le,{variant:n,item:e.item,icon:e.icon,index:e.index,showPlayCount:i,playCountDelta:a,showEpisode:o,widthStyle:{width:`100%`}})},j(e.item,e.index))})}),w(r,{className:`flex-1 min-w-0 flex flex-col`,children:Q.right.map((e,t)=>{let r=fe(e.item),i=Ue&&(r?.showPlayCount??!0),a=r?.playCountDelta??We,o=r?.showEpisode??Ge;return w(`div`,{ref:n=>{e.index===X&&(U.current=n),t===0&&(W.current.right=n)},children:w(le,{variant:n,item:e.item,icon:e.icon,index:e.index,showPlayCount:i,playCountDelta:a,showEpisode:o,widthStyle:{width:`100%`}})},j(e.item,e.index))})}),$&&w(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),$&&w(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:tt},"aria-hidden":!0,children:w(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),et&&w(r,{className:`w-full flex justify-center py-[12px]`,children:w(a,{size:`medium`,showLabel:!1,className:`text-theme5`})})]})}function le({variant:e,item:t,icon:a,index:s,showPlayCount:c,playCountDelta:l,showEpisode:m,widthStyle:te}){let h=f(t),ne=pe(t),g=t.name||t?.title||``,re=_e(k(t.static?.browse_cnt??0,l)),ie=he(t,m),_=ye(t,a,s),v=h?d(t):O(t),y=c&&!h,b=m&&!h;if(h){let e=ee(t)||ne;return w(r,{className:`w-full`,style:te,children:T(o,{href:v,className:`block w-full`,children:[T(r,{className:`relative w-full overflow-hidden rounded-[8px] bg-white`,style:{aspectRatio:`175 / 280`},children:[e&&w(r,{className:`absolute top-0`,style:{left:`-44.57%`,width:`321.14%`,height:`100%`},children:w(n,{src:e,alt:g||`广告封面`,fill:!0,objectFit:`cover`})}),w(r,{className:`absolute right-0 top-0 flex items-center justify-center`,style:{width:`32%`,height:`8.93%`,minWidth:`56px`,minHeight:`25px`,borderBottomLeftRadius:`8px`,backgroundColor:`rgba(0, 0, 0, 0.33)`},children:w(i,{className:`text-white`,style:{fontSize:`12px`,lineHeight:`normal`},children:`广告`})})]}),w(r,{className:`pt-[8px]`,children:w(i,{as:`h3`,className:`line-clamp-1 text-[14px] leading-[20px] text-white`,children:g})})]})})}return w(p,{url:ne,text:g,className:`w-full`,style:te,topRightChild:_?w(D,{url:_}):void 0,bottomLeftChild:y?T(r,{className:`h-[20px] leading-[20px] text-[#fff] text-[12px] px-[4px] py-0 rounded-[4px] bg-[rgba(255,255,255,0.1)] ml-[4px] flex items-center gap-[4px]`,children:[w(u,{className:`w-[12px] h-[12px] text-[#fff] shrink-0`}),re]}):null,bottomRightChild:b?ie&&w(i,{className:`text-[#fff] text-[12px] leading-[18px] pr-2`,children:ie}):null,textChild:w(r,{className:`py-[4px]`,children:w(i,{as:`h3`,className:`text-text1 text-[16px] leading-[24px] ${e===`waterfall`?`break-words line-clamp-3`:`line-clamp-1`}`,children:g})}),linkPath:v})}function D({url:e}){return w(r,{className:`relative w-[40px] h-[20px]`,children:w(n,{src:e,alt:`corner`,width:40,height:20,className:`w-full h-auto`})})}function O(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function ue(e){return e?e.trim():``}function de(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function fe(e){return e[_]}function pe(e){return e.img_y||e.img_x||e?.coverUrl}function me(e){return typeof e==`string`?e:``}function he(e,t){if(!t)return``;if(ge(e)){let t=e.update_status===`0`,n=Number(e.episode_cnt||e.links?.length||0);return n>0?`${t?`更新至`:`全`}${n}集`:``}return ve(Number(e.duration||0))}function ge(e){if(Number(e.type??0)===2)return!0;let t=Number(e.episode_cnt||e.links?.length||0);return Number.isFinite(t)&&t>1}function _e(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e6?`${A(e/1e6)}M`:e>=1e3?`${A(e/1e3)}k`:Math.floor(e).toString()}function k(e,t){let n=Number(e||0),r=Number(t||0);return!Number.isFinite(n)||!Number.isFinite(r)?0:Math.max(0,n+r)}function A(e){let t=e.toFixed(1);return t.endsWith(`.0`)?t.slice(0,-2):t}function ve(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function ye(e,t,n){return me(e.badge_url)||me(t?.material_url)||``}function be(e,t,n){let r=[],i=[],a=n<=0,o=0,s=0;return e.forEach((e,c)=>{let l=t[c];if(a){c%2==0?r.push({item:e,icon:l,index:c}):i.push({item:e,icon:l,index:c});return}let u=xe(n,e);o<=s?(r.push({item:e,icon:l,index:c}),o+=u):(i.push({item:e,icon:l,index:c}),s+=u)}),{left:r,right:i}}function xe(e,t){if(!e)return 0;let n=e*1.3461538461538463,r=he(t,!0)?18:0;return n+20+r+6+16}function j(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}export{E as default};
|
|
2
|
+
"use client";import{pContentGetPopularVideoList as e}from"../../../../../service/generated/client.mjs";import{Image as t}from"../../../../ui/image.mjs";import{Box as n}from"../../../../ui/box.mjs";import{Text as r}from"../../../../ui/text.mjs";import i from"../../../../ui/loading.mjs";import a from"../../../../ui/link.mjs";import{useGridFirstRowHeight as o,useWaterfallFirstRowHeight as s}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as c}from"../../../../../hooks/use-min-duration-loading.mjs";import l from"../../../../../assets/icons/common/right_arrow.mjs";import u from"../../../../../assets/icons/common/right_arrow_thin.mjs";import{WaterfallRecommend as d}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as f,HOME_RECOMMEND_DEFAULT_GRID_ROWS as ee,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as te,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as p,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as m,HOME_RECOMMEND_DEFAULT_TITLE as ne,HOME_RECOMMEND_MAX_GRID_COLUMNS as re,HOME_RECOMMEND_MAX_GRID_ROWS as ie}from"./home-recommend-default-config.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as ae}from"./home-recommend-preview.mjs";import{enrichHomeRecommendItemsWithVideoDetails as oe}from"./home-recommend-video-detail.mjs";import{useCallback as se,useEffect as h,useId as g,useLayoutEffect as ce,useMemo as _,useRef as v,useState as y}from"react";import{Fragment as le,jsx as b,jsxs as x}from"react/jsx-runtime";const ue={backgroundImage:`var(--gradient-card-mask-medium)`},de={},fe={list:[]};function S({variant:t,props:ae=de,data:g=fe,mode:ue=`renderer`}){let S=ue===`editor`,{list:C,title:me,cursor:w}=g,T=_(()=>Array.isArray(C)?C:[],[C]),E=_(()=>Array.isArray(g.icons)?g.icons:[],[g.icons]),{rows:ve,columns:ye,moreLink:be,title:xe,smartTagEnabled:Se,smartTagIds:D,catId:O,showPlayCount:Ce,playCountDelta:we,showEpisode:Te,enableInfinite:k,items:A}=ae,j=Se===!0,M=k===!0&&j,N=!S&&M&&T.length>=16,P=_(()=>Array.isArray(D)?D.map(e=>String(e||``).trim()).filter(Boolean):[],[D]),F=typeof O==`string`?O.trim():``,I=_(()=>j||!Array.isArray(A)?``:A.map(e=>String(e?.contentId||``).trim()).filter(Boolean).join(`,`),[j,A]),[ke,Ae]=y(0),[L,R]=y(T),[je,Me]=y(E),[z,B]=y(()=>typeof w==`string`?w:void 0),[V,Ne]=y(!1),Pe=v(null),Fe=v(null),H=v(null),Ie=v([]),U=v({left:null,right:null}),W=v(!1),G=v(``),{isLoading:Le,show:Re,hide:ze}=c(600),Be=ge(ve,ee,ie),K=ge(ye,f,re),q=M?16:t===`grid`?Be*K:16,J=_(()=>[t,j?`smart`:`manual:${I}`,P.join(`,`),F,String(q)].join(`|`),[j,I,F,q,P,t]);h(()=>{R(T),Me(E),B(typeof w==`string`?w:void 0)},[w,E,T]);let Ve=Be*K,He=S&&t===`grid`,Y=He?L.slice(0,Ve):L,Ue=He?je.slice(0,Ve):je,We=t===`waterfall`?6:4,Ge=Y.length>0?Math.max(0,Y.length-We):-1,Ke=!!z,qe=xe&&xe.trim()||me||ne,X=Ce??m,Z=Number(we??te),Q=Te??p,Je=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 ${S?`text-[#1F1F1F]`:`text-text2`}`,Ye=t===`grid`?u:S?l:u,Xe=he(be),Ze=(t===`waterfall`||!M)&&!!Xe,Qe=Ze?Xe:``,$e=t===`grid`?`flex size-[24px] shrink-0 items-center justify-center ${S?`opacity-100`:`opacity-50`}`:`ml-[8px] flex size-[24px] shrink-0 items-center justify-center ${S?`opacity-100`:`opacity-50`}`,et=t===`grid`?`size-[16px] ${S?`text-[#1F1F1F]`:`text-text1`}`:S?`h-[12px] w-[12px] text-[#1F1F1F]`:`size-[16px] text-text1`,tt=o({enabled:!S&&t===`grid`,containerRef:Fe,firstRowItemRef:Ie,columns:K,itemsCount:Y.length,deps:[t]}),nt=s({enabled:!S&&t===`waterfall`,containerRef:Pe,firstRowRef:U,deps:[t,Y.length]}),rt=t===`grid`?tt:nt,it=se(async()=>{if(S)return;if(G.current===J){G.current=J;return}let t=j||!!I;if(G.current=J,t)try{if(Re(),!j){if(!I)return;R(await oe(L));return}let t=await e({page_size:q,tags:P.length>0?P:void 0,cat_id:F||void 0},{cache:`no-store`}),n=Array.isArray(t.data?.videos)?t.data.videos:[],r=t.data?.cursor;R(n),B(r)}catch(e){console.error(`推荐位刷新首屏失败(client)`,e)}finally{ze()}},[ze,S,j,I,J,F,q,P,L,Re]);h(()=>{it()},[it]);let at=se(async()=>{let t=z;if(!(!N||!t||W.current)){W.current=!0,Ne(!0);try{let n=await e({cursor:t,page_size:q,tags:P.length>0?P:void 0,cat_id:F||void 0}),r=Array.isArray(n.data?.videos)?n.data.videos:[],i=n.data?.cursor;r.length>0&&R(e=>e.concat(r)),B(e=>{if(!(!r.length||!i))return i===e?void 0:i})}catch(e){console.error(`推荐位加载下一页失败(client)`,e),B(void 0)}finally{W.current=!1,Ne(!1)}}},[z,F,q,P,N]);h(()=>{let e=H.current;if(!e||!N||!Ke)return;let t=new IntersectionObserver(e=>{!e[0]?.isIntersecting||V||at()},{root:null,threshold:0});return t.observe(e),()=>{t.disconnect()}},[at,Ke,V,Y.length,q,N,Ge]),ce(()=>{let e=Pe.current;if(!e||t!==`waterfall`)return;let n=()=>{let t=e.clientWidth||0;Ae(t>0?(t-15)/2:0)};n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect()}},[t]);let $=_(()=>t===`waterfall`?De(Y,Ue,ke):{left:[],right:[]},[ke,Ue,Y,t]),ot=_(()=>t===`waterfall`?{left:$.left.map(e=>Ee(e,X,Z,Q)),right:$.right.map(e=>Ee(e,X,Z,Q))}:{left:[],right:[]},[Z,Q,X,t,$.left,$.right]);if(h(()=>{t===`waterfall`&&($.left.length||(U.current.left=null),$.right.length||(U.current.right=null))},[t,$.left.length,$.right.length]),!Y.length)return null;let st=!S&&Le,ct=!S&&V,lt=rt>0?rt/2:160;return x(n,{className:`w-full mt-[16px]`,children:[t===`grid`&&x(n,{className:`flex items-center justify-between pl-[16px] pr-0 mb-[16px]`,children:[b(r,{className:Je,children:qe}),Ze&&b(a,{href:Qe,"aria-label":`更多`,className:$e,children:b(Ye,{className:et})})]}),t===`grid`&&x(n,{ref:Fe,className:`relative flex w-full flex-wrap items-start gap-[16px] px-[16px]`,children:[Y.map((e,t)=>{let n=Ue[t],r=_e(e);return b(`div`,{ref:e=>{t===Ge&&(H.current=e),t<K&&(Ie.current[t]=e)},className:`w-[calc((100%-16px)/2)]`,children:b(pe,{item:e,icon:n,index:t,showPlayCount:X&&(r?.showPlayCount??!0),playCountDelta:r?.playCountDelta??Z,showEpisode:r?.showEpisode??Q,widthStyle:{width:`100%`}})},Oe(e,t))}),st&&b(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),st&&b(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:lt},"aria-hidden":!0,children:b(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),t===`waterfall`&&b(d,{title:qe,moreHref:Qe||void 0,moreIcon:Ze?b(Ye,{className:et}):void 0,titleClassName:Je,moreLinkClassName:$e,columns:ot,containerClassName:`relative flex w-full gap-[15px] px-[16px]`,getItemRef:({item:e,column:t,columnIndex:n})=>r=>{e.sourceIndex===Ge&&(H.current=r),n===0&&(U.current[t]=r)},overlay:st?x(le,{children:[b(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),b(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:lt},"aria-hidden":!0,children:b(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]}):void 0}),ct&&b(n,{className:`w-full flex justify-center py-[12px]`,children:b(i,{size:`medium`,showLabel:!1,className:`text-theme5`})})]})}function pe({item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o}){return b(C,{item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o})}function C({item:e,icon:i,index:o,showPlayCount:s,playCountDelta:c,showEpisode:l,widthStyle:u}){let d=E(e),f=e.name||e?.title||``,ee=e.id?T(e):`#`,te=N(e,i,o),p=Te(e,l),m=s?D(e.static?.browse_cnt??0,c):``;return b(a,{href:ee,className:`block w-full`,style:u,children:x(n,{className:`relative w-full overflow-hidden rounded-[8px] bg-bg3`,style:{aspectRatio:`109 / 150`},children:[d&&b(t,{src:d,alt:f||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover object-top`}),b(n,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:ue,"aria-hidden":!0}),te&&b(n,{className:`absolute left-[8px] top-[8px] z-10`,children:b(me,{url:te})}),p&&b(n,{className:`absolute right-[8px] top-[10px] z-10 max-w-[56px]`,children:b(r,{as:`span`,className:`block text-right text-[10px] leading-[14px] font-medium not-italic text-text1 line-clamp-1 font-['PingFang_SC']`,children:p})}),x(n,{className:`absolute left-[8px] right-[8px] bottom-[8px] top-[78px] z-10 flex flex-col justify-end`,children:[b(n,{className:`flex min-h-[40px] w-full items-end`,children:b(r,{as:`h3`,className:`w-full line-clamp-2 text-[14px] font-medium not-italic leading-normal text-white font-['PingFang_SC']`,children:f})}),m&&x(n,{className:`flex h-[20px] items-center gap-[6px]`,children:[b(w,{className:`h-[15px] w-[12px] shrink-0`}),b(r,{as:`span`,className:`shrink-0 whitespace-nowrap text-[14px] font-normal not-italic leading-normal text-text3 font-['PingFang_SC']`,children:m})]})]})]})})}function me({url:e}){return b(t,{src:e,alt:`角标`,width:96,height:18,className:`h-[18px] w-auto max-w-[96px] object-contain`})}function w({className:e}){let t=g().replace(/:/g,``),n=`grid-heat-outer-${t}`,r=`grid-heat-highlight-left-${t}`,i=`grid-heat-highlight-right-${t}`;return x(`svg`,{viewBox:`0 0 11.9811 15`,fill:`none`,"aria-hidden":!0,className:e,children:[b(`path`,{d:`M2.94686 4.47572C4.52521 4.03871 4.39118 0.994604 4.39118 0C7.76131 0.497302 8.72372 3.31535 9.20563 4.97302C14.02 7.45953 12.568 15.9138 4.87263 14.9191C-2.42073 13.9763 -0.183446 5.34241 2.94686 4.47572Z`,fill:`url(#${n})`}),b(`path`,{d:`M5.66995 6.45327C6.82541 4.06622 5.16406 1.16037 4.20118 0C4.13684 1.21533 4.37554 3.91735 2.75432 4.45159C1.0513 5.01279 0.16048 7.16814 0 8.16274L3.26275 9.93438C3.58371 9.76861 4.51449 8.84032 5.66995 6.45327Z`,fill:`url(#${r})`,transform:`translate(0.19 0.01)`}),b(`path`,{d:`M3.55359 3.57102C2.65587 2.53581 3.298 0.846416 3.48828 0C0.514078 0.39887 -0.0720454 5.22416 0.0066677 7.58695L4.28508 8.57876C4.99512 7.12607 4.45131 4.60622 3.55359 3.57102Z`,fill:`url(#${i})`,transform:`translate(7.39 2.85)`}),x(`defs`,{children:[x(`linearGradient`,{id:n,x1:`7.35676`,y1:`1.93157`,x2:`3.49864`,y2:`15.4663`,gradientUnits:`userSpaceOnUse`,children:[b(`stop`,{offset:`0.0817308`,stopColor:`#FF3F49`}),b(`stop`,{offset:`0.6`,stopColor:`#FF4D56`}),b(`stop`,{offset:`1`,stopColor:`#FFA060`})]}),x(`linearGradient`,{id:r,x1:`4.39349`,y1:`0`,x2:`0.834125`,y2:`10.4383`,gradientUnits:`userSpaceOnUse`,children:[b(`stop`,{stopColor:`#FFBCB5`}),b(`stop`,{offset:`0.834055`,stopColor:`#FE676F`,stopOpacity:`0`})]}),x(`linearGradient`,{id:i,x1:`2.30551`,y1:`2.82163`,x2:`0.860506`,y2:`6.96924`,gradientUnits:`userSpaceOnUse`,children:[b(`stop`,{stopColor:`#FFA49B`}),b(`stop`,{offset:`1`,stopColor:`#FE676F`,stopOpacity:`0`})]})]})]})}function T(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function he(e){return e?e.trim():``}function ge(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function _e(e){return e[ae]}function E(e){return e.img_y||e.img_x||e?.coverUrl}function ve(e){return typeof e==`string`?e:``}function ye(e){return typeof e==`string`?e.trim():``}function be(e){return ye(e.img_type).toLowerCase()===`long`?`short`:`tall`}function xe(e,t){return t===`short`?e.img_x||e.img_y||e?.coverUrl:e.img_y||e.img_x||e?.coverUrl}function Se(e,t){return(e.tags?.map(e=>e.name).filter(Boolean).join(` · `)??``)||(t?we(e,!0):``)}function D(e,t){let n=j(e,t);return n<=0?``:`${O(n)}热度`}function O(e){return!Number.isFinite(e)||e<=0?`0`:e>=1e4?`${Math.floor(e/1e4)}万`:Math.floor(e).toString()}function Ce(e){let t=Number(e);if(!(!Number.isFinite(t)||t<=0))return t>10&&t<=100?t/10:Math.min(t,10)}function we(e,t){return t?k(e)||M(Number(e.duration||0)):``}function Te(e,t){return t?k(e):``}function k(e){if(!A(e))return``;let t=e.update_status===`0`,n=Number(e.episode_cnt||e.links?.length||0);return n>0?`${t?`更新至`:`全`}${n}集`:``}function A(e){if(Number(e.type??0)===2)return!0;let t=Number(e.episode_cnt||e.links?.length||0);return Number.isFinite(t)&&t>1}function j(e,t){let n=Number(e||0),r=Number(t||0);return!Number.isFinite(n)||!Number.isFinite(r)?0:Math.max(0,n+r)}function M(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function N(e,t,n){return ve(e.badge_url)||ve(t?.material_url)||``}function Ee(e,t,n,r){let i=be(e.item),a=xe(e.item,i),o=e.item.name||e.item?.title||``,s=e.item.id?T(e.item):`#`,c=N(e.item,e.icon,e.index),l=Se(e.item,r),u=t?D(e.item.static?.browse_cnt??0,n):``,d=Ce(e.item.score);return{key:Oe(e.item,e.index),sourceIndex:e.index,href:s,cardKind:i,coverUrl:a,title:o,badgeImageUrl:c,metaPrimaryText:l,heatText:u,score:d}}function De(e,t,n){let r=[],i=[],a=n<=0,o=0,s=0;return e.forEach((e,c)=>{let l=t[c];if(a){c%2==0?r.push({item:e,icon:l,index:c}):i.push({item:e,icon:l,index:c});return}let u=P(n,e);o<=s?(r.push({item:e,icon:l,index:c}),o+=u):(i.push({item:e,icon:l,index:c}),s+=u)}),{left:r,right:i}}function P(e,t){return e?(be(t)===`tall`?218:120)+16:0}function Oe(e,t){return e.id?`home-recommend-${e.id}`:`home-recommend-${t}`}export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as e,HOME_RECOMMEND_DEFAULT_GRID_ROWS as t,HOME_RECOMMEND_DEFAULT_TITLE as n,HOME_RECOMMEND_MAX_GRID_COLUMNS as r,HOME_RECOMMEND_MAX_GRID_ROWS as i}from"./home-recommend-default-config.mjs";const a=`/static/components-thumb/video_player.png`,o=`__homeRecommendCardConfig`,s=Array.from({length:60},(e,t)=>{let n=t%2==
|
|
2
|
+
import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as e,HOME_RECOMMEND_DEFAULT_GRID_ROWS as t,HOME_RECOMMEND_DEFAULT_TITLE as n,HOME_RECOMMEND_MAX_GRID_COLUMNS as r,HOME_RECOMMEND_MAX_GRID_ROWS as i}from"./home-recommend-default-config.mjs";const a=`/static/components-thumb/video_player.png`,o=`__homeRecommendCardConfig`,s=[`东野圭吾作品:11字谜案`,`诡异纸嫁衣:深夜回魂`,`夜行者档案:无声证词`,`狐面新娘:冥婚谜局`,`赤焰长歌:风雪诛心`,`山海禁术:九尾秘闻`],c=[`烧脑悬疑`,`民俗怪谈`,`悬疑推理`,`东方奇幻`,`古风权谋`,`奇诡冒险`],l=[8.9,9.1,8.7,9.3,8.8,9],u=[``,`独播`,``,`巅峰榜·历史上榜`,``,`独播`],d=Array.from({length:60},(e,t)=>{let n=t%2==0,r=s[t%s.length],i=c[t%c.length],o=l[t%l.length],d=u[t%u.length],f=d?[{id:`preview-tag-${t+1}`,name:d}]:void 0,p={browse_cnt:2242e4+t*186e3};return{id:`preview-recommend-${t+1}`,name:r,img_y:a,img_x:a,img_type:t%3==1?`long`:`short`,cat_name:i,score:o,tags:f,type:n?2:1,duration:n?0:60*(18+t),episode_cnt:n?24+t%3*6:0,static:p}});function f({variant:e,enableInfinite:t,rows:n,columns:r,items:i}){let a=Array.isArray(i)?i.length:0;return e===`grid`?a>0?a:Math.max(g(n,r),2,a):t?Math.max(8,a):e===`waterfall`?Math.max(4,a):Math.max(2,a)}function p(e){let t=Math.max(1,Math.floor(e));return Array.from({length:t},(e,t)=>{let n=d[t%d.length];return{...n,id:`preview-recommend-${t+1}`,name:n.name}})}function m(e,t,n){return t.length?e.map((e,r)=>{let i=t[r];if(!i)return e;let a=(i.contentId?n.get(i.contentId):void 0)||e,s=i.titleMode===`custom`?i.title?.trim()||a.name||e.name||``:a.name||e.name||``,c=i.coverUrl?.trim()||``,l=i.coverMode===`content`,u=l?a.img_y||a.img_x||e.img_y||e.img_x||c||``:c||a.img_y||a.img_x||e.img_y||e.img_x||``,d=l?a.img_x||a.img_y||e.img_x||e.img_y||c||``:c||a.img_x||a.img_y||e.img_x||e.img_y||``,f=a.badge_url||e.badge_url||``,p=i.badge_url??f,m=h(i,a),g=i.is_ad===!0;return{...e,...a,id:a.id||e.id||`preview-recommend-${r+1}`,name:s,img_y:u,img_x:d,is_ad:g,ad_advertise_url:g?i.ad_advertise_url?.trim()||``:void 0,ad_advertise_icon:g?i.ad_advertise_icon?.trim()||u||d||``:void 0,badge_url:p||void 0,[o]:m}}):e}function h(e,t){let n=t[o],r={showPlayCount:e.showPlayCount??n?.showPlayCount,playCountDelta:e.playCountDelta??n?.playCountDelta,showEpisode:e.showEpisode??n?.showEpisode};if(!(r.showPlayCount===void 0&&r.playCountDelta===void 0&&r.showEpisode===void 0))return r}function g(n,a){return _(n,t,1,i)*_(a,e,1,r)}function _(e,t,n,r){let i=Number(e);return Number.isFinite(i)?Math.min(r,Math.max(n,Math.floor(i))):t}function v({variant:e,schemaTitle:t,enableInfinite:r,smartTagEnabled:i,rows:a,columns:o,items:s}){let c=new Map,l=i?[]:Array.isArray(s)?s.filter(Boolean):[],u=m(p(f({variant:e,enableInfinite:r,rows:a,columns:o,items:l})),l,c);return{title:t&&t.trim()||n,list:u,icons:[],cursor:``,show_style:void 0}}export{o as HOME_RECOMMEND_CARD_CONFIG_FIELD,v as buildHomeRecommendEditorPreviewData};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils.mjs";
|
|
4
|
+
import { hotRecommendInspectorPropsSchema } from "./schema.mjs";
|
|
5
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region components/biz/business/hot-recommend/client.d.ts
|
|
8
|
+
type HotRecommendProps = InferSchemaProps<typeof hotRecommendInspectorPropsSchema>;
|
|
9
|
+
interface ClientProps extends HotRecommendProps {
|
|
10
|
+
onItemClick?: (keyword: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 热门推荐物料组件 - 客户端部分
|
|
14
|
+
*/
|
|
15
|
+
declare function HotRecommendClient(props: ClientProps): react_jsx_runtime0.JSX.Element | null;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { HotRecommendClient, HotRecommendProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{useRouter as e}from"../../../../utils/use-compatible-router.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useCallback as r,useId as i,useMemo as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{usePathname as u,useSearchParams as d}from"next/navigation";const f=[];function p(e,t){if(e.length<=t)return[...e];let n=[...e];for(let e=0;e<t;e++){let t=e+Math.floor(Math.random()*(n.length-e));[n[e],n[t]]=[n[t],n[e]]}return n.slice(0,t)}function m({className:e=``}){let t=i().replace(/:/g,``);return l(`svg`,{viewBox:`0 0 62.4481 14.192`,fill:`none`,"aria-hidden":!0,className:e,children:[l(`g`,{children:[c(`path`,{d:`M50.7201 4V3.04H47.9841V0.768H50.7201V0H53.3281V0.768H57.1201V0H59.7441V0.768H62.4481V3.04H59.7441V4H57.1201V3.04H53.3281V4H50.7201ZM48.1281 8.32C48.4587 8.32 48.8054 8.27733 49.1681 8.192C49.5307 8.096 49.8934 7.968 50.2561 7.808C50.6294 7.63733 50.9867 7.43467 51.3281 7.2C51.6801 6.95467 52.0054 6.688 52.3041 6.4H48.3041V4.464H53.5681C53.7067 4.112 53.7761 3.72267 53.7761 3.296H56.4641C56.4641 3.68 56.4107 4.06933 56.3041 4.464H62.1121V6.4H55.5041C55.4401 6.51733 55.3707 6.62933 55.2961 6.736C55.2321 6.832 55.1574 6.93867 55.0721 7.056H61.1841V7.536C61.1841 7.94133 61.1147 8.33067 60.9761 8.704C60.8481 9.07733 60.5921 9.39733 60.2081 9.664H62.3041V11.488H59.2801V11.696C59.2801 12.1653 59.2267 12.5547 59.1201 12.864C59.0134 13.1733 58.8534 13.4187 58.6401 13.6C58.4267 13.792 58.1601 13.9253 57.8401 14C57.5201 14.0747 57.1521 14.112 56.7361 14.112H54.7361V12.432H55.2481C55.5894 12.4213 55.8561 12.4 56.0481 12.368C56.2507 12.336 56.4001 12.288 56.4961 12.224C56.6027 12.16 56.6721 12.0853 56.7041 12C56.7361 11.9147 56.7521 11.8133 56.7521 11.696V11.488H53.2161V9.664H56.7521V9.44C57.2321 9.44 57.6267 9.39733 57.9361 9.312C58.2454 9.216 58.4747 9.04 58.6241 8.784H54.4641V7.856C54.1547 8.208 53.8187 8.544 53.4561 8.864C53.1041 9.17333 52.7254 9.456 52.3201 9.712V14.176H49.7761V10.784C49.2534 10.912 48.7041 10.976 48.1281 10.976V8.32Z`,fill:`url(#${t})`}),c(`path`,{d:`M40.3361 0.0159912C40.3361 0.805325 40.2614 1.53066 40.1121 2.19199H46.3841V4.28799H44.3361V5.45599H46.1601V7.31199H44.3361V8.47999H46.1601V10.352H44.3361V11.648H46.4961V13.968H40.1121V14.192H37.5681V5.63199C37.3441 5.69599 37.1201 5.72799 36.8961 5.72799V2.92799C37.2694 2.92799 37.5361 2.68799 37.6961 2.20799C37.8561 1.72799 37.9361 0.997325 37.9361 0.0159912H40.3361ZM33.2641 0.0159912H35.6641V2.20799H36.6721V4.57599H35.6641V6.20799L36.6881 6.09599V8.47999L35.6641 8.62399V10.992C35.6641 11.408 35.6427 11.8027 35.6001 12.176C35.5574 12.56 35.4507 12.8907 35.2801 13.168C35.1201 13.456 34.8801 13.68 34.5601 13.84C34.2401 14.0107 33.8081 14.096 33.2641 14.096H32.1921V11.872H32.6241C32.9014 11.872 33.0774 11.7973 33.1521 11.648C33.2267 11.488 33.2641 11.184 33.2641 10.736V8.97599L31.9841 9.15199V6.63999L33.2641 6.49599V4.57599H32.0641V2.20799H33.2641V0.0159912ZM41.6001 0.0159912H44.4161L44.4641 1.90399H41.6481L41.6001 0.0159912ZM40.1121 5.45599H41.8881V4.28799H40.1121V5.45599ZM40.1121 8.47999H41.8881V7.31199H40.1121V8.47999ZM40.1121 11.648H41.8881V10.352H40.1121V11.648Z`,fill:`url(#${t})`}),c(`path`,{d:`M16.6721 2.49599L16.6081 0.0159912H19.8401L19.9041 2.49599H16.6721ZM24.9601 14.192V11.68H25.7121C26.0427 11.68 26.2987 11.6587 26.4801 11.616C26.6721 11.5733 26.8161 11.4987 26.9121 11.392C27.0081 11.2747 27.0667 11.12 27.0881 10.928C27.1094 10.736 27.1201 10.4907 27.1201 10.192V2.68799H20.8001V0.175991H29.9521V10.448C29.9521 11.2267 29.8827 11.8613 29.7441 12.352C29.6161 12.8427 29.3921 13.2213 29.0721 13.488C28.7521 13.7653 28.3201 13.952 27.7761 14.048C27.2321 14.144 26.5494 14.192 25.7281 14.192H24.9601ZM16.5441 14.192V3.23199H19.3761V14.192H16.5441Z`,fill:`url(#${t})`}),c(`path`,{d:`M6.48499e-05 7.18399V5.10399L1.87206 5.02399V3.82399H0.176065V1.45599H1.87206V0.0159912H4.25607V1.45599H6.00007V3.82399H4.25607V4.91199L5.84007 4.84799V6.92799L4.25607 6.99199V8.36799C4.25607 8.73066 4.22407 9.06132 4.16007 9.35999C4.09607 9.65866 3.97873 9.91466 3.80806 10.128C3.64807 10.3413 3.41873 10.5067 3.12007 10.624C2.83207 10.7413 2.45873 10.8 2.00006 10.8H0.592065V8.68799H1.05606C1.24806 8.68799 1.3974 8.66666 1.50406 8.62399C1.6214 8.58132 1.70673 8.52266 1.76006 8.44799C1.8134 8.36266 1.8454 8.26666 1.85606 8.15999C1.86673 8.04266 1.87206 7.91999 1.87206 7.79199V7.10399L6.48499e-05 7.18399ZM13.8081 10.864C12.7627 10.864 12.0054 10.624 11.5361 10.144C11.0774 9.66399 10.8481 8.86933 10.8481 7.75999V3.82399H9.84007V4.87999V5.02399H10.5121V6.68799H9.76007C9.6854 7.46666 9.55206 8.12266 9.36006 8.65599C9.17873 9.18932 8.9174 9.62133 8.57607 9.95199C8.2454 10.2827 7.8294 10.5227 7.32807 10.672C6.82673 10.8213 6.2294 10.896 5.53607 10.896V8.79999C5.8774 8.79999 6.1654 8.76799 6.40007 8.70399C6.6454 8.63999 6.84273 8.52799 6.99207 8.36799C7.1414 8.20799 7.25873 7.99466 7.34407 7.72799C7.4294 7.45066 7.48807 7.10399 7.52007 6.68799H6.35207V5.02399H7.58406V4.84799V3.82399H6.44807V1.45599H7.60007V0.0159912H9.85606V1.45599H13.2321V7.24799C13.2321 7.66399 13.2747 7.92533 13.3601 8.03199C13.4561 8.13866 13.6321 8.19199 13.8881 8.19199H14.3521V10.864H13.8081ZM0.144065 14.192L0.256065 11.232H3.21606L3.10406 14.192H0.144065ZM11.3921 14.192L11.2481 11.232H14.2241L14.3681 14.192H11.3921ZM4.17606 14.192L4.03207 11.296H6.73607L6.86407 14.192H4.17606ZM7.77607 14.192L7.63207 11.296H10.3841L10.5121 14.192H7.77607Z`,fill:`url(#${t})`})]}),c(`defs`,{children:l(`linearGradient`,{id:t,x1:`33.7161`,y1:`-4.59601`,x2:`60.7161`,y2:`18.404`,gradientUnits:`userSpaceOnUse`,children:[c(`stop`,{stopColor:`#E914E9`}),c(`stop`,{offset:`1`,stopColor:`#6C43EE`})]})})]})}function h({className:e=``}){return c(`svg`,{viewBox:`0 0 16.6667 16.6667`,fill:`none`,"aria-hidden":!0,className:e,children:c(`path`,{d:`M8.33333 1.66667C6.04287 1.66667 4.0209 2.82188 2.82036 4.58333H5V6.25H0V1.25H1.66667V3.3328C3.18651 1.30972 5.60637 0 8.33333 0C12.9357 0 16.6667 3.73096 16.6667 8.33333H15C15 4.65143 12.0152 1.66667 8.33333 1.66667ZM1.66667 8.33333C1.66667 12.0152 4.65143 15 8.33333 15C10.6238 15 12.6458 13.8447 13.8463 12.0833H11.6667V10.4167H16.6667V15.4167H15V13.3338C13.4802 15.3569 11.0603 16.6667 8.33333 16.6667C3.73096 16.6667 0 12.9357 0 8.33333H1.66667Z`,fill:`currentColor`})})}function g({variant:e,className:t=``}){let n=i().replace(/:/g,``),r=e===`gold`?`#FFF047`:`#D7D7D7`;return l(`svg`,{viewBox:`0 0 10 8`,fill:`none`,"aria-hidden":!0,className:t,children:[c(`path`,{d:`M0.72289 1.44405L2.67531 2.6057L4.62168 0.173795C4.77092 -0.0126857 5.06132 -0.0558774 5.27027 0.0773202C5.31202 0.103935 5.34852 0.136533 5.37837 0.173795L7.32476 2.6057L9.27714 1.44405C9.49083 1.31693 9.77946 1.36845 9.92192 1.55913C9.98315 1.64113 10.0097 1.73991 9.99682 1.83779L9.23283 7.63352C9.20526 7.84249 9.00682 8 8.77105 8H1.22899C0.99323 8 0.794784 7.84249 0.767236 7.63352L0.00322932 1.83779C-0.0267734 1.61019 0.155642 1.40398 0.410663 1.3772C0.520333 1.36569 0.631013 1.38938 0.72289 1.44405ZM5.00005 5.51033C5.51357 5.51033 5.92993 5.13878 5.92993 4.68043C5.92993 4.22209 5.51357 3.85054 5.00005 3.85054C4.48647 3.85054 4.07016 4.22209 4.07016 4.68043C4.07016 5.13878 4.48647 5.51033 5.00005 5.51033Z`,fill:`url(#${n})`}),c(`defs`,{children:l(`linearGradient`,{id:n,x1:`5`,y1:`0`,x2:`5`,y2:`8`,gradientUnits:`userSpaceOnUse`,children:[c(`stop`,{stopColor:r}),c(`stop`,{offset:`1`,stopColor:r,stopOpacity:`0`})]})})]})}function _(i){let{title:_,displayCount:v=4,items:y=f,onItemClick:b,mode:x=`renderer`}=i,S=x===`editor`,C=e(),w=u(),T=d(),E=_.trim()||`热门推荐`,D=Math.max(1,v||0),[O,k]=s(0),[A,j]=s(!1),M=o(null),N=r(()=>{A||(j(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{k(e=>e+1),j(!1),M.current=null},500))},[A]),P=a(()=>p(y,D),[D,y,O]);if(y.length===0)return null;let F=e=>{if(b){b(e);return}let t=new URLSearchParams(T.toString());t.set(`q`,e);let n=w.includes(`/search-result`)?w:`/search-result`;C.push(`${n}?${t.toString()}`)};return l(t,{className:`relative mx-[16px] mt-[24px] overflow-hidden rounded-[12px] bg-black${S?` pointer-events-none`:``}`,children:[c(t,{className:`pointer-events-none absolute inset-0 rounded-[12px]`,style:{background:`linear-gradient(180deg, #9756E3 0%, #6C43EE 100%), linear-gradient(180deg, rgba(255,30,255,0.7) 0%, rgba(108,67,238,0) 100%)`,padding:`0.5px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`}}),c(t,{className:`pointer-events-none absolute inset-x-0 top-0 rounded-t-[12px] mix-blend-plus-lighter`,style:{height:`259px`,background:`linear-gradient(180deg, rgba(151,86,227,0.4) 0%, rgba(151,86,227,0) 85%)`}}),l(t,{className:`relative px-[24px] pb-[18px] pt-[22px]`,children:[l(t,{className:`flex items-center justify-between`,children:[E===`热门推荐`?c(m,{className:`h-[14.192px] w-[62.448px] shrink-0`}):c(n,{className:`shrink-0 bg-[linear-gradient(90deg,#E914E9_0%,#6C43EE_100%)] bg-clip-text font-["PingFang_SC"] text-[16px] font-semibold leading-none text-transparent`,children:E}),c(`button`,{type:`button`,"aria-label":`刷新`,className:`flex h-[20px] w-[20px] shrink-0 items-center justify-center text-white/40 transition-opacity active:opacity-70`,onClick:N,children:c(h,{className:`h-[16.6667px] w-[16.6667px] ${A?`animate-spin`:``}`})})]}),c(t,{className:`mt-[7px]`,children:P.map((e,r)=>{let i=r<3,a=r<2,o=i?`text-[#C922EF]`:`text-white/70`,s=i?`text-white/90`:`text-white/70`;return l(t,{children:[l(`button`,{type:`button`,className:`flex h-[48px] w-full items-center gap-[4px] text-left transition-opacity active:opacity-70`,onClick:()=>F(e.label),children:[l(t,{className:`relative flex h-[24px] w-[20px] shrink-0 items-end justify-center`,children:[a?c(g,{variant:r===0?`gold`:`silver`,className:`absolute left-1/2 top-0 h-[8px] w-[10px] -translate-x-1/2`}):null,c(n,{className:`font-['DIN_Black'] text-[14px] font-normal not-italic leading-[24px] ${o}`,children:r+1})]}),c(n,{className:`min-w-0 flex-1 truncate font-['PingFang_SC'] text-[14px] font-normal not-italic leading-[24px] ${s}`,children:e.label})]}),r<P.length-1?c(t,{className:`h-px w-full bg-white/[0.08]`}):null]},`${e.label}-${r}`)})})]})]})}export{_ as HotRecommendClient};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
+
import "../../../../utils.mjs";
|
|
5
|
+
import { HotRecommendClient } from "./client.mjs";
|
|
6
|
+
import { HotRecommendServer } from "./server.mjs";
|
|
7
|
+
import * as zod from "zod";
|
|
8
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
9
|
+
|
|
10
|
+
//#region components/biz/business/hot-recommend/material.d.ts
|
|
11
|
+
declare const hotRecommendMaterial: DefineMaterialOption<typeof HotRecommendServer, typeof HotRecommendClient, zod.ZodObject<{
|
|
12
|
+
readonly title: zod.ZodString & SchemaHasDefaultValue;
|
|
13
|
+
readonly displayCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
14
|
+
readonly items: zod.ZodArray<zod.ZodObject<{
|
|
15
|
+
label: zod.ZodString & SchemaHasDefaultValue;
|
|
16
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
17
|
+
} & {
|
|
18
|
+
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
19
|
+
renderer: "renderer";
|
|
20
|
+
editor: "editor";
|
|
21
|
+
}>>;
|
|
22
|
+
}, zod_v4_core0.$strip>, "hot-recommend", "内容组件">;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { hotRecommendMaterial };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{HotRecommendClient as t}from"./client.mjs";import{hotRecommendInspectorPropsSchema as n}from"./schema.mjs";import{HotRecommendServer as r}from"./server.mjs";const i=e({type:`hot-recommend`,name:`热门推荐`,icon:`/static/components-thumb/search_recommend_text.png`,category:`内容组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as hotRecommendMaterial};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
+
import "../../../../utils.mjs";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
|
|
6
|
+
//#region components/biz/business/hot-recommend/schema.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* 热门推荐物料属性定义
|
|
9
|
+
*/
|
|
10
|
+
declare const hotRecommendInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
readonly title: z.ZodString & SchemaHasDefaultValue;
|
|
12
|
+
readonly displayCount: z.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
readonly items: z.ZodArray<z.ZodObject<{
|
|
14
|
+
label: z.ZodString & SchemaHasDefaultValue;
|
|
15
|
+
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
16
|
+
} & {
|
|
17
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
renderer: "renderer";
|
|
19
|
+
editor: "editor";
|
|
20
|
+
}>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { hotRecommendInspectorPropsSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
import{defineComponentPropsSchema as e}from"../../../../utils/schema/schema.mjs";import{z as t}from"zod";const n=e(e=>({title:e.string(`热门推荐`,{label:`标题名称`,description:`支持输入,中/英/数/符,6个字符`}),displayCount:e.number(4,{label:`展示数`}),items:e.array(t.object({label:e.string(`东野圭吾作品:11字迷案`,{label:`热词`})}),{label:`推荐位模块`,defaultValue:[{label:`东野圭吾作品:11字迷案`},{label:`嫌疑人X的献身:高智商博弈`},{label:`白夜行:原著同名悬疑改编`},{label:`神探伽利略:校园连环谜案`},{label:`假面饭店:密室追凶夜`},{label:`恶意:东野圭吾高分作品`}]})}));export{n as hotRecommendInspectorPropsSchema};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { HotRecommendProps } from "./client.mjs";
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region components/biz/business/hot-recommend/server.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* 热门推荐物料组件 - 服务端部分
|
|
8
|
+
*/
|
|
9
|
+
declare function HotRecommendServer(props: HotRecommendProps): Promise<react_jsx_runtime0.JSX.Element>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { HotRecommendServer };
|