@funhub/platform 0.2.4-beta.4 → 0.2.5

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.
@@ -8,6 +8,8 @@ interface TabBarItem {
8
8
  domainId: string;
9
9
  icon: string;
10
10
  activeIcon: string;
11
+ showNavName?: boolean;
12
+ show_nav_name?: boolean;
11
13
  configType: TabBarItemConfigType;
12
14
  functionPageType: string;
13
15
  selectData: unknown;
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o}from"next/navigation";import s from"next/link";const c=[];function l(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function u(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function d(e,t){let n=l(t);if(e.configType===1){let t=l(u(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function f(e,t){return e.findIndex(e=>d(e,t))}function p(l){let{items:d=c,mode:p=`renderer`}=l,m=o(),h=r(()=>{if(p===`editor`)return 0;let e=f(d??[],m);return e>=0?e:0},[d,m,p]),g=r(()=>(d??[]).some(e=>e.label.trim()!==``),[d]);if(!d?.length)return null;function _(e){p===`editor`&&e.preventDefault()}let v=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${g?`gap-1`:``}`;return i(t,{className:`fixed bottom-0 left-0 right-0 z-50 h-[var(--tab-bar-height)] border-t border-line1 bg-bg1 py-3 backdrop-blur-[2px] shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:i(t,{className:`flex w-full items-center`,children:d.map((r,o)=>{let c=h===o,l=c?r.activeIcon:r.icon,d=r.label;return a(s,{href:u(r),className:v,"data-index":o,"data-webview-nav":`spa`,onClick:_,children:[i(t,{className:`relative size-[22px] shrink-0`,children:l?i(e,{src:l,alt:d,fill:!0,className:`object-contain`}):i(t,{"data-active":c,className:`size-full rounded-sm bg-text3 data-[active=true]:bg-theme5`})}),g&&i(n,{"data-active":c,className:`truncate text-center text-[10px] leading-[10px] font-medium min-w-0 max-w-full px-0.5 text-text2 data-[active=true]:text-theme5`,children:d})]},o)})})})}export{p as TabBarClient};
2
+ "use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useMemo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{usePathname as o}from"next/navigation";import s from"next/link";const c=[];function l(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function u(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/${t}`:`/`}function d(e,t){let n=l(t);if(e.configType===1){let t=l(u(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function f(e,t){return e.findIndex(e=>d(e,t))}function p(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function m(l){let{items:d=c,mode:m=`renderer`}=l,h=o(),g=r(()=>{if(m===`editor`)return 0;let e=f(d??[],h);return e>=0?e:0},[d,h,m]),_=r(()=>(d??[]).some(e=>p(e)&&e.label.trim()!==``),[d]);if(!d?.length)return null;function v(e){m===`editor`&&e.preventDefault()}let y=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${_?`gap-1`:``}`;return i(t,{className:`fixed bottom-0 left-0 right-0 z-50 h-[var(--tab-bar-height)] border-t border-line1 bg-bg1 py-3 backdrop-blur-[2px] shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:i(t,{className:`flex w-full items-center`,children:d.map((r,o)=>{let c=g===o,l=c?r.activeIcon:r.icon,d=r.label,f=p(r)&&d.trim()!==``;return a(s,{href:u(r),className:y,"data-index":o,"data-webview-nav":`spa`,onClick:v,children:[i(t,{className:`relative size-[22px] shrink-0`,children:l?i(e,{src:l,alt:d,fill:!0,className:`object-contain`}):i(t,{"data-active":c,className:`size-full rounded-sm bg-text3 data-[active=true]:bg-theme5`})}),_&&f?i(n,{"data-active":c,className:`truncate text-center text-[10px] leading-[10px] font-medium min-w-0 max-w-full px-0.5 text-text2 data-[active=true]:text-theme5`,children:d}):null]},o)})})})}export{m as TabBarClient};
@@ -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?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
9
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "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?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
10
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "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 组件属性。 */
@@ -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 NextImage from "next/image";
4
+ import Image from "next/image";
5
5
 
6
6
  //#region components/ui/image.d.ts
7
7
  /** BaseImageProps 属性定义。 */
8
- type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof NextImage>, 'className' | 'src' | 'alt' | 'width' | 'height' | 'loading' | 'priority' | 'fill' | 'style'>;
8
+ type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof Image>, '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(props: ImageProps): react_jsx_runtime0.JSX.Element;
30
+ declare function Image$1(props: ImageProps): react_jsx_runtime0.JSX.Element;
31
31
  //#endregion
32
- export { BaseImageProps, CommonImageProps, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
32
+ export { BaseImageProps, CommonImageProps, Image$1 as Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
@@ -6,10 +6,10 @@ type InspectorFieldOption<T> = Omit<T, 'type'>;
6
6
  declare const stringInspectorFieldSchema: z.ZodObject<{
7
7
  type: z.ZodLiteral<"string">;
8
8
  fieldType: z.ZodOptional<z.ZodEnum<{
9
- select: "select";
10
9
  input: "input";
11
10
  textarea: "textarea";
12
11
  color: "color";
12
+ select: "select";
13
13
  }>>;
14
14
  defaultValue: z.ZodOptional<z.ZodString>;
15
15
  label: z.ZodOptional<z.ZodString>;
@@ -68,10 +68,10 @@ type ObjectInspectorFieldOption = InspectorFieldOption<z.infer<typeof objectInsp
68
68
  declare const componentInspectorFieldMetaSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
69
69
  type: z.ZodLiteral<"string">;
70
70
  fieldType: z.ZodOptional<z.ZodEnum<{
71
- select: "select";
72
71
  input: "input";
73
72
  textarea: "textarea";
74
73
  color: "color";
74
+ select: "select";
75
75
  }>>;
76
76
  defaultValue: z.ZodOptional<z.ZodString>;
77
77
  label: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.2.4-beta.4",
4
+ "version": "0.2.5",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"