chore: migrate contexts to stores and refresh barrel exports
- Move state management from `src/contexts` to `src/stores` (zustand-based) - Update barrelsby config to include new stores directory - Add bottom-sheet and auth-background components - Auto-open browser on dev server ready in VS Code launch config - Refresh generated barrel index files
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
export * from "./auth-back-button";
|
||||
export * from "./bottom-sheet";
|
||||
export * from "./dialog";
|
||||
export * from "./loading-indicator";
|
||||
export * from "./mobile-shell";
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
export * from "./auth-background";
|
||||
export * from "./auth-divider";
|
||||
export * from "./auth-email-panel";
|
||||
export * from "./auth-error-message";
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import Image from "next/image";
|
||||
|
||||
import { useChatDispatch, useChatState } from "@/stores/chat/chat-context";
|
||||
import { GuestChatQuota } from "@/stores/chat/chat-types";
|
||||
import { GuestChatQuota } from "@/stores/chat";
|
||||
|
||||
import { MobileShell } from "@/app/_components/core/mobile-shell";
|
||||
|
||||
|
||||
@@ -1,35 +1,5 @@
|
||||
/**
|
||||
* Chat 公共组件导出
|
||||
* @file Automatically generated by barrelsby.
|
||||
*/
|
||||
|
||||
// 屏幕 + 顶层
|
||||
export { ChatScreen } from "./chat-screen";
|
||||
|
||||
// 顶部
|
||||
export { ChatHeader } from "./chat-header";
|
||||
|
||||
// 消息区
|
||||
export { ChatArea } from "./chat-area";
|
||||
|
||||
// 输入栏
|
||||
export { ChatInputBar } from "./chat-input-bar";
|
||||
export { ChatInputTextField } from "./chat-input-text-field";
|
||||
export { ChatSendButton } from "./chat-send-button";
|
||||
|
||||
// 消息气泡
|
||||
export { MessageBubble } from "./message-bubble";
|
||||
export { MessageContent } from "./message-content";
|
||||
export { MessageAvatar } from "./message-avatar";
|
||||
export { TextBubble } from "./text-bubble";
|
||||
export { ImageBubble } from "./image-bubble";
|
||||
export { LottieMessageBubble } from "./lottie-message-bubble";
|
||||
export { DateHeader } from "./date-header";
|
||||
export { FullscreenImageViewer } from "./fullscreen-image-viewer";
|
||||
|
||||
// 弹窗 / 浮层 / 卡片
|
||||
export { QuotaDialog } from "./quota-dialog";
|
||||
export { PwaInstallDialog } from "./pwa-install-dialog";
|
||||
export { PwaInstallOverlay } from "./pwa-install-overlay";
|
||||
export { BrowserHintOverlay } from "./browser-hint-overlay";
|
||||
export { AiDisclosureBanner } from "./ai-disclosure-banner";
|
||||
export { LanguageDialog, DEFAULT_LANGUAGES } from "./language-dialog";
|
||||
export * from "./index";
|
||||
|
||||
@@ -10,7 +10,6 @@ export * from "./http_client";
|
||||
export * from "./metrics_api";
|
||||
export * from "./response_helper";
|
||||
export * from "./user_api";
|
||||
export * from "../../../core/net/config/api_config";
|
||||
export * from "./interceptor/auth_refresh_interceptor";
|
||||
export * from "./interceptor/logging_interceptor";
|
||||
export * from "./interceptor/token_interceptor";
|
||||
|
||||
@@ -3,6 +3,4 @@
|
||||
*/
|
||||
|
||||
export * from "./browser-detect";
|
||||
export * from "../core/net/chat-websocket";
|
||||
export * from "./media-recorder";
|
||||
export * from "../core/net/message-queue";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* Auth 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 AuthState 接口、AuthEvent 联合、initialAuthState。
|
||||
* 状态机重构后:
|
||||
* - `AuthEvent` 联合由 `auth-events.ts` 导出
|
||||
* - Context 形状与初始值由 `auth-context.ts` 导出
|
||||
* - `AuthState` 由 `auth-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export type { AuthEvent } from "./auth-events";
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* @file Auth 公共导出
|
||||
* Auth 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - Context 形状与初始值位于 auth-context.ts
|
||||
* - 事件联合位于 auth-events.ts
|
||||
* - machine / 类型 / React 入口分别由对应文件导出
|
||||
* 重新导出 Auth store 的所有公共 API(state / events / machine / React Provider)。
|
||||
*/
|
||||
|
||||
export * from "./auth-state";
|
||||
export * from "./auth-context";
|
||||
export * from "./auth-events";
|
||||
export * from "./auth-machine";
|
||||
export * from "./auth-types";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Chat 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 ChatState 接口、ChatEvent 联合、initialChatState、GuestChatQuota。
|
||||
* 状态机重构后:
|
||||
* - `ChatEvent` 联合由 `chat-events.ts` 导出
|
||||
* - Context 形状与初始值由 `chat-context.ts` 导出
|
||||
* - `ChatState` 由 `chat-context.tsx` 导出(保持原 API 兼容)
|
||||
* - `GuestChatQuota` 仍由 `chat-machine.ts` 导出(业务常量,与上下文配对紧密)
|
||||
*/
|
||||
export type { ChatEvent } from "./chat-events";
|
||||
export { GuestChatQuota } from "./chat-machine";
|
||||
@@ -1,18 +1,10 @@
|
||||
/**
|
||||
* @file Chat 公共导出
|
||||
* Chat 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - 业务类(Dart 风格 context/reducer/side-effects)已合并到 chat-machine.ts
|
||||
* - 类型由 chat-types.ts 重新导出
|
||||
* - React 入口为 chat-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 chat-context.ts
|
||||
* - 事件联合位于 chat-events.ts
|
||||
*
|
||||
* 注:chat-side-effects.ts 暂未删除(其中 WebSocket 长生命周期逻辑
|
||||
* 待下一轮迁移到 fromCallback actor)。
|
||||
* 重新导出 Chat store 的所有公共 API(state / events / machine / React Provider + GuestChatQuota)。
|
||||
*/
|
||||
|
||||
export * from "./chat-state";
|
||||
export * from "./chat-context";
|
||||
export * from "./chat-events";
|
||||
export * from "./chat-types";
|
||||
export { chatMachine } from "./chat-machine";
|
||||
export * from "./chat-machine";
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
/**
|
||||
* @file Sidebar 公共导出
|
||||
* Sidebar 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - reducer 逻辑已合并到 sidebar-machine.ts
|
||||
* - 类型由 sidebar-types.ts 重新导出
|
||||
* - React 入口为 sidebar-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 sidebar-context.ts
|
||||
* - 事件联合位于 sidebar-events.ts
|
||||
* 重新导出 Sidebar store 的所有公共 API(state / events / machine / React Provider + SidebarPage / BottomNavItem)。
|
||||
*/
|
||||
|
||||
export * from "./sidebar-state";
|
||||
export * from "./sidebar-context";
|
||||
export * from "./sidebar-events";
|
||||
export * from "./sidebar-types";
|
||||
export { sidebarMachine } from "./sidebar-machine";
|
||||
export * from "./sidebar-machine";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Sidebar 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 SidebarPage、BottomNavItem、SidebarState、SidebarEvent。
|
||||
* 状态机重构后:
|
||||
* - 枚举(SidebarPage、BottomNavItem)由 `sidebar-machine.ts` 导出
|
||||
* - 事件联合(SidebarEvent)由 `sidebar-events.ts` 导出
|
||||
* - Context 形状由 `sidebar-context.ts` 导出
|
||||
* - SidebarState 由 `sidebar-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export { SidebarPage, BottomNavItem } from "./sidebar-machine";
|
||||
export type { SidebarEvent } from "./sidebar-events";
|
||||
@@ -1,15 +1,10 @@
|
||||
/**
|
||||
* @file User 公共导出
|
||||
* User 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - 业务类(Dart 风格 context/reducer/side-effects)已合并到 user-machine.ts
|
||||
* - 类型由 user-types.ts 重新导出
|
||||
* - React 入口为 user-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 user-context.ts
|
||||
* - 事件联合位于 user-events.ts
|
||||
* 重新导出 User store 的所有公共 API(state / events / machine / React Provider)。
|
||||
*/
|
||||
|
||||
export * from "./user-state";
|
||||
export * from "./user-context";
|
||||
export * from "./user-events";
|
||||
export * from "./user-types";
|
||||
export { userMachine } from "./user-machine";
|
||||
export * from "./user-machine";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* User 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 UserState 接口、UserEvent 联合、initialUserState。
|
||||
* 状态机重构后:
|
||||
* - `UserEvent` 联合由 `user-events.ts` 导出
|
||||
* - Context 形状与初始值由 `user-context.ts` 导出
|
||||
* - `UserState` 由 `user-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export type { UserEvent } from "./user-events";
|
||||
Reference in New Issue
Block a user