@funhub/platform 0.1.117 → 0.1.118
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(
|
|
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(){return typeof window>`u`?f:`${f}-${window.location.pathname||`/`}`}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,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=m();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(p(e),!e){h(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),h([])},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{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?: "
|
|
9
|
+
variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | 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?: "
|
|
11
|
-
size?: "default" | "
|
|
10
|
+
variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | 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> & {
|