退役旧创作模板业务并保留数据壳
保留 SpacetimeDB 历史表、迁移白名单与最小兼容读取定义 移除旧创作前后端、worker、业务过程及纯业务 crate 的编译依赖 恢复现役创作、项目、我的入口及桌面移动导航 收紧 Vite、TypeScript、ESLint、Vitest 与静态资源退役边界 补齐开发栈、网关、原生壳和文档退役约束
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
} from './platformActiveProfileModel';
|
||||
import { PlatformActiveProfileView } from './PlatformActiveProfileView';
|
||||
import type { PlatformEntryFlowShellProps } from './platformEntryActiveTypes';
|
||||
import { usePlatformDesktopLayout } from './platformEntryResponsive';
|
||||
import { PlatformProfileApiKeysModal } from './PlatformProfileApiKeysModal';
|
||||
import { PlatformProfileRechargeModal } from './PlatformProfileRechargeModal';
|
||||
import { PlatformProfileReferralModal } from './PlatformProfileReferralModal';
|
||||
@@ -95,6 +96,37 @@ function ActiveRailButton({
|
||||
);
|
||||
}
|
||||
|
||||
function ActiveBottomNavButton({
|
||||
active,
|
||||
emphasized = false,
|
||||
icon: Icon,
|
||||
label,
|
||||
onClick,
|
||||
}: Omit<ActiveRailButtonProps, 'iconSrc'>) {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
aria-current={active ? 'page' : undefined}
|
||||
aria-label={label}
|
||||
className={`platform-bottom-nav__button ${emphasized ? 'platform-bottom-nav__button--primary' : ''} ${active ? 'platform-bottom-nav__button--active' : ''}`}
|
||||
onClick={onClick}
|
||||
>
|
||||
<span className="platform-bottom-nav__button-content">
|
||||
<span className="platform-bottom-nav__icon-shell">
|
||||
<Icon className="platform-bottom-nav__icon" aria-hidden="true" />
|
||||
</span>
|
||||
<span className="platform-bottom-nav__label">{label}</span>
|
||||
{active ? (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className="platform-bottom-nav__active-mark"
|
||||
/>
|
||||
) : null}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
function ActivePlatformBrand() {
|
||||
return (
|
||||
<span
|
||||
@@ -138,10 +170,10 @@ export function PlatformEntryFlowShellImpl({
|
||||
null,
|
||||
);
|
||||
const [isLoadingDashboard, setIsLoadingDashboard] = useState(false);
|
||||
const [isProfileStage, setIsProfileStage] = useState(false);
|
||||
const [isApiKeysOpen, setIsApiKeysOpen] = useState(false);
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [activeSearchKeyword, setActiveSearchKeyword] = useState('');
|
||||
const isDesktopLayout = usePlatformDesktopLayout();
|
||||
|
||||
const refreshDashboard = useCallback(async () => {
|
||||
if (!authUi?.user || !authUi.canAccessProtectedData) {
|
||||
@@ -162,14 +194,10 @@ export function PlatformEntryFlowShellImpl({
|
||||
void refreshDashboard();
|
||||
}, [refreshDashboard]);
|
||||
|
||||
useEffect(() => {
|
||||
if (selectionStage !== 'platform') {
|
||||
setIsProfileStage(false);
|
||||
}
|
||||
}, [selectionStage]);
|
||||
const isProfileStage = selectionStage === 'profile';
|
||||
|
||||
const profileCenter = usePlatformProfileCenterController({
|
||||
activeTab: 'project',
|
||||
activeTab: isProfileStage ? 'profile' : 'project',
|
||||
isAuthenticated: Boolean(authUi?.user),
|
||||
showRechargeEntry: true,
|
||||
onRechargeSuccess: refreshDashboard,
|
||||
@@ -178,21 +206,18 @@ export function PlatformEntryFlowShellImpl({
|
||||
});
|
||||
|
||||
const openCreation = useCallback(() => {
|
||||
setIsProfileStage(false);
|
||||
pushAppHistoryPath('/creation');
|
||||
setSelectionStage('creation-home', { path: '/creation' });
|
||||
}, [setSelectionStage]);
|
||||
|
||||
const openProjects = useCallback(() => {
|
||||
setIsProfileStage(false);
|
||||
pushAppHistoryPath('/project');
|
||||
setSelectionStage('project', { path: '/project' });
|
||||
}, [setSelectionStage]);
|
||||
|
||||
const openProfile = useCallback(() => {
|
||||
setIsProfileStage(true);
|
||||
pushAppHistoryPath('/');
|
||||
setSelectionStage('platform', { path: '/' });
|
||||
pushAppHistoryPath('/profile');
|
||||
setSelectionStage('profile', { path: '/profile' });
|
||||
}, [setSelectionStage]);
|
||||
|
||||
const openEditorProject = useCallback(
|
||||
@@ -269,7 +294,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
<div
|
||||
className={`flex h-full min-h-0 min-w-0 flex-col overflow-hidden ${isCreationStage ? 'creation-home-stage--landing' : ''}`}
|
||||
>
|
||||
<div className="platform-desktop-shell platform-desktop-shell--workbench flex h-full min-h-0 flex-col">
|
||||
<div className="platform-desktop-shell platform-desktop-shell--workbench platform-mobile-entry-shell flex h-full min-h-0 flex-col">
|
||||
<div className="platform-desktop-layout flex min-h-0 flex-1">
|
||||
<aside className="platform-desktop-leftbar hidden shrink-0 flex-col lg:flex">
|
||||
<ActivePlatformBrand />
|
||||
@@ -303,8 +328,8 @@ export function PlatformEntryFlowShellImpl({
|
||||
</aside>
|
||||
|
||||
<div className="platform-desktop-main flex min-w-0 flex-1 flex-col">
|
||||
<header className="platform-desktop-topbar flex min-h-16 shrink-0 items-center justify-between gap-3 px-4 sm:px-6">
|
||||
<div className="min-w-0 lg:hidden">
|
||||
<header className="platform-desktop-topbar flex min-h-16 shrink-0 items-center justify-between gap-1 px-4 sm:gap-3 sm:px-6">
|
||||
<div className="min-w-0 shrink-0 lg:hidden">
|
||||
<ActivePlatformBrand />
|
||||
</div>
|
||||
<div className="platform-desktop-topbar__brand-search hidden min-w-0 flex-1 items-center lg:flex">
|
||||
@@ -343,10 +368,10 @@ export function PlatformEntryFlowShellImpl({
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div className="platform-desktop-topbar__actions flex shrink-0 items-center gap-3">
|
||||
<div className="platform-desktop-topbar__actions flex shrink-0 items-center gap-1 sm:gap-2 lg:gap-3">
|
||||
{isAuthenticated ? (
|
||||
<PlatformMudPointWalletEntry
|
||||
variant="desktop"
|
||||
variant={isDesktopLayout ? 'desktop' : 'mobile'}
|
||||
balance={balance}
|
||||
breakdown={
|
||||
profileCenter.rechargeCenter?.mudPointBalance ?? null
|
||||
@@ -356,7 +381,11 @@ export function PlatformEntryFlowShellImpl({
|
||||
profileCenter.isLoadingRechargeCenter
|
||||
}
|
||||
error={profileCenter.rechargeError}
|
||||
className="platform-desktop-create-wallet-chip"
|
||||
className={
|
||||
isDesktopLayout
|
||||
? 'platform-desktop-create-wallet-chip'
|
||||
: 'platform-mobile-create-wallet-chip'
|
||||
}
|
||||
onRequestDetails={profileCenter.loadRechargeCenter}
|
||||
onRecharge={openRecharge}
|
||||
onOpenLedger={profileCenter.openWalletLedgerPanel}
|
||||
@@ -365,7 +394,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
<button
|
||||
type="button"
|
||||
onClick={openUserSurface}
|
||||
className="platform-desktop-search flex items-center gap-3 px-3 py-2.5 text-left"
|
||||
className="platform-account-entry platform-desktop-search flex items-center gap-1 px-1 py-1 text-left sm:gap-2 sm:px-2 lg:gap-3 lg:px-3 lg:py-2.5"
|
||||
>
|
||||
<span
|
||||
className="flex h-11 w-11 items-center justify-center overflow-hidden rounded-full text-base font-black text-white"
|
||||
@@ -384,7 +413,7 @@ export function PlatformEntryFlowShellImpl({
|
||||
avatarLabel
|
||||
)}
|
||||
</span>
|
||||
<span className="min-w-0">
|
||||
<span className="hidden min-w-0 sm:block">
|
||||
<span className="block truncate text-sm font-semibold text-[var(--platform-text-strong)]">
|
||||
{authUi?.user?.displayName || '登录'}
|
||||
</span>
|
||||
@@ -438,6 +467,32 @@ export function PlatformEntryFlowShellImpl({
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<div className="platform-mobile-bottom-dock min-w-0 shrink-0 lg:hidden">
|
||||
<nav
|
||||
className="platform-bottom-nav grid grid-cols-3"
|
||||
aria-label="移动平台导航"
|
||||
>
|
||||
<ActiveBottomNavButton
|
||||
active={isCreationStage}
|
||||
emphasized={isCreationStage}
|
||||
icon={Palette}
|
||||
label="创作"
|
||||
onClick={openCreation}
|
||||
/>
|
||||
<ActiveBottomNavButton
|
||||
active={selectionStage === 'project'}
|
||||
icon={FolderKanban}
|
||||
label="项目"
|
||||
onClick={openProjects}
|
||||
/>
|
||||
<ActiveBottomNavButton
|
||||
active={isProfileStage}
|
||||
icon={UserRound}
|
||||
label="我的"
|
||||
onClick={openProfile}
|
||||
/>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user