@funhub/platform 0.1.117 → 0.1.119

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{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/popup.mjs";import i from"../../../../assets/images/add.mjs";import a from"../../../../assets/images/less.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";const f=`channel-filter-hidden-channel-ids`;function p(){if(typeof window>`u`)return[];try{let e=localStorage.getItem(f);return e?JSON.parse(e):[]}catch(e){return console.error(`Failed to load hidden channel IDs:`,e),[]}}function m(e){if(!(typeof window>`u`))try{localStorage.setItem(f,JSON.stringify(e))}catch(e){console.error(`Failed to save hidden channel IDs:`,e)}}function h({open:f,onOpenChange:h,channels:g,onChannelClick:_,onChannelsChange:v}){let y=d(`components.biz.business.navBar.variants.basicNavBar.runtime`),[b,x]=c(g);o(()=>{if(g.length>0){let e=p();x(g.filter(t=>!e.includes(t.name)))}},[g]);let S=s(()=>g.filter(e=>!b.some(t=>t.name===e.name)),[g,b]),C=e=>{if(h(e),!e){m(S.map(e=>e.name)),v?.(b);let e=new URL(window.location.href).pathname,t=decodeURIComponent(e.split(`/`).pop());S.find(e=>e.name===t)&&b[0]&&(window.location.href=`/`)}},w=e=>{x(t=>t.filter(t=>t.name!==e.name))},T=e=>{x(t=>[...t,e])},E=(e,t)=>{_?.(e,t)},D=()=>{x(g),m([])},O=e=>e===`推荐`;return l(r,{open:f,onOpenChange:C,side:`top`,showCloseButton:!0,className:`!h-screen max-h-screen`,closeButtonClassName:`border-0`,children:u(t,{className:`flex flex-col h-full px-[12px]`,children:[l(t,{className:`mb-4 pt-4`,children:l(n,{className:`text-text1 font-bold text-[18px]`,children:y(`channelFilterDialog.allChannels`)})}),u(t,{className:`mb-[32px]`,children:[u(t,{className:`flex items-center justify-between h-6 mb-[12px]`,children:[l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.myChannels`)}),l(t,{onClick:D,children:l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.resetDefault`)})})]}),l(t,{className:`grid grid-cols-4 gap-[12px]`,children:b.map((r,i)=>{let o=O(r.name);return u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>E(r,i),children:[l(n,{className:`text-text1 text-[14px]`,children:r.name}),!o&&l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),w(r)},children:l(e,{src:typeof a==`string`?a:a.src,alt:y(`channelFilterDialog.delete`),width:16,height:16})})]},r.name||`my-channel-${i}`)})})]}),u(t,{children:[l(t,{className:`h-6 mb-[12px]`,children:l(n,{className:`text-text1 text-[16px]`,children:y(`channelFilterDialog.moreChannels`)})}),S.length===0?l(t,{className:`flex justify-center`,children:u(n,{className:`text-text3 text-[14px]`,children:[y(`channelFilterDialog.allAddedTo`),`"`,y(`channelFilterDialog.myChannels`),`"`]})}):l(t,{className:`grid grid-cols-4 gap-[12px]`,children:S.map((r,a)=>u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>E(r,a),children:[l(n,{className:`text-text1 text-[14px]`,children:r.name}),l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),T(r)},children:l(e,{src:typeof i==`string`?i:i.src,alt:y(`channelFilterDialog.add`),width:16,height:16})})]},r.name||`more-channel-${a}`))})]})]})})}export{h as default,p as loadHiddenChannelIdsFromStorage};
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 r from"../../../ui/popup.mjs";import i from"../../../../assets/images/add.mjs";import a from"../../../../assets/images/less.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{useTranslations as d}from"next-intl";const f=`channel-filter-hidden-channel-ids`;function p(){let e=(window.location.pathname||`/`).match(/^\/domain\/([^/]+)/);return e?`${f}-${e[1]}`:f}function m(){if(typeof window>`u`)return[];try{let e=p(),t=localStorage.getItem(e);return t?JSON.parse(t):[]}catch(e){return console.error(`Failed to load hidden channel IDs:`,e),[]}}function h(e){if(!(typeof window>`u`))try{let t=p();localStorage.setItem(t,JSON.stringify(e))}catch(e){console.error(`Failed to save hidden channel IDs:`,e)}}function g({open:f,onOpenChange:p,currentChannelId:g,channels:_,onChannelClick:v,onChannelsChange:y}){let b=d(`components.biz.business.navBar.variants.basicNavBar.runtime`),[x,S]=c(_);o(()=>{if(_.length>0){let e=m();S(_.filter(t=>!e.includes(t.name)))}},[_]);let C=s(()=>_.filter(e=>!x.some(t=>t.name===e.name)),[_,x]),w=e=>{if(p(e),!e){h(C.map(e=>e.name)),y?.(x);let e=new URL(window.location.href).pathname,t=decodeURIComponent(e.split(`/`).pop());C.find(e=>e.name===t)&&x[0]&&(window.location.href=`/`)}},T=e=>{S(t=>t.filter(t=>t.name!==e.name))},E=e=>{S(t=>[...t,e])},D=(e,t)=>{v?.(e,t)},O=()=>{S(_),h([])},k=e=>e===`推荐`;return l(r,{open:f,onOpenChange:w,side:`top`,showCloseButton:!0,className:`!h-screen max-h-screen`,closeButtonClassName:`border-0`,children:u(t,{className:`flex flex-col h-full px-[12px]`,children:[l(t,{className:`mb-4 pt-4`,children:l(n,{className:`text-text1 font-bold text-[18px]`,children:b(`channelFilterDialog.allChannels`)})}),u(t,{className:`mb-[32px]`,children:[u(t,{className:`flex items-center justify-between h-6 mb-[12px]`,children:[l(n,{className:`text-text1 text-[16px]`,children:b(`channelFilterDialog.myChannels`)}),l(t,{onClick:O,children:l(n,{className:`text-text1 text-[16px]`,children:b(`channelFilterDialog.resetDefault`)})})]}),l(t,{className:`grid grid-cols-4 gap-[12px]`,children:x.map((r,i)=>{let o=!k(r.name)&&!r.isDefault&&x.length>1&&r.name!==g;return u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>D(r,i),children:[l(n,{className:`text-text1 text-[14px]`,children:r.name}),o&&l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),T(r)},children:l(e,{src:typeof a==`string`?a:a.src,alt:b(`channelFilterDialog.delete`),width:16,height:16})})]},r.name||`my-channel-${i}`)})})]}),u(t,{children:[l(t,{className:`h-6 mb-[12px]`,children:l(n,{className:`text-text1 text-[16px]`,children:b(`channelFilterDialog.moreChannels`)})}),C.length===0?l(t,{className:`flex justify-center`,children:u(n,{className:`text-text3 text-[14px]`,children:[b(`channelFilterDialog.allAddedTo`),`"`,b(`channelFilterDialog.myChannels`),`"`]})}):l(t,{className:`grid grid-cols-4 gap-[12px]`,children:C.map((r,a)=>u(t,{className:`relative h-[40px] px-4 bg-bg1 rounded-[50px] cursor-pointer flex items-center justify-center whitespace-nowrap`,onClick:()=>D(r,a),children:[l(n,{className:`text-text1 text-[14px]`,children:r.name}),l(t,{className:`absolute top-0 right-0 flex items-center justify-center cursor-pointer w-[16px] h-[16px]`,onClick:e=>{e.stopPropagation(),E(r)},children:l(e,{src:typeof i==`string`?i:i.src,alt:b(`channelFilterDialog.add`),width:16,height:16})})]},r.name||`more-channel-${a}`))})]})]})})}export{g as default,m as loadHiddenChannelIdsFromStorage};
@@ -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" | "outline" | "secondary" | "ghost" | null | undefined;
9
+ variant?: "link" | "default" | "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?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
10
+ variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
11
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 组件属性。 */
@@ -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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funhub/platform",
3
3
  "type": "module",
4
- "version": "0.1.117",
4
+ "version": "0.1.119",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"