@funhub/platform 0.1.24 → 0.1.25
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.
- package/dist/components/biz/business/shortcut-grid/client.d.mts +2 -2
- package/dist/components/biz/business/shortcut-grid/client.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +12 -1
- package/dist/components/biz/business/shortcut-grid/material.mjs +1 -1
- package/dist/components/biz/business/shortcut-grid/schema.d.mts +13 -5
- package/dist/components/biz/business/shortcut-grid/schema.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/components/ui/image.d.mts +4 -4
- package/package.json +1 -1
|
@@ -5,8 +5,8 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
5
5
|
//#region components/biz/business/shortcut-grid/client.d.ts
|
|
6
6
|
type ShortcutGridClientProps = ShortcutGridInspectorProps;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 金刚区客户端组件:
|
|
9
9
|
*/
|
|
10
|
-
declare function ShortcutGridClient(
|
|
10
|
+
declare function ShortcutGridClient(props: ShortcutGridClientProps): react_jsx_runtime0.JSX.Element;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { ShortcutGridClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{
|
|
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/link.mjs";import{shortcutGridInspectorDefaultProps as i}from"./schema.mjs";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s(s){let{title:c,shortcutCount:l,isShortcutTitle:u,shortcuts:d}={...i,...s},f=(()=>{let e=l??d.length??0;return Math.min(Math.max(e,3),5)})(),p=(d??[]).slice(0,f);return o(t,{as:`section`,className:`p-[12px]`,"aria-label":`金刚区`,children:[c?.trim()?a(n,{as:`h2`,className:`font-bold text-[16px] text-text1`,children:c}):null,a(t,{className:`flex justify-around mt-[8px]`,children:p.map((i,s)=>{let c=o(t,{className:`flex flex-col items-center justify-center gap-[10px] w-[52px]`,children:[a(t,{className:`flex h-[39px] w-[52px] items-center justify-center relative`,"aria-hidden":!i.label,children:a(e,{src:i.icon,alt:i.label||`入口图标`,fill:!0,className:`object-cover`})}),u?a(n,{className:`text-[12px] w-[52px] truncate text-center`,title:u?i.label:void 0,children:i.label}):null]});return a(r,{href:i.href,className:`block`,children:c},s)})})]})}export{s as ShortcutGridClient};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
|
|
2
|
+
import { SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
2
3
|
import { DefineMaterialOption } from "../../../../utils/schema/material.mjs";
|
|
4
|
+
import "../../../../utils/schema/index.mjs";
|
|
3
5
|
import { ShortcutGridClient } from "./client.mjs";
|
|
4
6
|
import * as zod from "zod";
|
|
5
7
|
import * as zod_v4_core0 from "zod/v4/core";
|
|
6
8
|
|
|
7
9
|
//#region components/biz/business/shortcut-grid/material.d.ts
|
|
8
|
-
declare const shortcutGridMaterial: DefineMaterialOption<typeof ShortcutGridClient, zod.ZodObject<{
|
|
10
|
+
declare const shortcutGridMaterial: DefineMaterialOption<typeof ShortcutGridClient, zod.ZodObject<{
|
|
11
|
+
title: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
shortcutCount: zod.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
isShortcutTitle: zod.ZodBoolean & SchemaHasDefaultValue;
|
|
14
|
+
shortcuts: zod.ZodArray<zod.ZodObject<{
|
|
15
|
+
label: zod.ZodOptional<zod.ZodString> & SchemaHasDefaultValue;
|
|
16
|
+
icon: zod.ZodString & SchemaHasDefaultValue;
|
|
17
|
+
href: zod.ZodString & SchemaHasDefaultValue;
|
|
18
|
+
}, zod_v4_core0.$strip>> & SchemaHasDefaultValue;
|
|
19
|
+
}, zod_v4_core0.$strip>, "shortcut-grid">;
|
|
9
20
|
//#endregion
|
|
10
21
|
export { shortcutGridMaterial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{shortcutGridInspectorPropsSchema as t}from"./schema.mjs";import{ShortcutGridClient as n}from"./client.mjs";import{ShortcutGrid as r}from"./server.mjs";const i=e({type:`shortcut-grid`,name:`金刚区`,icon:`/static/components-thumb/shortcut_grid_5.png`,category:`金刚组件`,serverComponent:r,clientComponent:n,propsSchema:t});export{i as shortcutGridMaterial};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
|
|
2
|
-
import { InferSchemaProps } from "../../../../utils/schema/schema.mjs";
|
|
2
|
+
import { InferSchemaProps, SchemaHasDefaultValue } from "../../../../utils/schema/schema.mjs";
|
|
3
3
|
import "../../../../utils/schema/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import * as zod_v4_core0 from "zod/v4/core";
|
|
4
|
+
import z from "zod";
|
|
6
5
|
|
|
7
6
|
//#region components/biz/business/shortcut-grid/schema.d.ts
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
8
|
+
* 金刚区物料可配置字段:
|
|
10
9
|
*/
|
|
11
|
-
declare const shortcutGridInspectorPropsSchema:
|
|
10
|
+
declare const shortcutGridInspectorPropsSchema: z.ZodObject<{
|
|
11
|
+
title: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
12
|
+
shortcutCount: z.ZodNumber & SchemaHasDefaultValue;
|
|
13
|
+
isShortcutTitle: z.ZodBoolean & SchemaHasDefaultValue;
|
|
14
|
+
shortcuts: z.ZodArray<z.ZodObject<{
|
|
15
|
+
label: z.ZodOptional<z.ZodString> & SchemaHasDefaultValue;
|
|
16
|
+
icon: z.ZodString & SchemaHasDefaultValue;
|
|
17
|
+
href: z.ZodString & SchemaHasDefaultValue;
|
|
18
|
+
}, z.core.$strip>> & SchemaHasDefaultValue;
|
|
19
|
+
}, z.core.$strip>;
|
|
12
20
|
type ShortcutGridInspectorProps = InferSchemaProps<typeof shortcutGridInspectorPropsSchema>;
|
|
13
21
|
//#endregion
|
|
14
22
|
export { ShortcutGridInspectorProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{
|
|
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 o from"zod";const s=t({title:i({label:`推荐位名称`,required:!1,defaultValue:`推荐列表`}),shortcutCount:n({label:`入口数量`,required:!0,defaultValue:4}).refine(e=>e>=3&&e<=5,`入口数量必须为 3-5`),isShortcutTitle:r({label:`是否显示入口标题`,required:!0,defaultValue:!0}),shortcuts:e(o.object({label:i({label:`入口标题`,required:!1,defaultValue:`最新`}),icon:i({label:`图标`,required:!0,defaultValue:``}),href:i({label:`跳转指向`,required:!0,defaultValue:``})}),{label:`推荐列表`,required:!0,defaultValue:[{label:`热门`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`新上架`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`排行榜`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`},{label:`筛选`,icon:`/images/2026/01/21/6967aec2d806ed47d5238861/fce0a95c-1e8f-4872-ab69-86212435e1bc.jpegxxx`,href:`/video-list?title=穷小伙刚离婚,找了他3年的女总裁蒙着面纱出现了,一身红嫁衣当众求嫁,前妻嘲笑她是丑八怪,下秒揭开面纱后全场沉默了&tags=动作`}]})}),c=a(s);export{c as shortcutGridInspectorDefaultProps,s as shortcutGridInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{AlertDialog as n,AlertDialogAction as r,AlertDialogCancel as i,AlertDialogContent as a,AlertDialogDescription as ee,AlertDialogFooter as o,AlertDialogHeader as s}from"../../../ui/alert-dialog.mjs";import{useUserStore as c}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as l,pUserUserPrivacySettings as u}from"../../../../service/generated/client.mjs";import{Box as d}from"../../../ui/box.mjs";import{List as f}from"../../../ui/list.mjs";import{Switch as p}from"../../../ui/switch.mjs";import{useLoginModalStore as m}from"../../../../store/modules/login-modal-store.mjs";import{locales as h,persistLocalePreference as g}from"../../../../i18n.mjs";import{useDeleteRequest as _,useRequest as v}from"../../../../hooks/query/use-query.mjs";import{HeaderNav as y}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as b}from"./reset-password-drawer.mjs";import{useEffect as x,useRef as S,useState as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{useLocale as te,useTranslations as E}from"next-intl";import ne from"next/link";function D(e){return{collection:Number(e?.collections_open??0)>0,follower:Number(e?.follower_open??0)>0,following:Number(e?.following_open??0)>0,like:Number(e?.like_open??0)>0}}function O(e){return{collections_open:e.collection?1:0,follower_open:e.follower?1:0,following_open:e.following?1:0,like_open:e.like?1:0}}function k({className:k}={}){let A=E(`components.pages.settings.components`),j=te(),{open:M}=m(),N=c(e=>e.isLogin),P=c(e=>e.token),F=c(e=>e.logout),I=c(e=>e.userId),L=(N||!!P)&&!!I,R=D(),[z,B]=C(R),V=S(R),[H,U]=C(!1),[W,G]=C(!1),K=_(),q=[`user-privacy-settings`,I],J=j===`zh-CN`?`en`:`zh-CN`,Y=h.find(e=>e.code===J)?.name||J,{data:X}=v(q,()=>l({user_id:I}),{enabled:!!I}),Z=X?.data;x(()=>{if(!Z)return;let e=D(Z);B(e),V.current=e},[Z]),x(()=>{V.current=z},[z]);async function re(e){let t=await u({user_id:I,...O(e)});if(t.code!==0)throw Error(t.message||`隐私设置更新失败`);K(q)}async function Q(e,t){let n=V.current,r={...n,[e]:t};B(r);try{await re(r)}catch(e){console.error(`update settings failed:`,e),B(n)}}let ie=_();function ae(){ie([`user-profile`,`mine`]),F(),window.location.href
|
|
2
|
+
"use client";import{cn as e}from"../../../../utils/cn.mjs";import{Button as t}from"../../../ui/button.mjs";import{AlertDialog as n,AlertDialogAction as r,AlertDialogCancel as i,AlertDialogContent as a,AlertDialogDescription as ee,AlertDialogFooter as o,AlertDialogHeader as s}from"../../../ui/alert-dialog.mjs";import{useUserStore as c}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as l,pUserUserPrivacySettings as u}from"../../../../service/generated/client.mjs";import{Box as d}from"../../../ui/box.mjs";import{List as f}from"../../../ui/list.mjs";import{Switch as p}from"../../../ui/switch.mjs";import{useLoginModalStore as m}from"../../../../store/modules/login-modal-store.mjs";import{locales as h,persistLocalePreference as g}from"../../../../i18n.mjs";import{useDeleteRequest as _,useRequest as v}from"../../../../hooks/query/use-query.mjs";import{HeaderNav as y}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as b}from"./reset-password-drawer.mjs";import{useEffect as x,useRef as S,useState as C}from"react";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{useLocale as te,useTranslations as E}from"next-intl";import ne from"next/link";function D(e){return{collection:Number(e?.collections_open??0)>0,follower:Number(e?.follower_open??0)>0,following:Number(e?.following_open??0)>0,like:Number(e?.like_open??0)>0}}function O(e){return{collections_open:e.collection?1:0,follower_open:e.follower?1:0,following_open:e.following?1:0,like_open:e.like?1:0}}function k({className:k}={}){let A=E(`components.pages.settings.components`),j=te(),{open:M}=m(),N=c(e=>e.isLogin),P=c(e=>e.token),F=c(e=>e.logout),I=c(e=>e.userId),L=(N||!!P)&&!!I,R=D(),[z,B]=C(R),V=S(R),[H,U]=C(!1),[W,G]=C(!1),K=_(),q=[`user-privacy-settings`,I],J=j===`zh-CN`?`en`:`zh-CN`,Y=h.find(e=>e.code===J)?.name||J,{data:X}=v(q,()=>l({user_id:I}),{enabled:!!I}),Z=X?.data;x(()=>{if(!Z)return;let e=D(Z);B(e),V.current=e},[Z]),x(()=>{V.current=z},[z]);async function re(e){let t=await u({user_id:I,...O(e)});if(t.code!==0)throw Error(t.message||`隐私设置更新失败`);K(q)}async function Q(e,t){let n=V.current,r={...n,[e]:t};B(r);try{await re(r)}catch(e){console.error(`update settings failed:`,e),B(n)}}let ie=_();function ae(){ie([`user-profile`,`mine`]),F(),window.location.href=`/user/mine`}function oe(e){G(e)}function se(){G(!0)}function ce(){G(!1)}function le(){G(!1),ae()}function $(e){U(e)}function ue(){if(!L){M();return}U(!0)}function de(e){L||(e.preventDefault(),e.stopPropagation(),M())}function fe(){g(J),window.location.reload()}function pe(e){Q(`collection`,e)}function me(e){Q(`like`,e)}function he(e){Q(`following`,e)}function ge(e){Q(`follower`,e)}return T(d,{className:e(k),children:[w(y,{className:`!bg-bg2`,title:A(`settings.title`)}),w(b,{open:H,onOpenChange:$}),T(d,{className:`flex flex-col gap-2 `,children:[w(f,{className:`bg-bg2 py-2`,children:w(ne,{href:`/feedback`,onClick:de,children:w(f.Item,{title:A(`settings.feedbackTitle`),arrow:!0})})}),w(f,{className:`bg-bg2 py-2`,children:w(f.Item,{title:A(`settings.resetPasswordTitle`),arrow:!0,onClick:ue})}),w(f,{className:`bg-bg2 py-2`,children:w(f.Item,{title:A(`settings.languageTitle`),extra:T(t,{size:`sm`,variant:`outline`,onClick:fe,children:[A(`settings.switchTo`),` `,Y]})})}),L?T(f,{className:`bg-bg2 py-2`,children:[w(f.Item,{title:A(`settings.privacySettingsTitle`),extra:T(`span`,{className:`text-xs`,children:[A(`settings.whenOff`),`,`,A(`settings.listPrivateHint`)]})}),w(f.Item,{className:`pl-8 mt-2`,title:A(`settings.collectionsTitle`),extra:w(p,{checked:z.collection,onCheckedChange:pe})}),w(f.Item,{className:`pl-8`,title:A(`settings.like`),extra:w(p,{checked:z.like,onCheckedChange:me})}),w(f.Item,{className:`pl-8`,title:A(`settings.follow`),extra:w(p,{checked:z.following,onCheckedChange:he})}),w(f.Item,{className:`pl-8`,title:A(`settings.followersTitle`),extra:w(p,{checked:z.follower,onCheckedChange:ge})})]}):null]}),H||!L?null:w(d,{className:`fixed bottom-0 w-full left-0`,children:w(t,{className:`h-auto text-base py-4 w-full`,variant:`secondary`,onClick:se,children:A(`settings.button`)})}),w(n,{open:W,onOpenChange:oe,children:T(a,{size:`sm`,children:[w(s,{children:w(ee,{children:A(`settings.logoutConfirmMessage`)})}),T(o,{children:[w(i,{onClick:ce,children:A(`settings.cancel`)}),w(r,{onClick:le,children:A(`settings.confirm`)})]})]})})]})}export{k as Settings};
|
|
@@ -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
|
|
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
|
|
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 };
|