2026-03-09 21:29:03 +08:00
|
|
|
/**
|
|
|
|
|
* Hooks 导出
|
|
|
|
|
*/
|
|
|
|
|
|
refactor: restructure core architecture and responsive system
This commit implements a major architectural refactor to improve modularity, type safety, and maintainability across the codebase.
Key changes include:
- **Responsive System Refactor**: Migrated from a monolithic `useResponsive` hook to a set of specialized, granular hooks (`useBreakpoint`, `useOrientation`, `usePlatform`, etc.) located in `src/presentation/hooks/responsive`. This reduces unnecessary re-renders and improves developer experience.
- **Core Service Restructuring**: Introduced a new directory structure for services, including dedicated folders for `datasources`, `mappers`, and domain-specific types (`message`, `post`).
- **Data Layer Improvements**:
- Centralized JSON parsing logic in `src/database/core/jsonUtils.ts`.
- Cleaned up repository implementations by removing redundant local utility functions.
- Refactored `MessageMapper` to use the new centralized JSON utility.
- **Type System Cleanup**:
- Decomposed the large `src/types/dto.ts` into a modular `src/types/dto/` directory.
- Simplified `src/types/index.ts` and introduced backward-compatible aliases for core entities.
- **Utility Consolidation**:
- Created a centralized `src/utils/formatTime.ts` to replace fragmented date formatting logic across various screens and components.
- Removed deprecated responsive utility files in favor of the new hook-based system.
- **Service Logic Refinement**: Refactored `ApiClient` and `WebSocketService` to use a centralized `showVerificationModal` service, removing duplicated state management for verification prompts.
2026-05-05 19:07:33 +08:00
|
|
|
// ==================== 响应式 Hooks ====================
|
2026-03-09 21:29:03 +08:00
|
|
|
export {
|
2026-03-18 12:11:49 +08:00
|
|
|
useBreakpoint,
|
2026-03-09 21:29:03 +08:00
|
|
|
useBreakpointGTE,
|
2026-03-18 12:11:49 +08:00
|
|
|
useScreenSize,
|
|
|
|
|
useWindowDimensions,
|
|
|
|
|
useOrientation,
|
2026-03-09 21:29:03 +08:00
|
|
|
usePlatform,
|
2026-03-18 12:11:49 +08:00
|
|
|
useResponsiveValue,
|
2026-03-09 21:29:03 +08:00
|
|
|
useColumnCount,
|
|
|
|
|
useResponsiveSpacing,
|
2026-03-18 12:11:49 +08:00
|
|
|
useResponsive,
|
|
|
|
|
getBreakpoint,
|
|
|
|
|
getFineBreakpoint,
|
2026-03-09 21:29:03 +08:00
|
|
|
isBreakpointGTE,
|
|
|
|
|
isBreakpointLT,
|
2026-03-18 12:11:49 +08:00
|
|
|
isBreakpointBetween,
|
|
|
|
|
BREAKPOINTS,
|
|
|
|
|
FINE_BREAKPOINTS,
|
|
|
|
|
} from '../presentation/hooks/responsive';
|
|
|
|
|
|
2026-03-09 21:29:03 +08:00
|
|
|
export type {
|
|
|
|
|
BreakpointKey,
|
|
|
|
|
FineBreakpointKey,
|
2026-03-18 12:11:49 +08:00
|
|
|
BreakpointValue,
|
2026-03-09 21:29:03 +08:00
|
|
|
ResponsiveValue,
|
2026-03-18 12:11:49 +08:00
|
|
|
Orientation,
|
|
|
|
|
PlatformInfo,
|
|
|
|
|
ScreenSize,
|
|
|
|
|
MediaQueryOptions,
|
|
|
|
|
ResponsiveInfo,
|
|
|
|
|
} from '../presentation/hooks/responsive';
|
|
|
|
|
|
|
|
|
|
// ==================== 其他 Hooks ====================
|
2026-03-09 21:29:03 +08:00
|
|
|
export {
|
|
|
|
|
usePrefetch,
|
|
|
|
|
prefetchPosts,
|
|
|
|
|
prefetchConversations,
|
|
|
|
|
prefetchUserInfo,
|
|
|
|
|
prefetchOnAppLaunch,
|
|
|
|
|
prefetchMessageScreen,
|
|
|
|
|
prefetchHomeScreen,
|
|
|
|
|
} from './usePrefetch';
|
2026-03-18 23:05:28 +08:00
|
|
|
|
|
|
|
|
// ==================== 分页 Hooks ====================
|
|
|
|
|
export {
|
|
|
|
|
usePagination,
|
|
|
|
|
usePaginationManager,
|
|
|
|
|
} from './usePagination';
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
UsePaginationOptions,
|
|
|
|
|
UsePaginationReturn,
|
|
|
|
|
} from './usePagination';
|
|
|
|
|
|
2026-03-20 23:00:27 +08:00
|
|
|
// ==================== 游标分页 Hooks ====================
|
|
|
|
|
export { useCursorPagination } from './useCursorPagination';
|
|
|
|
|
|
2026-03-18 23:05:28 +08:00
|
|
|
// ==================== 连接状态 Hooks ====================
|
|
|
|
|
export { useConnectionState } from './useConnectionState';
|
|
|
|
|
|
|
|
|
|
export type { UseConnectionStateResult } from './useConnectionState';
|
|
|
|
|
|
|
|
|
|
// ==================== 媒体缓存 Hooks ====================
|
|
|
|
|
export { useMediaCache } from './useMediaCache';
|
|
|
|
|
|
|
|
|
|
export type { UseMediaCacheReturn } from './useMediaCache';
|
refactor: migrate post operations to use case architecture with differential updates
Migrate post-related operations from direct service/store calls to a new use case architecture featuring differential updates. Key changes include: (1) introduce ProcessPostUseCase to handle like, unlike, favorite, unfavorite, delete, and fetch operations with proper state management, (2) add useDifferentialPosts hook for efficient list rendering with minimal re-renders, (3) add PostDiffCalculator and PostUpdateBatcher in infrastructure layer for incremental updates, (4) deprecate NotificationItem component in favor of SystemMessageItem, (5) remove deprecated interactive methods from userStore, (6) add posts_cache table to local datasource, (7) clean up legacy MessageDTO and ConversationDTO types, (8) remove deprecated hook useBreakpointCheck, (9) refactor MessageBubble to use measureInWindow directly for better React Native compatibility
2026-03-21 20:55:36 +08:00
|
|
|
|
2026-06-12 23:42:09 +08:00
|
|
|
// ==================== 推送设备注册 Hook ====================
|
|
|
|
|
export { useRegisterPushDevice } from './useRegisterPushDevice';
|
|
|
|
|
|
refactor: migrate post operations to use case architecture with differential updates
Migrate post-related operations from direct service/store calls to a new use case architecture featuring differential updates. Key changes include: (1) introduce ProcessPostUseCase to handle like, unlike, favorite, unfavorite, delete, and fetch operations with proper state management, (2) add useDifferentialPosts hook for efficient list rendering with minimal re-renders, (3) add PostDiffCalculator and PostUpdateBatcher in infrastructure layer for incremental updates, (4) deprecate NotificationItem component in favor of SystemMessageItem, (5) remove deprecated interactive methods from userStore, (6) add posts_cache table to local datasource, (7) clean up legacy MessageDTO and ConversationDTO types, (8) remove deprecated hook useBreakpointCheck, (9) refactor MessageBubble to use measureInWindow directly for better React Native compatibility
2026-03-21 20:55:36 +08:00
|
|
|
// ==================== 差异更新 Hooks ====================
|
|
|
|
|
export { useDifferentialMessages } from './useDifferentialMessages';
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
UseDifferentialMessagesOptions,
|
|
|
|
|
UseDifferentialMessagesResult,
|
|
|
|
|
} from './useDifferentialMessages';
|
|
|
|
|
|
|
|
|
|
export { useDifferentialPosts } from './useDifferentialPosts';
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
UseDifferentialPostsOptions,
|
|
|
|
|
UseDifferentialPostsResult,
|
|
|
|
|
DiffUpdatesInfo,
|
|
|
|
|
} from './useDifferentialPosts';
|
2026-04-11 22:35:11 +08:00
|
|
|
|
|
|
|
|
// ==================== 平台键盘 Hooks ====================
|
|
|
|
|
export {
|
|
|
|
|
usePlatformKeyboard,
|
|
|
|
|
useKeyboardAvoidingProps,
|
|
|
|
|
useKeyboardListener,
|
|
|
|
|
} from './usePlatformKeyboard';
|
|
|
|
|
|
|
|
|
|
export type {
|
|
|
|
|
KeyboardEventType,
|
|
|
|
|
PlatformKeyboardOptions,
|
|
|
|
|
PlatformKeyboardResult,
|
refactor: restructure core architecture and responsive system
This commit implements a major architectural refactor to improve modularity, type safety, and maintainability across the codebase.
Key changes include:
- **Responsive System Refactor**: Migrated from a monolithic `useResponsive` hook to a set of specialized, granular hooks (`useBreakpoint`, `useOrientation`, `usePlatform`, etc.) located in `src/presentation/hooks/responsive`. This reduces unnecessary re-renders and improves developer experience.
- **Core Service Restructuring**: Introduced a new directory structure for services, including dedicated folders for `datasources`, `mappers`, and domain-specific types (`message`, `post`).
- **Data Layer Improvements**:
- Centralized JSON parsing logic in `src/database/core/jsonUtils.ts`.
- Cleaned up repository implementations by removing redundant local utility functions.
- Refactored `MessageMapper` to use the new centralized JSON utility.
- **Type System Cleanup**:
- Decomposed the large `src/types/dto.ts` into a modular `src/types/dto/` directory.
- Simplified `src/types/index.ts` and introduced backward-compatible aliases for core entities.
- **Utility Consolidation**:
- Created a centralized `src/utils/formatTime.ts` to replace fragmented date formatting logic across various screens and components.
- Removed deprecated responsive utility files in favor of the new hook-based system.
- **Service Logic Refinement**: Refactored `ApiClient` and `WebSocketService` to use a centralized `showVerificationModal` service, removing duplicated state management for verification prompts.
2026-05-05 19:07:33 +08:00
|
|
|
} from './usePlatformKeyboard';
|