@funhub/platform 0.1.48 → 0.1.49

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.
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{buildContentUrl as e}from"../../utils/helpers/url.mjs";import{mergeStyles as t}from"../../utils/styles/helpers.mjs";import{Image as n}from"../../../ui/image.mjs";import{Box as r}from"../../../ui/box.mjs";import{Carousel as i,CarouselContent as a,CarouselItem as o}from"../../../ui/carousel.mjs";import{Text as s}from"../../../ui/text.mjs";import c from"../../../ui/legacy/button.mjs";import l from"../../../ui/link.mjs";import{defaultProps as u}from"./default-props.mjs";import d from"clsx";import{useIsClient as f}from"foxact/use-is-client";import{useEffect as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v={list:[]};function y({mode:y=`renderer`,props:b=v,styles:x,events:S}){let C=y===`editor`,{autoplay:w=u.autoplay,interval:T=u.interval,loop:E=u.loop,showTitle:D=u.showTitle,showIndicator:O=u.showIndicator,list:k=[]}={...u,...b},[A,j]=h(),[M,N]=h(0),P=f(),F=m(null);if(p(()=>{if(!A||!P)return;let e=()=>{N(A.selectedScrollSnap())};return A.on(`select`,e),e(),()=>{A.off(`select`,e)}},[A,S,P]),p(()=>!w||!A||k.length<=1?void 0:(F.current=setInterval(()=>{A.canScrollNext()?A.scrollNext():E&&A.scrollTo(0)},T*1e3),()=>{F.current&&=(clearInterval(F.current),null)}),[w,A,T,E,k.length]),!k||k.length===0)return null;let I=k[M],L=x?t(x,{}):void 0;return _(r,{className:C?`relative w-full pointer-events-none`:`relative w-full`,style:L,children:[g(i,{setApi:j,opts:{align:`start`,loop:E,skipSnaps:!1,dragFree:!1},className:`w-full`,children:g(a,{className:`ml-0`,children:k.map((t,r)=>g(o,{className:`pl-0`,children:g(l,{href:e({url:``,contentId:t.contentId,contentType:1,title:t.title}),className:`block relative w-full h-[242px] overflow-hidden touch-manipulation`,children:g(n,{src:t.coverUrl,alt:t.title||`Banner ${r+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},r))})}),D&&I?.title&&g(r,{className:`absolute bottom-[8px] left-[8px]`,children:g(s,{as:`p`,className:`text-white text-[16px] line-clamp-1`,children:I.title})}),O&&k.length>1&&g(r,{className:`absolute bottom-[16px] right-[8px] flex items-center gap-[4px]`,children:k.map((e,t)=>g(c,{type:`button`,className:d(`transition-all duration-300 rounded-full !p-0`,t===M?`w-[10px] h-[6px] bg-black`:`w-[6px] h-[6px] bg-white/50`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})}export{y as default};
2
+ "use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Carousel as r,CarouselContent as i,CarouselItem as a}from"../../../ui/carousel.mjs";import{Text as o}from"../../../ui/text.mjs";import s from"../../../ui/legacy/button.mjs";import c from"../../../ui/link.mjs";import{defaultProps as l}from"./default-props.mjs";import u from"clsx";import{useIsClient as d}from"foxact/use-is-client";import{useEffect as f,useRef as p,useState as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _={list:[]};function v({mode:v=`renderer`,props:y=_,styles:b,events:x}){let S=v===`editor`,{autoplay:C=l.autoplay,interval:w=l.interval,loop:T=l.loop,showTitle:E=l.showTitle,showIndicator:D=l.showIndicator,list:O=[]}={...l,...y},[k,A]=m(),[j,M]=m(0),N=d(),P=p(null);if(f(()=>{if(!k||!N)return;let e=()=>{M(k.selectedScrollSnap())};return k.on(`select`,e),e(),()=>{k.off(`select`,e)}},[k,x,N]),f(()=>!C||!k||O.length<=1?void 0:(P.current=setInterval(()=>{k.canScrollNext()?k.scrollNext():T&&k.scrollTo(0)},w*1e3),()=>{P.current&&=(clearInterval(P.current),null)}),[C,k,w,T,O.length]),!O||O.length===0)return null;let F=O[j],I=b?e(b,{}):void 0;return g(n,{className:S?`relative w-full pointer-events-none`:`relative w-full`,style:I,children:[h(r,{setApi:A,opts:{align:`start`,loop:T,skipSnaps:!1,dragFree:!1},className:`w-full`,children:h(i,{className:`ml-0`,children:O.map((e,n)=>h(a,{className:`pl-0`,children:h(c,{href:e.target,className:`block relative w-full h-[242px] overflow-hidden touch-manipulation`,children:h(t,{src:e.coverUrl,alt:e.title||`Banner ${n+1}`,fill:!0,objectFit:`cover`,unoptimized:!0})})},n))})}),E&&F?.title&&h(n,{className:`absolute bottom-[8px] left-[8px]`,children:h(o,{as:`p`,className:`text-white text-[16px] line-clamp-1`,children:F.title})}),D&&O.length>1&&h(n,{className:`absolute bottom-[16px] right-[8px] flex items-center gap-[4px]`,children:O.map((e,t)=>h(s,{type:`button`,className:u(`transition-all duration-300 rounded-full !p-0`,t===j?`w-[10px] h-[6px] bg-black`:`w-[6px] h-[6px] bg-white/50`),"aria-label":`跳转到第 ${t+1} 个 Banner`},t))})]})}export{v as default};
@@ -16,6 +16,7 @@ declare const BannerCarouselMaterial: DefineMaterialOption<typeof BannerCarousel
16
16
  badgeUrl: zod.ZodOptional<zod.ZodString>;
17
17
  showPlayCount: zod.ZodOptional<zod.ZodBoolean>;
18
18
  showEpisodeCount: zod.ZodOptional<zod.ZodBoolean>;
19
+ target: zod.ZodOptional<zod.ZodString>;
19
20
  }, zod_v4_core0.$strip>>> & SchemaHasDefaultValue;
20
21
  mode: zod.ZodOptional<zod.ZodEnum<{
21
22
  renderer: "renderer";
@@ -16,6 +16,7 @@ declare const basicBannerInspectorPropsSchema: z$1.ZodObject<{
16
16
  badgeUrl: z$1.ZodOptional<z$1.ZodString>;
17
17
  showPlayCount: z$1.ZodOptional<z$1.ZodBoolean>;
18
18
  showEpisodeCount: z$1.ZodOptional<z$1.ZodBoolean>;
19
+ target: z$1.ZodOptional<z$1.ZodString>;
19
20
  }, z$1.core.$strip>>> & SchemaHasDefaultValue;
20
21
  mode: z$1.ZodOptional<z$1.ZodEnum<{
21
22
  renderer: "renderer";
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../utils/schema/schema.mjs";import{defaultProps as o}from"./default-props.mjs";import s from"zod";const c=t({interval:n({label:`播放间隔`,defaultValue:o.interval}),list:e(s.object({contentId:n({label:`内容ID`,required:!1}),title:i({label:`内容标题`,required:!1}),coverUrl:i({label:`封面`,required:!1}),badgeUrl:i({label:`角标`,required:!1}),showPlayCount:r({label:`展示播放量`,required:!1}),showEpisodeCount:r({label:`展示集数`,required:!1})}),{required:!1,label:`list`,defaultValue:[{contentId:1,title:`视频标题一`,desc:`视频描述`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1},{contentId:2,title:`视频标题二`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1},{contentId:3,title:`视频标题三`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1}]})});a(c);export{c as basicBannerInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineSwitchPropSchema as r,defineTextPropSchema as i,getSchemaDefaultProps as a}from"../../../../utils/schema/schema.mjs";import{defaultProps as o}from"./default-props.mjs";import s from"zod";const c=t({interval:n({label:`播放间隔`,defaultValue:o.interval}),list:e(s.object({contentId:n({label:`内容ID`,required:!1}),title:i({label:`内容标题`,required:!1}),coverUrl:i({label:`封面`,required:!1}),badgeUrl:i({label:`角标`,required:!1}),showPlayCount:r({label:`展示播放量`,required:!1}),showEpisodeCount:r({label:`展示集数`,required:!1}),target:i({label:`跳转地址`,required:!1})}),{required:!1,label:`list`,defaultValue:[{contentId:1,title:`视频标题一`,desc:`视频描述`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1,target:``},{contentId:2,title:`视频标题二`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1,target:``},{contentId:3,title:`视频标题三`,coverUrl:`/static/components-resource/banner.png`,badgeUrl:``,showPlayCount:!1,showEpisodeCount:!1,target:``}]})});a(c);export{c as basicBannerInspectorPropsSchema};
@@ -8,7 +8,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
8
8
  /** buttonVariants 工具定义。 */
9
9
  declare const buttonVariants: (props?: ({
10
10
  variant?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
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 组件属性。 */
14
14
  type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
@@ -1,11 +1,11 @@
1
1
 
2
2
  import * as React from "react";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
- import Image from "next/image";
4
+ import NextImage from "next/image";
5
5
 
6
6
  //#region components/ui/image.d.ts
7
7
  /** BaseImageProps 属性定义。 */
8
- type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof Image>, 'className' | 'src' | 'alt' | 'width' | 'height' | 'loading' | 'priority' | 'fill' | 'style'>;
8
+ type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof NextImage>, 'className' | 'src' | 'alt' | 'width' | 'height' | 'loading' | 'priority' | 'fill' | 'style'>;
9
9
  type CommonImageProps = BaseImageProps & {
10
10
  /** 图片地址,支持普通 URL、默认资源路径和加密地址。 */src: string; /** 图片替代文本。 */
11
11
  alt?: string; /** 图片类名。 */
@@ -27,6 +27,6 @@ type ImagePropsWithSize = CommonImageProps & {
27
27
  /** ImageProps 属性定义。 */
28
28
  type ImageProps = ImagePropsWithFill | ImagePropsWithSize;
29
29
  /** 图片组件:支持 bnc 解密、默认资源域名拼接与错误占位。 */
30
- declare function Image$1(props: ImageProps): react_jsx_runtime0.JSX.Element;
30
+ declare function Image(props: ImageProps): react_jsx_runtime0.JSX.Element;
31
31
  //#endregion
32
- export { BaseImageProps, CommonImageProps, Image$1 as Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
32
+ export { BaseImageProps, CommonImageProps, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";import{Tabs as r}from"@base-ui/react/tabs";function i({className:n,orientation:i=`horizontal`,...a}){return t(r.Root,{"data-slot":`tabs`,"data-orientation":i,className:e(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col`,n),...a})}const a=n(`group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,{variants:{variant:{default:` gap-2 rounded-none bg-transparent p-0 group-data-[orientation=horizontal]/tabs:h-10`,tag:`gap-2 rounded-none bg-transparent p-0 group-data-[orientation=horizontal]/tabs:h-8`,segment:`gap-1 rounded-sm bg-bg2 p-1 group-data-[orientation=horizontal]/tabs:h-8`}},defaultVariants:{variant:`default`}});function o({className:n,variant:i=`default`,...o}){return t(r.List,{"data-slot":`tabs-list`,"data-variant":i,className:e(a({variant:i}),n),...o})}function s({className:n,...i}){return t(r.Tab,{"data-slot":`tabs-trigger`,className:e(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-sm font-medium leading-none transition-all focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='w-']):not([class*='h-'])]:w-4 [&_svg:not([class*='w-']):not([class*='h-'])]:h-4`,`group-data-[variant=default]:pb-1`,`text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground`,`group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start`,`group-data-[variant=default]/tabs-list:h-full group-data-[variant=default]/tabs-list:px-3 group-data-[variant=default]/tabs-list:py-2 group-data-[variant=default]/tabs-list:data-[active]:text-foreground`,`group-data-[variant=tag]/tabs-list:rounded-md group-data-[variant=tag]/tabs-list:px-3 group-data-[variant=tag]/tabs-list:py-1`,`group-data-[variant=tag]/tabs-list:data-[active]:bg-theme5 group-data-[variant=tag]/tabs-list:data-[active]:text-white`,`group-data-[variant=segment]/tabs-list:rounded-sm group-data-[variant=segment]/tabs-list:px-3 group-data-[variant=segment]/tabs-list:py-1`,`group-data-[variant=segment]/tabs-list:text-xs group-data-[variant=segment]/tabs-list:text-text3 group-data-[variant=segment]/tabs-list:data-[active]:bg-text1/10 group-data-[variant=segment]/tabs-list:data-[active]:text-text1`,`group-data-[orientation=horizontal]/tabs:after:h-0.5`,`group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5`,`group-data-[variant=default]/tabs-list:after:w-12 group-data-[variant=default]/tabs-list:after:left-1/2 group-data-[variant=default]/tabs-list:after:-translate-x-1/2 group-data-[variant=default]/tabs-list:data-[active]:after:opacity-100`,`group-data-[variant=tag]/tabs-list:after:hidden group-data-[variant=segment]/tabs-list:after:hidden`,`after:absolute after:!bottom-0 after:opacity-0 after:transition-opacity after:bg-text1`,n),...i})}function c({className:n,...i}){return t(r.Panel,{"data-slot":`tabs-content`,className:e(`text-sm flex-1 outline-none`,n),...i})}export{i as Tabs,c as TabsContent,o as TabsList,s as TabsTrigger,a as tabsListVariants};
2
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";import{Tabs as r}from"@base-ui/react/tabs";function i({className:n,orientation:i=`horizontal`,...a}){return t(r.Root,{"data-slot":`tabs`,"data-orientation":i,className:e(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col`,n),...a})}const a=n(`group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,{variants:{variant:{default:` gap-2 rounded-none bg-transparent p-0 group-data-[orientation=horizontal]/tabs:h-10`,tag:`gap-2 rounded-none bg-transparent p-0 group-data-[orientation=horizontal]/tabs:h-8`,segment:`gap-1 rounded-sm bg-bg2 p-1 group-data-[orientation=horizontal]/tabs:h-8`}},defaultVariants:{variant:`default`}});function o({className:n,variant:i=`default`,...o}){return t(r.List,{"data-slot":`tabs-list`,"data-variant":i,className:e(a({variant:i}),n),...o})}function s({className:n,...i}){return t(r.Tab,{"data-slot":`tabs-trigger`,className:e(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-sm font-medium leading-none transition-all focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='w-']):not([class*='h-'])]:w-4 [&_svg:not([class*='w-']):not([class*='h-'])]:h-4`,`group-data-[variant=default]:pb-1`,`text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground`,`group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start`,`group-data-[variant=default]/tabs-list:h-full group-data-[variant=default]/tabs-list:px-3 group-data-[variant=default]/tabs-list:py-2 group-data-[variant=default]/tabs-list:data-[active]:text-foreground`,`group-data-[variant=tag]/tabs-list:rounded-md group-data-[variant=tag]/tabs-list:px-3 group-data-[variant=tag]/tabs-list:py-1`,`group-data-[variant=tag]/tabs-list:data-[active]:bg-theme5 group-data-[variant=tag]/tabs-list:data-[active]:text-white`,`group-data-[variant=segment]/tabs-list:rounded-sm group-data-[variant=segment]/tabs-list:px-3 group-data-[variant=segment]/tabs-list:py-1`,`group-data-[variant=segment]/tabs-list:text-xs group-data-[variant=segment]/tabs-list:text-text3 group-data-[variant=segment]/tabs-list:data-[active]:bg-text1/10 group-data-[variant=segment]/tabs-list:data-[active]:text-text1`,`after:absolute after:!bottom-0 after:opacity-0 after:transition-opacity after:bg-text1`,`group-data-[orientation=horizontal]/tabs:after:-bottom-1.25 group-data-[orientation=horizontal]/tabs:after:h-0.5`,`group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5`,`group-data-[variant=default]/tabs-list:after:w-12 group-data-[variant=default]/tabs-list:after:left-1/2 group-data-[variant=default]/tabs-list:after:-translate-x-1/2 group-data-[variant=default]/tabs-list:data-[active]:after:opacity-100`,`group-data-[variant=tag]/tabs-list:after:hidden group-data-[variant=segment]/tabs-list:after:hidden`,n),...i})}function c({className:n,...i}){return t(r.Panel,{"data-slot":`tabs-content`,className:e(`text-sm flex-1 outline-none`,n),...i})}export{i as Tabs,c as TabsContent,o as TabsList,s as TabsTrigger,a as tabsListVariants};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.48",
4
+ "version": "0.1.49",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"