@funhub/platform 0.1.49 → 0.1.52
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/README.md +13 -0
- package/bin/index.mjs +323 -0
- package/dist/assets/images/user/default_avatar.mjs +2 -0
- package/dist/components/biz/business/banner/variants/basic-banner/material.d.mts +1 -1
- package/dist/components/biz/business/banner-carousel/material.d.mts +1 -1
- package/dist/components/biz/business/channel-list/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/registry.d.mts +6 -6
- package/dist/components/biz/business/detail/materials/video-detail-actions/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-info-title-tags-episodes/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-player/material.d.mts +1 -1
- package/dist/components/biz/business/detail/materials/video-detail-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/floating-ball/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/material.d.mts +1 -1
- package/dist/components/biz/business/header-search/header-search/material.d.mts +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-grid/material.d.mts +1 -1
- package/dist/components/biz/business/home-recommend/variants/home-recommend-waterfall/material.d.mts +1 -1
- package/dist/components/biz/business/large-feature-grid/card-item.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/material.d.mts +2 -2
- package/dist/components/biz/business/marquee/client.mjs +1 -1
- package/dist/components/biz/business/marquee/marquee.module.mjs +28 -0
- package/dist/components/biz/business/marquee/material.d.mts +1 -1
- package/dist/components/biz/business/profile/profile-header/material.d.mts +2 -2
- package/dist/components/biz/business/profile/profile-header/user-profile-avatar.mjs +1 -1
- package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/material.d.mts +1 -1
- package/dist/components/biz/business/search-history/material.d.mts +1 -1
- package/dist/components/biz/business/search-input/material.d.mts +1 -1
- package/dist/components/biz/business/shortcut-grid/material.d.mts +1 -1
- package/dist/components/biz/business/tab-bar/material.d.mts +1 -1
- package/dist/components/biz/business/text-recommend/material.d.mts +1 -1
- package/dist/components/biz/business/video-horizontal-list/material.d.mts +1 -1
- package/dist/components/biz/example/button/material.d.mts +1 -1
- package/dist/components/biz/example/button/material.mjs +1 -1
- package/dist/components/pages/(follow)/_components/follow-button/index.mjs +1 -1
- package/dist/components/pages/login/password.mjs +1 -1
- package/dist/components/pages/login/register.mjs +1 -1
- package/dist/components/pages/login/reset-password.mjs +1 -1
- package/dist/components/pages/login/verify.mjs +1 -1
- package/dist/components/pages/search-result/page-client.mjs +1 -1
- package/dist/components/pages/search-result/search-all.mjs +1 -1
- package/dist/components/pages/search-result/search-tab.mjs +1 -1
- package/dist/components/pages/search-result/search-user.mjs +1 -1
- package/dist/components/pages/search-result/search-video.mjs +1 -1
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
- package/dist/components/pages/settings/_components/settings.mjs +1 -1
- package/dist/i18n/locales/en.mjs +1 -1
- package/dist/i18n/locales/zh-CN.mjs +1 -1
- package/dist/utils/password-validator.d.mts +28 -0
- package/dist/utils/password-validator.mjs +2 -0
- package/dist/utils/schema/index.d.mts +1 -1
- package/dist/utils/schema/material.d.mts +7 -9
- package/dist/utils/schema/utils.d.mts +13 -3
- package/dist/utils/schema/utils.mjs +1 -1
- package/dist/utils.d.mts +3 -2
- package/dist/utils.mjs +1 -1
- package/package.json +7 -2
- package/templates/base/_meta.json +4 -0
- package/templates/base/template/README.md.template +32 -0
- package/templates/base/template/__dot__gitignore +6 -0
- package/templates/base/template/app/[locale]/layout.tsx.template +36 -0
- package/templates/base/template/app/[locale]/page.tsx.template +24 -0
- package/templates/base/template/app/globals.css +26 -0
- package/templates/base/template/app/layout.tsx.template +38 -0
- package/templates/base/template/eslint.config.mjs.template +68 -0
- package/templates/base/template/i18n/request.ts.template +3 -0
- package/templates/base/template/next-env.d.ts.template +4 -0
- package/templates/base/template/next.config.ts.template +21 -0
- package/templates/base/template/package.json.template +37 -0
- package/templates/base/template/postcss.config.js.template +18 -0
- package/templates/base/template/proxy.ts.template +18 -0
- package/templates/base/template/tailwind.config.cjs.template +13 -0
- package/templates/base/template/tsconfig.json.template +43 -0
|
@@ -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"../../../../assets/icons/
|
|
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"../../../../assets/icons/right_arrow.mjs";import i from"../../../../assets/images/marquee.mjs";import a from"./marquee.module.mjs";import{useEffect as o,useMemo as s,useState as c}from"react";import{X as l}from"lucide-react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{useRouter as f}from"next/navigation";const p=[];function m(e,t=20){let n=Array.from(e);return n.length<=t?e:`${n.slice(0,t).join(``)}...`}function h(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t^(e.codePointAt(n)??0);return(t>>>0).toString(36)}function g(e,t){return e?t===`once`?!0:new Date(e).toLocaleDateString()===new Date().toLocaleDateString():!1}function _(e){let t=localStorage.getItem(e);if(!t)return{};try{return JSON.parse(t)}catch{let e=Number(t);return Number.isNaN(e)?{}:{closedAt:e}}}function v(e,t){localStorage.setItem(e,JSON.stringify(t))}function y(y){let{contents:b=p,click:x,close:S,displayStrategy:C,mode:w=`renderer`}=y,T=w===`editor`,E=f(),[D,O]=c(!0),[k,A]=c(!1),[j,M]=c(0);o(()=>{A(!0)},[]);let N=s(()=>{let e=C?.period?.start,t=C?.period?.end;if(!e&&!t)return!0;let n=Date.now(),r=e?new Date(e).getTime():0,i=t?new Date(t).getTime():2**53-1;return n>=r&&n<=i},[C?.period]),P=s(()=>(b??[]).map(e=>({...e,text:m(String(e?.text??``))})).filter(e=>!!e.text),[b]),F=s(()=>{let e=C?.rule??`once`,t=C?.period??{start:``,end:``};return`marquee_state_${h(JSON.stringify({rule:e,start:t.start??``,end:t.end??``,items:P.map(e=>({text:e.text??``,link:e.link??``}))}))}`},[C?.period,C?.rule,P]);if(o(()=>{M(0)},[P.length]),o(()=>{if(!k||T||!C?.rule||P.length===0)return;let e=_(F),t=g(e.displayedAt,C.rule),n=g(e.closedAt,C.rule);(t||n)&&O(!1)},[C?.rule,T,k,P.length,F]),o(()=>{if(!k||T||!C?.rule||!D||!N||P.length===0)return;let e=_(F);g(e.displayedAt,C.rule)||v(F,{...e,displayedAt:Date.now()})},[C?.rule,T,k,N,D,P.length,F]),!k||!D||!N||P.length===0)return null;let I=P[j%P.length],L=x?.enabled===!0,R=x?.link||I.link,z=L&&!!R,B=S?.enabled===!0;function V(){!C?.rule||P.length===0||v(F,{..._(F),closedAt:Date.now()})}let H=e=>{e.stopPropagation(),O(!1),V()},U=()=>{T||z&&R&&(B&&(O(!1),V()),E.push(R))},W=()=>{T||!D||P.length<=1||M(e=>(e+1)%P.length)},G=T?a[`marquee-item-paused`]:P.length>1?a[`marquee-item-once`]:a[`marquee-item-loop`];return u(t,{className:T?`px-3 py-2 w-full bg-bg1 pointer-events-none`:`px-3 py-2 w-full bg-bg1`,children:d(t,{className:`pl-[2px] pr-[12px] py-[2px] flex items-center w-full cursor-pointer relative rounded-[8px] overflow-hidden ${a[`marquee-shell`]}`,onClick:U,children:[u(t,{className:`relative shrink-0 w-[36px] h-[36px] mr-[4px]`,children:u(e,{src:typeof i==`string`?i:i.src,alt:`notice`,fill:!0,className:`object-cover`,unoptimized:!0})}),u(t,{className:`flex-1 overflow-hidden relative h-[22px] ml-1`,children:u(t,{className:`absolute inset-y-0 left-0 flex items-center whitespace-nowrap ${G}`,onAnimationEnd:W,children:u(n,{className:`inline-block text-[14px] text-[#f59e0b] leading-[22px] font-medium`,children:I.text})},`marquee-item-${j}`)}),d(t,{className:`flex items-center gap-[12px] shrink-0 ml-[4px]`,children:[z&&u(r,{className:`w-[16px] h-[16px] text-[#f59e0b]`}),B&&u(t,{className:`opacity-30 hover:opacity-100 transition-opacity`,onClick:H,children:u(l,{className:`w-[12px] h-[12px] text-[#F59E0B]`})})]})]})})}export{y as MarqueeClient};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
import e from"../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.mjs";var t=`.marquee-module_marquee-shell__UrSDr {
|
|
3
|
+
background-image: linear-gradient(154deg, rgba(255, 228, 133, 0.2) 9.14%, rgba(207, 129, 37, 0.05) 90.86%);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.marquee-module_marquee-item-loop__xI-aW {
|
|
7
|
+
animation: marquee-module_funhub-marquee-run__evIQh 12s linear infinite;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.marquee-module_marquee-item-once__KFzcv {
|
|
11
|
+
animation: marquee-module_funhub-marquee-run__evIQh 12s linear forwards;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.marquee-module_marquee-item-paused__edGch {
|
|
15
|
+
animation: none;
|
|
16
|
+
transform: translateX(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes marquee-module_funhub-marquee-run__evIQh {
|
|
20
|
+
0% {
|
|
21
|
+
transform: translateX(100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
100% {
|
|
25
|
+
transform: translateX(-100%);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`,n={"marquee-shell":`marquee-module_marquee-shell__UrSDr`,"marquee-item-loop":`marquee-module_marquee-item-loop__xI-aW`,"funhub-marquee-run":`marquee-module_funhub-marquee-run__evIQh`,"marquee-item-once":`marquee-module_marquee-item-once__KFzcv`,"marquee-item-paused":`marquee-module_marquee-item-paused__edGch`};e(t);export{n as default};
|
|
@@ -35,6 +35,6 @@ declare const marqueeMaterial: DefineMaterialOption<typeof MarqueeServer, typeof
|
|
|
35
35
|
renderer: "renderer";
|
|
36
36
|
editor: "editor";
|
|
37
37
|
}>>;
|
|
38
|
-
}, zod_v4_core0.$strip>, "marquee">;
|
|
38
|
+
}, zod_v4_core0.$strip>, "marquee", "内容组件">;
|
|
39
39
|
//#endregion
|
|
40
40
|
export { marqueeMaterial };
|
|
@@ -18,7 +18,7 @@ declare const profileHeaderMaterial: DefineMaterialOption<({
|
|
|
18
18
|
renderer: "renderer";
|
|
19
19
|
editor: "editor";
|
|
20
20
|
}>>;
|
|
21
|
-
}, zod_v4_core0.$strip>, "profile-header">;
|
|
21
|
+
}, zod_v4_core0.$strip>, "profile-header", "内容组件">;
|
|
22
22
|
declare const profileHeaderMaterialWithDisabledBackground: DefineMaterialOption<({
|
|
23
23
|
mode,
|
|
24
24
|
...props
|
|
@@ -30,6 +30,6 @@ declare const profileHeaderMaterialWithDisabledBackground: DefineMaterialOption<
|
|
|
30
30
|
renderer: "renderer";
|
|
31
31
|
editor: "editor";
|
|
32
32
|
}>>;
|
|
33
|
-
}, zod_v4_core0.$strip>, "profile-header-with-disabled-background">;
|
|
33
|
+
}, zod_v4_core0.$strip>, "profile-header-with-disabled-background", "内容组件">;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { profileHeaderMaterial, profileHeaderMaterialWithDisabledBackground };
|
|
@@ -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{pUserEditUserInfo as r}from"../../../../../service/generated/client.mjs";import{uploadFile as i}from"../../../../../utils/upload-file.mjs";import{Avatar as a,AvatarFallback as o,AvatarImage as s}from"../../../../ui/avatar.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Input as l}from"../../../../ui/input.mjs";import{Dialog as u,DialogContent as d}from"../../../../ui/dialog.mjs";import{Text as f}from"../../../../ui/text.mjs";import{useDeleteRequest as p}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as m}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";const
|
|
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{pUserEditUserInfo as r}from"../../../../../service/generated/client.mjs";import{uploadFile as i}from"../../../../../utils/upload-file.mjs";import{Avatar as a,AvatarFallback as o,AvatarImage as s}from"../../../../ui/avatar.mjs";import{Box as c}from"../../../../ui/box.mjs";import{Input as l}from"../../../../ui/input.mjs";import{Dialog as u,DialogContent as d}from"../../../../ui/dialog.mjs";import{Text as f}from"../../../../ui/text.mjs";import{useDeleteRequest as p}from"../../../../../hooks/query/use-query.mjs";import{ImageCropModal as m}from"../../../../common/image-crop-modal/image-crop-modal.mjs";import{useRef as h,useState as g}from"react";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import{toast as b}from"sonner";import{useTranslations as x}from"next-intl";const S=`https://guadd-sg-ccs-sing-dev.s3.ap-southeast-1.amazonaws.com/default/default_avatar.png`,C=[`image/jpeg`,`image/png`];function w(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return C.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function T({isMine:C,src:T,alt:E,onUnauthorizedClick:D}){let O=x(`components.pages.profile`),k=h(null),{userId:A,setUserInfo:j,userInfo:M}=n(),N=p(),[P,F]=g(!1),[I,L]=g(!1),[R,z]=g(``),[B,V]=g(!1);function H(){if(!B){if(C){F(!0);return}D?.()}}function U(){R&&(URL.revokeObjectURL(R),z(``))}function W(){F(!1)}function G(){B||k.current?.click()}function K(e){let t=e.target.files?.[0];if(t){if(!w(t)){b.error(O(`client.imageTypeInvalid`)),e.target&&(e.target.value=``);return}if(t.size>5242880){b.error(O(`client.imageTooLarge`)),e.target&&(e.target.value=``);return}z(URL.createObjectURL(t)),L(!0),e.target&&(e.target.value=``)}}async function q(e){if(!A){b.error(O(`client.loginRequiredForUpload`));return}try{V(!0);let t=await i(new File([e],`avatar.jpg`,{type:`image/jpeg`}),1);await r({user_id:String(A),avatar:t.objectKey}),j({...M,avatar:t.objectKey}),N([`user-profile`,`mine`]),N([`user-edit-info`,String(A)]),F(!1),L(!1),b.success(O(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传头像失败`,e),b.error(O(`client.uploadFailed`))}finally{U(),V(!1)}}function J(){L(!1),U()}return y(_,{children:[C||D?v(t,{variant:`ghost`,size:`icon`,className:`!absolute bottom-3 left-0 h-22 w-22 rounded-full p-0 hover:bg-transparent`,onClick:H,"aria-label":`打开头像预览`,children:y(a,{className:`w-22 h-22`,children:[v(s,{src:T||S,alt:E||`avatar`}),v(o,{})]})}):y(a,{className:`!absolute bottom-3 left-0 w-22 h-22`,children:[v(s,{src:T||S,alt:E||`avatar`}),v(o,{})]}),v(u,{open:P,onOpenChange:W,children:v(d,{showCloseButton:!1,className:`bg-black !m-0 !p-0 !fixed !inset-0 !w-screen !h-screen !max-w-none !rounded-none !top-0 !left-0 !translate-x-0 !translate-y-0 !transform-none z-[9999] !pointer-events-auto`,children:y(c,{className:`relative flex h-full w-full flex-col items-center justify-center`,children:[v(t,{variant:`ghost`,size:`icon`,className:`absolute left-0 top-0 h-14 w-14 text-white hover:bg-transparent hover:text-white/80`,onClick:W,"aria-label":`关闭头像预览`,children:v(`svg`,{className:`w-4 h-4`,xmlns:`http://www.w3.org/2000/svg`,fill:`currentColor`,viewBox:`0 0 16 16`,children:v(`path`,{d:`M14.55.2a.889.889 0 0 1 1.25 1.25l-.06.067L9.255 8l6.483 6.482.06.069a.888.888 0 0 1-1.25 1.25l-.067-.062L8 9.256l-6.482 6.483A.888.888 0 1 1 .26 14.482L6.742 8 .26 1.517.2 1.45A.888.888 0 0 1 1.45.2l.067.062 6.482 6.482L14.482.261l.068-.062Z`})})}),y(a,{className:`w-50 h-50`,children:[v(s,{src:T||S,alt:E||`avatar`}),v(o,{})]}),y(t,{variant:`ghost`,className:e(`absolute bottom-8 left-0 right-0 mx-auto flex w-[366px] max-w-[90%] items-center justify-between rounded-3xl bg-white/10 px-3 py-3 transition-colors hover:bg-white/20`,`active:scale-95`),onClick:G,disabled:B,children:[v(f,{as:`span`,className:`text-base font-medium text-white`,children:B?`上传中...`:`更换头像`}),y(`svg`,{className:`w-6 h-6 text-white`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:[v(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z`}),v(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15 13a3 3 0 11-6 0 3 3 0 016 0z`})]})]})]})})}),v(l,{ref:k,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:K}),v(m,{open:I,onClose:J,imageSrc:R,onConfirm:q})]})}export{T as UserProfileAvatar};
|
package/dist/components/biz/business/profile/profile-header/user-profile-cover-background.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{BackgroundPreviewModal as s}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{showImageCrop as c}from"../../../../common/image-crop/show-image-crop.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{toast as h}from"sonner";const
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../../../store/modules/user-store.mjs";import{pUserUploadUserBgImage as t}from"../../../../../service/generated/client.mjs";import{uploadFile as n}from"../../../../../utils/upload-file.mjs";import{Image as r}from"../../../../ui/image.mjs";import{Box as i}from"../../../../ui/box.mjs";import{Input as a}from"../../../../ui/input.mjs";import{useDeleteRequest as o}from"../../../../../hooks/query/use-query.mjs";import{BackgroundPreviewModal as s}from"../../../../common/background-preview-modal/background-preview-modal.mjs";import{showImageCrop as c}from"../../../../common/image-crop/show-image-crop.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{toast as h}from"sonner";import{useTranslations as g}from"next-intl";const _=[`image/jpeg`,`image/png`];function v(e){let t=e.name.toLowerCase(),n=e.type.toLowerCase();return _.includes(n)||/\.(?:jpg|jpeg|png)$/i.test(t)}function y({isMine:_,enableCustomBackground:y=!0,src:b,onUnauthorizedClick:x}){let S=g(`components.pages.profile`),C=`/images/mine/img_mine_head_bg.png`,w=u(null),{userId:T,setUserInfo:E,userInfo:D}=e(),O=o(),[k,A]=d(!1),[j,M]=d(!1),N=y&&(!!_||typeof x==`function`);l(()=>{y||M(!1)},[y]);let P=()=>{if(y){if(_){k||M(!0);return}x?.()}},F=()=>{M(!1)};function I(){k||w.current?.click()}async function L(e){let r=e.target.files?.[0];if(e.target&&(e.target.value=``),r)try{if(!v(r)){h.error(S(`client.imageTypeInvalid`));return}if(r.size>5242880){h.error(S(`client.imageTooLarge`));return}A(!0);let e=await n(await c(r,{aspectRatio:430/256,cropShape:`rect`,quality:.92,maxWidth:1920,maxHeight:1920}),1);await t({user_id:String(T),bg_image:e.objectKey}),E({...D,bg_image:e.objectKey}),O([`user-profile`,`mine`]),M(!1),h.success(S(`client.mediaUpdateSuccess`))}catch(e){console.error(`上传背景图失败`,e),e instanceof Error&&e.message!==`用户取消`&&h.error(S(`client.uploadFailed`))}finally{A(!1)}}return m(f,{children:[p(i,{className:y?`h-33.75`:`h-24`,children:y?p(i,{className:`relative h-full w-full`,onClick:N?P:void 0,children:p(r,{alt:`cover background`,fill:!0,objectFit:`cover`,className:`pointer-events-none`,src:b||C})}):p(i,{className:`h-full w-full bg-bg1`})}),y&&m(f,{children:[p(s,{open:j,onClose:F,bgUrl:b||C,onUpload:I}),p(a,{ref:w,type:`file`,accept:`.jpg,.jpeg,.png,image/jpeg,image/png`,className:`hidden`,onChange:L})]})]})}export{y as UserProfileCoverBackground};
|
|
@@ -11,6 +11,6 @@ declare const profileMainMaterial: DefineMaterialOption<typeof UserProfileMain,
|
|
|
11
11
|
renderer: "renderer";
|
|
12
12
|
editor: "editor";
|
|
13
13
|
}>>;
|
|
14
|
-
}, zod_v4_core0.$strip>, "profile-main">;
|
|
14
|
+
}, zod_v4_core0.$strip>, "profile-main", "内容组件">;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { profileMainMaterial };
|
|
@@ -15,6 +15,6 @@ declare const searchHistoryMaterial: DefineMaterialOption<typeof SearchHistorySe
|
|
|
15
15
|
renderer: "renderer";
|
|
16
16
|
editor: "editor";
|
|
17
17
|
}>>;
|
|
18
|
-
}, zod_v4_core0.$strip>, "search-history">;
|
|
18
|
+
}, zod_v4_core0.$strip>, "search-history", "行为组件">;
|
|
19
19
|
//#endregion
|
|
20
20
|
export { searchHistoryMaterial };
|
|
@@ -14,6 +14,6 @@ declare const searchInputMaterial: DefineMaterialOption<typeof SearchInputServer
|
|
|
14
14
|
renderer: "renderer";
|
|
15
15
|
editor: "editor";
|
|
16
16
|
}>>;
|
|
17
|
-
}, zod_v4_core0.$strip>, "search-input">;
|
|
17
|
+
}, zod_v4_core0.$strip>, "search-input", "行为组件">;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { searchInputMaterial };
|
|
@@ -21,6 +21,6 @@ declare const shortcutGridMaterial: DefineMaterialOption<typeof ShortcutGrid, ty
|
|
|
21
21
|
renderer: "renderer";
|
|
22
22
|
editor: "editor";
|
|
23
23
|
}>>;
|
|
24
|
-
}, zod_v4_core0.$strip>, "shortcut-grid">;
|
|
24
|
+
}, zod_v4_core0.$strip>, "shortcut-grid", "金刚组件">;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { shortcutGridMaterial };
|
|
@@ -29,6 +29,6 @@ declare const tabBarMaterial: DefineMaterialOption<typeof TabBarServer, typeof T
|
|
|
29
29
|
renderer: "renderer";
|
|
30
30
|
editor: "editor";
|
|
31
31
|
}>>;
|
|
32
|
-
}, zod_v4_core0.$strip>, "tab-bar">;
|
|
32
|
+
}, zod_v4_core0.$strip>, "tab-bar", "行为组件">;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { tabBarMaterial };
|
|
@@ -18,6 +18,6 @@ declare const textRecommendMaterial: DefineMaterialOption<typeof TextRecommendSe
|
|
|
18
18
|
renderer: "renderer";
|
|
19
19
|
editor: "editor";
|
|
20
20
|
}>>;
|
|
21
|
-
}, zod_v4_core0.$strip>, "text-recommend">;
|
|
21
|
+
}, zod_v4_core0.$strip>, "text-recommend", "内容组件">;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { textRecommendMaterial };
|
|
@@ -38,6 +38,6 @@ declare const videoHorizontalListMaterial: DefineMaterialOption<typeof VideoHori
|
|
|
38
38
|
renderer: "renderer";
|
|
39
39
|
editor: "editor";
|
|
40
40
|
}>>;
|
|
41
|
-
}, zod_v4_core0.$strip>, "video-horizontal-list">;
|
|
41
|
+
}, zod_v4_core0.$strip>, "video-horizontal-list", "内容组件">;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { videoHorizontalListMaterial };
|
|
@@ -23,6 +23,6 @@ declare const exampleButtonMaterial: DefineMaterialOption<typeof Button, typeof
|
|
|
23
23
|
renderer: "renderer";
|
|
24
24
|
editor: "editor";
|
|
25
25
|
}>>;
|
|
26
|
-
}, zod_v4_core0.$strip>, "example-button">;
|
|
26
|
+
}, zod_v4_core0.$strip>, "example-button", "行为组件">;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { exampleButtonMaterial };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{ButtonClient as t}from"./client.mjs";import{buttonInspectorPropsSchema as n}from"./schema.mjs";import{Button as r}from"./server.mjs";const i=e({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category
|
|
2
|
+
import{defineMaterial as e}from"../../../../utils/schema/material.mjs";import{ButtonClient as t}from"./client.mjs";import{buttonInspectorPropsSchema as n}from"./schema.mjs";import{Button as r}from"./server.mjs";const i=e({type:`example-button`,name:`按钮`,icon:`/icon/button.png`,category:`行为组件`,serverComponent:r,clientComponent:t,propsSchema:n});export{i as exampleButtonMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{useFollowIdsState as e}from"../../../../../store/modules/follow-ids-store.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{pInteractionFollow as n,pInteractionUnfollow as r}from"../../../../../service/generated/client.mjs";import{useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l(l){let u=c(`components.pages.follow.components.followButton`),{userId:d,hasFollow:f,followText:p=``,onChange:m}=l,h=p||u(`follow`),[g,_]=a(f),{isLogin:v,userInfo:y,userId:b}=t(),{followIds:x}=e(),S=b||y?.userId||``,C=y?.userId===d,w=f||x.includes(d);i(()=>{_(w)},[w]);async function T(){try{g?await r({follower_id:S,followee_id:d}):await n({follower_id:S,followee_id:d}),window.sensors?.track(`detail_follow_click`,{object_id:``,action:g?`取消关注`:`关注`,author_id:d}),sessionStorage.setItem(`user_page_refresh`,`1`)}catch(e){console.error(`关注或取消关注失败:`,e)}_(!g),m?.(!g)}function E(){T(),v&&(g||T())}return C?null:s(`button`,{className:` h-7 rounded-full px-4 py-1.5 border border-solid cursor-pointer flex items-center justify-center ${g?`border-text3`:`border-theme5`}`,onClick:()=>E(),children:g?s(o,{children:s(`span`,{className:`text-text3 text-xs leading-4.5 ml-1 shrink-0`,children:u(`following`)})}):s(o,{children:s(`span`,{className:`block text-theme5 text-xs leading-4.5 ml-1 shrink-0`,children:h})})})}export{l as FollowButton};
|
|
2
|
+
"use client";import{useFollowIdsState as e}from"../../../../../store/modules/follow-ids-store.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{pInteractionFollow as n,pInteractionUnfollow as r}from"../../../../../service/generated/client.mjs";import{useEffect as i,useState as a}from"react";import{Fragment as o,jsx as s}from"react/jsx-runtime";import{useTranslations as c}from"next-intl";function l(l){let u=c(`components.pages.follow.components.followButton`),{userId:d,hasFollow:f,followText:p=``,onChange:m}=l,h=p||u(`follow`),[g,_]=a(f),{isLogin:v,userInfo:y,userId:b}=t(),{followIds:x}=e(),S=b||y?.userId||``,C=y?.userId===d,w=f||x.includes(d);i(()=>{_(w)},[w]);async function T(){if(!v){_(g),m?.(!1);return}try{g?await r({follower_id:S,followee_id:d}):await n({follower_id:S,followee_id:d}),window.sensors?.track(`detail_follow_click`,{object_id:``,action:g?`取消关注`:`关注`,author_id:d}),sessionStorage.setItem(`user_page_refresh`,`1`)}catch(e){console.error(`关注或取消关注失败:`,e)}_(!g),m?.(!g)}function E(){T(),v&&(g||T())}return C?null:s(`button`,{className:` h-7 rounded-full px-4 py-1.5 border border-solid cursor-pointer flex items-center justify-center ${g?`border-text3`:`border-theme5`}`,onClick:()=>E(),children:g?s(o,{children:s(`span`,{className:`text-text3 text-xs leading-4.5 ml-1 shrink-0`,children:u(`following`)})}):s(o,{children:s(`span`,{className:`block text-theme5 text-xs leading-4.5 ml-1 shrink-0`,children:h})})})}export{l as FollowButton};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t,hashPassword as n}from"../../../utils/common.mjs";import{pUserRegister as r,pUserResetForgetPassword as i,pUserResetPassword as a}from"../../../service/generated/client.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{getCookie as t,hashPassword as n}from"../../../utils/common.mjs";import{pUserRegister as r,pUserResetForgetPassword as i,pUserResetPassword as a}from"../../../service/generated/client.mjs";import{getPasswordValidationErrorText as o,validatePasswordPair as s}from"../../../utils/password-validator.mjs";import{Box as c}from"../../ui/box.mjs";import{Input as l}from"../../ui/input.mjs";import{Text as u}from"../../ui/text.mjs";import{useLoginModalStore as d}from"../../../store/modules/login-modal-store.mjs";import{useSetAuthFields as f,useUserId as p}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as m}from"../../../assets/icons/left-arrow-icon.mjs";import{EyeIcon as h}from"../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as g}from"../../../assets/icons/eye-off-icon.mjs";import{useCallback as _,useMemo as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{toast as S}from"sonner";import{useTranslations as C}from"next-intl";function w(w){let T=C(`components.pages.login`),{email:E,onClose:D}=w,O=f(),k=p(),{resolveLogin:A}=d(),[j,M]=y(``),[N,P]=y(``),[F,I]=y(!1),[L,R]=y(!1),[z,B]=y(!1),[V,H]=y(``),{verifyStep:U}=d(),W=_(async()=>{let e=n(j);return U===`reset-password`?await a({user_id:k,password:e}):U===`forgot-password`?await i({email:E,password:e}):await r({email:E,user_id:await t(`guestUserId`),password:e})},[U,k,E,j]),G=v(()=>s(j,N),[j,N]),K=v(()=>o(G),[G]),q=K!==``,J=G.type===`not-match`,Y=v(()=>j.length>0&&N.length>0&&K===``&&!z,[j,N,K,z]);async function X(){if(Y)try{B(!0),H(``);let{data:e}=await W();e?.user_id&&(O({token:e.token,expireTime:e.expire_time,userId:e.user_id}),S.success(T(`password.passwordSetSuccess`))),A(!0)}catch(e){H(e.message??T(`password.submitFailed`))}finally{B(!1)}}let Z=T(U===`reset-password`?`password.confirmModify`:U===`forgot-password`?`password.confirmReset`:`password.register`),Q=T(U===`reset-password`||U===`forgot-password`?`password.setNewPassword`:`password.setLoginPassword`);return x(c,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[x(c,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[b(e,{type:`button`,onClick:D,"aria-label":T(`password.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:b(m,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),b(u,{className:`text-[14px] text-text2`})]}),x(c,{className:`px-[24px] flex flex-col mt-[15px]`,children:[b(c,{className:`flex flex-col`,children:b(u,{className:`text-[24px] leading-[32px] font-bold`,children:Q})}),x(`form`,{className:`mt-[58px]`,autoComplete:`off`,onSubmit:e=>{e.preventDefault(),X()},children:[x(c,{className:`space-y-[16px]`,children:[x(c,{className:`flex items-center justify-between px-[28px] rounded-[50px] h-[66px] bg-line1 border ${q?`border-theme5`:`border-line1`}`,children:[b(l,{placeholder:T(`password.passwordPlaceholder`),type:F?`text`:`password`,name:`funhub-password`,value:j,onChange:e=>M(e.target.value),autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`}),b(e,{type:`button`,onClick:()=>I(!F),className:`ml-[10px] cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:b(F?h:g,{className:`w-[20px] h-[20px] text-text3`})})]}),x(c,{className:`flex items-center justify-between px-[28px] rounded-[50px] h-[66px] bg-line1 border ${J?`border-theme5`:`border-line1`}`,children:[b(l,{placeholder:T(`password.confirmPasswordPlaceholder`),type:L?`text`:`password`,name:`funhub-confirm-password`,value:N,onChange:e=>P(e.target.value),autoComplete:`new-password`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`}),b(e,{type:`button`,onClick:()=>R(!L),className:`ml-[10px] cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:b(L?h:g,{className:`w-[20px] h-[20px] text-text3`})})]})]}),b(c,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:K||V}),b(e,{type:`submit`,disabled:!Y,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:z?T(`password.submitting`):Z})]})]})]})}export{w as Password};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t}from"../../../service/generated/client.mjs";import{Box as n}from"../../ui/box.mjs";import{Checkbox as r}from"../../ui/checkbox.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{LeftArrowIcon as s}from"../../../assets/icons/left-arrow-icon.mjs";import{AgreementDialog as c}from"./agreement-dialog.mjs";import{useMemo as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useTranslations as p}from"next-intl";function m(m){let h=p(`components.pages.login`),{onClose:g,onLogin:_,onVerify:v}=m,{setVerifyStep:y}=o(),[b,x]=u(``),[S,C]=u(!1),[w,T]=u(``),[E,D]=u(!1),[O,k]=u(null),A=l(()=>b.trim().length>0&&E&&!S,[b,E,S]);function j(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function M(e){x(e),w&&T(``)}async function N(){if(A)try{C(!0),T(``);let e=b.trim();if(!j(e)){T(h(`register.invalidEmail`));return}await t({email:e}),y(`register-verify`),v?.(e)}catch(e){T(e.message??h(`register.sendFailed`))}finally{C(!1)}}return f(n,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[f(n,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[d(e,{type:`button`,onClick:g,"aria-label":h(`register.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:d(s,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),d(a,{className:`text-[14px] text-text2`})]}),f(n,{className:`px-[24px] flex flex-1 flex-col mt-[15px]`,children:[f(n,{className:`flex flex-col`,children:[d(a,{className:`text-[24px] leading-[32px] font-bold`,children:h(`register.title`)}),f(a,{className:`text-[14px] leading-[22px] mt-[12px] text-text1/80`,children:[h(`register.hasAccount`),`?`,d(e,{type:`button`,onClick:_,className:`cursor-pointer text-theme5 hover:opacity-90 bg-transparent !p-0 !px-0 !py-0`,children:h(`register.loginLink`)})]})]}),f(n,{className:`mt-[38px]`,children:[d(n,{className:`flex items-center px-[28px] rounded-[50px] h-[66px] bg-line1 border border-line1`,children:d(i,{placeholder:h(`register.emailPlaceholder`),type:`email`,name:`funhub-register-email`,value:b,onChange:e=>M(e.target.value),autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`!bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[26px] text-[18px]`})}),d(n,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:w})]}),f(n,{className:`mt-auto flex flex-col items-center w-full pb-[55px]`,children:[f(n,{className:`flex items-center justify-center gap-2 flex-wrap mb-[16px] w-full`,children:[d(r,{checked:E,onCheckedChange:e=>D(e===!0),"aria-label":h(`loginClient.agreeToTerms`),className:`shrink-0`}),f(a,{as:`span`,className:`text-[14px] text-text2`,children:[h(`loginClient.agreeToTermsPrefix`),f(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>k(`terms`),children:[`《`,h(`loginClient.userAgreement`),`》`]}),h(`loginClient.and`),f(e,{type:`button`,variant:`link`,className:`inline text-theme6 !p-0 !h-auto font-normal underline-offset-2 hover:underline bg-transparent`,onClick:()=>k(`privacy`),children:[`《`,h(`loginClient.privacyPolicy`),`》`]})]})]}),d(e,{type:`button`,onClick:N,disabled:!A,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:h(S?`register.sending`:`register.getCode`)})]})]}),d(c,{type:O,onClose:()=>k(null)})]})}export{m as Register};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendResetPasswordEmailCode as t,pUserVerifyResetPasswordEmailCode as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{useUserId as s,useUserInfo as c}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as l}from"../../../assets/icons/left-arrow-icon.mjs";import{useEffect as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function _(_){let v=h(`components.pages.login`),{onClose:y,onPassword:b}=_,x=s(),S=c(),{setVerifyStep:C}=o(),[w,T]=f(``),[E,D]=f(0),[O,k]=f(!1),[A,j]=f(!1),[M,N]=f(``),P=d(()=>{let e=S;return e?.email||e?.mail||``},[S]),F=d(()=>P?g(P):``,[P]);u(()=>{C(`reset-password`)},[C]),u(()=>{if(E<=0)return;let e=setInterval(()=>{D(e=>e-1)},1e3);return()=>clearInterval(e)},[E]);let I=d(()=>w.trim().length>=6&&!A,[w,A]);function L(e){T(e.replace(/\D/g,``))}function R(e){e.preventDefault(),B()}async function z(){if(!(!x||O||E>0))try{k(!0),N(``),await t({user_id:x}),D(60)}catch(e){N(e.message??v(`resetPassword.sendFailed`))}finally{k(!1)}}async function B(){if(!(!I||!x))try{j(!0),N(``),await n({user_id:x,email_code:w.trim()}),b?.(P)}catch(e){N(e.message??v(`resetPassword.verifyFailed`))}finally{j(!1)}}return m(r,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[m(r,{className:`flex items-center h-[60px] px-[16px]`,children:[p(e,{type:`button`,onClick:y,"aria-label":v(`resetPassword.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:p(l,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),p(a,{className:`flex-1 text-center text-[16px] font-semibold`,children:v(`resetPassword.title`)}),p(r,{className:`w-[16px]`,"aria-hidden":`true`})]}),m(r,{className:`px-[24px] flex flex-col mt-[24px]`,children:[m(a,{className:`text-[14px] leading-[22px] text-text1/80`,children:[v(`resetPassword.verifyViaEmail`),F?` ${F} `:` `,v(`resetPassword.verifyHint`)]}),m(`form`,{className:`mt-[36px]`,autoComplete:`off`,onSubmit:R,children:[m(r,{className:`flex items-center justify-between px-[20px] rounded-[50px] h-[56px] bg-line1 border border-line1`,children:[p(i,{placeholder:v(`resetPassword.codePlaceholder`),type:`text`,name:`funhub-reset-password-code`,value:w,onChange:e=>L(e.target.value),inputMode:`numeric`,autoComplete:`one-time-code`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[24px] text-[16px]`}),p(e,{type:`button`,onClick:z,disabled:O||E>0,className:`ml-[12px] cursor-pointer text-theme5 !p-0 !px-0 !py-0 disabled:text-text3`,children:E>0
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendResetPasswordEmailCode as t,pUserVerifyResetPasswordEmailCode as n}from"../../../service/generated/client.mjs";import{Box as r}from"../../ui/box.mjs";import{Input as i}from"../../ui/input.mjs";import{Text as a}from"../../ui/text.mjs";import{useLoginModalStore as o}from"../../../store/modules/login-modal-store.mjs";import{useUserId as s,useUserInfo as c}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as l}from"../../../assets/icons/left-arrow-icon.mjs";import{useEffect as u,useMemo as d,useState as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{useTranslations as h}from"next-intl";function g(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function _(_){let v=h(`components.pages.login`),{onClose:y,onPassword:b}=_,x=s(),S=c(),{setVerifyStep:C}=o(),[w,T]=f(``),[E,D]=f(0),[O,k]=f(!1),[A,j]=f(!1),[M,N]=f(``),P=d(()=>{let e=S;return e?.email||e?.mail||``},[S]),F=d(()=>P?g(P):``,[P]);u(()=>{C(`reset-password`)},[C]),u(()=>{if(E<=0)return;let e=setInterval(()=>{D(e=>e-1)},1e3);return()=>clearInterval(e)},[E]);let I=d(()=>w.trim().length>=6&&!A,[w,A]);function L(e){T(e.replace(/\D/g,``))}function R(e){e.preventDefault(),B()}async function z(){if(!(!x||O||E>0))try{k(!0),N(``),await t({user_id:x}),D(60)}catch(e){N(e.message??v(`resetPassword.sendFailed`))}finally{k(!1)}}async function B(){if(!(!I||!x))try{j(!0),N(``),await n({user_id:x,email_code:w.trim()}),b?.(P)}catch(e){N(e.message??v(`resetPassword.verifyFailed`))}finally{j(!1)}}return m(r,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[m(r,{className:`flex items-center h-[60px] px-[16px]`,children:[p(e,{type:`button`,onClick:y,"aria-label":v(`resetPassword.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:p(l,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),p(a,{className:`flex-1 text-center text-[16px] font-semibold`,children:v(`resetPassword.title`)}),p(r,{className:`w-[16px]`,"aria-hidden":`true`})]}),m(r,{className:`px-[24px] flex flex-col mt-[24px]`,children:[m(a,{className:`text-[14px] leading-[22px] text-text1/80`,children:[v(`resetPassword.verifyViaEmail`),F?` ${F} `:` `,v(`resetPassword.verifyHint`)]}),p(a,{className:`mt-[8px] text-[12px] leading-[18px] text-text3`,children:v(`resetPassword.passwordRuleHint`)}),m(`form`,{className:`mt-[36px]`,autoComplete:`off`,onSubmit:R,children:[m(r,{className:`flex items-center justify-between px-[20px] rounded-[50px] h-[56px] bg-line1 border border-line1`,children:[p(i,{placeholder:v(`resetPassword.codePlaceholder`),type:`text`,name:`funhub-reset-password-code`,value:w,onChange:e=>L(e.target.value),inputMode:`numeric`,autoComplete:`one-time-code`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-form-type":`other`,className:`flex-1 !bg-transparent !px-0 !py-0 !rounded-none !text-text1 placeholder:!text-text3 leading-[24px] text-[16px]`}),p(e,{type:`button`,onClick:z,disabled:O||E>0,className:`ml-[12px] cursor-pointer text-theme5 !p-0 !px-0 !py-0 disabled:text-text3`,children:E>0?`${v(`resetPassword.resend`)} (${E}s)`:v(`resetPassword.sendCode`)})]}),p(r,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:M}),p(e,{type:`submit`,disabled:!I,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:v(A?`resetPassword.verifying`:`resetPassword.verifyEmail`)})]})]})]})}export{_ as ResetPassword};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t,pUserSendResetPasswordEmailCode as n,pUserVerifyEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{Box as o}from"../../ui/box.mjs";import{Text as s}from"../../ui/text.mjs";import{useLoginModalStore as c}from"../../../store/modules/login-modal-store.mjs";import{useUserId as l}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as u}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";function y(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function b(b){let x=v(`components.pages.login`),{email:S,onClose:C,onPassword:w}=b,{verifyStep:T}=c(),[E,D]=h([,,,,,,].fill(``)),[O,k]=h(0),[A,j]=h(!1),[M,N]=h(60),[P,F]=h(!1),[I,L]=h(``),R=m(null),z=l(),B=p(()=>y(S),[S]),V=d(async()=>T===`reset-password`?await a({user_id:z,email_code:E.join(``)}):T===`forgot-password`?await i({email:S,email_code:E.join(``)}):await r({email:S,email_code:E.join(``)}),[T,E,z,S]),H=p(()=>E.every(e=>e!==``)&&!A,[E,A]);f(()=>{if(M<=0)return;let e=setInterval(()=>{N(e=>e-1)},1e3);return()=>clearInterval(e)},[M]),f(()=>{R.current?.focus()},[]);let U=d(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...E],r=t.split(``),i=O;for(let e of r)i<6&&(n[i]=e,i++);D(n),k(Math.min(i,5)),L(``)},[E,O]),W=d(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...E];E[O]?t[O]=``:O>0&&(t[O-1]=``,k(O-1)),D(t),L(``)}else e.key===`ArrowLeft`&&O>0?k(O-1):e.key===`ArrowRight`&&O<5&&k(O+1)},[E,O]),G=d(e=>{k(e),R.current?.focus()},[]);async function K(){if(!(M>0||P))try{F(!0),T===`reset-password`?await n({user_id:z}):await t({email:S}),N(60),L(``)}finally{F(!1)}}async function q(){if(H)try{j(!0),await V(),w?.(S)}catch(e){L(e.message??x(`verify.invalidCode`))}finally{j(!1)}}return _(o,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[_(o,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[g(e,{type:`button`,onClick:C,"aria-label":x(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:g(u,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),g(s,{className:`text-[14px] text-text2`})]}),_(o,{className:`px-[24px] flex flex-col mt-[15px]`,children:[_(o,{className:`flex flex-col`,children:[g(s,{className:`text-[24px] leading-[32px] font-bold`,children:x(`verify.title`)}),_(o,{className:`mt-[12px] flex items-center`,children:[_(s,{className:`text-[14px] leading-[14px] text-text1/80`,children:[x(`verify.sentTo`),` `,B]}),g(e,{type:`button`,onClick:K,disabled:M>0||P,className:`ml-[8px] rounded-[19px] !px-[8px] !py-[8px] text-[12px] leading-[12px] cursor-pointer bg-line1 text-text1/80 disabled:cursor-not-allowed`,children:M>0
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{pUserSendEmailCode as t,pUserSendResetPasswordEmailCode as n,pUserVerifyEmailCode as r,pUserVerifyForgetEmailCode as i,pUserVerifyResetPasswordEmailCode as a}from"../../../service/generated/client.mjs";import{Box as o}from"../../ui/box.mjs";import{Text as s}from"../../ui/text.mjs";import{useLoginModalStore as c}from"../../../store/modules/login-modal-store.mjs";import{useUserId as l}from"../../../hooks/use-auth.mjs";import{LeftArrowIcon as u}from"../../../assets/icons/left-arrow-icon.mjs";import{useCallback as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{useTranslations as v}from"next-intl";function y(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function b(b){let x=v(`components.pages.login`),{email:S,onClose:C,onPassword:w}=b,{verifyStep:T}=c(),[E,D]=h([,,,,,,].fill(``)),[O,k]=h(0),[A,j]=h(!1),[M,N]=h(60),[P,F]=h(!1),[I,L]=h(``),R=m(null),z=l(),B=p(()=>y(S),[S]),V=d(async()=>T===`reset-password`?await a({user_id:z,email_code:E.join(``)}):T===`forgot-password`?await i({email:S,email_code:E.join(``)}):await r({email:S,email_code:E.join(``)}),[T,E,z,S]),H=p(()=>E.every(e=>e!==``)&&!A,[E,A]);f(()=>{if(M<=0)return;let e=setInterval(()=>{N(e=>e-1)},1e3);return()=>clearInterval(e)},[M]),f(()=>{R.current?.focus()},[]);let U=d(e=>{let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...E],r=t.split(``),i=O;for(let e of r)i<6&&(n[i]=e,i++);D(n),k(Math.min(i,5)),L(``)},[E,O]),W=d(e=>{if(e.key===`Backspace`){e.preventDefault();let t=[...E];E[O]?t[O]=``:O>0&&(t[O-1]=``,k(O-1)),D(t),L(``)}else e.key===`ArrowLeft`&&O>0?k(O-1):e.key===`ArrowRight`&&O<5&&k(O+1)},[E,O]),G=d(e=>{k(e),R.current?.focus()},[]);async function K(){if(!(M>0||P))try{F(!0),T===`reset-password`?await n({user_id:z}):await t({email:S}),N(60),L(``)}finally{F(!1)}}async function q(){if(H)try{j(!0),await V(),w?.(S)}catch(e){L(e.message??x(`verify.invalidCode`))}finally{j(!1)}}return _(o,{className:`min-h-screen w-full h-full bg-bg1 text-text1 flex flex-col`,children:[_(o,{className:`flex justify-between items-center h-[60px] px-[16px]`,children:[g(e,{type:`button`,onClick:C,"aria-label":x(`verify.back`),className:`cursor-pointer bg-transparent !p-0 !px-0 !py-0`,children:g(u,{className:`w-[16px] h-[16px] text-text1/80`,"aria-hidden":`true`,focusable:`false`})}),g(s,{className:`text-[14px] text-text2`})]}),_(o,{className:`px-[24px] flex flex-col mt-[15px]`,children:[_(o,{className:`flex flex-col`,children:[g(s,{className:`text-[24px] leading-[32px] font-bold`,children:x(`verify.title`)}),_(o,{className:`mt-[12px] flex items-center`,children:[_(s,{className:`text-[14px] leading-[14px] text-text1/80`,children:[x(`verify.sentTo`),` `,B]}),g(e,{type:`button`,onClick:K,disabled:M>0||P,className:`ml-[8px] rounded-[19px] !px-[8px] !py-[8px] text-[12px] leading-[12px] cursor-pointer bg-line1 text-text1/80 disabled:cursor-not-allowed`,children:M>0?`${x(`verify.resend`)} (${M}s)`:x(`verify.resend`)})]})]}),_(`form`,{className:`mt-[38px]`,onSubmit:e=>{e.preventDefault(),q()},children:[_(o,{className:`h-14 sm:h-16 md:h-20 relative`,children:[g(`input`,{ref:R,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:U,onKeyDown:W,className:`absolute opacity-0 pointer-events-none w-full h-full border-none outline-none bg-transparent text-base`,autoComplete:`one-time-code`}),g(o,{className:`w-full flex justify-between items-center`,children:E.map((e,t)=>g(o,{onClick:()=>G(t),className:`
|
|
3
3
|
w-14 h-14 sm:w-16 sm:h-16 md:w-20 md:h-20 rounded-xl border-2 flex items-center justify-center cursor-pointer transition-all duration-200
|
|
4
4
|
${t===O?`border-theme3 bg-theme3`:`border-transparent bg-bg2`}
|
|
5
5
|
`,children:g(s,{className:`select-none font-semibold text-2xl sm:text-3xl leading-none text-text1`,children:e})},t))})]}),g(o,{className:`h-[22px] mt-[16px] mb-[22px] ml-[12px] text-[14px] text-theme5`,children:I}),g(e,{type:`submit`,disabled:!H,className:`w-full h-[60px] !rounded-[30px] !text-[18px] font-bold leading-[26px] bg-theme6 disabled:bg-theme6/40 disabled:text-text3 active:opacity-90 !px-0 !py-0`,children:x(A?`verify.verifying`:`verify.nextStep`)})]})]})]})}export{b as Verify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useSearchParams as v}from"next/navigation";const y=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function b(){let{userInfo:b}=n(),x=b?.user_id||`guest`,S=v().get(`q`)?.toString()||``,C=S?decodeURIComponent(S):``,[w,T]=m(C),[E]=m(C),[D]=m(0),[O,k]=m(y[0].value),[A,j]=m(u[0].value),[,
|
|
2
|
+
"use client";import{updateUrlParams as e}from"../../../utils/common.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{Box as r}from"../../ui/box.mjs";import{eventKey as i}from"../../../constants/event-key.mjs";import{useSearchHistory as a}from"../../../hooks/use-search-history.mjs";import o from"../search/top-header.mjs";import s from"./search-user.mjs";import c from"./search-video.mjs";import l from"./search-all.mjs";import{SORT_OPTIONS as u,SearchTab as d}from"./search-tab.mjs";import{useEffect as f,useMemo as p,useState as m}from"react";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{useSearchParams as v}from"next/navigation";const y=[{label:`综合`,value:`all`},{label:`视频`,value:`video`},{label:`用户`,value:`user`}];function b(){let{userInfo:b}=n(),x=b?.user_id||`guest`,S=v().get(`q`)?.toString()||``,C=S?decodeURIComponent(S):``,[w,T]=m(C),[E]=m(C),[D]=m(0),[O,k]=m(y[0].value),[A,j]=m(u[0].value),[M,N]=m(0),[,P]=m([]),{addHistory:F}=a({storageKey:x}),I=p(()=>w.trim()!==``,[w]);return f(()=>(t.on(i.EXCHANGE_SEARCH_TYPE,k),()=>{t.off(i.EXCHANGE_SEARCH_TYPE,k)}),[k]),_(r,{className:`w-full min-h-screen bg-bg1 pb-[12px] overscroll-y-none`,children:[g(o,{setSearchInputVal:t=>{t!==w&&(P([]),T(t),e({q:t}))},initInputVal:E,initInputVersion:D,addSearchHistory:F}),g(d,{searchType:O,tabList:y,onChange:e=>{k(e),P([])},sort:A,onSortChange:e=>{j(e),N(e=>e+1)}}),I&&_(h,{children:[O===`user`&&g(s,{mode:`user`,inputVal:w,sort:A,refreshVersion:M}),O===`all`&&g(l,{searchInputVal:w,sort:A,refreshVersion:M}),O===`video`&&g(c,{mode:`video`,inputVal:w,sort:A,refreshVersion:M})]}),!I&&g(r,{className:`w-full pt-[12px]`})]})}export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import a from"./search-user.mjs";import o from"./search-video.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function f({searchInputVal:f,sort:p}){let
|
|
2
|
+
"use client";import{gContentGetRecommendVideoList as e}from"../../../service/generated/client.mjs";import{gContentGetRecommendVideoListKey as t}from"../../../service/generated/tanstack.mjs";import{Box as n}from"../../ui/box.mjs";import{List as r}from"../../ui/list.mjs";import{useRequest as i}from"../../../hooks/query/use-query.mjs";import a from"./search-user.mjs";import o from"./search-video.mjs";import{useMemo as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{useTranslations as u}from"next-intl";function d(e,t=1){return JSON.stringify({type:1,keywords:e,sort:t})}function f({searchInputVal:f,sort:p,refreshVersion:m}){let h=u(`components.pages.search.searchResult`),g=s(()=>d(f,p),[f,p]),{data:_,isFetching:v}=i(s(()=>[...t({data_type:2,extra_params:g,page:1,page_size:10}),m],[m,g]),async()=>(await e({data_type:2,extra_params:g,page:1,page_size:10})).data??{}),y=s(()=>_?.videos?.list??[],[_]),b=s(()=>!!_?.videos?.has_more,[_]),x=s(()=>_?.users?.list??[],[_]);return y.length===0&&x.length===0&&!v?c(n,{className:`w-full pt-[12px]`,children:c(r,{loading:v,empty:`nodata`,emptyText:h(`searchAll.emptyResult`)})}):l(n,{className:`w-full pt-[12px]`,children:[x.length>0&&c(a,{mode:`all`,list:x}),c(o,{mode:`all`,list:y,hasMore:b})]})}export{f as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{Box as t}from"../../ui/box.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"../../ui/popover.mjs";import{Text as a}from"../../ui/text.mjs";import o from"../../../assets/icons/search/filter.mjs";import{memo as s,useState as c}from"react";import{ChevronUpIcon as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=[{label:`综合`,value:1},{label:`最新`,value:2},{label:`最热`,value:3}],m=s(({searchType:s,onChange:m,tabList:h,sort:g,onSortChange:_})=>{let[v,y]=c(!1);return f(u,{children:[f(t,{as:`nav`,className:`w-full h-[42px] bg-bg1 flex items-center justify-between px-[3px] fixed top-[
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import{Box as t}from"../../ui/box.mjs";import{Popover as n,PopoverContent as r,PopoverTrigger as i}from"../../ui/popover.mjs";import{Text as a}from"../../ui/text.mjs";import o from"../../../assets/icons/search/filter.mjs";import{memo as s,useState as c}from"react";import{ChevronUpIcon as l}from"lucide-react";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";const p=[{label:`综合`,value:1},{label:`最新`,value:2},{label:`最热`,value:3}],m=s(({searchType:s,onChange:m,tabList:h,sort:g,onSortChange:_})=>{let[v,y]=c(!1);return f(u,{children:[f(t,{as:`nav`,className:`w-full h-[42px] bg-bg1 flex items-center justify-between px-[3px] fixed top-[54px] left-0 right-0 z-40`,children:[d(t,{className:`flex items-center`,children:h.map(e=>d(a,{className:`h-[30px] rounded-[15px] leading-[30px] px-[9px] text-[16px] bg-transparent transition-all duration-150 ${s===e.value?`text-theme5 !text-[20px] font-bold`:`text-text2`}`,onClick:()=>{s!==e.value&&m(e.value)},children:e.label},e.value))}),f(n,{open:v,onOpenChange:y,children:[d(i,{"aria-label":`排序筛选`,className:`shrink-0 w-7 h-7 rounded-[min(var(--radius-md),12px)] inline-flex items-center justify-center`,children:d(o,{className:`w-[16px] h-[16px]`})}),f(r,{side:`bottom`,align:`end`,className:`w-[100vw] bg-muted`,children:[d(a,{as:`p`,className:`text-[14px] font-medium text-text1 mb-[12px]`,children:`排序方式`}),f(t,{className:`flex flex-col gap-[8px]`,children:[d(t,{className:`flex justify-between gap-[8px]`,children:p.map(t=>d(e,{variant:g===t.value?`default`:`outline`,size:`sm`,className:`w-[100px]`,onClick:()=>{_(t.value),y(!1)},children:t.label},t.value))}),f(e,{variant:`ghost`,size:`sm`,className:`w-full justify-center gap-[4px] text-text2`,onClick:()=>y(!1),children:[d(l,{className:`w-[14px] h-[14px]`}),`收起`]})]})]})]})]}),d(t,{className:`w-full h-[42px]`})]})});m.displayName=`SearchTab`;export{p as SORT_OPTIONS,m as SearchTab};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as r}from"../../../service/generated/client.mjs";import{Image as i}from"../../ui/image.mjs";import{Box as a}from"../../ui/box.mjs";import{Item as o}from"../../ui/item.mjs";import{List as s}from"../../ui/list.mjs";import{Skeleton as c}from"../../ui/skeleton.mjs";import{Text as l}from"../../ui/text.mjs";import{usePaginated as u,useUpdateRequest as d}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as f}from"../../../hooks/use-auth.mjs";import{eventKey as p}from"../../../constants/event-key.mjs";import m from"../../../assets/icons/right_arrow.mjs";import{FollowButton as h}from"../(follow)/_components/follow-button/index.mjs";import{memo as
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import t from"../../../utils/event-bus.mjs";import{useUserStore as n}from"../../../store/modules/user-store.mjs";import{gContentGetRecommendVideoList as r}from"../../../service/generated/client.mjs";import{Image as i}from"../../ui/image.mjs";import{Box as a}from"../../ui/box.mjs";import{Item as o}from"../../ui/item.mjs";import{List as s}from"../../ui/list.mjs";import{Skeleton as c}from"../../ui/skeleton.mjs";import{Text as l}from"../../ui/text.mjs";import{usePaginated as u,useUpdateRequest as d}from"../../../hooks/query/use-query.mjs";import{useRequireLogin as f}from"../../../hooks/use-auth.mjs";import{eventKey as p}from"../../../constants/event-key.mjs";import m from"../../../assets/icons/right_arrow.mjs";import{FollowButton as h}from"../(follow)/_components/follow-button/index.mjs";import g from"../../../assets/images/user/default_avatar.mjs";import{memo as _,useCallback as v,useEffect as y,useMemo as b,useState as x}from"react";import{jsx as S,jsxs as C}from"react/jsx-runtime";import{useTranslations as w}from"next-intl";import T from"next/link";const E=typeof g==`string`?g:g.src;function D(){return S(a,{className:`w-full`,children:Array.from({length:6}).map((e,t)=>C(a,{className:`w-full h-[56px] flex items-center justify-between mb-[12px]`,children:[C(a,{className:`flex items-center`,children:[S(c,{className:`w-[56px] h-[56px] rounded-[28px]`}),C(a,{className:`ml-[8px]`,children:[S(c,{className:`w-[120px] h-[18px] mb-[8px]`}),S(c,{className:`w-[72px] h-[14px]`})]})]}),S(c,{className:`w-[76px] h-[34px] rounded-[18px]`})]},`search-user-skeleton-${t}`))})}const O=_(({item:e,onUpdate:t})=>{let r=w(`components.pages.search.searchResult`),{userInfo:o}=n(),s=v(n=>{t({...e,is_following:n?1:0})},[e,t]);return C(a,{className:`w-full h-[56px] bg-bg1 flex flex-row items-center justify-between mb-[12px]`,children:[C(T,{className:`cursor-pointer flex flex-row items-center justify-center`,href:`/profile/${e.user_id}`,children:[S(a,{className:`w-[56px] h-[56px] rounded-[28px] overflow-hidden bg-bg2 relative`,children:S(i,{src:e.avatar||E,fill:!0,objectFit:`cover`,alt:e.nick_name})}),C(a,{className:`flex flex-col ml-[8px]`,children:[S(l,{as:`span`,className:`text-text1 text-[16px] leading-[24px] h-[24px] font-bold overflow-hidden max-w-[200px] line-clamp-1`,children:e.nick_name}),C(l,{as:`span`,className:`text-text2 leading-[22px] text-[14px]`,children:[e.follower_count??0,r(`searchUser.followersSuffix`)]})]})]}),o.user_id!==e.user_id&&S(h,{userId:e.user_id,hasFollow:!!e.is_following,onChange:s})]})});O.displayName=`UserItem`;const k=_(({list:n})=>{let r=f(),[i,o]=x({});y(()=>{o({})},[n]);let s=v(e=>{e.user_id&&o(t=>({...t,[e.user_id]:e.is_following?1:0}))},[]),c=b(()=>n.slice(0,3).map(e=>{let t=e.user_id||``;return!t||i[t]===void 0?e:{...e,is_following:i[t]}}),[i,n,3]),u=n.length>3,d=v(()=>{t.emit(p.EXCHANGE_SEARCH_TYPE,`user`)},[]);return c.length===0?null:C(a,{className:`w-full pt-[12px]`,children:[S(a,{className:`px-[12px]`,children:c.map((e,t)=>S(O,{item:e,onUpdate:e=>{r(()=>s(e))}},String(e.user_id??t)))}),u&&S(a,{className:`w-full flex items-center justify-center`,children:C(e,{variant:`ghost`,className:`w-fit h-[46px] leading-[46px] mx-auto mt-[-12px] text-[14px] text-text2`,onClick:d,children:[S(l,{as:`span`,children:`查看更多`}),S(m,{className:`w-[12px] h-[12px]`})]})})]})});k.displayName=`SearchUserWithLimit`;const A=_(({inputVal:e,sort:t,refreshVersion:n})=>{let i=w(`components.pages.search.searchResult`),c=f(),l=v(async n=>await r({data_type:2,extra_params:JSON.stringify({type:4,keywords:e,sort:t}),page:n||1,page_size:20}),[e,t]),p=b(()=>[`searchByKeyForUser`,e,4,t,n],[e,t,n]),m=u({key:p,initialPageParam:1,async queryFn(e){return(await l(e))?.data?.users??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),h=d(),g=v((e,t)=>{e&&h(p,n=>n&&{...n,pages:n.pages.map(n=>({...n,list:(n.list??[]).map(n=>n.user_id===e?{...n,is_following:t?1:0}:n)}))})},[h,p]),_=async e=>{try{await m.fetchNextPage()}catch(e){console.error(`获取用户列表失败`,e)}},y=(m?.data?.pages??[]).flatMap(e=>e.list??[]),x=!!(m?.isPending||m?.isFetching);return x&&y.length===0?S(D,{}):S(a,{className:`w-full`,children:S(s,{loading:x,hasMore:m?.hasNextPage??!1,loadMore:_,empty:`nodata`,emptyText:i(`searchUser.emptyResult`),children:y.map((e,t)=>S(o,{children:S(O,{item:e,onUpdate:e=>{c(()=>{g(e.user_id||``,!!e.is_following)})}})},String(e.user_id??t)))})})});A.displayName=`SearchUserWithPagination`;const j=_(e=>e.mode===`all`?S(k,{list:e.list??[]}):S(A,{inputVal:e.inputVal??``,sort:e.sort??1,refreshVersion:e.refreshVersion??0}));j.displayName=`SearchUser`;export{j as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Button as e}from"../../ui/button.mjs";import{gContentGetRecommendVideoList as
|
|
2
|
+
"use client";import{Button as e}from"../../ui/button.mjs";import t from"../../../utils/event-bus.mjs";import{gContentGetRecommendVideoList as n}from"../../../service/generated/client.mjs";import{Image as r}from"../../ui/image.mjs";import{Box as i}from"../../ui/box.mjs";import{Item as a}from"../../ui/item.mjs";import{List as o}from"../../ui/list.mjs";import{Text as s}from"../../ui/text.mjs";import{usePaginated as c}from"../../../hooks/query/use-query.mjs";import{eventKey as l}from"../../../constants/event-key.mjs";import{getPostDetailPagePath as u}from"../../../utils/tools.mjs";import{apiCollectCustom as d}from"../../../utils/api-collect.mjs";import{VideoListItemSkeleton as f}from"../../common/skeleton/video-list-item-skeleton.mjs";import{useCardDecoration as p}from"../../../hooks/use-card-decoration.mjs";import m from"../../../assets/icons/right_arrow.mjs";import h from"../../ui/rate.mjs";import{memo as g,useCallback as _,useMemo as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{useTranslations as x}from"next-intl";import S from"next/link";const C=g(()=>y(i,{className:`w-full px-[12px] pt-[12px]`,children:Array.from({length:3}).map((e,t)=>y(f,{},`search-video-skeleton-${t}`))}));C.displayName=`SearchVideoListSkeleton`;const w=g(({item:e})=>{let{getCalculationScore:t}=p();return b(S,{className:`w-full flex items-center justify-between mb-[12px] pb-[12px] border-b border-line1 cursor-pointer px-[12px]`,href:u({id:e.video_id,contentType:0}),onClick:()=>{e.video_id},children:[y(i,{className:`w-[76px] h-[102px] shrink-0 rounded-[8px] overflow-hidden relative bg-bg2`,children:y(r,{src:e.img_y||e.img_x||``,fill:!0,objectFit:`cover`,alt:e.name||``})}),b(i,{className:`flex-1 min-w-0 flex flex-col ml-[12px]`,children:[y(s,{as:`span`,className:`leading-[26px] text-text1 text-[18px] font-bold max-w-[200px] line-clamp-1 mb-[4px]`,children:e.name||``}),b(i,{className:`flex items-center`,style:{transform:`scale(0.6)`,transformOrigin:`left center`},children:[y(h,{allowHalf:!0,value:t({score:String(e.score??0)})}),y(s,{as:`span`,className:`ml-[8px] text-[24px] text-[#F59E0B] font-bold leading-[24px]`,children:e.score?(Number(e.score)/10).toFixed(1):0})]}),b(i,{className:`w-full mt-[4px] flex items-center shrink-0 pr-[12px]`,children:[y(i,{className:`w-fit h-[20px] leading-[20px] px-[6px] text-text3 text-[12px] bg-line1 rounded-[4px] shrink-0 mr-[10px]`,children:e.group_name}),y(s,{as:`span`,className:`text-text2 text-[14px] leading-[22px] flex-1 min-w-0 line-clamp-1`,children:e.description})]})]})]})});w.displayName=`VideoItem`;const T=g(({list:e})=>y(i,{className:`w-full px-[12px] pt-[12px]`,children:e.map((e,t)=>y(w,{item:e},String(e.video_id??t)))}));T.displayName=`VideoListContent`;const E=g(({list:n,hasMore:r})=>{let a=_(()=>{t.emit(l.EXCHANGE_SEARCH_TYPE,`video`)},[]);return b(i,{className:`w-full`,children:[y(T,{list:n}),r&&y(i,{className:`w-full flex items-center justify-center`,children:b(e,{variant:`ghost`,className:`w-fit h-[46px] leading-[46px] mx-auto mt-[-12px] text-[14px] text-text2`,onClick:a,children:[y(s,{as:`span`,children:`查看更多`}),y(m,{className:`w-[12px] h-[12px]`})]})})]})});E.displayName=`SearchVideoWithAll`;const D=g(({inputVal:e,sort:t,refreshVersion:r})=>{let s=x(`components.pages.search.searchResult`),l=_(async r=>await n({data_type:2,extra_params:JSON.stringify({type:3,keywords:e,sort:t}),page:r||1,page_size:20}),[e,t]),u=c({key:v(()=>[`searchByKeyForVideoInfo`,e,3,t,r],[e,t,r]),initialPageParam:1,async queryFn(e){return(await l(e))?.data?.videos??{has_more:!1,total:0,list:[]}},getNextPageParam(e,t){if(e.has_more)return t.length+1}}),d=v(()=>{let e=u.data?.pages??[],t=[];for(let n of e){let e=n.list??[];t.push(...e)}return t},[u.data?.pages]),f=u.isPending||u.isFetching;return f&&d.length===0?y(C,{}):y(i,{className:`w-full`,children:y(o,{loading:f,hasMore:u.hasNextPage??!1,loadMore:async e=>{try{await u.fetchNextPage()}catch(e){console.error(`获取内容列表失败`,e)}},empty:`nodata`,emptyText:s(`searchVideoInfo.noRelevantContent`),children:d.map((e,t)=>y(a,{className:`p-0`,children:y(w,{item:e})},String(e.video_id??t)))})})});D.displayName=`SearchVideoWithPagination`;const O=g(e=>e.mode===`all`?y(E,{list:e.list,hasMore:e.hasMore}):y(D,{inputVal:e.inputVal,sort:e.sort,refreshVersion:e.refreshVersion}));O.displayName=`SearchVideo`;export{O as default};
|
|
@@ -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{
|
|
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};
|
|
@@ -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
|
|
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 o,AlertDialogFooter as s,AlertDialogHeader as c}from"../../../ui/alert-dialog.mjs";import{useUserStore as l}from"../../../../store/modules/user-store.mjs";import{gUserGetUserPrivacySettings as u}from"../../../../service/generated/client.mjs";import{Box as d}from"../../../ui/box.mjs";import{List as f}from"../../../ui/list.mjs";import{useLoginModalStore as p}from"../../../../store/modules/login-modal-store.mjs";import{useDeleteRequest as m,useRequest as h}from"../../../../hooks/query/use-query.mjs";import{locales as g}from"../../../../i18n.mjs";import{HeaderNav as _}from"../../../common/header-nav/client.mjs";import{ResetPasswordDrawer as v}from"./reset-password-drawer.mjs";import{useEffect as y,useRef as b,useState as x}from"react";import{jsx as S,jsxs as C}from"react/jsx-runtime";import{useLocale as w,useTranslations as T}from"next-intl";import E 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({className:O}={}){let k=T(`components.pages.settings.components`),A=w(),{open:j}=p(),M=l(e=>e.isLogin),N=l(e=>e.token),P=l(e=>e.logout),F=l(e=>e.userId),I=(M||!!N)&&!!F,L=D(),[R,ee]=x(L),z=b(L),[B,V]=x(!1),[H,U]=x(!1);m();let W=[`user-privacy-settings`,F],G=A===`zh-CN`?`en`:`zh-CN`;g.find(e=>e.code===G)?.name;let{data:K}=h(W,()=>u({user_id:F}),{enabled:!!F}),q=K?.data;y(()=>{if(!q)return;let e=D(q);ee(e),z.current=e},[q]),y(()=>{z.current=R},[R]);let J=m();function Y(){J([`user-profile`,`mine`]),P(),window.location.href=`/user/mine`}function X(e){U(e)}function Z(){U(!0)}function Q(){U(!1)}function $(){U(!1),Y()}function te(e){V(e)}function ne(){if(!I){j();return}V(!0)}function re(e){I||(e.preventDefault(),e.stopPropagation(),j())}return C(d,{className:e(O),children:[S(_,{className:`!bg-bg2`,title:k(`settings.title`)}),S(v,{open:B,onOpenChange:te}),C(d,{className:`flex flex-col gap-2 `,children:[S(f,{className:`bg-bg2 py-2`,children:S(E,{href:`/feedback`,onClick:re,children:S(f.Item,{title:k(`settings.feedbackTitle`),arrow:!0})})}),S(f,{className:`bg-bg2 py-2`,children:S(f.Item,{title:k(`settings.resetPasswordTitle`),arrow:!0,onClick:ne})})]}),B||!I?null:S(d,{className:`fixed bottom-0 w-full left-0`,children:S(t,{className:`h-auto text-base py-4 w-full`,variant:`secondary`,onClick:Z,children:k(`settings.button`)})}),S(n,{open:H,onOpenChange:X,children:C(a,{size:`sm`,children:[S(c,{children:S(o,{children:k(`settings.logoutConfirmMessage`)})}),C(s,{children:[S(i,{onClick:Q,children:k(`settings.cancel`)}),S(r,{onClick:$,children:k(`settings.confirm`)})]})]})})]})}export{O as Settings};
|