@funhub/platform 0.1.69 → 0.1.70

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{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{Box as s}from"../../../../ui/box.mjs";import{Text as c}from"../../../../ui/text.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as u,useMutation as d,useRequest as f,useUpdateRequest as p}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as m}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as h}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as g}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as _}from"./user-profile-cover-background.mjs";import{useEffect as v,useMemo as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";import T from"next/link";import{useRouter as ee}from"next/navigation";const E=n.persist,D=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,O=`/images/mine/img_mine_head_bg.png`;function te({userId:e,currentUserId:n,isFollowing:r}){let i=w(`components.pages.profile`),{open:s}=l(),c=u(),f=p(),{mutateAsync:m,isPending:h}=d(async e=>a(e)),{mutateAsync:g,isPending:_}=d(async e=>o(e)),v=h||_;async function y(){if(!v){if(!n){s();return}try{if(r){let t=await g({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.unfollowSuccess`)),b(!1),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.unfollowFailed`))}else{let t=await m({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.followSuccess`)),b(!0),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),C.error(i(`client.operationFailed`))}}}function b(t){f([`user-profile`,`profile`,e],e=>!e||!e.data?e:{...e,data:{...e.data,is_following:t}})}return x(t,{variant:r?`outline`:`default`,className:`rounded-full disabled:opacity-100`,onClick:y,disabled:v,children:i(v?`client.processing`:r?`client.followed`:`client.follow`)})}function k({id:a,enableCustomBackground:o=!0,showBackButton:u=!0,requireLogin:d=!1,cookieToken:p,cookieUserId:C,isEditorPreview:k=!1,className:A,mode:j=`renderer`}){let M=w(`components.pages.profile`);w(`components.pages.profile.components`);let N=k||j===`editor`,ne=!N,re=ee(),{open:ie}=l(),{isLogin:ae,userId:P,token:F}=n(),[I,L]=b(!1);v(()=>{if(!E){L(!0);return}L(E.hasHydrated());let e=E.onHydrate(()=>{L(!1)}),t=E.onFinishHydration(()=>{L(!0)});return()=>{e(),t()}},[]);let R=N?!1:I?ae&&!!P&&!!F:!!C&&!!p,z=N?``:I?P:P||C,B=z,V=a==null||!!a&&!!B&&a===B,oe=!V&&!!a,H=V?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:U}=f(N?[`editor-preview`,...H]:H,()=>a?i({target_user_id:a,user_id:z||a}):r({user_id:a||z||``}),{staleTime:0,enabled:ne&&(!!a||!!z)}),W=y(()=>{let e=U?U.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||D,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||O}:{}},[a,U]),G=N||d&&V&&!R,K=!G&&!R&&oe,q=V&&R&&!G,J=!R,se=o&&q,ce=o&&J,le={name:M(`client.welcomeToPlanet`),description:M(`client.exploreAdventures`),avatar:D,followingCnt:0,followersCnt:0,likeCnt:0,background:O};function Y(){ie()}function X(){re.back()}let ue=G?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}):K?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.follow`)}):R?V?x(T,{href:`/edit`,children:x(t,{variant:`outline`,className:`rounded-full`,children:M(`client.editProfile`)})}):x(te,{userId:a||``,currentUserId:z,isFollowing:W?.isFollowing}):x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}),Z=G?le:W,Q=Z.name||``,$=Z.description||Z.signature||``;Z.followingCnt,Z.followersCnt,Z.likeCnt;let de=Z.avatar||``;return S(s,{className:e(`flex flex-col relative`,A),children:[S(s,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[x(t,{variant:`ghost`,size:`icon-xs`,onClick:X,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!u}),children:x(m,{className:`w-4 h-4`})}),x(T,{href:`/settings`,className:e({invisible:!V}),children:x(h,{})})]}),x(_,{isMine:se,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:ce?Y:void 0}),S(s,{className:`flex-1 px-3`,children:[S(s,{className:`relative flex justify-end`,children:[x(g,{isMine:q,src:de,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),x(s,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),S(s,{className:`flex items-center justify-between gap-1`,children:[x(c,{as:`p`,className:`text-text1 text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q}),ue]}),$&&x(c,{as:`p`,className:`text-sm py-1 line-clamp-2 break-all text-text1/66`,children:$})]})]})}export{k as UserProfileHeaderClient};
2
+ "use client";import{cn as e}from"../../../../../utils/cn.mjs";import{Button as t}from"../../../../ui/button.mjs";import{useUserStore as n}from"../../../../../store/modules/user-store.mjs";import{gUserGetUserInfo as r,gUserViewUserInfo as i,pInteractionFollow as a,pInteractionUnfollow as o}from"../../../../../service/generated/client.mjs";import{Box as s}from"../../../../ui/box.mjs";import{Text as c}from"../../../../ui/text.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as u,useMutation as d,useRequest as f,useUpdateRequest as p}from"../../../../../hooks/query/use-query.mjs";import{LeftArrowIcon as m}from"../../../../common/icons/left-arrow.mjs";import{SettingIcon as h}from"../../../../common/icons/setting.mjs";import{UserProfileAvatar as g}from"./user-profile-avatar.mjs";import{UserProfileCoverBackground as _}from"./user-profile-cover-background.mjs";import{useEffect as v,useMemo as y,useState as b}from"react";import{jsx as x,jsxs as S}from"react/jsx-runtime";import{toast as C}from"sonner";import{useTranslations as w}from"next-intl";import T from"next/link";import{useRouter as ee}from"next/navigation";const E=n.persist,D=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,O=`/images/mine/img_mine_head_bg.png`;function te({userId:e,currentUserId:n,isFollowing:r}){let i=w(`components.pages.profile`),{open:s}=l(),c=u(),f=p(),{mutateAsync:m,isPending:h}=d(async e=>a(e)),{mutateAsync:g,isPending:_}=d(async e=>o(e)),v=h||_;async function y(){if(!v){if(!n){s();return}try{if(r){let t=await g({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.unfollowSuccess`)),b(!1),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.unfollowFailed`))}else{let t=await m({app_id:0,follower_id:n,followee_id:e});t.code===0?(C.success(i(`client.followSuccess`)),b(!0),c([`check-follow`,e]),c([`user-profile`,`profile`,e])):C.error(t.message||i(`client.followFailed`))}}catch(e){console.error(`关注操作失败`,e),C.error(i(`client.operationFailed`))}}}function b(t){f([`user-profile`,`profile`,e],e=>!e||!e.data?e:{...e,data:{...e.data,is_following:t}})}return x(t,{variant:r?`outline`:`default`,className:`rounded-full disabled:opacity-100`,onClick:y,disabled:v,children:i(v?`client.processing`:r?`client.followed`:`client.follow`)})}function k({id:a,enableCustomBackground:o=!0,showBackButton:u=!0,requireLogin:d=!1,cookieToken:p,cookieUserId:C,isEditorPreview:k=!1,className:A,mode:j=`renderer`}){let M=w(`components.pages.profile`);w(`components.pages.profile.components`);let N=k||j===`editor`,ne=!N,re=ee(),{open:ie}=l(),{isLogin:ae,userId:P,token:F}=n(),[I,L]=b(!1);v(()=>{if(!E){L(!0);return}L(E.hasHydrated());let e=E.onHydrate(()=>{L(!1)}),t=E.onFinishHydration(()=>{L(!0)});return()=>{e(),t()}},[]);let R=N?!1:I?ae&&!!P&&!!F:!!C&&!!p,z=N?``:I?P:P||C,B=z,V=a==null||!!a&&!!B&&a===B,oe=!V&&!!a,H=V?[`user-profile`,`mine`]:[`user-profile`,`profile`,a],{data:U}=f(N?[`editor-preview`,...H]:H,()=>a?i({target_user_id:a,user_id:z||a}):r({user_id:a||z||``}),{staleTime:0,enabled:ne&&(!!a||!!z)}),W=y(()=>{let e=U?U.data:void 0;return e?{userId:e.user_id,isFollowing:e.is_following||!1,name:e.nick_name||`User${a??``}`,avatar:e.avatar||D,followingCnt:e.following_count??0,followersCnt:e.follower_count??0,likeCnt:e.like_count??0,signature:e.signature||``,background:e.bg_image||O}:{}},[a,U]),G=N||d&&V&&!R,K=!G&&!R&&oe,q=V&&R&&!G,J=!R,se=o&&q,ce=o&&J,le={name:M(`client.welcomeToPlanet`),description:M(`client.exploreAdventures`),avatar:D,followingCnt:0,followersCnt:0,likeCnt:0,background:O};function Y(){ie()}function X(){re.back()}let ue=G?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}):K?x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.follow`)}):R?V?x(T,{href:`/edit`,children:x(t,{variant:`outline`,className:`rounded-full`,children:M(`client.editProfile`)})}):x(te,{userId:a||``,currentUserId:z,isFollowing:W?.isFollowing}):x(t,{className:`rounded-full`,size:`lg`,onClick:Y,children:M(`client.loginNow`)}),Z=G?le:W,Q=Z.name||``,$=Z.description||Z.signature||``;Z.followingCnt,Z.followersCnt,Z.likeCnt;let de=Z.avatar||``;return S(s,{className:e(`flex flex-col relative`,A),children:[S(s,{className:`absolute top-0 p-3 z-10 flex items-center justify-between w-full`,children:[x(t,{variant:`ghost`,size:`icon-xs`,onClick:X,className:e(`h-4 w-4 p-0 hover:bg-transparent`,{invisible:!u}),children:x(m,{className:`w-4 h-4`})}),x(T,{href:`/settings`,className:e({invisible:!V}),children:x(h,{})})]}),x(_,{isMine:se,enableCustomBackground:o,src:Z.background,onUnauthorizedClick:ce?Y:void 0}),S(s,{className:`flex-1 px-3`,children:[S(s,{className:`relative flex justify-end`,children:[x(g,{isMine:q,src:de,alt:Q||`avatar`,onUnauthorizedClick:J?Y:void 0}),x(s,{className:`flex divide-x divide-text1/5 py-4 h-12`})]}),S(s,{className:`flex items-center justify-between gap-1`,children:[x(c,{as:`p`,className:`text-text1 text-xl overflow-hidden whitespace-nowrap text-ellipsis font-bold `,children:Q}),ue]}),$&&x(c,{as:`p`,className:`text-sm pt-1 pb-0 line-clamp-2 break-all text-text1/66`,children:$})]})]})}export{k as UserProfileHeaderClient};
@@ -1,2 +1,2 @@
1
1
 
2
- import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineTextPropSchema as r}from"../../../../utils/schema/schema.mjs";import{z as i}from"zod";const a=t({title:r({label:`标题名称`,defaultValue:`推荐搜索`,description:`支持输入,中/英/数/符,6个字符`}),displayCount:n({label:`展示数`,defaultValue:2}),items:e(i.object({label:r({label:`热词`,defaultValue:`爱回家中文`})}),{label:`推荐位模块`,defaultValue:[{label:`爱回家中文`},{label:`爱回家中文`}]})});export{a as textRecommendInspectorPropsSchema};
2
+ import{defineArrayItemPropSchema as e,defineComponentPropsSchema as t,defineNumberPropSchema as n,defineTextPropSchema as r}from"../../../../utils/schema/schema.mjs";import{z as i}from"zod";const a=t({title:r({label:`标题名称`,defaultValue:`文字推荐标题`,description:`支持输入,中/英/数/符,6个字符`}),displayCount:n({label:`展示数`,defaultValue:2}),items:e(i.object({label:r({label:`热词`,defaultValue:`推荐搜索1`})}),{label:`推荐位模块`,defaultValue:[{label:`推荐搜索2`},{label:`推荐搜索3`}]})});export{a as textRecommendInspectorPropsSchema};
@@ -1,2 +1,2 @@
1
1
 
2
- "use client";import{Button as e}from"../../../ui/button.mjs";import{hashPassword as t}from"../../../../utils/common.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserResetPassword as r,pUserSendResetPasswordEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../../service/generated/client.mjs";import{getPasswordValidationErrorText as o,validatePasswordPair as ee}from"../../../../utils/password-validator.mjs";import{Box as s}from"../../../ui/box.mjs";import{Drawer as c,DrawerContent as l,DrawerDescription as u,DrawerHeader as d,DrawerTitle as f}from"../../../ui/drawer.mjs";import{Text as p}from"../../../ui/text.mjs";import m from"../../../ui/legacy/button.mjs";import{EyeIcon as h}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as g}from"../../../../assets/icons/eye-off-icon.mjs";import{HeaderNav as _}from"../../../common/header-nav/client.mjs";import v from"../../../ui/legacy/input.mjs";import{useEffect as y,useMemo as b,useRef as x,useState as S}from"react";import{jsx as C,jsxs as w}from"react/jsx-runtime";import{toast as T}from"sonner";import{useTranslations as te}from"next-intl";function E(E){let D=te(`components.pages.settings.components`),{open:O,onOpenChange:k}=E,A=n(e=>e.userInfo),[j,M]=S(``),ne=j.length!==6,N=x(null),[P,F]=S(60),[I,L]=S(!1);async function R(){if(I)return;let e=T.loading(D(`resetPasswordDrawer.sending`));try{let t=await i({user_id:A?.user_id});t.code===0?(T.success(D(`resetPasswordDrawer.codeSentSuccess`),{id:e}),L(!0),F(60)):T.error(t.message||D(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.sendFailed`),{id:e})}}function z(){H(e=>e===1?e:e+1)}async function B(){let e=T.loading(D(`resetPasswordDrawer.verifying`));try{let t=await a({user_id:A?.user_id,email_code:j});t.code===0?(T.success(D(`resetPasswordDrawer.verifySuccess`),{id:e}),z()):T.error(t.message||D(`resetPasswordDrawer.verifyFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.verifyFailed`),{id:e})}}y(()=>{if(I)return N.current=setInterval(()=>{F(e=>e<=1?(N.current&&clearInterval(N.current),L(!1),60):e-1)},1e3),()=>{N.current&&clearInterval(N.current)}},[I]);let[V,H]=S(0),[U,W]=S({password:``,confirmPassword:``}),[G,K]=S(!1),[q,J]=S(!1),[Y,X]=S(!1),Z=b(()=>ee(U.password,U.confirmPassword),[U.password,U.confirmPassword]),Q=b(()=>o(Z),[Z]),$=b(()=>G||U.password.length===0||U.confirmPassword.length===0||Z.type!==`none`,[G,U.password.length,U.confirmPassword.length,Z.type]);async function re(){if($)return;let e=T.loading(D(`resetPasswordDrawer.submitting`));try{K(!0);let n=await r({user_id:A?.user_id,password:t(U.password)});n.code===0?(T.success(D(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),W({password:``,confirmPassword:``}),M(``),k(!1)):T.error(n.message||D(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.resetFailed`),{id:e})}finally{K(!1)}}let ie=w(s,{className:`p-6`,children:[C(s,{children:w(p,{className:`text-text2`,children:[D(`resetPasswordDrawer.boundEmailNotice`),C(p,{className:`dark:text-white text-white`,children:A?.email}),D(`resetPasswordDrawer.verifyHint`)]})}),w(s,{className:`mt-6 space-y-6`,children:[w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border border-line1`,children:[C(v,{value:j,onChange:e=>M(e)}),C(e,{variant:`link`,disabled:I,onClick:R,children:I?`${P}s ${D(`resetPasswordDrawer.resendAfter`)}`:D(`resetPasswordDrawer.sendCode`)})]}),C(m,{onClick:B,disabled:ne,className:`w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:D(`resetPasswordDrawer.verifyEmailButton`)})]})]}),ae=w(s,{className:`p-6`,children:[C(s,{children:C(p,{className:`text-text2`,children:D(`resetPasswordDrawer.setNewPasswordHint`)})}),w(s,{className:`mt-6 space-y-6`,children:[w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Q?`border-theme5`:`border-line1`}`,children:[C(v,{value:U.password,onChange:e=>W(t=>({...t,password:e})),placeholder:D(`resetPasswordDrawer.passwordPlaceholder`),type:q?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),C(`button`,{type:`button`,onClick:()=>J(!q),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:C(q?g:h,{className:`w-5 h-5`})})]}),w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Z.type===`not-match`?`border-theme5`:`border-line1`}`,children:[C(v,{value:U.confirmPassword,onChange:e=>W(t=>({...t,confirmPassword:e})),placeholder:D(`resetPasswordDrawer.confirmPasswordPlaceholder`),type:Y?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),C(`button`,{type:`button`,onClick:()=>X(!Y),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:C(Y?g:h,{className:`w-5 h-5`})})]}),C(p,{className:`min-h-[22px] text-[14px] text-theme5 px-[12px]`,children:Q}),C(m,{onClick:re,disabled:$,className:`w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:D(G?`resetPasswordDrawer.submitting`:`resetPasswordDrawer.resetPassword`)})]})]});return w(c,{open:O,onOpenChange:k,direction:`right`,handleOnly:!0,children:[w(d,{className:`hidden`,children:[C(f,{children:D(`resetPasswordDrawer.title`)}),C(u,{children:D(`resetPasswordDrawer.title`)})]}),w(l,{className:`!w-full`,children:[C(_,{onBack:()=>k(!1),title:D(`resetPasswordDrawer.title`)}),V===0&&ie,V===1&&ae]})]})}export{E as ResetPasswordDrawer};
2
+ "use client";import{Button as e}from"../../../ui/button.mjs";import{hashPassword as t}from"../../../../utils/common.mjs";import{useUserStore as n}from"../../../../store/modules/user-store.mjs";import{pUserResetPassword as r,pUserSendResetPasswordEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../../service/generated/client.mjs";import{getPasswordValidationErrorText as o,validatePasswordPair as ee}from"../../../../utils/password-validator.mjs";import{Box as s}from"../../../ui/box.mjs";import{Drawer as c,DrawerContent as l,DrawerDescription as u,DrawerHeader as d,DrawerTitle as f}from"../../../ui/drawer.mjs";import{Text as p}from"../../../ui/text.mjs";import m from"../../../ui/legacy/button.mjs";import{EyeIcon as h}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as g}from"../../../../assets/icons/eye-off-icon.mjs";import{HeaderNav as _}from"../../../common/header-nav/client.mjs";import v from"../../../ui/legacy/input.mjs";import{useEffect as y,useMemo as b,useRef as x,useState as S}from"react";import{jsx as C,jsxs as w}from"react/jsx-runtime";import{toast as T}from"sonner";import{useTranslations as te}from"next-intl";function E(E){let D=te(`components.pages.settings.components`),{open:O,onOpenChange:k}=E,A=n(e=>e.userInfo),[j,M]=S(``),ne=j.length!==6,N=x(null),[P,F]=S(60),[I,L]=S(!1);async function R(){if(I)return;let e=T.loading(D(`resetPasswordDrawer.sending`));try{let t=await i({user_id:A?.user_id});t.code===0?(T.success(D(`resetPasswordDrawer.codeSentSuccess`),{id:e}),L(!0),F(60)):T.error(t.message||D(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.sendFailed`),{id:e})}}function z(){H(e=>e===1?e:e+1)}async function B(){let e=T.loading(D(`resetPasswordDrawer.verifying`));try{let t=await a({user_id:A?.user_id,email_code:j});t.code===0?(T.success(D(`resetPasswordDrawer.verifySuccess`),{id:e}),z()):T.error(t.message||D(`resetPasswordDrawer.verifyFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.verifyFailed`),{id:e})}}y(()=>{if(I)return N.current=setInterval(()=>{F(e=>e<=1?(N.current&&clearInterval(N.current),L(!1),60):e-1)},1e3),()=>{N.current&&clearInterval(N.current)}},[I]);let[V,H]=S(0),[U,W]=S({password:``,confirmPassword:``}),[G,K]=S(!1),[q,J]=S(!1),[Y,X]=S(!1),Z=b(()=>ee(U.password,U.confirmPassword),[U.password,U.confirmPassword]),Q=b(()=>o(Z),[Z]),$=b(()=>G||U.password.length===0||U.confirmPassword.length===0||Z.type!==`none`,[G,U.password.length,U.confirmPassword.length,Z.type]);async function re(){if($)return;let e=T.loading(D(`resetPasswordDrawer.submitting`));try{K(!0);let n=await r({user_id:A?.user_id,password:t(U.password)});n.code===0?(T.success(D(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),W({password:``,confirmPassword:``}),M(``),k(!1)):T.error(n.message||D(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),T.error(D(`resetPasswordDrawer.resetFailed`),{id:e})}finally{K(!1)}}let ie=w(s,{className:`p-6`,children:[C(s,{children:w(p,{className:`text-text2`,children:[D(`resetPasswordDrawer.boundEmailNotice`),C(p,{className:`dark:text-white text-white`,children:A?.email}),D(`resetPasswordDrawer.verifyHint`)]})}),w(s,{className:`mt-6 space-y-6`,children:[w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border border-line1`,children:[C(v,{value:j,onChange:e=>M(e)}),C(e,{variant:`link`,disabled:I,onClick:R,children:I?`${P}s ${D(`resetPasswordDrawer.resendAfter`)}`:D(`resetPasswordDrawer.sendCode`)})]}),C(m,{onClick:B,disabled:ne,className:`w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:D(`resetPasswordDrawer.verifyEmailButton`)})]})]}),ae=w(s,{className:`p-6`,children:[C(s,{children:C(p,{className:`text-text2`,children:D(`resetPasswordDrawer.setNewPasswordHint`)})}),w(s,{className:`mt-6 space-y-6`,children:[w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Q?`border-theme5`:`border-line1`}`,children:[C(v,{value:U.password,onChange:e=>W(t=>({...t,password:e})),placeholder:D(`resetPasswordDrawer.passwordPlaceholder`),type:q?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),C(`button`,{type:`button`,onClick:()=>J(!q),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:C(q?g:h,{className:`w-5 h-5`})})]}),w(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Z.type===`not-match`?`border-theme5`:`border-line1`}`,children:[C(v,{value:U.confirmPassword,onChange:e=>W(t=>({...t,confirmPassword:e})),placeholder:D(`resetPasswordDrawer.confirmPasswordPlaceholder`),type:Y?`text`:`password`,autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`pr-10`}),C(`button`,{type:`button`,onClick:()=>X(!Y),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:C(Y?g:h,{className:`w-5 h-5`})})]}),C(s,{children:C(p,{className:`min-h-[22px] text-[14px] text-theme5 px-[12px]`,children:Q})}),C(m,{onClick:re,disabled:$,className:`w-full h-15 !rounded-[30px] !text-[18px] font-bold leading-6.5 bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:D(G?`resetPasswordDrawer.submitting`:`resetPasswordDrawer.resetPassword`)})]})]});return w(c,{open:O,onOpenChange:k,direction:`right`,handleOnly:!0,children:[w(d,{className:`hidden`,children:[C(f,{children:D(`resetPasswordDrawer.title`)}),C(u,{children:D(`resetPasswordDrawer.title`)})]}),w(l,{className:`!w-full`,children:[C(_,{onBack:()=>k(!1),title:D(`resetPasswordDrawer.title`)}),V===0&&ie,V===1&&ae]})]})}export{E as ResetPasswordDrawer};
@@ -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" | "secondary" | "destructive" | "outline" | "ghost" | "link" | 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?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | 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.69",
4
+ "version": "0.1.70",
5
5
  "private": false,
6
6
  "sideEffects": [
7
7
  "**/*.css"