@funhub/platform 0.1.88 → 0.1.89

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.
@@ -3,12 +3,11 @@ import { TabBarInspectorProps } from "./schema.mjs";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/biz/business/tab-bar/client.d.ts
6
- /** 无面板配置时无 items;可扩展为运行时注入。 */
7
6
  type TabBarProps = TabBarInspectorProps & {
8
7
  items?: Array<Record<string, unknown>>;
9
8
  };
10
9
  /**
11
- * TabBar 物料组件 - 客户端交互部分(支持 icon+文案 / 仅 icon 两种形式)
10
+ * TabBar 物料组件
12
11
  */
13
12
  declare function TabBarClient(props: TabBarProps): react_jsx_runtime0.JSX.Element | null;
14
13
  //#endregion
@@ -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 o from"next/link";import{usePathname as s}from"next/navigation";const c=[];function l(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function u(e){let t=typeof e.path==`string`?e.path.trim():``;if(t)return t;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 n=(e.domainId??``).toString().trim();return n?`/domain/${n}`:`/`}function d(e,t){let n=l(t),r=l(u(e).split(`?`)[0]);return r===`/`?n===`/`:n===r||n.startsWith(`${r}/`)}function f(e,t){return e.findIndex(e=>d(e,t))}function p(l){let{items:d=c,mode:p=`renderer`}=l,m=s(),h=r(()=>p===`editor`?0:f(d??[],m),[d,m,p]),g=r(()=>(d??[]).some(e=>e.label!=null&&String(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 safe-area-bottom bg-bg1 border-t border-line1 backdrop-blur-[2px] py-3 shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:i(t,{className:`flex w-full items-center`,children:d.map((r,s)=>{let c=h===s,l=c&&r.activeIcon?r.activeIcon:r.icon,d=typeof r.label==`string`?r.label:String(r.label??``);return a(o,{href:u(r),className:v,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})]},s)})})})}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{useEffect as r,useMemo as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"next/link";import{usePathname as u}from"next/navigation";const d=[];function f(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function p(e){let t=typeof e.path==`string`?e.path.trim():``;if(t)return t;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 n=(e.domainId??``).toString().trim();return n?`/domain/${n}`:`/`}function m(e,t){let n=f(t),r=typeof e.path==`string`?e.path.trim():``;if(r){let e=f(r.split(`?`)[0]);return e===`/`?n===`/`:n===e||n.startsWith(`${e}/`)}let i=(e.domainId??``).toString().trim();if(!i)return n===`/`||n.startsWith(`/category/`);let a=`/domain/${i}`;return n===a||n.startsWith(`${a}/`)}function h(e,t){return e.findIndex(e=>m(e,t))}function g(f){let{items:m=d,mode:g=`renderer`}=f,_=u(),[v,y]=o(()=>{if(g===`editor`)return 0;let e=h(m??[],_);return e>=0?e:0}),b=a(!1);r(()=>{if(g===`editor`||b.current||!m?.length)return;let e=h(m,_);y(e>=0?e:0),b.current=!0},[m,_,g]);let x=g===`editor`?0:v,S=i(()=>(m??[]).some(e=>e.label!=null&&String(e.label).trim()!==``),[m]);if(!m?.length)return null;function C(e){if(g===`editor`){e.preventDefault();return}let t=Number(e.currentTarget.dataset.index);Number.isNaN(t)||y(t)}let w=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${S?`gap-1`:``}`;return s(t,{className:`fixed bottom-0 left-0 right-0 z-50 safe-area-bottom bg-bg1 border-t border-line1 backdrop-blur-[2px] py-3 shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:s(t,{className:`flex w-full items-center`,children:m.map((r,i)=>{let a=x===i,o=a&&r.activeIcon?r.activeIcon:r.icon,u=typeof r.label==`string`?r.label:String(r.label??``);return c(l,{href:p(r),className:w,"data-index":i,onClick:C,children:[s(t,{className:`relative size-[22px] shrink-0`,children:o?s(e,{src:o,alt:u,fill:!0,className:`object-contain`}):s(t,{"data-active":a,className:`size-full rounded-sm bg-text3 data-[active=true]:bg-theme5`})}),S&&s(n,{"data-active":a,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:u})]},i)})})})}export{g 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?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
9
+ variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
10
10
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
11
  /** Badge 组件。 */
12
12
  declare function Badge({
@@ -7,8 +7,8 @@ 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?: "default" | "link" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
- size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
+ variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link" | null | undefined;
11
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
12
12
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
13
13
  /** Button 组件属性。 */
14
14
  type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.88",
4
+ "version": "0.1.89",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"