@vlian/framework 1.2.19 → 1.2.25

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.
Files changed (63) hide show
  1. package/dist/analytics.umd.js +1 -1
  2. package/dist/core/index.cjs +0 -1
  3. package/dist/core/index.cjs.map +1 -1
  4. package/dist/core/index.d.ts +1 -2
  5. package/dist/core/index.js +0 -1
  6. package/dist/core/index.js.map +1 -1
  7. package/dist/core/initialization/index.cjs.map +1 -1
  8. package/dist/core/initialization/index.d.ts +1 -1
  9. package/dist/core/initialization/index.js.map +1 -1
  10. package/dist/core/initialization/initialization.cjs +2 -147
  11. package/dist/core/initialization/initialization.cjs.map +1 -1
  12. package/dist/core/initialization/initialization.d.ts +0 -57
  13. package/dist/core/initialization/initialization.js +2 -148
  14. package/dist/core/initialization/initialization.js.map +1 -1
  15. package/dist/core/kernel/startKernel.cjs +1 -2
  16. package/dist/core/kernel/startKernel.cjs.map +1 -1
  17. package/dist/core/kernel/startKernel.js +1 -2
  18. package/dist/core/kernel/startKernel.js.map +1 -1
  19. package/dist/core/plugin.cjs +16 -16
  20. package/dist/core/plugin.cjs.map +1 -1
  21. package/dist/core/plugin.d.ts +5 -1
  22. package/dist/core/plugin.js +17 -17
  23. package/dist/core/plugin.js.map +1 -1
  24. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +13 -8
  25. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs.map +1 -1
  26. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +13 -8
  27. package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js.map +1 -1
  28. package/dist/core/startup/startApp.cjs +0 -2
  29. package/dist/core/startup/startApp.cjs.map +1 -1
  30. package/dist/core/startup/startApp.js +0 -2
  31. package/dist/core/startup/startApp.js.map +1 -1
  32. package/dist/core/types.d.ts +1 -5
  33. package/dist/core/types.js.map +1 -1
  34. package/dist/index.umd.js +35 -204
  35. package/dist/index.umd.js.map +1 -1
  36. package/dist/lazy/index.cjs +104 -0
  37. package/dist/lazy/index.cjs.map +1 -0
  38. package/dist/lazy/index.d.ts +19 -0
  39. package/dist/lazy/index.js +24 -0
  40. package/dist/lazy/index.js.map +1 -0
  41. package/dist/library/storage/index.cjs +1 -1
  42. package/dist/library/storage/index.cjs.map +1 -1
  43. package/dist/library/storage/index.d.ts +1 -0
  44. package/dist/library/storage/index.js +1 -1
  45. package/dist/library/storage/index.js.map +1 -1
  46. package/dist/request.umd.js +1 -1
  47. package/dist/state.umd.js +1 -1
  48. package/package.json +96 -2
  49. package/dist/core/ui-adapter/adapters.cjs +0 -45
  50. package/dist/core/ui-adapter/adapters.cjs.map +0 -1
  51. package/dist/core/ui-adapter/adapters.d.ts +0 -4
  52. package/dist/core/ui-adapter/adapters.js +0 -27
  53. package/dist/core/ui-adapter/adapters.js.map +0 -1
  54. package/dist/core/ui-adapter/index.cjs +0 -21
  55. package/dist/core/ui-adapter/index.cjs.map +0 -1
  56. package/dist/core/ui-adapter/index.d.ts +0 -2
  57. package/dist/core/ui-adapter/index.js +0 -3
  58. package/dist/core/ui-adapter/index.js.map +0 -1
  59. package/dist/core/ui-adapter/types.cjs +0 -6
  60. package/dist/core/ui-adapter/types.cjs.map +0 -1
  61. package/dist/core/ui-adapter/types.d.ts +0 -24
  62. package/dist/core/ui-adapter/types.js +0 -3
  63. package/dist/core/ui-adapter/types.js.map +0 -1
@@ -2,7 +2,7 @@ import { LogLevel } from '../utils';
2
2
  import type { LangType } from '../library/locale/types';
3
3
  import { Container, RootOptions } from 'react-dom/client';
4
4
  import { type ComponentType, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';
5
- import { type InitializationContext, type ConfigStrategy } from './initialization';
5
+ import { type InitializationContext } from './initialization';
6
6
  import type { StorageOptions } from '../types';
7
7
  import type { ThemeConfig } from './app';
8
8
  import type { FrameworkError } from '../utils/errors';
@@ -176,10 +176,6 @@ export interface StartOptions {
176
176
  * 国际化
177
177
  */
178
178
  locale?: Record<LangType, Record<string, unknown>>;
179
- /**
180
- * 配置加载策略
181
- */
182
- configStrategy?: ConfigStrategy;
183
179
  /**
184
180
  * 启动页完成回调
185
181
  * 仅在显示启动页时,启动页完成初始化后调用
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/types.ts"],"sourcesContent":["import { LogLevel } from '../utils';\nimport type { LangType } from '../library/locale/types';\nimport { Container, RootOptions } from 'react-dom/client';\nimport { type ComponentType, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\nimport { type InitializationContext, type ConfigStrategy } from './initialization';\nimport type { StorageOptions } from '../types';\nimport type { ThemeConfig } from './app';\nimport type { FrameworkError } from '../utils/errors';\nimport type { RouterConfig } from './router/types';\n\nexport type UIProviderConfig = Record<string, unknown>;\nexport type UIAppConfig = Record<string, unknown>;\nexport type GlobalProviderComponent = ComponentType<PropsWithChildren>;\nexport type GlobalProviderLoader = () => Promise<{ default: GlobalProviderComponent }>;\n\n/**\n * 生命周期钩子函数类型\n */\nexport type ManagerLifecycle = {\n /**\n * 在初始化之前执行\n */\n beforeInitialization?: () => Promise<void> | void;\n\n /**\n * 初始化\n */\n initialization?: () => Promise<void> | void;\n\n /**\n * 在初始化之后执行\n * \n * @param context - 初始化上下文,包含配置、进度、耗时等信息\n * \n * @example\n * ```typescript\n * start({\n * lifecycle: {\n * afterInitialization: (context) => {\n * console.log('初始化完成', context);\n * },\n * },\n * });\n * ```\n */\n afterInitialization?: (context: InitializationContext) => Promise<void> | void;\n};\n\n\n/**\n * 启动配置选项\n */\nexport interface StartOptions {\n /**\n * React 应用的挂载容器\n * \n * 用于指定 React 应用渲染的目标 DOM 元素。如果不提供,框架将自动查找页面中\n * 的根元素(通常为 id=\"root\" 的元素)作为默认容器。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * // 使用默认容器(自动查找 id=\"root\" 的元素)\n * start({});\n * \n * // 指定自定义容器\n * const container = document.getElementById('app');\n * start({ container });\n * ```\n */\n container?: Container;\n /**\n * React 根节点的配置选项\n * \n * 用于配置 React 18+ 的 createRoot 方法的选项,包括:\n * - `onRecoverableError`: 错误恢复回调函数\n * - `identifierPrefix`: 用于标识符前缀,用于服务端渲染的 hydration\n * \n * 这些选项将传递给 `react-dom/client` 的 `createRoot` 方法。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * rootOptions: {\n * onRecoverableError: (error) => {\n * console.error('React 错误恢复:', error);\n * },\n * identifierPrefix: 'my-app-',\n * },\n * });\n * ```\n */\n rootOptions?: RootOptions;\n /**\n * 应用根组件\n * \n * 用于指定要渲染的 React 应用根组件。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * import App from './App';\n * \n * start({\n * app: <App />,\n * });\n * ```\n */\n app?: ReactElement;\n /**\n * 是否显示启动页\n * - 'auto': 自动判断(推荐)\n * - 'always': 总是显示\n * - 'never': 从不显示\n * - 'first-time-only': 仅首次加载显示\n * \n * @default 'auto'\n */\n showSplashScreen?: 'auto' | 'always' | 'never' | 'first-time-only';\n\n /**\n * 启动页最小显示时间(毫秒)\n * \n * 用于避免启动页闪烁,确保用户能看到启动过程。\n * 如果初始化完成时间小于此值,将等待至最小时间后再隐藏启动页。\n * \n * @default 500\n * \n * @example\n * ```typescript\n * start({\n * minSplashScreenTime: 1000, // 至少显示 1 秒\n * });\n * ```\n */\n minSplashScreenTime?: number;\n\n /**\n * 路由配置\n * \n * 配置应用的路由系统,支持内置路由、自定义路由和禁用路由三种模式。\n * \n * @example\n * ```typescript\n * start({\n * router: {\n * enabled: true,\n * routes: [\n * {\n * path: '/login',\n * page: LoginPage,\n * },\n * {\n * path: '/',\n * layout: MainLayout,\n * children: [\n * {\n * path: 'dashboard',\n * page: DashboardPage,\n * meta: { title: '仪表盘' },\n * },\n * ],\n * },\n * ],\n * },\n * });\n * ```\n */\n router?: RouterConfig;\n /**\n * 日志级别\n */\n loggerLevel?: LogLevel;\n /**\n * 生命周期钩子\n */\n lifecycle?: ManagerLifecycle;\n /**\n * 国际化\n */\n locale?: Record<LangType, Record<string, unknown>>;\n /**\n * 配置加载策略\n */\n configStrategy?: ConfigStrategy;\n /**\n * 启动页完成回调\n * 仅在显示启动页时,启动页完成初始化后调用\n * 可以在这里执行额外的操作,然后调用 complete() 继续\n * \n * @example\n * ```typescript\n * start({\n * onSplashComplete: (complete, context) => {\n * // 执行额外操作\n * await doSomething();\n * // 完成后继续\n * complete();\n * },\n * });\n * ```\n */\n onSplashComplete?: (\n complete: () => void,\n context: InitializationContext\n ) => Promise<void> | void;\n\n /**\n * 存储配置\n */\n storageOptions?: StorageOptions;\n\n /**\n * IndexedDB 表名\n */\n indexedDBTableName?: string;\n\n /**\n * UI Provider 配置(框架无关)\n * 可由 UI 适配器消费,适配到 antd/shadcn 等实现。\n */\n uiProvider?: UIProviderConfig;\n\n /**\n * UI App 基础配置(框架无关)\n * 可用于通知、弹窗、消息容器等能力的统一注入。\n */\n uiApp?: UIAppConfig;\n\n /**\n * 全局 UI 包裹组件懒加载器\n * \n * 组件会在 BasicLayout 中统一包裹 children。\n * 需返回带 default 导出的 React 组件模块。\n *\n * @example\n * ```typescript\n * start({\n * globalProvider: () => import('./components/AntdGlobalProvider'),\n * });\n * ```\n */\n globalProvider?: GlobalProviderLoader;\n\n /**\n * @deprecated 使用 uiProvider 替代\n */\n antd?: Record<string, unknown>;\n\n /**\n * @deprecated 使用 uiApp 替代\n */\n antdApp?: Record<string, unknown>;\n\n /**\n * 主题配置\n * \n * @example\n * ```typescript\n * start({\n * theme: {\n * mode: 'dark',\n * primaryColor: '#1890ff',\n * },\n * });\n * ```\n */\n theme?: ThemeConfig;\n\n /**\n * 运行时安全配置\n */\n runtimeSecurity?: import('../utils/runtimeSecurity').RuntimeSecurityOptions;\n\n /**\n * 配置安全选项\n */\n configSecurity?: import('../utils/configSecurity').ConfigSecurityOptions;\n\n /**\n * 性能监控配置\n */\n performanceMonitor?: import('../utils/performance').PerformanceMonitorConfig;\n\n /**\n * 错误监控配置\n */\n errorMonitor?: import('../utils/monitoring').ErrorMonitorConfig;\n\n /**\n * 分析服务配置\n */\n analytics?: import('../utils/analytics').AnalyticsConfig;\n\n /**\n * 状态管理器配置\n * \n * 配置框架的状态管理器,支持自定义适配器和作用域设置。\n * 如果不提供,将使用默认配置创建状态管理器。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * stateManager: {\n * enableRegistry: true,\n * defaultScope: 'app',\n * devMode: true,\n * },\n * });\n * ```\n */\n stateManager?: import('../state').StateManagerOptions;\n\n /**\n * 事件总线配置\n * \n * 配置应用级事件系统,支持事件追踪、性能监控、安全模式等。\n * 如果不提供,将使用默认配置创建事件总线。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * eventBus: {\n * enableTracking: true,\n * maxHistorySize: 200,\n * enablePerformanceMonitoring: true,\n * namespacePrefix: 'my-app:',\n * },\n * });\n * ```\n */\n eventBus?: {\n enableTracking?: boolean;\n maxHistorySize?: number;\n enableValidation?: boolean;\n validator?: (event: string, data: unknown) => boolean;\n enablePerformanceMonitoring?: boolean;\n namespacePrefix?: string;\n instanceId?: string;\n enableSecurityMode?: boolean;\n allowedSources?: string[];\n };\n\n /**\n * 自定义启动屏组件\n * \n * 如果提供,将使用自定义组件替代默认的启动屏 UI。\n * 自定义组件将接收初始化进度、当前步骤和初始化状态作为 props。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * const CustomSplashScreen = ({ progress, currentStep, isInitializing }) => {\n * return (\n * <div>\n * <h1>加载中...</h1>\n * <div>进度: {progress}%</div>\n * <div>步骤: {currentStep}</div>\n * </div>\n * );\n * };\n * \n * start({\n * splashScreen: CustomSplashScreen,\n * });\n * ```\n */\n splashScreen?: React.ComponentType<SplashScreenCustomProps>;\n\n /**\n * 自定义错误反馈组件\n * \n * 如果提供,将使用自定义的错误 UI 替代默认错误 UI。\n * 自定义组件将接收错误对象和重置函数作为参数。\n * \n * @param error - 标准化后的框架错误对象\n * @param resetError - 重置错误边界的函数,调用后可以尝试重新渲染子组件\n * @returns 错误 UI 的 React 节点\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * start({\n * errorFallback: (error, reset) => (\n * <div>\n * <h2>自定义错误标题</h2>\n * <p>{error.message}</p>\n * <button onClick={reset}>重试</button>\n * </div>\n * ),\n * });\n * ```\n */\n errorFallback?: (error: FrameworkError, resetError: () => void) => ReactNode;\n\n /**\n * 安全配置选项\n * \n * 用于配置框架的安全策略,包括 XSS 防护、配置验证等。\n * 框架默认启用所有安全策略,确保应用安全。\n * \n * @example\n * ```typescript\n * start({\n * security: {\n * enableXSSProtection: true, // 默认启用\n * validateConfig: true, // 默认启用\n * sanitizeUserInput: true, // 默认启用\n * },\n * });\n * ```\n */\n security?: {\n /**\n * 是否启用 XSS 防护\n * @default true\n */\n enableXSSProtection?: boolean;\n /**\n * 是否验证配置项安全性\n * @default true\n */\n validateConfig?: boolean;\n /**\n * 是否清理用户输入\n * @default true\n */\n sanitizeUserInput?: boolean;\n /**\n * CSP(内容安全策略)配置\n */\n csp?: {\n defaultSrc?: string[];\n scriptSrc?: string[];\n styleSrc?: string[];\n imgSrc?: string[];\n connectSrc?: string[];\n fontSrc?: string[];\n frameSrc?: string[];\n allowUnsafeInline?: boolean;\n allowUnsafeEval?: boolean;\n };\n /**\n * CSRF 防护配置\n */\n csrf?: {\n /**\n * 是否启用 CSRF 防护\n * @default true\n */\n enabled?: boolean;\n /**\n * CSRF Token 获取函数\n * 如果不提供,框架会自动从 cookie 或 header 中获取\n */\n getToken?: () => string | Promise<string>;\n /**\n * CSRF Token 验证函数\n * 如果不提供,框架会使用默认验证逻辑\n */\n validateToken?: (token: string) => boolean | Promise<boolean>;\n /**\n * CSRF Token 请求头名称\n * @default 'X-CSRF-Token'\n */\n headerName?: string;\n /**\n * CSRF Token Cookie 名称\n * @default 'csrf-token'\n */\n cookieName?: string;\n };\n };\n \n /**\n * 服务初始化重试配置\n * \n * 用于配置服务初始化失败时的重试策略。\n * \n * @example\n * ```typescript\n * start({\n * serviceRetry: {\n * maxRetries: 3,\n * retryDelay: 1000,\n * exponentialBackoff: true,\n * },\n * });\n * ```\n */\n serviceRetry?: {\n /**\n * 最大重试次数\n * @default 3\n */\n maxRetries?: number;\n /**\n * 重试延迟(毫秒)\n * @default 1000\n */\n retryDelay?: number;\n /**\n * 是否启用指数退避\n * @default true\n */\n exponentialBackoff?: boolean;\n };\n}\n\n/**\n * 自定义启动屏组件的 Props\n */\nexport interface SplashScreenCustomProps {\n /**\n * 初始化进度(0-100)\n */\n progress: number;\n\n /**\n * 当前步骤描述\n */\n currentStep: string;\n\n /**\n * 是否正在初始化\n */\n isInitializing: boolean;\n}\n"],"names":[],"mappings":"AAqgBA;;CAEC,GACD,WAeC"}
1
+ {"version":3,"sources":["../../src/core/types.ts"],"sourcesContent":["import { LogLevel } from '../utils';\nimport type { LangType } from '../library/locale/types';\nimport { Container, RootOptions } from 'react-dom/client';\nimport { type ComponentType, type PropsWithChildren, type ReactElement, type ReactNode } from 'react';\nimport { type InitializationContext } from './initialization';\nimport type { StorageOptions } from '../types';\nimport type { ThemeConfig } from './app';\nimport type { FrameworkError } from '../utils/errors';\nimport type { RouterConfig } from './router/types';\n\nexport type UIProviderConfig = Record<string, unknown>;\nexport type UIAppConfig = Record<string, unknown>;\nexport type GlobalProviderComponent = ComponentType<PropsWithChildren>;\nexport type GlobalProviderLoader = () => Promise<{ default: GlobalProviderComponent }>;\n\n/**\n * 生命周期钩子函数类型\n */\nexport type ManagerLifecycle = {\n /**\n * 在初始化之前执行\n */\n beforeInitialization?: () => Promise<void> | void;\n\n /**\n * 初始化\n */\n initialization?: () => Promise<void> | void;\n\n /**\n * 在初始化之后执行\n * \n * @param context - 初始化上下文,包含配置、进度、耗时等信息\n * \n * @example\n * ```typescript\n * start({\n * lifecycle: {\n * afterInitialization: (context) => {\n * console.log('初始化完成', context);\n * },\n * },\n * });\n * ```\n */\n afterInitialization?: (context: InitializationContext) => Promise<void> | void;\n};\n\n\n/**\n * 启动配置选项\n */\nexport interface StartOptions {\n /**\n * React 应用的挂载容器\n * \n * 用于指定 React 应用渲染的目标 DOM 元素。如果不提供,框架将自动查找页面中\n * 的根元素(通常为 id=\"root\" 的元素)作为默认容器。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * // 使用默认容器(自动查找 id=\"root\" 的元素)\n * start({});\n * \n * // 指定自定义容器\n * const container = document.getElementById('app');\n * start({ container });\n * ```\n */\n container?: Container;\n /**\n * React 根节点的配置选项\n * \n * 用于配置 React 18+ 的 createRoot 方法的选项,包括:\n * - `onRecoverableError`: 错误恢复回调函数\n * - `identifierPrefix`: 用于标识符前缀,用于服务端渲染的 hydration\n * \n * 这些选项将传递给 `react-dom/client` 的 `createRoot` 方法。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * rootOptions: {\n * onRecoverableError: (error) => {\n * console.error('React 错误恢复:', error);\n * },\n * identifierPrefix: 'my-app-',\n * },\n * });\n * ```\n */\n rootOptions?: RootOptions;\n /**\n * 应用根组件\n * \n * 用于指定要渲染的 React 应用根组件。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * import App from './App';\n * \n * start({\n * app: <App />,\n * });\n * ```\n */\n app?: ReactElement;\n /**\n * 是否显示启动页\n * - 'auto': 自动判断(推荐)\n * - 'always': 总是显示\n * - 'never': 从不显示\n * - 'first-time-only': 仅首次加载显示\n * \n * @default 'auto'\n */\n showSplashScreen?: 'auto' | 'always' | 'never' | 'first-time-only';\n\n /**\n * 启动页最小显示时间(毫秒)\n * \n * 用于避免启动页闪烁,确保用户能看到启动过程。\n * 如果初始化完成时间小于此值,将等待至最小时间后再隐藏启动页。\n * \n * @default 500\n * \n * @example\n * ```typescript\n * start({\n * minSplashScreenTime: 1000, // 至少显示 1 秒\n * });\n * ```\n */\n minSplashScreenTime?: number;\n\n /**\n * 路由配置\n * \n * 配置应用的路由系统,支持内置路由、自定义路由和禁用路由三种模式。\n * \n * @example\n * ```typescript\n * start({\n * router: {\n * enabled: true,\n * routes: [\n * {\n * path: '/login',\n * page: LoginPage,\n * },\n * {\n * path: '/',\n * layout: MainLayout,\n * children: [\n * {\n * path: 'dashboard',\n * page: DashboardPage,\n * meta: { title: '仪表盘' },\n * },\n * ],\n * },\n * ],\n * },\n * });\n * ```\n */\n router?: RouterConfig;\n /**\n * 日志级别\n */\n loggerLevel?: LogLevel;\n /**\n * 生命周期钩子\n */\n lifecycle?: ManagerLifecycle;\n /**\n * 国际化\n */\n locale?: Record<LangType, Record<string, unknown>>;\n /**\n * 启动页完成回调\n * 仅在显示启动页时,启动页完成初始化后调用\n * 可以在这里执行额外的操作,然后调用 complete() 继续\n * \n * @example\n * ```typescript\n * start({\n * onSplashComplete: (complete, context) => {\n * // 执行额外操作\n * await doSomething();\n * // 完成后继续\n * complete();\n * },\n * });\n * ```\n */\n onSplashComplete?: (\n complete: () => void,\n context: InitializationContext\n ) => Promise<void> | void;\n\n /**\n * 存储配置\n */\n storageOptions?: StorageOptions;\n\n /**\n * IndexedDB 表名\n */\n indexedDBTableName?: string;\n\n /**\n * UI Provider 配置(框架无关)\n * 可由 UI 适配器消费,适配到 antd/shadcn 等实现。\n */\n uiProvider?: UIProviderConfig;\n\n /**\n * UI App 基础配置(框架无关)\n * 可用于通知、弹窗、消息容器等能力的统一注入。\n */\n uiApp?: UIAppConfig;\n\n /**\n * 全局 UI 包裹组件懒加载器\n * \n * 组件会在 BasicLayout 中统一包裹 children。\n * 需返回带 default 导出的 React 组件模块。\n *\n * @example\n * ```typescript\n * start({\n * globalProvider: () => import('./components/AntdGlobalProvider'),\n * });\n * ```\n */\n globalProvider?: GlobalProviderLoader;\n\n /**\n * @deprecated 使用 uiProvider 替代\n */\n antd?: Record<string, unknown>;\n\n /**\n * @deprecated 使用 uiApp 替代\n */\n antdApp?: Record<string, unknown>;\n\n /**\n * 主题配置\n * \n * @example\n * ```typescript\n * start({\n * theme: {\n * mode: 'dark',\n * primaryColor: '#1890ff',\n * },\n * });\n * ```\n */\n theme?: ThemeConfig;\n\n /**\n * 运行时安全配置\n */\n runtimeSecurity?: import('../utils/runtimeSecurity').RuntimeSecurityOptions;\n\n /**\n * 配置安全选项\n */\n configSecurity?: import('../utils/configSecurity').ConfigSecurityOptions;\n\n /**\n * 性能监控配置\n */\n performanceMonitor?: import('../utils/performance').PerformanceMonitorConfig;\n\n /**\n * 错误监控配置\n */\n errorMonitor?: import('../utils/monitoring').ErrorMonitorConfig;\n\n /**\n * 分析服务配置\n */\n analytics?: import('../utils/analytics').AnalyticsConfig;\n\n /**\n * 状态管理器配置\n * \n * 配置框架的状态管理器,支持自定义适配器和作用域设置。\n * 如果不提供,将使用默认配置创建状态管理器。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * stateManager: {\n * enableRegistry: true,\n * defaultScope: 'app',\n * devMode: true,\n * },\n * });\n * ```\n */\n stateManager?: import('../state').StateManagerOptions;\n\n /**\n * 事件总线配置\n * \n * 配置应用级事件系统,支持事件追踪、性能监控、安全模式等。\n * 如果不提供,将使用默认配置创建事件总线。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * start({\n * eventBus: {\n * enableTracking: true,\n * maxHistorySize: 200,\n * enablePerformanceMonitoring: true,\n * namespacePrefix: 'my-app:',\n * },\n * });\n * ```\n */\n eventBus?: {\n enableTracking?: boolean;\n maxHistorySize?: number;\n enableValidation?: boolean;\n validator?: (event: string, data: unknown) => boolean;\n enablePerformanceMonitoring?: boolean;\n namespacePrefix?: string;\n instanceId?: string;\n enableSecurityMode?: boolean;\n allowedSources?: string[];\n };\n\n /**\n * 自定义启动屏组件\n * \n * 如果提供,将使用自定义组件替代默认的启动屏 UI。\n * 自定义组件将接收初始化进度、当前步骤和初始化状态作为 props。\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * \n * const CustomSplashScreen = ({ progress, currentStep, isInitializing }) => {\n * return (\n * <div>\n * <h1>加载中...</h1>\n * <div>进度: {progress}%</div>\n * <div>步骤: {currentStep}</div>\n * </div>\n * );\n * };\n * \n * start({\n * splashScreen: CustomSplashScreen,\n * });\n * ```\n */\n splashScreen?: React.ComponentType<SplashScreenCustomProps>;\n\n /**\n * 自定义错误反馈组件\n * \n * 如果提供,将使用自定义的错误 UI 替代默认错误 UI。\n * 自定义组件将接收错误对象和重置函数作为参数。\n * \n * @param error - 标准化后的框架错误对象\n * @param resetError - 重置错误边界的函数,调用后可以尝试重新渲染子组件\n * @returns 错误 UI 的 React 节点\n * \n * @example\n * ```typescript\n * import { start } from '@vlian/framework';\n * start({\n * errorFallback: (error, reset) => (\n * <div>\n * <h2>自定义错误标题</h2>\n * <p>{error.message}</p>\n * <button onClick={reset}>重试</button>\n * </div>\n * ),\n * });\n * ```\n */\n errorFallback?: (error: FrameworkError, resetError: () => void) => ReactNode;\n\n /**\n * 安全配置选项\n * \n * 用于配置框架的安全策略,包括 XSS 防护、配置验证等。\n * 框架默认启用所有安全策略,确保应用安全。\n * \n * @example\n * ```typescript\n * start({\n * security: {\n * enableXSSProtection: true, // 默认启用\n * validateConfig: true, // 默认启用\n * sanitizeUserInput: true, // 默认启用\n * },\n * });\n * ```\n */\n security?: {\n /**\n * 是否启用 XSS 防护\n * @default true\n */\n enableXSSProtection?: boolean;\n /**\n * 是否验证配置项安全性\n * @default true\n */\n validateConfig?: boolean;\n /**\n * 是否清理用户输入\n * @default true\n */\n sanitizeUserInput?: boolean;\n /**\n * CSP(内容安全策略)配置\n */\n csp?: {\n defaultSrc?: string[];\n scriptSrc?: string[];\n styleSrc?: string[];\n imgSrc?: string[];\n connectSrc?: string[];\n fontSrc?: string[];\n frameSrc?: string[];\n allowUnsafeInline?: boolean;\n allowUnsafeEval?: boolean;\n };\n /**\n * CSRF 防护配置\n */\n csrf?: {\n /**\n * 是否启用 CSRF 防护\n * @default true\n */\n enabled?: boolean;\n /**\n * CSRF Token 获取函数\n * 如果不提供,框架会自动从 cookie 或 header 中获取\n */\n getToken?: () => string | Promise<string>;\n /**\n * CSRF Token 验证函数\n * 如果不提供,框架会使用默认验证逻辑\n */\n validateToken?: (token: string) => boolean | Promise<boolean>;\n /**\n * CSRF Token 请求头名称\n * @default 'X-CSRF-Token'\n */\n headerName?: string;\n /**\n * CSRF Token Cookie 名称\n * @default 'csrf-token'\n */\n cookieName?: string;\n };\n };\n \n /**\n * 服务初始化重试配置\n * \n * 用于配置服务初始化失败时的重试策略。\n * \n * @example\n * ```typescript\n * start({\n * serviceRetry: {\n * maxRetries: 3,\n * retryDelay: 1000,\n * exponentialBackoff: true,\n * },\n * });\n * ```\n */\n serviceRetry?: {\n /**\n * 最大重试次数\n * @default 3\n */\n maxRetries?: number;\n /**\n * 重试延迟(毫秒)\n * @default 1000\n */\n retryDelay?: number;\n /**\n * 是否启用指数退避\n * @default true\n */\n exponentialBackoff?: boolean;\n };\n}\n\n/**\n * 自定义启动屏组件的 Props\n */\nexport interface SplashScreenCustomProps {\n /**\n * 初始化进度(0-100)\n */\n progress: number;\n\n /**\n * 当前步骤描述\n */\n currentStep: string;\n\n /**\n * 是否正在初始化\n */\n isInitializing: boolean;\n}\n"],"names":[],"mappings":"AAigBA;;CAEC,GACD,WAeC"}
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @vlian/framework v1.2.19
2
+ * @vlian/framework v1.2.25
3
3
  * Secra Framework - 一个现代化的低代码框架
4
4
  * (c) 2026 Secra Framework Contributors
5
5
  * Licensed under Apache-2.0
@@ -17676,7 +17676,7 @@
17676
17676
  }
17677
17677
  /**
17678
17678
  * 获取单例实例
17679
- *
17679
+ *
17680
17680
  * @returns Singleton 实例
17681
17681
  */ static getInstance() {
17682
17682
  if (!Storage.instance) {
@@ -20446,7 +20446,7 @@
20446
20446
  }
20447
20447
  /**
20448
20448
  * 插件管理器
20449
- *
20449
+ *
20450
20450
  * 优化:
20451
20451
  * 1. 支持插件依赖管理
20452
20452
  * 2. 支持插件优先级控制
@@ -20455,7 +20455,7 @@
20455
20455
  */ let PluginManager$1 = class PluginManager {
20456
20456
  /**
20457
20457
  * 注册插件
20458
- *
20458
+ *
20459
20459
  * 优化:检查插件依赖是否已注册
20460
20460
  */ register(plugin) {
20461
20461
  if (this.plugins.has(plugin.name)) {
@@ -20488,7 +20488,7 @@
20488
20488
  }
20489
20489
  /**
20490
20490
  * 获取插件加载顺序(考虑依赖和优先级)
20491
- *
20491
+ *
20492
20492
  * @returns 插件名称数组,按加载顺序排列
20493
20493
  */ getLoadOrder() {
20494
20494
  const plugins = Array.from(this.plugins.values());
@@ -20540,7 +20540,7 @@
20540
20540
  }
20541
20541
  /**
20542
20542
  * 动态加载插件(热插拔)
20543
- *
20543
+ *
20544
20544
  * @param options - 插件加载选项
20545
20545
  * @returns 加载的插件
20546
20546
  */ async loadPlugin(options) {
@@ -20584,7 +20584,7 @@
20584
20584
  }
20585
20585
  /**
20586
20586
  * 初始化单个插件
20587
- *
20587
+ *
20588
20588
  * @param name - 插件名称
20589
20589
  * @param options - 启动选项
20590
20590
  * @param context - 初始化上下文
@@ -20615,7 +20615,7 @@
20615
20615
  }
20616
20616
  /**
20617
20617
  * 卸载插件(热插拔)
20618
- *
20618
+ *
20619
20619
  * @param name - 插件名称
20620
20620
  * @param force - 是否强制卸载(即使有依赖)
20621
20621
  */ async unloadPlugin(name, force = false) {
@@ -20647,7 +20647,7 @@
20647
20647
  }
20648
20648
  /**
20649
20649
  * 检查插件是否可以热加载
20650
- *
20650
+ *
20651
20651
  * @param plugin - 插件
20652
20652
  * @returns 是否可以热加载
20653
20653
  */ canHotLoad(plugin) {
@@ -20662,7 +20662,7 @@
20662
20662
  }
20663
20663
  /**
20664
20664
  * 注册插件加载器(用于延迟加载)
20665
- *
20665
+ *
20666
20666
  * @param name - 插件名称
20667
20667
  * @param loader - 加载器函数
20668
20668
  */ registerLoader(name, loader) {
@@ -20670,7 +20670,7 @@
20670
20670
  }
20671
20671
  /**
20672
20672
  * 使用加载器加载插件
20673
- *
20673
+ *
20674
20674
  * @param name - 插件名称
20675
20675
  * @param options - 加载选项
20676
20676
  * @returns 加载的插件
@@ -20717,7 +20717,7 @@
20717
20717
  }
20718
20718
  /**
20719
20719
  * 执行初始化前钩子
20720
- *
20720
+ *
20721
20721
  * 优化:按依赖顺序执行
20722
20722
  */ async executeBeforeInit(options) {
20723
20723
  const loadOrder = this.getLoadOrder();
@@ -20742,7 +20742,7 @@
20742
20742
  }
20743
20743
  /**
20744
20744
  * 执行初始化钩子
20745
- *
20745
+ *
20746
20746
  * 优化:按依赖顺序执行,并更新插件状态
20747
20747
  */ async executeInit(options, context) {
20748
20748
  const loadOrder = this.getLoadOrder();
@@ -20768,7 +20768,7 @@
20768
20768
  }
20769
20769
  /**
20770
20770
  * 执行初始化后钩子
20771
- *
20771
+ *
20772
20772
  * 优化:按依赖顺序执行(逆序,确保依赖插件先执行)
20773
20773
  */ async executeAfterInit(options, context) {
20774
20774
  const loadOrder = this.getLoadOrder();
@@ -20797,7 +20797,7 @@
20797
20797
  }
20798
20798
  /**
20799
20799
  * 获取插件状态
20800
- *
20800
+ *
20801
20801
  * @param name - 插件名称
20802
20802
  * @returns 插件状态
20803
20803
  */ getPluginStatus(name) {
@@ -20805,7 +20805,7 @@
20805
20805
  }
20806
20806
  /**
20807
20807
  * 检查插件是否已加载
20808
- *
20808
+ *
20809
20809
  * @param name - 插件名称
20810
20810
  * @returns 是否已加载
20811
20811
  */ isLoaded(name) {
@@ -20813,21 +20813,21 @@
20813
20813
  }
20814
20814
  /**
20815
20815
  * 获取已加载的插件列表
20816
- *
20816
+ *
20817
20817
  * @returns 插件名称数组
20818
20818
  */ getLoadedPlugins() {
20819
20819
  return Array.from(this.plugins.keys());
20820
20820
  }
20821
20821
  /**
20822
20822
  * 获取所有插件状态
20823
- *
20823
+ *
20824
20824
  * @returns 插件状态映射
20825
20825
  */ getAllPluginStatus() {
20826
20826
  return new Map(this.pluginStatus);
20827
20827
  }
20828
20828
  /**
20829
20829
  * 获取插件沙箱
20830
- *
20830
+ *
20831
20831
  * @param name - 插件名称
20832
20832
  * @returns 插件沙箱或undefined
20833
20833
  */ getSandbox(name) {
@@ -20863,68 +20863,6 @@
20863
20863
  * 默认插件管理器
20864
20864
  */ const pluginManager = new PluginManager$1();
20865
20865
 
20866
- /**
20867
- * 配置缓存键
20868
- */ const CONFIG_CACHE_KEY = '__framework_config_cache__';
20869
- /**
20870
- * 加载配置(带超时、重试和缓存)
20871
- */ async function loadConfigWithRetry(loadConfig, strategy, fallbackConfig) {
20872
- const timeout = strategy.configTimeout ?? 5000;
20873
- const retryCount = strategy.retryCount ?? 3;
20874
- const retryDelay = strategy.retryDelay ?? 1000;
20875
- const enableCache = strategy.enableCache ?? true;
20876
- const cacheTTL = strategy.cacheTTL ?? 5 * 60 * 1000; // 5分钟
20877
- const configVersion = strategy.configVersion;
20878
- // 检查缓存
20879
- if (enableCache && storage.localCache) {
20880
- try {
20881
- const cacheKey = `${CONFIG_CACHE_KEY}_${configVersion || 'default'}`;
20882
- const cached = await storage.localCache.get(cacheKey);
20883
- if (cached && (!configVersion || cached.version === configVersion)) {
20884
- logger.debug('使用缓存的配置');
20885
- return cached.data;
20886
- }
20887
- } catch (error) {
20888
- logger.warn('读取配置缓存失败:', error);
20889
- }
20890
- }
20891
- // 重试加载配置
20892
- let lastError = null;
20893
- for(let attempt = 0; attempt <= retryCount; attempt++){
20894
- try {
20895
- if (attempt > 0) {
20896
- logger.debug(`配置加载重试 ${attempt}/${retryCount}`);
20897
- // 指数退避
20898
- await new Promise((resolve)=>setTimeout(resolve, retryDelay * Math.pow(2, attempt - 1)));
20899
- }
20900
- const configPromise = loadConfig();
20901
- const timeoutPromise = new Promise((_, reject)=>setTimeout(()=>reject(new NetworkError('配置加载超时')), timeout));
20902
- const config = await Promise.race([
20903
- configPromise,
20904
- timeoutPromise
20905
- ]);
20906
- // 保存到缓存
20907
- if (enableCache && storage.localCache) {
20908
- try {
20909
- const cacheKey = `${CONFIG_CACHE_KEY}_${configVersion || 'default'}`;
20910
- await storage.localCache.set(cacheKey, {
20911
- data: config,
20912
- version: configVersion
20913
- }, cacheTTL);
20914
- } catch (error) {
20915
- logger.warn('保存配置缓存失败:', error);
20916
- }
20917
- }
20918
- return config;
20919
- } catch (error) {
20920
- lastError = error instanceof Error ? error : new Error(String(error));
20921
- logger.warn(`配置加载失败 (尝试 ${attempt + 1}/${retryCount + 1}):`, lastError);
20922
- }
20923
- }
20924
- // 所有重试都失败,使用降级配置
20925
- logger.warn('配置加载失败,使用降级配置:', lastError);
20926
- return fallbackConfig || {};
20927
- }
20928
20866
  /**
20929
20867
  * 初始化方法
20930
20868
  *
@@ -20956,89 +20894,8 @@
20956
20894
  // 1. 设置日志级别
20957
20895
  onProgress?.(5, '初始化日志系统...');
20958
20896
  logger.setLevel(options.loggerLevel ?? LogLevel.INFO);
20959
- // 2. 加载关键配置
20960
- if (options.configStrategy?.loadCriticalConfig) {
20961
- onProgress?.(10, '加载关键配置...');
20962
- try {
20963
- config = await loadConfigWithRetry(options.configStrategy.loadCriticalConfig, options.configStrategy, options.configStrategy.fallbackConfig);
20964
- // 验证配置安全性
20965
- if (options.configSecurity) {
20966
- const securityResult = await ConfigSecurity.validateConfigSecurity(config, options.configSecurity);
20967
- if (!securityResult.valid) {
20968
- logger.warn('配置安全验证失败:', securityResult.errors);
20969
- // 根据安全策略决定是否继续
20970
- }
20971
- }
20972
- options.configStrategy.onConfigLoaded?.(config);
20973
- onProgress?.(30, '关键配置加载完成');
20974
- } catch (error) {
20975
- logger.warn('关键配置加载失败,使用默认配置:', error);
20976
- config = options.configStrategy.fallbackConfig || {};
20977
- options.configStrategy.onConfigLoaded?.(config);
20978
- onProgress?.(30, '使用默认配置');
20979
- }
20980
- } else {
20981
- onProgress?.(30);
20982
- }
20983
- // 2.5. 渐进式加载非关键配置(在应用渲染后异步加载)
20984
- if (options.configStrategy?.loadNonCriticalConfig) {
20985
- // 智能延迟加载:根据网络状况动态调整延迟时间
20986
- const getDelayTime = ()=>{
20987
- if (typeof navigator === 'undefined' || !('connection' in navigator)) {
20988
- return 1000; // 默认延迟
20989
- }
20990
- const connection = navigator.connection;
20991
- if (!connection) {
20992
- return 1000;
20993
- }
20994
- // 根据网络类型调整延迟
20995
- const effectiveType = connection.effectiveType;
20996
- switch(effectiveType){
20997
- case 'slow-2g':
20998
- case '2g':
20999
- return 3000; // 慢网络延迟更久
21000
- case '3g':
21001
- return 2000;
21002
- case '4g':
21003
- default:
21004
- return 500; // 快网络可以更快加载
21005
- }
21006
- };
21007
- // 使用 requestIdleCallback 在空闲时加载
21008
- if (typeof requestIdleCallback !== 'undefined') {
21009
- requestIdleCallback(async ()=>{
21010
- try {
21011
- const nonCriticalConfig = await loadConfigWithRetry(options.configStrategy.loadNonCriticalConfig, options.configStrategy, {});
21012
- // 合并到主配置
21013
- config = {
21014
- ...config,
21015
- ...nonCriticalConfig
21016
- };
21017
- options.configStrategy?.onConfigLoaded?.(config);
21018
- logger.debug('非关键配置加载完成');
21019
- } catch (error) {
21020
- logger.warn('非关键配置加载失败:', error);
21021
- }
21022
- }, {
21023
- timeout: getDelayTime()
21024
- });
21025
- } else {
21026
- // 降级方案:智能延迟加载
21027
- setTimeout(async ()=>{
21028
- try {
21029
- const nonCriticalConfig = await loadConfigWithRetry(options.configStrategy.loadNonCriticalConfig, options.configStrategy, {});
21030
- config = {
21031
- ...config,
21032
- ...nonCriticalConfig
21033
- };
21034
- options.configStrategy?.onConfigLoaded?.(config);
21035
- logger.debug('非关键配置加载完成');
21036
- } catch (error) {
21037
- logger.warn('非关键配置加载失败:', error);
21038
- }
21039
- }, getDelayTime());
21040
- }
21041
- }
20897
+ // 2. 预留配置阶段
20898
+ onProgress?.(30);
21042
20899
  // 3. 初始化之前回调
21043
20900
  if (options.lifecycle?.beforeInitialization) {
21044
20901
  onProgress?.(35, '执行初始化前回调...');
@@ -25683,8 +25540,13 @@
25683
25540
  const isDevelopment = process.env.NODE_ENV === 'development';
25684
25541
  const RouteErrorBoundary = ({ error, resetErrorBoundary })=>{
25685
25542
  const [showDetails, setShowDetails] = React.useState(false);
25686
- const errorWithCause = error;
25687
- const hasCause = 'cause' in error && errorWithCause.cause !== undefined;
25543
+ const errorObject = error !== null && typeof error === 'object' ? error : null;
25544
+ const errorMessage = typeof errorObject?.message === 'string' && errorObject.message !== '' ? errorObject.message : '未知错误';
25545
+ const hasCause = errorObject?.cause !== undefined;
25546
+ const isNotFoundError = errorObject?.status === 404 || typeof errorObject?.statusText === 'string' && /not\s*found/i.test(errorObject.statusText) || /no routes matched location|not found|404/i.test(errorMessage);
25547
+ const title = isNotFoundError ? '页面不存在(404)' : '出错了,请稍后再试';
25548
+ const friendlyMessage = isNotFoundError ? '访问的路由未注册或不存在,请检查访问地址。' : '请稍后再试或联系技术支持';
25549
+ const displayMessage = isDevelopment ? errorMessage : friendlyMessage;
25688
25550
  return /*#__PURE__*/ jsxRuntime.jsx("div", {
25689
25551
  role: "alert",
25690
25552
  style: {
@@ -25707,10 +25569,10 @@
25707
25569
  style: {
25708
25570
  marginTop: 0
25709
25571
  },
25710
- children: "出错了,请稍后再试"
25572
+ children: title
25711
25573
  }),
25712
25574
  /*#__PURE__*/ jsxRuntime.jsx("p", {
25713
- children: isDevelopment ? error.message : '请稍后再试或联系技术支持'
25575
+ children: displayMessage
25714
25576
  }),
25715
25577
  /*#__PURE__*/ jsxRuntime.jsxs("div", {
25716
25578
  style: {
@@ -25761,10 +25623,10 @@
25761
25623
  /*#__PURE__*/ jsxRuntime.jsx("strong", {
25762
25624
  children: "错误信息:"
25763
25625
  }),
25764
- error.message
25626
+ errorMessage
25765
25627
  ]
25766
25628
  }),
25767
- error.stack && /*#__PURE__*/ jsxRuntime.jsxs("div", {
25629
+ errorObject?.stack && /*#__PURE__*/ jsxRuntime.jsxs("div", {
25768
25630
  style: {
25769
25631
  marginBottom: 10,
25770
25632
  whiteSpace: 'pre-wrap',
@@ -25775,7 +25637,7 @@
25775
25637
  children: "堆栈:"
25776
25638
  }),
25777
25639
  /*#__PURE__*/ jsxRuntime.jsx("br", {}),
25778
- error.stack
25640
+ errorObject.stack
25779
25641
  ]
25780
25642
  }),
25781
25643
  hasCause && /*#__PURE__*/ jsxRuntime.jsxs("div", {
@@ -25783,7 +25645,7 @@
25783
25645
  /*#__PURE__*/ jsxRuntime.jsx("strong", {
25784
25646
  children: "原因:"
25785
25647
  }),
25786
- errorWithCause.cause instanceof Error ? errorWithCause.cause.message : String(errorWithCause.cause)
25648
+ errorObject?.cause instanceof Error ? errorObject.cause.message : String(errorObject?.cause)
25787
25649
  ]
25788
25650
  })
25789
25651
  ]
@@ -29688,8 +29550,7 @@
29688
29550
  const initContext = await initialization({
29689
29551
  loggerLevel: options.loggerLevel,
29690
29552
  locale: i18n.resources,
29691
- lifecycle: options.lifecycle,
29692
- configStrategy: undefined
29553
+ lifecycle: options.lifecycle
29693
29554
  });
29694
29555
  await options.lifecycle?.afterInitialization?.(initContext);
29695
29556
  });
@@ -29821,8 +29682,6 @@
29821
29682
  // 3. 使用无 UI Kernel 管理启动阶段(配置、主题、i18n、服务注入、统一错误处理)
29822
29683
  const kernelRuntime = await startKernel({
29823
29684
  loggerLevel: options.loggerLevel,
29824
- configLoader: options.configStrategy?.loadCriticalConfig,
29825
- configFallback: options.configStrategy?.fallbackConfig,
29826
29685
  locale: {
29827
29686
  locale: (options.locale ? Object.keys(options.locale)[0] : 'zh-CN') || 'zh-CN',
29828
29687
  resources: options.locale
@@ -30370,32 +30229,6 @@
30370
30229
  }
30371
30230
  }
30372
30231
 
30373
- function buildAntdCompatTheme(theme) {
30374
- const token = {
30375
- ...theme.tokens || {}
30376
- };
30377
- if (theme.primaryColor) {
30378
- token.colorPrimary = theme.primaryColor;
30379
- }
30380
- return {
30381
- ...theme.compatibility?.antd || {},
30382
- token
30383
- };
30384
- }
30385
- function buildShadcnCompatTheme(theme) {
30386
- const cssVariables = {
30387
- ...theme.compatibility?.shadcn || {},
30388
- ...theme.tokens || {}
30389
- };
30390
- if (theme.primaryColor) {
30391
- cssVariables['app-primary-color'] = theme.primaryColor;
30392
- }
30393
- return {
30394
- cssVariables,
30395
- className: theme.mode === 'dark' ? 'dark' : theme.mode === 'light' ? 'light' : 'system'
30396
- };
30397
- }
30398
-
30399
30232
  function _define_property$8(obj, key, value) {
30400
30233
  if (key in obj) {
30401
30234
  Object.defineProperty(obj, key, {
@@ -34173,8 +34006,6 @@
34173
34006
  exports.adapterRegistry = adapterRegistry;
34174
34007
  exports.appConfig = appConfig;
34175
34008
  exports.axiosAdapter = axiosAdapter;
34176
- exports.buildAntdCompatTheme = buildAntdCompatTheme;
34177
- exports.buildShadcnCompatTheme = buildShadcnCompatTheme;
34178
34009
  exports.cancelRequestContext = cancelRequestContext;
34179
34010
  exports.clearCurrentTraceId = clearCurrentTraceId;
34180
34011
  exports.commonSchemas = commonSchemas;