@funhub/platform 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- 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/material.d.mts +4 -34
- package/dist/components/biz/business/large-feature-grid/schema.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +1 -1
- package/package.json +1 -1
- package/dist/components/biz/business/large-feature-grid/client.d.mts +0 -15
- package/dist/components/biz/business/large-feature-grid/schema.d.mts +0 -42
- package/dist/components/biz/business/large-feature-grid/server.d.mts +0 -15
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a,{loadHiddenChannelIdsFromStorage as o}from"./channel-filter-dialog.mjs";import{defaultProps as s}from"./default-props.mjs";import{clsx as c}from"clsx";import{useEffect as l,useMemo as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h={};function g(e,t){return t===0?`/`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function _(r){let{mode:_=`renderer`,styles:v,events:y,...b}=r,x=_===`editor`,S=b||h,C={...s,...S},[w,T]=d(!1),{isSticky:E,ref:D}=i(),[O,k]=d(C.list),A=u(()=>C.
|
|
2
|
+
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a,{loadHiddenChannelIdsFromStorage as o}from"./channel-filter-dialog.mjs";import{defaultProps as s}from"./default-props.mjs";import{clsx as c}from"clsx";import{useEffect as l,useMemo as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";const h={};function g(e,t){return t===0?`/`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function _(r){let{mode:_=`renderer`,styles:v,events:y,...b}=r,x=_===`editor`,S=b||h,C={...s,...S},[w,T]=d(!1),{isSticky:E,ref:D}=i(),[O,k]=d(C.list),A=u(()=>C.list.find(e=>e.isDefault)?.name??null,[C.list]),j=u(()=>C.currentChannelId??A,[C.currentChannelId,A]);l(()=>{let e=o();k(e?.length?C.list.filter(t=>!e.includes(t.name)):C.list)},[C.list]);let M=e=>{k(e)},N=(e,t)=>{y?.onChannelChange?.(e,t)},P=v?e(v,{}):void 0;return m(f,{children:[E&&p(t,{className:`w-full h-11`}),p(t,{as:`nav`,ref:D,className:c(`w-full transition-all duration-200`,x&&`pointer-events-none`,!C.isFullfeed&&E&&`fixed top-0 left-0 right-0 z-50`,C.isFullfeed&&`fixed top-[54px] left-0 z-10 w-full`,!C.isFullfeed&&`bg-bg1`),style:P,children:p(t,{className:`relative flex items-center h-[44px]`,children:p(t,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:p(t,{className:`flex items-center h-full w-4 h-4 gap-4`,children:O.map((e,t)=>{let r=j===e.name||j===null&&t===0;return p(n,{href:g(e,t),className:c(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center h-11`,`${r?`text-xl`:`text-base`}`),style:{fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>N(e,t),children:e.name},e.name||`channel-${t}`)})})})})}),p(a,{open:w,onOpenChange:T,channels:C.list,currentChannelId:j,onChannelClick:N,onChannelsChange:M})]})}export{_ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.
|
|
2
|
+
import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import r from"../../../ui/link.mjs";import i from"../../../../assets/icons/view.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(e){if(e.episodeText===void 0||e.episodeText===null||e.episodeText===``)return null;let t=String(e.episodeText).trim();if(!t)return null;if(t===`已完结`||t===`连载中`)return t;let n=Number(t);return Number.isFinite(n)&&n>0?`全${Math.floor(n)}集`:/^全\d+集$/.test(t)?t:null}function c(e){if(e==null||e===``)return null;let t=Number(e);if(Number.isNaN(t))return String(e);if(t<1e3)return String(t);if(t<1e6){let e=(t/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}K`:`${e}K`}else{let e=(t/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}}function l(e,t,n){return t===`showPlayCount`?e.showPlayCount??n:t===`showEpisode`?e.showEpisode??n:n}function u(e){if(l(e,`showPlayCount`,!0))return e.playCount}function d(e){let t=e.tagImageUrl;return t?String(t):null}function f({data:f}){return f?a(t,{children:(Array.isArray(f)?f:[f]).map(f=>{let p=f.id?`/video/${f.id}/${f.title?encodeURIComponent(f.title):``}`:`#`,m=d(f),h=l(f,`showEpisode`,!0)?s(f):null,g=c(u(f));return a(t,{children:o(r,{href:p,children:[o(t,{className:`relative w-full overflow-hidden rounded-[12px] bg-neutral-800`,style:{aspectRatio:`16/9`},children:[f.cover&&a(e,{src:f.cover,alt:f.title,fill:!0,objectFit:`cover`}),m&&a(t,{className:`absolute right-0 top-0 z-10 h-[37px] w-[20px] overflow-hidden`,style:{borderRadius:`0 8px`},children:a(e,{src:m,alt:f.title,fill:!0,objectFit:`cover`})}),a(t,{className:`absolute inset-x-0 bottom-0 h-[40px] bg-gradient-to-t from-black/80 to-transparent z-0 pointer-events-none`}),g&&o(t,{className:`absolute bottom-0 left-[8px] mb-[6px] z-10 flex items-center gap-[4px]`,children:[a(i,{className:`h-[14px] w-[14px] text-white`}),a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:g})]}),h&&a(t,{className:`absolute bottom-0 right-[8px] mb-[6px] z-10 flex items-center`,children:a(n,{as:`span`,className:`text-[12px] font-medium text-white drop-shadow-md`,children:h})})]}),o(t,{className:`flex items-center justify-between gap-[12px] pt-[10px] px-2`,children:[o(t,{className:`flex-1 min-w-0`,children:[a(n,{as:`h3`,className:`text-[16px] font-semibold leading-[24px] text-text1 line-clamp-1`,children:f.title}),f.desc&&a(n,{as:`p`,className:`mt-[4px] text-[13px] leading-[20px] text-text2 line-clamp-1`,children:f.desc})]}),a(n,{className:`shrink-0 rounded-[20px] border border-[#FD4C5E] px-[24px] py-[8px] text-[14px] font-normal text-[#FD4C5E]`,children:`观看`})]})]})},f.id||f.title)})}):null}export{f as LargeGridItemClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),
|
|
2
|
+
"use client";import{Box as e}from"../../../ui/box.mjs";import{Text as t}from"../../../ui/text.mjs";import n from"../../../ui/link.mjs";import r from"../../../../assets/icons/common/right_arrow.mjs";import{LargeGridItemClient as i}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as a}from"./schema.mjs";import{jsx as o,jsxs as s}from"react/jsx-runtime";const c=[],l=a.data??[];function u(e){return e==null||e===``}function d(e,t){return u(e)?t:e}function f(e,t){return t?{...e,...t,id:d(t.id,e.id),cover:d(t.cover,e.cover),title:d(t.title,e.title),desc:d(t.desc,e.desc),playCount:d(t.playCount,e.playCount),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:d(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:d(t.tagImageUrl,e.tagImageUrl)}:e}function p(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:d(t.title,e.title),moreUrl:d(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?f(n,t.items):t.items}}function m({mode:a=`renderer`,data:u=c}){let d=a===`editor`,f=u??c,m=Array.isArray(f)&&f.length>0?[p(l[0],f[0])]:l;if(!m||m.length===0)return null;let h=m[0],g=h?.title,_=h?.moreUrl;return s(e,{className:d?`p-3 pointer-events-none`:`p-3`,children:[s(e,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[g&&o(t,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:g}),_&&s(n,{href:_,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,o(r,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),m.map((t,n)=>{let{items:r}=t;return r?o(e,{className:n>0?`mt-3`:``,children:o(i,{data:r})},`large-feature-grid-items-${n}`):null})]})}export{m as LargeFeatureGridClient};
|
|
@@ -1,42 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
2
|
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
-
import "
|
|
5
|
-
import { LargeFeatureGridClient } from "./client.mjs";
|
|
6
|
-
import { LargeFeatureGrid } from "./server.mjs";
|
|
3
|
+
import * as react from "react";
|
|
7
4
|
import * as zod from "zod";
|
|
8
5
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
9
6
|
|
|
10
7
|
//#region components/biz/business/large-feature-grid/material.d.ts
|
|
11
|
-
declare const largeFeatureGridMaterial: DefineMaterialOption<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
moreUrl: zod.ZodOptional<zod.ZodString>;
|
|
15
|
-
moreLinkType: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
16
|
-
recommendMode: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
17
|
-
items: zod.ZodObject<{
|
|
18
|
-
id: zod.ZodString;
|
|
19
|
-
cover: zod.ZodString;
|
|
20
|
-
tag: zod.ZodOptional<zod.ZodString>;
|
|
21
|
-
playCount: zod.ZodOptional<zod.ZodString>;
|
|
22
|
-
playCountDelta: zod.ZodOptional<zod.ZodNumber> & SchemaHasDefaultValue;
|
|
23
|
-
showPlayCount: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
24
|
-
duration: zod.ZodOptional<zod.ZodString>;
|
|
25
|
-
showEpisode: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
26
|
-
useContentCover: zod.ZodOptional<zod.ZodBoolean> & SchemaHasDefaultValue;
|
|
27
|
-
title: zod.ZodString;
|
|
28
|
-
desc: zod.ZodOptional<zod.ZodString>;
|
|
29
|
-
tagImageUrl: zod.ZodOptional<zod.ZodString>;
|
|
30
|
-
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
31
|
-
renderer: "renderer";
|
|
32
|
-
editor: "editor";
|
|
33
|
-
}>>;
|
|
34
|
-
}, zod_v4_core0.$strip>;
|
|
35
|
-
}, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
|
|
36
|
-
mode: zod.ZodOptional<zod.ZodEnum<{
|
|
37
|
-
renderer: "renderer";
|
|
38
|
-
editor: "editor";
|
|
39
|
-
}>>;
|
|
40
|
-
}, zod_v4_core0.$strip>, "large-feature-grid">;
|
|
8
|
+
declare const largeFeatureGridMaterial: DefineMaterialOption<react.ComponentType<any>, react.ComponentType<any>, zod.ZodObject<Readonly<{
|
|
9
|
+
[k: string]: zod_v4_core0.$ZodType<unknown, unknown, zod_v4_core0.$ZodTypeInternals<unknown, unknown>>;
|
|
10
|
+
}>, zod_v4_core0.$strip>, string>;
|
|
41
11
|
//#endregion
|
|
42
12
|
export { largeFeatureGridMaterial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,
|
|
2
|
+
import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineSwitchPropSchema as n,defineTextPropSchema as r,getSchemaDefaultProps as i}from"../../../../utils/schema/schema.mjs";import a from"zod";const o=t({data:e(a.object({title:r({label:`推荐位名称`,required:!1}),moreUrl:r({label:`更多链接`,required:!1}),moreLinkType:r({label:`更多链接类型`,required:!1,defaultValue:`content-list`}),items:t({id:r({label:`内容ID`}),cover:r({label:`封面`}),playCount:r({label:`播放量`,required:!1}),showPlayCount:n({label:`展示播放量`,required:!1,defaultValue:!0}),episodeText:r({label:`集数文案`,required:!1}),showEpisode:n({label:`展示集数`,required:!1,defaultValue:!0}),useContentCover:n({label:`沿用内容海报`,required:!1,defaultValue:!0}),title:r({label:`内容标题`}),desc:r({label:`内容简介`,required:!1}),tagImageUrl:r({label:`角标图`,required:!1})})}),{label:`大图推荐数据`,required:!1,defaultValue:[{title:`推荐位名称`,moreUrl:`/channel`,moreLinkType:`content-list`,items:{id:`22edc8693ebbdaf1`,cover:`https://base-resources.guadd.fun/md-204/dcc-file/f7/f70a9f9f0c17aa9aff6c3a3e03a822db-small.jpg`,playCount:`11111`,showPlayCount:!0,episodeText:`连载中`,showEpisode:!0,useContentCover:!0,title:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`,desc:`穷小伙一睁眼穿越古代,娶个老婆就能得到奖励,后宫3000宠都宠不过来!谁料女帝主动送上门来,征服女帝可以直接开终极宝箱,不用选择全都可以!`}}]})}),s=i(o);export{s as largeFeatureGridInspectorDefaultProps,o as largeFeatureGridInspectorPropsSchema};
|
|
@@ -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" | "link" | "destructive" | "secondary" | "outline" | "ghost" | 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" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
11
11
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LargeFeatureGridInspectorProps } from "./schema.mjs";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region components/biz/business/large-feature-grid/client.d.ts
|
|
6
|
-
type LargeFeatureGridClientProps = LargeFeatureGridInspectorProps;
|
|
7
|
-
/**
|
|
8
|
-
* 大图推荐客户端组件。
|
|
9
|
-
*/
|
|
10
|
-
declare function LargeFeatureGridClient({
|
|
11
|
-
mode,
|
|
12
|
-
data
|
|
13
|
-
}: LargeFeatureGridClientProps): react_jsx_runtime0.JSX.Element | null;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { LargeFeatureGridClient };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { InferSchemaProps, SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
|
-
import "../../../../utils/schema/index.mjs";
|
|
4
|
-
import z$1 from "zod";
|
|
5
|
-
|
|
6
|
-
//#region components/biz/business/large-feature-grid/schema.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* 大图推荐物料 schema
|
|
9
|
-
*/
|
|
10
|
-
declare const largeFeatureGridInspectorPropsSchema: z$1.ZodObject<{
|
|
11
|
-
data: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
|
|
12
|
-
title: z$1.ZodOptional<z$1.ZodString>;
|
|
13
|
-
moreUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
14
|
-
moreLinkType: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
15
|
-
recommendMode: z$1.ZodOptional<z$1.ZodString> & SchemaHasDefaultValue;
|
|
16
|
-
items: z$1.ZodObject<{
|
|
17
|
-
id: z$1.ZodString;
|
|
18
|
-
cover: z$1.ZodString;
|
|
19
|
-
tag: z$1.ZodOptional<z$1.ZodString>;
|
|
20
|
-
playCount: z$1.ZodOptional<z$1.ZodString>;
|
|
21
|
-
playCountDelta: z$1.ZodOptional<z$1.ZodNumber> & SchemaHasDefaultValue;
|
|
22
|
-
showPlayCount: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
23
|
-
duration: z$1.ZodOptional<z$1.ZodString>;
|
|
24
|
-
showEpisode: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
25
|
-
useContentCover: z$1.ZodOptional<z$1.ZodBoolean> & SchemaHasDefaultValue;
|
|
26
|
-
title: z$1.ZodString;
|
|
27
|
-
desc: z$1.ZodOptional<z$1.ZodString>;
|
|
28
|
-
tagImageUrl: z$1.ZodOptional<z$1.ZodString>;
|
|
29
|
-
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
30
|
-
renderer: "renderer";
|
|
31
|
-
editor: "editor";
|
|
32
|
-
}>>;
|
|
33
|
-
}, z$1.core.$strip>;
|
|
34
|
-
}, z$1.core.$strip>>> & SchemaHasDefaultValue;
|
|
35
|
-
mode: z$1.ZodOptional<z$1.ZodEnum<{
|
|
36
|
-
renderer: "renderer";
|
|
37
|
-
editor: "editor";
|
|
38
|
-
}>>;
|
|
39
|
-
}, z$1.core.$strip>;
|
|
40
|
-
type LargeFeatureGridInspectorProps = InferSchemaProps<typeof largeFeatureGridInspectorPropsSchema>;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { LargeFeatureGridInspectorProps };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { LargeFeatureGridInspectorProps } from "./schema.mjs";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region components/biz/business/large-feature-grid/server.d.ts
|
|
6
|
-
type LargeFeatureGridProps = LargeFeatureGridInspectorProps;
|
|
7
|
-
/**
|
|
8
|
-
* 大图推荐服务端组件,直接渲染客户端组件。
|
|
9
|
-
*/
|
|
10
|
-
declare function LargeFeatureGrid({
|
|
11
|
-
mode,
|
|
12
|
-
...props
|
|
13
|
-
}: LargeFeatureGridProps): react_jsx_runtime0.JSX.Element;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { LargeFeatureGrid };
|