@funhub/platform 0.1.161 → 0.1.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.d.mts +3 -1
- package/dist/common.mjs +1 -1
- package/dist/components/biz/business/channel-list/client.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs +1 -1
- package/dist/components/biz/business/header-search/header-logo-search/schema.mjs +1 -1
- package/dist/components/biz/business/profile/profile-main/shell.mjs +1 -1
- package/dist/components/common/analytics-init/analytics-init.d.mts +21 -0
- package/dist/components/common/analytics-init/analytics-init.mjs +2 -0
- package/dist/components/common/analytics-init/index.d.mts +2 -0
- package/dist/components/common/video-player/style.module.mjs +0 -1
- package/dist/components/pages/login/reset-password.mjs +1 -1
- package/dist/components/pages/settings/_components/reset-password-drawer.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/image.d.mts +4 -4
- package/package.json +1 -1
package/dist/common.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { UserActivityListItem, UserActivityListItemProps, UserActivityMediaGrid, UserActivityMediaGridProps } from "./components/common/list/user-activity-list/user-activity-list-item.mjs";
|
|
3
|
+
import { AnalyticsInit } from "./components/common/analytics-init/analytics-init.mjs";
|
|
4
|
+
import "./components/common/analytics-init/index.mjs";
|
|
3
5
|
import { BlockedDialog } from "./components/common/blocked-dialog/blocked-dialog.mjs";
|
|
4
6
|
import "./components/common/blocked-dialog/index.mjs";
|
|
5
7
|
import { MiniThreeCard } from "./components/common/cards/mini-three-card.mjs";
|
|
@@ -56,4 +58,4 @@ import { TopNavBarServer } from "./components/common/top-nav-bar/index.mjs";
|
|
|
56
58
|
import { UserInfoInitializer } from "./components/common/user-info-initializer/index.mjs";
|
|
57
59
|
import { CommonPlayer, CommonPlayerRef } from "./components/common/video-player/index.mjs";
|
|
58
60
|
import { WaitLoading } from "./components/common/wait-loading.mjs";
|
|
59
|
-
export { ActionButton, AddIcon, BlockedDialog, CollectionList, CollectionListItem, CollectionListItemProps, CollectionListMediaItem, CollectionListProps, CollectionPopupComponent, CollectionPopupHost, CommentIcon, CommonPhotoGrid, CommonPlayer, CommonPlayerRef, DebugLocaleSwitcher, DeleteConfirmDialog, DeleteConfirmDialogProps, DeleteIcon, Empty, FunhubProvider, FunhubProviderProps, GenderPicker, GenderPickerOption, GenderPickerProps, HeaderNav, IntlProvider, IntlProviderProps, LeftArrowIcon, LocaleSync, LoginDialog, MediaPreview, MiniThreeCard, MoreIcon, PageSkeleton, SeriesEpisodePage as PhotoGrid, PopupVideo, PostList, PostListItem, PostListItemProps, PostListProps, RightArrowIcon, SeriesEpisodes, SeriesEpisodesProps, SettingIcon, ShareContent, ShareDataType, ShareDrawer, ShareDrawerProps, ShareIcon, SharePlatform, SharePopupComponent, TabBar, ThemeSync, TopNavBarServer, UserActivityList, UserActivityListItem, UserActivityListItemProps, UserActivityListProps, UserActivityMediaGrid, UserActivityMediaGridProps, MediaPreview as UserActivityMediaPreview, UserInfoInitializer, VideoList, VideoListItem, VideoListItemProps, VideoListProps, WaitLoading, closePhotoPreview, defaultActions, defaultPlatforms, photoPreview, useMediaPreview };
|
|
61
|
+
export { ActionButton, AddIcon, AnalyticsInit, BlockedDialog, CollectionList, CollectionListItem, CollectionListItemProps, CollectionListMediaItem, CollectionListProps, CollectionPopupComponent, CollectionPopupHost, CommentIcon, CommonPhotoGrid, CommonPlayer, CommonPlayerRef, DebugLocaleSwitcher, DeleteConfirmDialog, DeleteConfirmDialogProps, DeleteIcon, Empty, FunhubProvider, FunhubProviderProps, GenderPicker, GenderPickerOption, GenderPickerProps, HeaderNav, IntlProvider, IntlProviderProps, LeftArrowIcon, LocaleSync, LoginDialog, MediaPreview, MiniThreeCard, MoreIcon, PageSkeleton, SeriesEpisodePage as PhotoGrid, PopupVideo, PostList, PostListItem, PostListItemProps, PostListProps, RightArrowIcon, SeriesEpisodes, SeriesEpisodesProps, SettingIcon, ShareContent, ShareDataType, ShareDrawer, ShareDrawerProps, ShareIcon, SharePlatform, SharePopupComponent, TabBar, ThemeSync, TopNavBarServer, UserActivityList, UserActivityListItem, UserActivityListItemProps, UserActivityListProps, UserActivityMediaGrid, UserActivityMediaGridProps, MediaPreview as UserActivityMediaPreview, UserInfoInitializer, VideoList, VideoListItem, VideoListItemProps, VideoListProps, WaitLoading, closePhotoPreview, defaultActions, defaultPlatforms, photoPreview, useMediaPreview };
|
package/dist/common.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{MediaPreview as e,useMediaPreview as t}from"./components/common/media-preview/index.mjs";import{CollectionPopupComponent as n,CollectionPopupHost as r}from"./components/common/collection-popup/index.mjs";import i from"./components/common/share-popup/share-content.mjs";import{ShareDrawer as a}from"./components/common/share-popup/share-drawer.mjs";import{IntlProvider as o}from"./components/common/intl-provider/intl-provider.mjs";import{SharePopupComponent as s,defaultActions as c,defaultPlatforms as l}from"./components/common/share-popup/share-popup.mjs";import u from"./components/common/video-player/index.mjs";import{
|
|
2
|
+
import{MediaPreview as e,useMediaPreview as t}from"./components/common/media-preview/index.mjs";import{CollectionPopupComponent as n,CollectionPopupHost as r}from"./components/common/collection-popup/index.mjs";import i from"./components/common/share-popup/share-content.mjs";import{ShareDrawer as a}from"./components/common/share-popup/share-drawer.mjs";import{IntlProvider as o}from"./components/common/intl-provider/intl-provider.mjs";import{SharePopupComponent as s,defaultActions as c,defaultPlatforms as l}from"./components/common/share-popup/share-popup.mjs";import u from"./components/common/video-player/index.mjs";import{AnalyticsInit as d}from"./components/common/analytics-init/analytics-init.mjs";import{BlockedDialog as f}from"./components/common/blocked-dialog/blocked-dialog.mjs";import{MiniThreeCard as p}from"./components/common/cards/mini-three-card.mjs";import{DebugLocaleSwitcher as m}from"./components/common/debug-locale-switcher/index.mjs";import{DeleteConfirmDialog as h}from"./components/common/delete-confirm-dialog/delete-confirm-dialog.mjs";import g from"./components/common/empty/index.mjs";import{FunhubProvider as _}from"./components/common/funhub-provider/funhub-provider.mjs";import{LeftArrowIcon as v}from"./components/common/icons/left-arrow.mjs";import{HeaderNav as y}from"./components/common/header-nav/client.mjs";import{AddIcon as b}from"./components/common/icons/add.mjs";import{CommentIcon as x}from"./components/common/icons/comment.mjs";import{DeleteIcon as S}from"./components/common/icons/delete.mjs";import{MoreIcon as C}from"./components/common/icons/more.mjs";import{RightArrowIcon as w}from"./components/common/icons/right-arrow.mjs";import{SettingIcon as T}from"./components/common/icons/setting.mjs";import{ShareIcon as E}from"./components/common/icons/share.mjs";import{CollectionListItem as D}from"./components/common/list/collection-list/collection-list-item.mjs";import{CollectionList as O}from"./components/common/list/collection-list/collection-list.mjs";import{PostListItem as k}from"./components/common/list/post-list/post-list-item.mjs";import{PostList as A}from"./components/common/list/post-list/post-list.mjs";import{UserActivityList as j}from"./components/common/list/user-activity-list/user-activity-list.mjs";import{UserActivityListItem as M,UserActivityMediaGrid as N}from"./components/common/list/user-activity-list/user-activity-list-item.mjs";import{VideoListItem as P}from"./components/common/list/video-list/video-list-item.mjs";import{VideoList as F}from"./components/common/list/video-list/video-list.mjs";import{LocaleSync as I}from"./components/common/locale-sync/locale-sync.mjs";import{LoginDialog as L}from"./components/common/login-dialog/login-dialog.mjs";import{PageSkeleton as R}from"./components/common/page-skeleton/page-skeleton.mjs";import z from"./components/common/photo-grid/index.mjs";import B from"./components/common/photo-grid/common-photo-grid.mjs";import{closePhotoPreview as V,photoPreview as H}from"./components/common/photo-preview/index.mjs";import{GenderPicker as U}from"./components/common/picker/gender-picker/gender-picker.mjs";import W from"./components/common/popup-video/index.mjs";import{SeriesEpisodes as G}from"./components/common/series-episodes/index.mjs";import{TabBar as K}from"./components/common/tab-bar/index.mjs";import{ThemeSync as q}from"./components/common/theme-sync/index.mjs";import{TopNavBarServer as J}from"./components/common/top-nav-bar/index.mjs";import{UserInfoInitializer as Y}from"./components/common/user-info-initializer/index.mjs";import{WaitLoading as X}from"./components/common/wait-loading.mjs";export{b as AddIcon,d as AnalyticsInit,f as BlockedDialog,O as CollectionList,D as CollectionListItem,n as CollectionPopupComponent,r as CollectionPopupHost,x as CommentIcon,B as CommonPhotoGrid,u as CommonPlayer,m as DebugLocaleSwitcher,h as DeleteConfirmDialog,S as DeleteIcon,g as Empty,_ as FunhubProvider,U as GenderPicker,y as HeaderNav,o as IntlProvider,v as LeftArrowIcon,I as LocaleSync,L as LoginDialog,e as MediaPreview,p as MiniThreeCard,C as MoreIcon,R as PageSkeleton,z as PhotoGrid,W as PopupVideo,A as PostList,k as PostListItem,w as RightArrowIcon,G as SeriesEpisodes,T as SettingIcon,i as ShareContent,a as ShareDrawer,E as ShareIcon,s as SharePopupComponent,K as TabBar,q as ThemeSync,J as TopNavBarServer,j as UserActivityList,M as UserActivityListItem,N as UserActivityMediaGrid,e as UserActivityMediaPreview,Y as UserInfoInitializer,F as VideoList,P as VideoListItem,X as WaitLoading,V as closePhotoPreview,c as defaultActions,l as defaultPlatforms,H as photoPreview,t as useMediaPreview};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/filter_dark.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import{defaultProps as c}from"./default-props.mjs";import{clsx as l}from"clsx";import{useEffect as u,useMemo as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{usePathname as g}from"next/navigation";const _={};function v(e,t){let n=`${r.DOMAIN}/`,i=t.indexOf(n),a=i!==-1,o=a?t.slice(i+n.length).split(`/`)[0]:void 0;return e.isDefault?a&&o?`${r.DOMAIN}/${o}`:`/`:a&&o?`${r.DOMAIN}/${o}/${encodeURIComponent(e.name)}`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function y(r){let{mode:y=`renderer`,styles:b,events:x,...S}=r,C=g()??`/`,w=y===`editor`,T=S||_,E={...c,...T},[D,O]=f(!1),{isSticky:k,ref:A}=i(),[j,M]=f(!1),[N,P]=f(E.list),F=d(()=>E.list.find(e=>e.isDefault)?.name??null,[E.list]),I=d(()=>E.currentChannelId??F,[E.currentChannelId,F]);u(()=>{let e=s();P(e?.length?E.list.filter(t=>!e.includes(t.name)):E.list)},[E.list]);let L=e=>{P(e)},R=(e,t)=>{x?.onChannelChange?.(e,t)},z=b?e(b,{}):void 0;return u(()=>{let e=()=>{let e=window.scrollY??document.documentElement.scrollTop??0,t=window.innerHeight,n=document.documentElement.scrollHeight;M(e+t>=n-1)};return window.addEventListener(`scroll`,e,{passive:!0}),e(),()=>{window.removeEventListener(`scroll`,e)}},[]),h(p,{children:[k&&m(t,{className:`w-full h-11`}),m(t,{as:`nav`,ref:A,className:l(`w-full transition-all duration-200`,w&&`pointer-events-none
|
|
2
|
+
"use client";import{mergeStyles as e}from"../../utils/styles/helpers.mjs";import{Box as t}from"../../../ui/box.mjs";import n from"../../../ui/link.mjs";import{urlPrefix as r}from"../../../../constants/url-prefix.mjs";import{useSticky as i}from"../../../../hooks/use-sticky.mjs";import a from"../../../../assets/icons/filter_dark.mjs";import o,{loadHiddenChannelIdsFromStorage as s}from"./channel-filter-dialog.mjs";import{defaultProps as c}from"./default-props.mjs";import{clsx as l}from"clsx";import{useEffect as u,useMemo as d,useState as f}from"react";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import{usePathname as g}from"next/navigation";const _={};function v(e,t){let n=`${r.DOMAIN}/`,i=t.indexOf(n),a=i!==-1,o=a?t.slice(i+n.length).split(`/`)[0]:void 0;return e.isDefault?a&&o?`${r.DOMAIN}/${o}`:`/`:a&&o?`${r.DOMAIN}/${o}/${encodeURIComponent(e.name)}`:`${r.CHANNEL}/${encodeURIComponent(e.name)}`}function y(r){let{mode:y=`renderer`,styles:b,events:x,...S}=r,C=g()??`/`,w=y===`editor`,T=S||_,E={...c,...T},[D,O]=f(!1),{isSticky:k,ref:A}=i(),[j,M]=f(!1),[N,P]=f(E.list),F=d(()=>E.list.find(e=>e.isDefault)?.name??null,[E.list]),I=d(()=>E.currentChannelId??F,[E.currentChannelId,F]);u(()=>{let e=s();P(e?.length?E.list.filter(t=>!e.includes(t.name)):E.list)},[E.list]);let L=e=>{P(e)},R=(e,t)=>{x?.onChannelChange?.(e,t)},z=b?e(b,{}):void 0;return u(()=>{let e=()=>{let e=window.scrollY??document.documentElement.scrollTop??0,t=window.innerHeight,n=document.documentElement.scrollHeight;M(e+t>=n-1)};return window.addEventListener(`scroll`,e,{passive:!0}),e(),()=>{window.removeEventListener(`scroll`,e)}},[]),h(p,{children:[k&&m(t,{className:`w-full h-11`}),m(t,{as:`nav`,ref:A,className:l(`w-full transition-all duration-200 bg-bg1`,w&&`pointer-events-none`,k&&`fixed top-0 left-0 right-0 z-50`),style:z,children:h(t,{className:`relative flex items-center h-[44px]`,children:[m(t,{className:`flex-1 overflow-x-auto overflow-y-hidden [&::-webkit-scrollbar]:hidden`,style:{scrollbarWidth:`none`,msOverflowStyle:`none`,WebkitOverflowScrolling:`touch`},children:m(t,{className:`flex items-center h-full pl-4 pr-4 gap-4`,children:N.map((e,t)=>{let r=I===e.name||I===null&&t===0;return m(n,{href:v(e,C),webviewNavMode:`spa`,className:l(`whitespace-nowrap cursor-pointer transition-all duration-200`,`flex items-center justify-center h-11`,`${r?`text-xl`:`text-base`}`),style:{fontWeight:r?`bold`:`normal`,color:r?`var(--color-theme5)`:`var(--color-text2)`},onClick:()=>R(e,t),children:e.name},e.name||`channel-${t}`)})})}),r.modifiable?m(t,{className:`flex items-center gap-[12px] px-[8px]`,children:m(t,{className:`flex items-center justify-center cursor-pointer w-7 h-8`,onClick:()=>{O(!0),x?.onFilterClick?.()},children:m(a,{className:`w-5 h-5`,style:{color:`var(--color-text1)`}})})}):null]})}),m(o,{open:D,onOpenChange:O,channels:E.list,currentChannelId:I,onChannelClick:R,onChannelsChange:L})]})}export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(`/static/icons/video.svg`,{label:`LOGO 图片地址`,required:!1}),logoHref:e.string(`/`,{label:`LOGO 跳转地址`,required:!1})})),r=t(n);export{r as headerAvatarLogoSearchInspectorDefaultProps,n as headerAvatarLogoSearchInspectorPropsSchema};
|
package/dist/components/biz/business/header-search/header-avatar-logo-search-icon/schema.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(`/static/icons/video.svg`,{label:`LOGO 图片地址`,required:!1}),logoHref:e.string(`/`,{label:`LOGO 跳转地址`,required:!1})})),r=t(n);export{r as headerAvatarLogoSearchIconInspectorDefaultProps,n as headerAvatarLogoSearchIconInspectorPropsSchema};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(
|
|
2
|
+
import{defineComponentPropsSchema as e,getSchemaDefaultProps as t}from"../../../../../utils/schema/schema.mjs";const n=e(e=>({logoSrc:e.string(`/static/icons/video.svg`,{label:`LOGO 图片地址`,required:!1}),logoHref:e.string(`/`,{label:`LOGO 跳转地址`,required:!1})})),r=t(n);export{r as headerLogoSearchInspectorDefaultProps,n as headerLogoSearchInspectorPropsSchema};
|
|
@@ -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{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useMemo as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import{parseAsString as v,useQueryState as y}from"nuqs";function b(e){return e?[...u]:[...d]}function x(e,t){let n=b(t);return n.includes(e)?e:n[0]}function S(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function C(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(S(t))return t;t=t.parentElement}return null}function w(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function T(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function E({profileId:u,currentUserId:d,isMine:S,renderMode:E,className:D,children:O}){let k=_(`components.pages.profile`),A=m(null),j=l(e=>e.open),M=n(e=>e.userId),N=b(S),[
|
|
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{Box as r}from"../../../../ui/box.mjs";import{EmptyState as i}from"../../../../ui/empty.mjs";import{Text as a}from"../../../../ui/text.mjs";import{Tabs as o,TabsList as s,TabsTrigger as c}from"../../../../ui/tabs.mjs";import{useLoginModalStore as l}from"../../../../../store/modules/login-modal-store.mjs";import{profileMainMineTabOptions as u,profileMainProfileTabOptions as d}from"./variants.mjs";import{useEffect as f,useMemo as p,useRef as m}from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{useTranslations as _}from"next-intl";import{parseAsString as v,useQueryState as y}from"nuqs";function b(e){return e?[...u]:[...d]}function x(e,t){let n=b(t);return n.includes(e)?e:n[0]}function S(e){let t=window.getComputedStyle(e);return/auto|scroll|overlay/.test(t.overflowY)}function C(e){if(typeof window>`u`)return null;let t=e?.parentElement??null;for(;t;){if(S(t))return t;t=t.parentElement}return null}function w(e){return typeof window>`u`?0:e?e.scrollTop:window.scrollY||window.pageYOffset||0}function T(e,t){if(!(typeof window>`u`)){if(e){e.scrollTo({top:t});return}window.scrollTo({top:t,left:0})}}function E({profileId:u,currentUserId:d,isMine:S,renderMode:E,className:D,children:O}){let k=_(`components.pages.profile`),A=m(null),j=l(e=>e.open),M=n(e=>e.userId),N=m(``),P=b(S),[F,I]=y(`tab`,v.withDefault(`collect`)),L=p(()=>x(F,S),[S,F]),R=d||M||``,z=S?R:u,B=p(()=>`profile-scroll:${z||(S?`mine`:`guest`)}:${L}`,[S,L,z]);f(()=>{F!==L&&I(L,{shallow:!1})},[L,I,F]),f(()=>{if(typeof window>`u`)return;let e=`${S?`mine`:`profile`}:${z||``}:${L}`;N.current!==e&&(N.current=e,window.WebSDK?.track?.({event:`recommend_list_click`,payload:{page_type:S?`mine`:`profile`,profile_id:u||z||``,current_user_id:R,tab:L,page_source:window.location?.pathname||``}}))},[S,u,R,L,z]),f(()=>{if(typeof window>`u`)return;let e=C(A.current),t=window.sessionStorage.getItem(B),n=t?Number(t):0;Number.isFinite(n)&&n>0&&requestAnimationFrame(()=>{T(e,n)});let r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{window.sessionStorage.setItem(B,String(w(e))),r=!1}))};return e?(e.addEventListener(`scroll`,i,{passive:!0}),()=>{e.removeEventListener(`scroll`,i)}):(window.addEventListener(`scroll`,i,{passive:!0}),()=>{window.removeEventListener(`scroll`,i)})},[B]);let V={collect:k(`client.collect`),like:k(`client.like`),history:k(`client.history`)},H=O;return E===`login-required`?H=g(r,{className:`flex gap-4 flex-col items-center justify-center py-10 text-center`,children:[h(a,{className:`text-base text-text1`,children:k(`client.loginToView`)}),h(t,{size:`lg`,variant:`secondary`,onClick:j,children:k(`client.loginNow`)})]}):E===`privacy-collect`?H=h(i,{type:`no-content`,text:k(`client.collectionNotPublic`)}):E===`privacy-like`&&(H=h(i,{type:`no-content`,text:k(`client.likeNotPublic`)})),g(r,{ref:A,className:e(D),children:[h(r,{className:`border-b bg-bg1 sticky z-10 top-0 border-text1/5 h-10`,children:h(o,{value:L,onValueChange:e=>{I(e,{shallow:!1})},className:`w-fit`,children:h(s,{variant:`default`,className:`inline-flex h-9`,children:P.map(e=>h(c,{value:e,className:`p-2.5 !text-base !w-fit data-active:!text-lg data-active:font-bold`,children:V[e]},e))})})}),h(r,{className:`p-2`,children:H})]})}export{E as UserProfileMainShell};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
//#region components/common/analytics-init/analytics-init.d.ts
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
WebSDK?: {
|
|
6
|
+
init: (options?: Record<string, unknown>) => unknown;
|
|
7
|
+
track: (event: {
|
|
8
|
+
event: string;
|
|
9
|
+
payload?: Record<string, unknown>;
|
|
10
|
+
}) => Promise<unknown>;
|
|
11
|
+
flush: () => Promise<unknown>;
|
|
12
|
+
};
|
|
13
|
+
__funhubWebSdkLoader?: Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 在应用根部初始化埋点 SDK。
|
|
18
|
+
*/
|
|
19
|
+
declare function AnalyticsInit(): null;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { AnalyticsInit };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import{useUserStore as e}from"../../../store/modules/user-store.mjs";import{useEffect as t,useRef as n}from"react";const r=`funhub-web-sdk-script`;function i(e){return{appId:process.env.NEXT_PUBLIC_TRACK_APP_ID||`1`,uid:e||``,channel:process.env.NEXT_PUBLIC_TRACK_CHANNEL||`test`,domain:process.env.NEXT_PUBLIC_TRACK_DOMAIN||`https://api.shuifeng.cc`,prod:process.env.NODE_ENV===`production`}}function a(){return typeof window>`u`||window.WebSDK?Promise.resolve():(window.__funhubWebSdkLoader||(window.__funhubWebSdkLoader=new Promise((e,t)=>{let n=document.getElementById(r);if(n){n.addEventListener(`load`,()=>e(),{once:!0}),n.addEventListener(`error`,()=>t(Error(`load web sdk failed`)),{once:!0});return}let i=document.createElement(`script`);i.id=r,i.async=!0,i.src=`/web-sdk-v1.js`,i.onload=()=>e(),i.onerror=()=>t(Error(`load web sdk failed`)),document.head.appendChild(i)})),window.__funhubWebSdkLoader)}function o(){let r=e(e=>e.userId),o=n(``);return t(()=>{let e=!1;async function t(){if(await a(),e||!window.WebSDK?.init)return;let t=i(r),n=JSON.stringify(t);n!==o.current&&(window.WebSDK.init(t),o.current=n)}return t(),()=>{e=!0}},[r]),null}export{o as AnalyticsInit};
|
|
@@ -157,7 +157,6 @@ import e from"../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-
|
|
|
157
157
|
.style-module_videoBox__4Gmdw .xgplayer-error .xgplayer-error-text {
|
|
158
158
|
position: relative;
|
|
159
159
|
color: transparent;
|
|
160
|
-
width: 300px;
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
.style-module_videoBox__4Gmdw .xgplayer-error .xgplayer-error-text::after {
|
|
@@ -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`)]}),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};
|
|
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] caret-transparent`}),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{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 te,DrawerHeader as ne,DrawerTitle as u}from"../../../ui/drawer.mjs";import{Text as d}from"../../../ui/text.mjs";import f from"../../../ui/legacy/button.mjs";import{HeaderNav as re}from"../../../common/header-nav/client.mjs";import{EyeIcon as p}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as m}from"../../../../assets/icons/eye-off-icon.mjs";import h from"../../../ui/legacy/input.mjs";import{useEffect as g,useMemo as _,useRef 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 ie}from"next-intl";function ae(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function C(C){let w=ie(`components.pages.settings.components`),{open:oe,onOpenChange:T}=C,E=n(e=>e.userInfo),[D,O]=y([,,,,,,].fill(``)),[k,A]=y(0),j=v(null),M=D.includes(``),[N,P]=y(``),F=v(null),[se,I]=y(60),[L,R]=y(!1),z=_(()=>ae(E?.email||``),[E?.email]);async function B(){if(L)return;let e=S.loading(w(`resetPasswordDrawer.sending`));try{let t=await i({user_id:E?.user_id});t.code===0?(S.success(w(`resetPasswordDrawer.codeSentSuccess`),{id:e}),R(!0),I(60),P(``)):S.error(t.message||w(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),S.error(w(`resetPasswordDrawer.sendFailed`),{id:e})}}function V(){W(e=>e===1?e:e+1)}async function H(){let e=S.loading(w(`resetPasswordDrawer.verifying`));try{P(``);let t=await a({user_id:E?.user_id,email_code:D.join(``)});t.code===0?(S.success(w(`resetPasswordDrawer.verifySuccess`),{id:e}),V()):(P(t.message||w(`resetPasswordDrawer.verifyFailed`)),S.error(t.message||w(`resetPasswordDrawer.verifyFailed`),{id:e}))}catch(t){console.error(t),P(w(`resetPasswordDrawer.verifyFailed`)),S.error(w(`resetPasswordDrawer.verifyFailed`),{id:e})}}g(()=>{if(L)return F.current=setInterval(()=>{I(e=>e<=1?(F.current&&clearInterval(F.current),R(!1),60):e-1)},1e3),()=>{F.current&&clearInterval(F.current)}},[L]);let[U,W]=y(0);g(()=>{U===0&&j.current?.focus()},[U]);let[G,K]=y({password:``,confirmPassword:``}),[q,J]=y(!1),[Y,ce]=y(!1),[X,le]=y(!1),Z=_(()=>ee(G.password,G.confirmPassword),[G.password,G.confirmPassword]),Q=_(()=>o(Z),[Z]),$=_(()=>q||G.password.length===0||G.confirmPassword.length===0||Z.type!==`none`,[q,G.password.length,G.confirmPassword.length,Z.type]);async function ue(){if($)return;let e=S.loading(w(`resetPasswordDrawer.submitting`));try{J(!0);let n=await r({user_id:E?.user_id,password:t(G.password)});n.code===0?(S.success(w(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),K({password:``,confirmPassword:``}),O([,,,,,,].fill(``)),A(0),T(!1)):S.error(n.message||w(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),S.error(w(`resetPasswordDrawer.resetFailed`),{id:e})}finally{J(!1)}}function de(e){let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...D],r=t.split(``),i=k;for(let e of r){if(i>=6)break;n[i]=e,i+=1}O(n),A(Math.min(i,5)),N&&P(``)}function fe(e){if(e.key===`Backspace`){e.preventDefault();let t=[...D];t[k]?t[k]=``:k>0&&(t[k-1]=``,A(k-1)),O(t),N&&P(``);return}e.key===`ArrowLeft`&&k>0&&A(k-1),e.key===`ArrowRight`&&k<5&&A(k+1)}function pe(e){A(e),j.current?.focus()}let me=x(s,{className:`p-6`,children:[x(s,{className:`space-y-[12px]`,children:[b(d,{className:`text-[24px] leading-[32px] font-bold text-text1`,children:`请输入验证码`}),x(s,{className:`flex items-center justify-between gap-[8px]`,children:[x(d,{className:`min-w-0 flex-1 truncate text-[12px] leading-[16px] text-text2`,children:[w(`resetPasswordDrawer.boundEmailNotice`),b(d,{className:`dark:text-white text-white`,children:z}),w(`resetPasswordDrawer.verifyHint`)]}),b(e,{variant:`link`,disabled:L,onClick:B,className:`h-auto shrink-0 rounded-[10px] bg-line1 px-[10px] py-[4px] text-[10px] leading-[12px] text-text1 no-underline hover:no-underline disabled:opacity-60`,children:L?`${w(`resetPasswordDrawer.sendCode`)} (${se}s)`:w(`resetPasswordDrawer.sendCode`)})]})]}),x(s,{className:`mt-[28px]`,children:[x(s,{className:`relative`,children:[b(`input`,{ref:j,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:de,onKeyDown:fe,className:`absolute inset-0 h-full w-full opacity-0 pointer-events-none`,autoComplete:`one-time-code`}),b(s,{className:`flex justify-between gap-[10px]`,children:D.map((e,t)=>b(s,{onClick:()=>pe(t),className:`
|
|
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 te,DrawerHeader as ne,DrawerTitle as u}from"../../../ui/drawer.mjs";import{Text as d}from"../../../ui/text.mjs";import f from"../../../ui/legacy/button.mjs";import{HeaderNav as re}from"../../../common/header-nav/client.mjs";import{EyeIcon as p}from"../../../../assets/icons/eye-icon.mjs";import{EyeOffIcon as m}from"../../../../assets/icons/eye-off-icon.mjs";import h from"../../../ui/legacy/input.mjs";import{useEffect as g,useMemo as _,useRef 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 ie}from"next-intl";function ae(e){let[t,n]=e.split(`@`);return!t||!n?e:`${t.slice(0,3)}***${t.length>3?t.slice(-1):``}@${n}`}function C(C){let w=ie(`components.pages.settings.components`),{open:oe,onOpenChange:T}=C,E=n(e=>e.userInfo),[D,O]=y([,,,,,,].fill(``)),[k,A]=y(0),j=v(null),M=D.includes(``),[N,P]=y(``),F=v(null),[se,I]=y(60),[L,R]=y(!1),z=_(()=>ae(E?.email||``),[E?.email]);async function B(){if(L)return;let e=S.loading(w(`resetPasswordDrawer.sending`));try{let t=await i({user_id:E?.user_id});t.code===0?(S.success(w(`resetPasswordDrawer.codeSentSuccess`),{id:e}),R(!0),I(60),P(``)):S.error(t.message||w(`resetPasswordDrawer.sendFailed`),{id:e})}catch(t){console.error(t),S.error(w(`resetPasswordDrawer.sendFailed`),{id:e})}}function V(){W(e=>e===1?e:e+1)}async function H(){let e=S.loading(w(`resetPasswordDrawer.verifying`));try{P(``);let t=await a({user_id:E?.user_id,email_code:D.join(``)});t.code===0?(S.success(w(`resetPasswordDrawer.verifySuccess`),{id:e}),V()):(P(t.message||w(`resetPasswordDrawer.verifyFailed`)),S.error(t.message||w(`resetPasswordDrawer.verifyFailed`),{id:e}))}catch(t){console.error(t),P(w(`resetPasswordDrawer.verifyFailed`)),S.error(w(`resetPasswordDrawer.verifyFailed`),{id:e})}}g(()=>{if(L)return F.current=setInterval(()=>{I(e=>e<=1?(F.current&&clearInterval(F.current),R(!1),60):e-1)},1e3),()=>{F.current&&clearInterval(F.current)}},[L]);let[U,W]=y(0);g(()=>{U===0&&j.current?.focus()},[U]);let[G,K]=y({password:``,confirmPassword:``}),[q,J]=y(!1),[Y,ce]=y(!1),[X,le]=y(!1),Z=_(()=>ee(G.password,G.confirmPassword),[G.password,G.confirmPassword]),Q=_(()=>o(Z),[Z]),$=_(()=>q||G.password.length===0||G.confirmPassword.length===0||Z.type!==`none`,[q,G.password.length,G.confirmPassword.length,Z.type]);async function ue(){if($)return;let e=S.loading(w(`resetPasswordDrawer.submitting`));try{J(!0);let n=await r({user_id:E?.user_id,password:t(G.password)});n.code===0?(S.success(w(`resetPasswordDrawer.passwordResetSuccess`),{id:e}),K({password:``,confirmPassword:``}),O([,,,,,,].fill(``)),A(0),T(!1)):S.error(n.message||w(`resetPasswordDrawer.resetFailed`),{id:e})}catch(t){console.error(t),S.error(w(`resetPasswordDrawer.resetFailed`),{id:e})}finally{J(!1)}}function de(e){let t=e.target.value.replace(/\D/g,``);if(t.length===0)return;let n=[...D],r=t.split(``),i=k;for(let e of r){if(i>=6)break;n[i]=e,i+=1}O(n),A(Math.min(i,5)),N&&P(``)}function fe(e){if(e.key===`Backspace`){e.preventDefault();let t=[...D];t[k]?t[k]=``:k>0&&(t[k-1]=``,A(k-1)),O(t),N&&P(``);return}e.key===`ArrowLeft`&&k>0&&A(k-1),e.key===`ArrowRight`&&k<5&&A(k+1)}function pe(e){A(e),j.current?.focus()}let me=x(s,{className:`p-6`,children:[x(s,{className:`space-y-[12px]`,children:[b(d,{className:`text-[24px] leading-[32px] font-bold text-text1`,children:`请输入验证码`}),x(s,{className:`flex items-center justify-between gap-[8px]`,children:[x(d,{className:`min-w-0 flex-1 truncate text-[12px] leading-[16px] text-text2`,children:[w(`resetPasswordDrawer.boundEmailNotice`),b(d,{className:`dark:text-white text-white`,children:z}),w(`resetPasswordDrawer.verifyHint`)]}),b(e,{variant:`link`,disabled:L,onClick:B,className:`h-auto shrink-0 rounded-[10px] bg-line1 px-[10px] py-[4px] text-[10px] leading-[12px] text-text1 no-underline hover:no-underline disabled:opacity-60`,children:L?`${w(`resetPasswordDrawer.sendCode`)} (${se}s)`:w(`resetPasswordDrawer.sendCode`)})]})]}),x(s,{className:`mt-[28px]`,children:[x(s,{className:`relative`,children:[b(`input`,{ref:j,type:`text`,inputMode:`numeric`,pattern:`[0-9]*`,value:``,onChange:de,onKeyDown:fe,className:`absolute inset-0 h-full w-full opacity-0 pointer-events-none caret-transparent`,autoComplete:`one-time-code`}),b(s,{className:`flex justify-between gap-[10px]`,children:D.map((e,t)=>b(s,{onClick:()=>pe(t),className:`
|
|
3
3
|
h-[48px] flex-1 rounded-[6px] border-2 flex items-center justify-center cursor-pointer transition-all duration-200
|
|
4
4
|
${N?`border-theme5 bg-line1`:t===k?`border-theme3 bg-theme3/10`:`border-transparent bg-line1`}
|
|
5
5
|
`,children:b(d,{className:`text-[24px] leading-none font-semibold text-text1 select-none`,children:e})},`${t}-${e||`empty`}`))})]}),b(s,{className:`min-h-[22px] pt-[8px]`,children:b(d,{className:`text-[12px] leading-[18px] text-theme5`,children:N})}),b(f,{onClick:H,disabled:M,className:`mt-[180px] 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:`提交`})]})]}),he=x(s,{className:`p-6`,children:[b(s,{children:b(d,{className:`text-text2`,children:w(`resetPasswordDrawer.setNewPasswordHint`)})}),x(s,{className:`mt-6 space-y-6`,children:[x(s,{className:`flex relative items-center px-2 rounded-[50px] h-16.5 bg-line1 border ${Q?`border-theme5`:`border-line1`}`,children:[b(h,{value:G.password,onChange:e=>K(t=>({...t,password:e})),placeholder:w(`resetPasswordDrawer.passwordPlaceholder`),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`}),b(`button`,{type:`button`,onClick:()=>ce(!Y),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:b(Y?m:p,{className:`w-5 h-5`})})]}),x(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:[b(h,{value:G.confirmPassword,onChange:e=>K(t=>({...t,confirmPassword:e})),placeholder:w(`resetPasswordDrawer.confirmPasswordPlaceholder`),type:X?`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`}),b(`button`,{type:`button`,onClick:()=>le(!X),className:`absolute right-4 top-1/2 -translate-y-1/2 text-text2 hover:text-text1 transition-colors`,children:b(X?m:p,{className:`w-5 h-5`})})]}),Q?b(s,{children:b(d,{className:`min-h-[22px] text-[14px] text-theme5 px-[12px]`,children:Q})}):null,b(f,{onClick:ue,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:w(q?`resetPasswordDrawer.submitting`:`resetPasswordDrawer.resetPassword`)})]})]});return x(c,{open:oe,onOpenChange:T,direction:`right`,handleOnly:!0,children:[x(ne,{className:`hidden`,children:[b(u,{children:w(`resetPasswordDrawer.title`)}),b(te,{children:w(`resetPasswordDrawer.title`)})]}),x(l,{className:`!w-full`,children:[b(re,{onBack:()=>T(!1),title:w(`resetPasswordDrawer.title`)}),U===0&&me,U===1&&he]})]})}export{C 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?: "
|
|
9
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,8 +7,8 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
11
|
-
size?: "default" | "
|
|
10
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
11
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import
|
|
4
|
+
import NextImage from "next/image";
|
|
5
5
|
|
|
6
6
|
//#region components/ui/image.d.ts
|
|
7
7
|
/** BaseImageProps 属性定义。 */
|
|
8
|
-
type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof
|
|
8
|
+
type BaseImageProps = Omit<React.ComponentPropsWithoutRef<typeof NextImage>, '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
|
|
30
|
+
declare function Image(props: ImageProps): react_jsx_runtime0.JSX.Element;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { BaseImageProps, CommonImageProps, Image
|
|
32
|
+
export { BaseImageProps, CommonImageProps, Image, ImageProps, ImagePropsWithFill, ImagePropsWithSize };
|