@vlian/framework 1.2.62 → 1.2.63
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/analytics.umd.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/state.umd.js +1 -1
- package/package.json +21 -6
- package/dist/components/LocaleSwitch.cjs +0 -1
- package/dist/components/LocaleSwitch.d.ts +0 -21
- package/dist/components/LocaleSwitch.js +0 -1
- package/dist/components/ThemeSwitch.cjs +0 -1
- package/dist/components/ThemeSwitch.d.ts +0 -20
- package/dist/components/ThemeSwitch.js +0 -1
- package/dist/core/Test.cjs +0 -1
- package/dist/core/Test.d.ts +0 -5
- package/dist/core/Test.js +0 -1
- package/dist/core/app/AppContext.cjs +0 -1
- package/dist/core/app/AppContext.d.ts +0 -113
- package/dist/core/app/AppContext.js +0 -1
- package/dist/core/app/AppContext.types.cjs +0 -1
- package/dist/core/app/AppContext.types.d.ts +0 -146
- package/dist/core/app/AppContext.types.js +0 -1
- package/dist/core/app/BasicLayout.cjs +0 -1
- package/dist/core/app/BasicLayout.d.ts +0 -15
- package/dist/core/app/BasicLayout.js +0 -1
- package/dist/core/app/DefaultApp.cjs +0 -1
- package/dist/core/app/DefaultApp.d.ts +0 -10
- package/dist/core/app/DefaultApp.js +0 -1
- package/dist/core/app/index.cjs +0 -1
- package/dist/core/app/index.d.ts +0 -8
- package/dist/core/app/index.js +0 -1
- package/dist/core/config/AppConfig.cjs +0 -1
- package/dist/core/config/AppConfig.d.ts +0 -88
- package/dist/core/config/AppConfig.js +0 -1
- package/dist/core/config/ConfigLoader.cjs +0 -1
- package/dist/core/config/ConfigLoader.d.ts +0 -118
- package/dist/core/config/ConfigLoader.js +0 -1
- package/dist/core/config/ConfigValidator.cjs +0 -2
- package/dist/core/config/ConfigValidator.d.ts +0 -84
- package/dist/core/config/ConfigValidator.js +0 -2
- package/dist/core/config/index.cjs +0 -1
- package/dist/core/config/index.d.ts +0 -6
- package/dist/core/config/index.js +0 -1
- package/dist/core/dev/DevTools.cjs +0 -1
- package/dist/core/dev/DevTools.d.ts +0 -16
- package/dist/core/dev/DevTools.js +0 -1
- package/dist/core/error/ErrorBoundary.cjs +0 -1
- package/dist/core/error/ErrorBoundary.d.ts +0 -121
- package/dist/core/error/ErrorBoundary.js +0 -1
- package/dist/core/error/ErrorHandler.cjs +0 -1
- package/dist/core/error/ErrorHandler.d.ts +0 -171
- package/dist/core/error/ErrorHandler.js +0 -1
- package/dist/core/error/index.cjs +0 -1
- package/dist/core/error/index.d.ts +0 -7
- package/dist/core/error/index.js +0 -1
- package/dist/core/event/AppEventBus.cjs +0 -1
- package/dist/core/event/AppEventBus.d.ts +0 -178
- package/dist/core/event/AppEventBus.js +0 -1
- package/dist/core/event/frameworkEvents.cjs +0 -1
- package/dist/core/event/frameworkEvents.d.ts +0 -69
- package/dist/core/event/frameworkEvents.js +0 -1
- package/dist/core/event/hooks.cjs +0 -1
- package/dist/core/event/hooks.d.ts +0 -57
- package/dist/core/event/hooks.js +0 -1
- package/dist/core/event/index.cjs +0 -1
- package/dist/core/event/index.d.ts +0 -10
- package/dist/core/event/index.js +0 -1
- package/dist/core/event/types.cjs +0 -1
- package/dist/core/event/types.d.ts +0 -269
- package/dist/core/event/types.js +0 -1
- package/dist/core/event/useEventBus.cjs +0 -1
- package/dist/core/event/useEventBus.d.ts +0 -28
- package/dist/core/event/useEventBus.js +0 -1
- package/dist/core/index.cjs +0 -1
- package/dist/core/index.d.ts +0 -54
- package/dist/core/index.js +0 -1
- package/dist/core/initialization/InitializationErrorThrower.cjs +0 -1
- package/dist/core/initialization/InitializationErrorThrower.d.ts +0 -7
- package/dist/core/initialization/InitializationErrorThrower.js +0 -1
- package/dist/core/initialization/index.cjs +0 -1
- package/dist/core/initialization/index.d.ts +0 -7
- package/dist/core/initialization/index.js +0 -1
- package/dist/core/initialization/initialization.cjs +0 -1
- package/dist/core/initialization/initialization.d.ts +0 -69
- package/dist/core/initialization/initialization.js +0 -1
- package/dist/core/initialization/initializationErrorState.cjs +0 -1
- package/dist/core/initialization/initializationErrorState.d.ts +0 -35
- package/dist/core/initialization/initializationErrorState.js +0 -1
- package/dist/core/kernel/defaultAdapters.cjs +0 -1
- package/dist/core/kernel/defaultAdapters.d.ts +0 -2
- package/dist/core/kernel/defaultAdapters.js +0 -1
- package/dist/core/kernel/errors.cjs +0 -1
- package/dist/core/kernel/errors.d.ts +0 -18
- package/dist/core/kernel/errors.js +0 -1
- package/dist/core/kernel/index.cjs +0 -1
- package/dist/core/kernel/index.d.ts +0 -3
- package/dist/core/kernel/index.js +0 -1
- package/dist/core/kernel/startKernel.cjs +0 -1
- package/dist/core/kernel/startKernel.d.ts +0 -2
- package/dist/core/kernel/startKernel.js +0 -1
- package/dist/core/kernel/types.cjs +0 -1
- package/dist/core/kernel/types.d.ts +0 -114
- package/dist/core/kernel/types.js +0 -1
- package/dist/core/middleware.cjs +0 -1
- package/dist/core/middleware.d.ts +0 -36
- package/dist/core/middleware.js +0 -1
- package/dist/core/plugin/PluginEventBus.cjs +0 -1
- package/dist/core/plugin/PluginEventBus.d.ts +0 -169
- package/dist/core/plugin/PluginEventBus.js +0 -1
- package/dist/core/plugin/PluginSandbox.cjs +0 -1
- package/dist/core/plugin/PluginSandbox.d.ts +0 -101
- package/dist/core/plugin/PluginSandbox.js +0 -1
- package/dist/core/plugin.cjs +0 -1
- package/dist/core/plugin.d.ts +0 -224
- package/dist/core/plugin.js +0 -1
- package/dist/core/router/RouterManager.cjs +0 -1
- package/dist/core/router/RouterManager.d.ts +0 -87
- package/dist/core/router/RouterManager.js +0 -1
- package/dist/core/router/adapter/AdapterManager.cjs +0 -1
- package/dist/core/router/adapter/AdapterManager.d.ts +0 -94
- package/dist/core/router/adapter/AdapterManager.js +0 -1
- package/dist/core/router/adapter/index.cjs +0 -1
- package/dist/core/router/adapter/index.d.ts +0 -6
- package/dist/core/router/adapter/index.js +0 -1
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs +0 -1
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts +0 -43
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js +0 -1
- package/dist/core/router/adapter/react-router/index.cjs +0 -1
- package/dist/core/router/adapter/react-router/index.d.ts +0 -4
- package/dist/core/router/adapter/react-router/index.js +0 -1
- package/dist/core/router/adapter/types.cjs +0 -1
- package/dist/core/router/adapter/types.d.ts +0 -111
- package/dist/core/router/adapter/types.js +0 -1
- package/dist/core/router/dev/RouterDevTools.cjs +0 -1
- package/dist/core/router/dev/RouterDevTools.d.ts +0 -5
- package/dist/core/router/dev/RouterDevTools.js +0 -1
- package/dist/core/router/dev/index.cjs +0 -1
- package/dist/core/router/dev/index.d.ts +0 -4
- package/dist/core/router/dev/index.js +0 -1
- package/dist/core/router/dynamic/DynamicRouteManager.cjs +0 -1
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts +0 -71
- package/dist/core/router/dynamic/DynamicRouteManager.js +0 -1
- package/dist/core/router/dynamic/index.cjs +0 -1
- package/dist/core/router/dynamic/index.d.ts +0 -4
- package/dist/core/router/dynamic/index.js +0 -1
- package/dist/core/router/errors/RouterError.cjs +0 -1
- package/dist/core/router/errors/RouterError.d.ts +0 -48
- package/dist/core/router/errors/RouterError.js +0 -1
- package/dist/core/router/errors/index.cjs +0 -1
- package/dist/core/router/errors/index.d.ts +0 -4
- package/dist/core/router/errors/index.js +0 -1
- package/dist/core/router/index.cjs +0 -1
- package/dist/core/router/index.d.ts +0 -16
- package/dist/core/router/index.js +0 -1
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs +0 -1
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts +0 -56
- package/dist/core/router/lifecycle/RouterLifecycleManager.js +0 -1
- package/dist/core/router/lifecycle/index.cjs +0 -1
- package/dist/core/router/lifecycle/index.d.ts +0 -4
- package/dist/core/router/lifecycle/index.js +0 -1
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs +0 -1
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts +0 -61
- package/dist/core/router/middleware/RouterMiddlewareManager.js +0 -1
- package/dist/core/router/middleware/auth.cjs +0 -1
- package/dist/core/router/middleware/auth.d.ts +0 -54
- package/dist/core/router/middleware/auth.js +0 -1
- package/dist/core/router/middleware/index.cjs +0 -1
- package/dist/core/router/middleware/index.d.ts +0 -6
- package/dist/core/router/middleware/index.js +0 -1
- package/dist/core/router/middleware/types.cjs +0 -1
- package/dist/core/router/middleware/types.d.ts +0 -82
- package/dist/core/router/middleware/types.js +0 -1
- package/dist/core/router/monitoring/RouterMonitoring.cjs +0 -1
- package/dist/core/router/monitoring/RouterMonitoring.d.ts +0 -134
- package/dist/core/router/monitoring/RouterMonitoring.js +0 -1
- package/dist/core/router/monitoring/index.cjs +0 -1
- package/dist/core/router/monitoring/index.d.ts +0 -4
- package/dist/core/router/monitoring/index.js +0 -1
- package/dist/core/router/navigation/RouterNavigation.cjs +0 -1
- package/dist/core/router/navigation/RouterNavigation.d.ts +0 -43
- package/dist/core/router/navigation/RouterNavigation.js +0 -1
- package/dist/core/router/navigation/index.cjs +0 -1
- package/dist/core/router/navigation/index.d.ts +0 -4
- package/dist/core/router/navigation/index.js +0 -1
- package/dist/core/router/performance/RouteCache.cjs +0 -1
- package/dist/core/router/performance/RouteCache.d.ts +0 -113
- package/dist/core/router/performance/RouteCache.js +0 -1
- package/dist/core/router/performance/RoutePreloader.cjs +0 -1
- package/dist/core/router/performance/RoutePreloader.d.ts +0 -111
- package/dist/core/router/performance/RoutePreloader.js +0 -1
- package/dist/core/router/performance/index.cjs +0 -1
- package/dist/core/router/performance/index.d.ts +0 -5
- package/dist/core/router/performance/index.js +0 -1
- package/dist/core/router/plugin/RouterPluginManager.cjs +0 -1
- package/dist/core/router/plugin/RouterPluginManager.d.ts +0 -74
- package/dist/core/router/plugin/RouterPluginManager.js +0 -1
- package/dist/core/router/plugin/index.cjs +0 -1
- package/dist/core/router/plugin/index.d.ts +0 -5
- package/dist/core/router/plugin/index.js +0 -1
- package/dist/core/router/plugin/types.cjs +0 -1
- package/dist/core/router/plugin/types.d.ts +0 -153
- package/dist/core/router/plugin/types.js +0 -1
- package/dist/core/router/types.cjs +0 -1
- package/dist/core/router/types.d.ts +0 -464
- package/dist/core/router/types.js +0 -1
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +0 -1
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +0 -2
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +0 -1
- package/dist/core/router/utils/adapters/react-router/transform.cjs +0 -1
- package/dist/core/router/utils/adapters/react-router/transform.d.ts +0 -5
- package/dist/core/router/utils/adapters/react-router/transform.js +0 -1
- package/dist/core/router/utils/transform.cjs +0 -1
- package/dist/core/router/utils/transform.d.ts +0 -348
- package/dist/core/router/utils/transform.js +0 -1
- package/dist/core/router/validation/RouterConfigValidator.cjs +0 -2
- package/dist/core/router/validation/RouterConfigValidator.d.ts +0 -121
- package/dist/core/router/validation/RouterConfigValidator.js +0 -2
- package/dist/core/router/validation/index.cjs +0 -1
- package/dist/core/router/validation/index.d.ts +0 -5
- package/dist/core/router/validation/index.js +0 -1
- package/dist/core/router/validation/schema.cjs +0 -1
- package/dist/core/router/validation/schema.d.ts +0 -180
- package/dist/core/router/validation/schema.js +0 -1
- package/dist/core/router/version/RouteVersionManager.cjs +0 -1
- package/dist/core/router/version/RouteVersionManager.d.ts +0 -124
- package/dist/core/router/version/RouteVersionManager.js +0 -1
- package/dist/core/router/version/index.cjs +0 -1
- package/dist/core/router/version/index.d.ts +0 -4
- package/dist/core/router/version/index.js +0 -1
- package/dist/core/splash/SplashScreen.cjs +0 -1
- package/dist/core/splash/SplashScreen.d.ts +0 -14
- package/dist/core/splash/SplashScreen.js +0 -1
- package/dist/core/splash/index.cjs +0 -1
- package/dist/core/splash/index.d.ts +0 -5
- package/dist/core/splash/index.js +0 -1
- package/dist/core/splash/splashScreenUtils.cjs +0 -1
- package/dist/core/splash/splashScreenUtils.d.ts +0 -7
- package/dist/core/splash/splashScreenUtils.js +0 -1
- package/dist/core/startup/AppInstance.cjs +0 -1
- package/dist/core/startup/AppInstance.d.ts +0 -138
- package/dist/core/startup/AppInstance.js +0 -1
- package/dist/core/startup/environment.cjs +0 -1
- package/dist/core/startup/environment.d.ts +0 -87
- package/dist/core/startup/environment.js +0 -1
- package/dist/core/startup/index.cjs +0 -1
- package/dist/core/startup/index.d.ts +0 -7
- package/dist/core/startup/index.js +0 -1
- package/dist/core/startup/initializeServices.cjs +0 -1
- package/dist/core/startup/initializeServices.d.ts +0 -68
- package/dist/core/startup/initializeServices.js +0 -1
- package/dist/core/startup/performanceTracker.cjs +0 -1
- package/dist/core/startup/performanceTracker.d.ts +0 -104
- package/dist/core/startup/performanceTracker.js +0 -1
- package/dist/core/startup/renderApp.cjs +0 -1
- package/dist/core/startup/renderApp.d.ts +0 -70
- package/dist/core/startup/renderApp.js +0 -1
- package/dist/core/startup/startApp.cjs +0 -1
- package/dist/core/startup/startApp.d.ts +0 -14
- package/dist/core/startup/startApp.js +0 -1
- package/dist/core/types.cjs +0 -1
- package/dist/core/types.d.ts +0 -501
- package/dist/core/types.js +0 -1
- package/dist/core-bak/Test.cjs +0 -1
- package/dist/core-bak/Test.d.ts +0 -5
- package/dist/core-bak/Test.js +0 -1
- package/dist/core-bak/app/AppContext.cjs +0 -1
- package/dist/core-bak/app/AppContext.d.ts +0 -113
- package/dist/core-bak/app/AppContext.js +0 -1
- package/dist/core-bak/app/AppContext.types.cjs +0 -1
- package/dist/core-bak/app/AppContext.types.d.ts +0 -146
- package/dist/core-bak/app/AppContext.types.js +0 -1
- package/dist/core-bak/app/BasicLayout.cjs +0 -1
- package/dist/core-bak/app/BasicLayout.d.ts +0 -15
- package/dist/core-bak/app/BasicLayout.js +0 -1
- package/dist/core-bak/app/DefaultApp.cjs +0 -1
- package/dist/core-bak/app/DefaultApp.d.ts +0 -10
- package/dist/core-bak/app/DefaultApp.js +0 -1
- package/dist/core-bak/app/index.cjs +0 -1
- package/dist/core-bak/app/index.d.ts +0 -8
- package/dist/core-bak/app/index.js +0 -1
- package/dist/core-bak/config/AppConfig.cjs +0 -1
- package/dist/core-bak/config/AppConfig.d.ts +0 -88
- package/dist/core-bak/config/AppConfig.js +0 -1
- package/dist/core-bak/config/ConfigLoader.cjs +0 -1
- package/dist/core-bak/config/ConfigLoader.d.ts +0 -118
- package/dist/core-bak/config/ConfigLoader.js +0 -1
- package/dist/core-bak/config/ConfigValidator.cjs +0 -2
- package/dist/core-bak/config/ConfigValidator.d.ts +0 -84
- package/dist/core-bak/config/ConfigValidator.js +0 -2
- package/dist/core-bak/config/index.cjs +0 -1
- package/dist/core-bak/config/index.d.ts +0 -6
- package/dist/core-bak/config/index.js +0 -1
- package/dist/core-bak/dev/DevTools.cjs +0 -1
- package/dist/core-bak/dev/DevTools.d.ts +0 -16
- package/dist/core-bak/dev/DevTools.js +0 -1
- package/dist/core-bak/error/ErrorBoundary.cjs +0 -1
- package/dist/core-bak/error/ErrorBoundary.d.ts +0 -121
- package/dist/core-bak/error/ErrorBoundary.js +0 -1
- package/dist/core-bak/error/ErrorHandler.cjs +0 -1
- package/dist/core-bak/error/ErrorHandler.d.ts +0 -171
- package/dist/core-bak/error/ErrorHandler.js +0 -1
- package/dist/core-bak/error/index.cjs +0 -1
- package/dist/core-bak/error/index.d.ts +0 -7
- package/dist/core-bak/error/index.js +0 -1
- package/dist/core-bak/event/AppEventBus.cjs +0 -1
- package/dist/core-bak/event/AppEventBus.d.ts +0 -178
- package/dist/core-bak/event/AppEventBus.js +0 -1
- package/dist/core-bak/event/frameworkEvents.cjs +0 -1
- package/dist/core-bak/event/frameworkEvents.d.ts +0 -69
- package/dist/core-bak/event/frameworkEvents.js +0 -1
- package/dist/core-bak/event/hooks.cjs +0 -1
- package/dist/core-bak/event/hooks.d.ts +0 -57
- package/dist/core-bak/event/hooks.js +0 -1
- package/dist/core-bak/event/index.cjs +0 -1
- package/dist/core-bak/event/index.d.ts +0 -10
- package/dist/core-bak/event/index.js +0 -1
- package/dist/core-bak/event/types.cjs +0 -1
- package/dist/core-bak/event/types.d.ts +0 -269
- package/dist/core-bak/event/types.js +0 -1
- package/dist/core-bak/event/useEventBus.cjs +0 -1
- package/dist/core-bak/event/useEventBus.d.ts +0 -28
- package/dist/core-bak/event/useEventBus.js +0 -1
- package/dist/core-bak/index.cjs +0 -1
- package/dist/core-bak/index.d.ts +0 -54
- package/dist/core-bak/index.js +0 -1
- package/dist/core-bak/initialization/InitializationErrorThrower.cjs +0 -1
- package/dist/core-bak/initialization/InitializationErrorThrower.d.ts +0 -7
- package/dist/core-bak/initialization/InitializationErrorThrower.js +0 -1
- package/dist/core-bak/initialization/index.cjs +0 -1
- package/dist/core-bak/initialization/index.d.ts +0 -7
- package/dist/core-bak/initialization/index.js +0 -1
- package/dist/core-bak/initialization/initialization.cjs +0 -1
- package/dist/core-bak/initialization/initialization.d.ts +0 -69
- package/dist/core-bak/initialization/initialization.js +0 -1
- package/dist/core-bak/initialization/initializationErrorState.cjs +0 -1
- package/dist/core-bak/initialization/initializationErrorState.d.ts +0 -35
- package/dist/core-bak/initialization/initializationErrorState.js +0 -1
- package/dist/core-bak/kernel/defaultAdapters.cjs +0 -1
- package/dist/core-bak/kernel/defaultAdapters.d.ts +0 -2
- package/dist/core-bak/kernel/defaultAdapters.js +0 -1
- package/dist/core-bak/kernel/errors.cjs +0 -1
- package/dist/core-bak/kernel/errors.d.ts +0 -18
- package/dist/core-bak/kernel/errors.js +0 -1
- package/dist/core-bak/kernel/index.cjs +0 -1
- package/dist/core-bak/kernel/index.d.ts +0 -3
- package/dist/core-bak/kernel/index.js +0 -1
- package/dist/core-bak/kernel/startKernel.cjs +0 -1
- package/dist/core-bak/kernel/startKernel.d.ts +0 -2
- package/dist/core-bak/kernel/startKernel.js +0 -1
- package/dist/core-bak/kernel/types.cjs +0 -1
- package/dist/core-bak/kernel/types.d.ts +0 -114
- package/dist/core-bak/kernel/types.js +0 -1
- package/dist/core-bak/middleware.cjs +0 -1
- package/dist/core-bak/middleware.d.ts +0 -36
- package/dist/core-bak/middleware.js +0 -1
- package/dist/core-bak/plugin/PluginEventBus.cjs +0 -1
- package/dist/core-bak/plugin/PluginEventBus.d.ts +0 -169
- package/dist/core-bak/plugin/PluginEventBus.js +0 -1
- package/dist/core-bak/plugin/PluginSandbox.cjs +0 -1
- package/dist/core-bak/plugin/PluginSandbox.d.ts +0 -101
- package/dist/core-bak/plugin/PluginSandbox.js +0 -1
- package/dist/core-bak/plugin.cjs +0 -1
- package/dist/core-bak/plugin.d.ts +0 -224
- package/dist/core-bak/plugin.js +0 -1
- package/dist/core-bak/router/RouterManager.cjs +0 -1
- package/dist/core-bak/router/RouterManager.d.ts +0 -87
- package/dist/core-bak/router/RouterManager.js +0 -1
- package/dist/core-bak/router/adapter/AdapterManager.cjs +0 -1
- package/dist/core-bak/router/adapter/AdapterManager.d.ts +0 -94
- package/dist/core-bak/router/adapter/AdapterManager.js +0 -1
- package/dist/core-bak/router/adapter/index.cjs +0 -1
- package/dist/core-bak/router/adapter/index.d.ts +0 -6
- package/dist/core-bak/router/adapter/index.js +0 -1
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.cjs +0 -1
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.d.ts +0 -43
- package/dist/core-bak/router/adapter/react-router/ReactRouterAdapter.js +0 -1
- package/dist/core-bak/router/adapter/react-router/index.cjs +0 -1
- package/dist/core-bak/router/adapter/react-router/index.d.ts +0 -4
- package/dist/core-bak/router/adapter/react-router/index.js +0 -1
- package/dist/core-bak/router/adapter/types.cjs +0 -1
- package/dist/core-bak/router/adapter/types.d.ts +0 -111
- package/dist/core-bak/router/adapter/types.js +0 -1
- package/dist/core-bak/router/dev/RouterDevTools.cjs +0 -1
- package/dist/core-bak/router/dev/RouterDevTools.d.ts +0 -5
- package/dist/core-bak/router/dev/RouterDevTools.js +0 -1
- package/dist/core-bak/router/dev/index.cjs +0 -1
- package/dist/core-bak/router/dev/index.d.ts +0 -4
- package/dist/core-bak/router/dev/index.js +0 -1
- package/dist/core-bak/router/dynamic/DynamicRouteManager.cjs +0 -1
- package/dist/core-bak/router/dynamic/DynamicRouteManager.d.ts +0 -71
- package/dist/core-bak/router/dynamic/DynamicRouteManager.js +0 -1
- package/dist/core-bak/router/dynamic/index.cjs +0 -1
- package/dist/core-bak/router/dynamic/index.d.ts +0 -4
- package/dist/core-bak/router/dynamic/index.js +0 -1
- package/dist/core-bak/router/errors/RouterError.cjs +0 -1
- package/dist/core-bak/router/errors/RouterError.d.ts +0 -48
- package/dist/core-bak/router/errors/RouterError.js +0 -1
- package/dist/core-bak/router/errors/index.cjs +0 -1
- package/dist/core-bak/router/errors/index.d.ts +0 -4
- package/dist/core-bak/router/errors/index.js +0 -1
- package/dist/core-bak/router/index.cjs +0 -1
- package/dist/core-bak/router/index.d.ts +0 -16
- package/dist/core-bak/router/index.js +0 -1
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.cjs +0 -1
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.d.ts +0 -56
- package/dist/core-bak/router/lifecycle/RouterLifecycleManager.js +0 -1
- package/dist/core-bak/router/lifecycle/index.cjs +0 -1
- package/dist/core-bak/router/lifecycle/index.d.ts +0 -4
- package/dist/core-bak/router/lifecycle/index.js +0 -1
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.cjs +0 -1
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.d.ts +0 -61
- package/dist/core-bak/router/middleware/RouterMiddlewareManager.js +0 -1
- package/dist/core-bak/router/middleware/auth.cjs +0 -1
- package/dist/core-bak/router/middleware/auth.d.ts +0 -54
- package/dist/core-bak/router/middleware/auth.js +0 -1
- package/dist/core-bak/router/middleware/index.cjs +0 -1
- package/dist/core-bak/router/middleware/index.d.ts +0 -6
- package/dist/core-bak/router/middleware/index.js +0 -1
- package/dist/core-bak/router/middleware/types.cjs +0 -1
- package/dist/core-bak/router/middleware/types.d.ts +0 -82
- package/dist/core-bak/router/middleware/types.js +0 -1
- package/dist/core-bak/router/monitoring/RouterMonitoring.cjs +0 -1
- package/dist/core-bak/router/monitoring/RouterMonitoring.d.ts +0 -134
- package/dist/core-bak/router/monitoring/RouterMonitoring.js +0 -1
- package/dist/core-bak/router/monitoring/index.cjs +0 -1
- package/dist/core-bak/router/monitoring/index.d.ts +0 -4
- package/dist/core-bak/router/monitoring/index.js +0 -1
- package/dist/core-bak/router/navigation/RouterNavigation.cjs +0 -1
- package/dist/core-bak/router/navigation/RouterNavigation.d.ts +0 -43
- package/dist/core-bak/router/navigation/RouterNavigation.js +0 -1
- package/dist/core-bak/router/navigation/index.cjs +0 -1
- package/dist/core-bak/router/navigation/index.d.ts +0 -4
- package/dist/core-bak/router/navigation/index.js +0 -1
- package/dist/core-bak/router/performance/RouteCache.cjs +0 -1
- package/dist/core-bak/router/performance/RouteCache.d.ts +0 -113
- package/dist/core-bak/router/performance/RouteCache.js +0 -1
- package/dist/core-bak/router/performance/RoutePreloader.cjs +0 -1
- package/dist/core-bak/router/performance/RoutePreloader.d.ts +0 -111
- package/dist/core-bak/router/performance/RoutePreloader.js +0 -1
- package/dist/core-bak/router/performance/index.cjs +0 -1
- package/dist/core-bak/router/performance/index.d.ts +0 -5
- package/dist/core-bak/router/performance/index.js +0 -1
- package/dist/core-bak/router/plugin/RouterPluginManager.cjs +0 -1
- package/dist/core-bak/router/plugin/RouterPluginManager.d.ts +0 -74
- package/dist/core-bak/router/plugin/RouterPluginManager.js +0 -1
- package/dist/core-bak/router/plugin/index.cjs +0 -1
- package/dist/core-bak/router/plugin/index.d.ts +0 -5
- package/dist/core-bak/router/plugin/index.js +0 -1
- package/dist/core-bak/router/plugin/types.cjs +0 -1
- package/dist/core-bak/router/plugin/types.d.ts +0 -153
- package/dist/core-bak/router/plugin/types.js +0 -1
- package/dist/core-bak/router/types.cjs +0 -1
- package/dist/core-bak/router/types.d.ts +0 -464
- package/dist/core-bak/router/types.js +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.cjs +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +0 -2
- package/dist/core-bak/router/utils/adapters/react-router/RouteErrorBoundary.js +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/transform.cjs +0 -1
- package/dist/core-bak/router/utils/adapters/react-router/transform.d.ts +0 -5
- package/dist/core-bak/router/utils/adapters/react-router/transform.js +0 -1
- package/dist/core-bak/router/utils/transform.cjs +0 -1
- package/dist/core-bak/router/utils/transform.d.ts +0 -348
- package/dist/core-bak/router/utils/transform.js +0 -1
- package/dist/core-bak/router/validation/RouterConfigValidator.cjs +0 -2
- package/dist/core-bak/router/validation/RouterConfigValidator.d.ts +0 -121
- package/dist/core-bak/router/validation/RouterConfigValidator.js +0 -2
- package/dist/core-bak/router/validation/index.cjs +0 -1
- package/dist/core-bak/router/validation/index.d.ts +0 -5
- package/dist/core-bak/router/validation/index.js +0 -1
- package/dist/core-bak/router/validation/schema.cjs +0 -1
- package/dist/core-bak/router/validation/schema.d.ts +0 -180
- package/dist/core-bak/router/validation/schema.js +0 -1
- package/dist/core-bak/router/version/RouteVersionManager.cjs +0 -1
- package/dist/core-bak/router/version/RouteVersionManager.d.ts +0 -124
- package/dist/core-bak/router/version/RouteVersionManager.js +0 -1
- package/dist/core-bak/router/version/index.cjs +0 -1
- package/dist/core-bak/router/version/index.d.ts +0 -4
- package/dist/core-bak/router/version/index.js +0 -1
- package/dist/core-bak/splash/SplashScreen.cjs +0 -1
- package/dist/core-bak/splash/SplashScreen.d.ts +0 -14
- package/dist/core-bak/splash/SplashScreen.js +0 -1
- package/dist/core-bak/splash/index.cjs +0 -1
- package/dist/core-bak/splash/index.d.ts +0 -5
- package/dist/core-bak/splash/index.js +0 -1
- package/dist/core-bak/splash/splashScreenUtils.cjs +0 -1
- package/dist/core-bak/splash/splashScreenUtils.d.ts +0 -7
- package/dist/core-bak/splash/splashScreenUtils.js +0 -1
- package/dist/core-bak/startup/AppInstance.cjs +0 -1
- package/dist/core-bak/startup/AppInstance.d.ts +0 -138
- package/dist/core-bak/startup/AppInstance.js +0 -1
- package/dist/core-bak/startup/environment.cjs +0 -1
- package/dist/core-bak/startup/environment.d.ts +0 -87
- package/dist/core-bak/startup/environment.js +0 -1
- package/dist/core-bak/startup/index.cjs +0 -1
- package/dist/core-bak/startup/index.d.ts +0 -7
- package/dist/core-bak/startup/index.js +0 -1
- package/dist/core-bak/startup/initializeServices.cjs +0 -1
- package/dist/core-bak/startup/initializeServices.d.ts +0 -68
- package/dist/core-bak/startup/initializeServices.js +0 -1
- package/dist/core-bak/startup/performanceTracker.cjs +0 -1
- package/dist/core-bak/startup/performanceTracker.d.ts +0 -104
- package/dist/core-bak/startup/performanceTracker.js +0 -1
- package/dist/core-bak/startup/renderApp.cjs +0 -1
- package/dist/core-bak/startup/renderApp.d.ts +0 -70
- package/dist/core-bak/startup/renderApp.js +0 -1
- package/dist/core-bak/startup/startApp.cjs +0 -1
- package/dist/core-bak/startup/startApp.d.ts +0 -14
- package/dist/core-bak/startup/startApp.js +0 -1
- package/dist/core-bak/types.cjs +0 -1
- package/dist/core-bak/types.d.ts +0 -501
- package/dist/core-bak/types.js +0 -1
- package/dist/index.umd.cjs +0 -1
- package/dist/index.umd.d.ts +0 -7
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import type { LangType } from '../../library/locale/types';
|
|
2
|
-
import type { InitializationContext } from '../initialization';
|
|
3
|
-
import type { StateManager } from '../../state';
|
|
4
|
-
import type { UIProviderConfig } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* 主题配置
|
|
7
|
-
*/
|
|
8
|
-
export interface ThemeConfig {
|
|
9
|
-
/**
|
|
10
|
-
* 主题模式:'light' | 'dark' | 'system'
|
|
11
|
-
* - 'light': 浅色主题
|
|
12
|
-
* - 'dark': 深色主题
|
|
13
|
-
* - 'system': 跟随系统设置
|
|
14
|
-
*/
|
|
15
|
-
mode?: 'light' | 'dark' | 'system';
|
|
16
|
-
/**
|
|
17
|
-
* 主题色(主色调)
|
|
18
|
-
*/
|
|
19
|
-
primaryColor?: string;
|
|
20
|
-
/**
|
|
21
|
-
* 自定义主题配置
|
|
22
|
-
*/
|
|
23
|
-
custom?: Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 应用配置接口
|
|
27
|
-
*/
|
|
28
|
-
export interface AppConfig {
|
|
29
|
-
/**
|
|
30
|
-
* 主题配置
|
|
31
|
-
*/
|
|
32
|
-
theme: ThemeConfig;
|
|
33
|
-
/**
|
|
34
|
-
* 国际化语言
|
|
35
|
-
*/
|
|
36
|
-
locale: LangType;
|
|
37
|
-
/**
|
|
38
|
-
* Ant Design 配置
|
|
39
|
-
*/
|
|
40
|
-
antdConfig?: UIProviderConfig;
|
|
41
|
-
/**
|
|
42
|
-
* 初始化上下文
|
|
43
|
-
*/
|
|
44
|
-
initializationContext?: InitializationContext;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 主题上下文值
|
|
48
|
-
*/
|
|
49
|
-
export interface ThemeContextValue {
|
|
50
|
-
/**
|
|
51
|
-
* 主题配置
|
|
52
|
-
*/
|
|
53
|
-
theme: ThemeConfig;
|
|
54
|
-
/**
|
|
55
|
-
* 更新主题
|
|
56
|
-
*/
|
|
57
|
-
setTheme: (theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)) => void;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* 国际化上下文值
|
|
61
|
-
*/
|
|
62
|
-
export interface LocaleContextValue {
|
|
63
|
-
/**
|
|
64
|
-
* 当前语言
|
|
65
|
-
*/
|
|
66
|
-
locale: LangType;
|
|
67
|
-
/**
|
|
68
|
-
* 更新语言
|
|
69
|
-
*/
|
|
70
|
-
setLocale: (locale: LangType) => void;
|
|
71
|
-
/**
|
|
72
|
-
* 是否正在切换语言
|
|
73
|
-
*/
|
|
74
|
-
isChanging?: boolean;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 配置上下文值
|
|
78
|
-
*/
|
|
79
|
-
export interface ConfigContextValue {
|
|
80
|
-
/**
|
|
81
|
-
* Ant Design 配置
|
|
82
|
-
*/
|
|
83
|
-
antdConfig?: UIProviderConfig;
|
|
84
|
-
/**
|
|
85
|
-
* 初始化上下文
|
|
86
|
-
*/
|
|
87
|
-
initializationContext?: InitializationContext;
|
|
88
|
-
/**
|
|
89
|
-
* 更新 Ant Design 配置
|
|
90
|
-
*/
|
|
91
|
-
setAntdConfig: (config: UIProviderConfig | undefined) => void;
|
|
92
|
-
/**
|
|
93
|
-
* 更新初始化上下文
|
|
94
|
-
*/
|
|
95
|
-
setInitializationContext: (context: InitializationContext | undefined) => void;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* 状态管理器上下文值
|
|
99
|
-
*/
|
|
100
|
-
export interface StateManagerContextValue {
|
|
101
|
-
/**
|
|
102
|
-
* 状态管理器实例
|
|
103
|
-
*/
|
|
104
|
-
stateManager: StateManager | null;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* 应用全局上下文值(聚合所有上下文)
|
|
108
|
-
*/
|
|
109
|
-
export interface AppContextValue {
|
|
110
|
-
/**
|
|
111
|
-
* 主题配置
|
|
112
|
-
*/
|
|
113
|
-
theme: ThemeConfig;
|
|
114
|
-
/**
|
|
115
|
-
* 国际化语言
|
|
116
|
-
*/
|
|
117
|
-
locale: LangType;
|
|
118
|
-
/**
|
|
119
|
-
* Ant Design 配置
|
|
120
|
-
*/
|
|
121
|
-
antdConfig?: UIProviderConfig;
|
|
122
|
-
/**
|
|
123
|
-
* 初始化上下文
|
|
124
|
-
*/
|
|
125
|
-
initializationContext?: InitializationContext;
|
|
126
|
-
/**
|
|
127
|
-
* 状态管理器实例
|
|
128
|
-
*/
|
|
129
|
-
stateManager: StateManager | null;
|
|
130
|
-
/**
|
|
131
|
-
* 更新主题
|
|
132
|
-
*/
|
|
133
|
-
setTheme: (theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)) => void;
|
|
134
|
-
/**
|
|
135
|
-
* 更新国际化语言
|
|
136
|
-
*/
|
|
137
|
-
setLocale: (locale: LangType) => void;
|
|
138
|
-
/**
|
|
139
|
-
* 更新 Ant Design 配置
|
|
140
|
-
*/
|
|
141
|
-
setAntdConfig: (config: UIProviderConfig | undefined) => void;
|
|
142
|
-
/**
|
|
143
|
-
* 更新初始化上下文
|
|
144
|
-
*/
|
|
145
|
-
setInitializationContext: (context: InitializationContext | undefined) => void;
|
|
146
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BasicLayout",{enumerable:true,get:function(){return BasicLayout}});const _jsxruntime=require("react/jsx-runtime");const _react=/*#__PURE__*/_interop_require_wildcard(require("react"));const _AppContext=require("./AppContext");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}const BasicLayout=(0,_react.memo)(({children,configProps:externalConfigProps,globalProvider})=>{const{antdConfig,theme}=(0,_AppContext.useAppContext)();const[isSystemDark,setIsSystemDark]=_react.default.useState(()=>{if(typeof window==="undefined"){return false}return window.matchMedia("(prefers-color-scheme: dark)").matches});const finalConfigProps=antdConfig||externalConfigProps;_react.default.useEffect(()=>{if(typeof window==="undefined"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const updateSystemTheme=event=>{setIsSystemDark(event.matches)};setIsSystemDark(mediaQuery.matches);if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",updateSystemTheme);return()=>mediaQuery.removeEventListener("change",updateSystemTheme)}mediaQuery.addListener(updateSystemTheme);return()=>mediaQuery.removeListener(updateSystemTheme)},[]);const resolvedMode=theme.mode==="system"?isSystemDark?"dark":"light":theme.mode;const cssVars=_react.default.useMemo(()=>{const vars={};if(theme.primaryColor){vars["--app-primary-color"]=theme.primaryColor}if(finalConfigProps&&typeof finalConfigProps==="object"){const cssVariables=finalConfigProps.cssVariables;if(cssVariables&&typeof cssVariables==="object"){Object.entries(cssVariables).forEach(([key,value])=>{vars[`--${key}`]=String(value)})}}return vars},[finalConfigProps,theme.primaryColor]);const GlobalProvider=_react.default.useMemo(()=>globalProvider?_react.default.lazy(globalProvider):null,[globalProvider]);const renderedContent=_react.default.useMemo(()=>{if(!GlobalProvider){return children}return(0,_jsxruntime.jsx)(_react.default.Suspense,{fallback:null,children:(0,_jsxruntime.jsx)(GlobalProvider,{children:children})})},[GlobalProvider,children]);return(0,_jsxruntime.jsx)("div",{"data-theme-mode":resolvedMode,style:cssVars,children:renderedContent})});BasicLayout.displayName="BasicLayout";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PropsWithChildren } from 'react';
|
|
3
|
-
import type { GlobalProviderLoader, UIProviderConfig } from '../types';
|
|
4
|
-
interface BasicLayoutProps {
|
|
5
|
-
/**
|
|
6
|
-
* 外部传入 UI provider 配置(向后兼容沿用 configProps 命名)
|
|
7
|
-
*/
|
|
8
|
-
configProps?: UIProviderConfig;
|
|
9
|
-
/**
|
|
10
|
-
* 全局 UI 包裹组件懒加载器
|
|
11
|
-
*/
|
|
12
|
-
globalProvider?: GlobalProviderLoader;
|
|
13
|
-
}
|
|
14
|
-
declare const BasicLayout: React.FC<PropsWithChildren<BasicLayoutProps>>;
|
|
15
|
-
export { BasicLayout };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import React,{memo}from"react";import{useAppContext}from"./AppContext";const BasicLayout=memo(({children,configProps:externalConfigProps,globalProvider})=>{const{antdConfig,theme}=useAppContext();const[isSystemDark,setIsSystemDark]=React.useState(()=>{if(typeof window==="undefined"){return false}return window.matchMedia("(prefers-color-scheme: dark)").matches});const finalConfigProps=antdConfig||externalConfigProps;React.useEffect(()=>{if(typeof window==="undefined"){return}const mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const updateSystemTheme=event=>{setIsSystemDark(event.matches)};setIsSystemDark(mediaQuery.matches);if(typeof mediaQuery.addEventListener==="function"){mediaQuery.addEventListener("change",updateSystemTheme);return()=>mediaQuery.removeEventListener("change",updateSystemTheme)}mediaQuery.addListener(updateSystemTheme);return()=>mediaQuery.removeListener(updateSystemTheme)},[]);const resolvedMode=theme.mode==="system"?isSystemDark?"dark":"light":theme.mode;const cssVars=React.useMemo(()=>{const vars={};if(theme.primaryColor){vars["--app-primary-color"]=theme.primaryColor}if(finalConfigProps&&typeof finalConfigProps==="object"){const cssVariables=finalConfigProps.cssVariables;if(cssVariables&&typeof cssVariables==="object"){Object.entries(cssVariables).forEach(([key,value])=>{vars[`--${key}`]=String(value)})}}return vars},[finalConfigProps,theme.primaryColor]);const GlobalProvider=React.useMemo(()=>globalProvider?React.lazy(globalProvider):null,[globalProvider]);const renderedContent=React.useMemo(()=>{if(!GlobalProvider){return children}return _jsx(React.Suspense,{fallback:null,children:_jsx(GlobalProvider,{children:children})})},[GlobalProvider,children]);return _jsx("div",{"data-theme-mode":resolvedMode,style:cssVars,children:renderedContent})});BasicLayout.displayName="BasicLayout";export{BasicLayout};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"DefaultApp",{enumerable:true,get:function(){return DefaultApp}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _library=require("../../library");const cardStyle={background:"rgba(255, 255, 255, 0.96)",borderRadius:10,boxShadow:"0 6px 20px rgba(0, 0, 0, 0.14)",padding:20};const DefaultApp=(0,_react.memo)(({title,description})=>{const displayTitle=title||(0,_library.$t)("defaultApp.title");const displayDescription=description||(0,_library.$t)("defaultApp.description");return(0,_jsxruntime.jsx)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"linear-gradient(130deg, #274c77 0%, #2c7da0 42%, #61a5c2 100%)"},children:(0,_jsxruntime.jsxs)("div",{style:{maxWidth:860,width:"100%"},children:[(0,_jsxruntime.jsxs)("div",{style:{textAlign:"center",marginBottom:28,color:"#fff"},children:[(0,_jsxruntime.jsx)("div",{style:{fontSize:56,lineHeight:"60px",marginBottom:12},children:"🚀"}),(0,_jsxruntime.jsx)("h1",{style:{margin:0,fontSize:34},children:displayTitle}),(0,_jsxruntime.jsx)("p",{style:{marginTop:12,opacity:.9},children:displayDescription})]}),(0,_jsxruntime.jsxs)("div",{style:{display:"grid",gap:16},children:[(0,_jsxruntime.jsxs)("section",{style:cardStyle,children:[(0,_jsxruntime.jsxs)("h2",{style:{marginTop:0},children:["💻 ",(0,_library.$t)("defaultApp.quickStart.title")]}),(0,_jsxruntime.jsx)("p",{children:(0,_library.$t)("defaultApp.quickStart.description")}),(0,_jsxruntime.jsx)("pre",{style:{margin:0,background:"#f4f6f8",borderRadius:8,padding:12,overflowX:"auto"},children:(0,_library.$t)("defaultApp.quickStart.code")})]}),(0,_jsxruntime.jsxs)("section",{style:cardStyle,children:[(0,_jsxruntime.jsxs)("h2",{style:{marginTop:0},children:["📚 ",(0,_library.$t)("defaultApp.nextSteps.title")]}),(0,_jsxruntime.jsxs)("ul",{style:{paddingLeft:20,marginBottom:0},children:[(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step1")}),(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step2")}),(0,_jsxruntime.jsx)("li",{children:(0,_library.$t)("defaultApp.nextSteps.step3")})]})]})]}),(0,_jsxruntime.jsx)("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.88)",marginTop:18},children:(0,_library.$t)("defaultApp.footer")})]})})});DefaultApp.displayName="DefaultApp";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{memo}from"react";import{$t}from"../../library";const cardStyle={background:"rgba(255, 255, 255, 0.96)",borderRadius:10,boxShadow:"0 6px 20px rgba(0, 0, 0, 0.14)",padding:20};const DefaultApp=memo(({title,description})=>{const displayTitle=title||$t("defaultApp.title");const displayDescription=description||$t("defaultApp.description");return _jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"linear-gradient(130deg, #274c77 0%, #2c7da0 42%, #61a5c2 100%)"},children:_jsxs("div",{style:{maxWidth:860,width:"100%"},children:[_jsxs("div",{style:{textAlign:"center",marginBottom:28,color:"#fff"},children:[_jsx("div",{style:{fontSize:56,lineHeight:"60px",marginBottom:12},children:"🚀"}),_jsx("h1",{style:{margin:0,fontSize:34},children:displayTitle}),_jsx("p",{style:{marginTop:12,opacity:.9},children:displayDescription})]}),_jsxs("div",{style:{display:"grid",gap:16},children:[_jsxs("section",{style:cardStyle,children:[_jsxs("h2",{style:{marginTop:0},children:["💻 ",$t("defaultApp.quickStart.title")]}),_jsx("p",{children:$t("defaultApp.quickStart.description")}),_jsx("pre",{style:{margin:0,background:"#f4f6f8",borderRadius:8,padding:12,overflowX:"auto"},children:$t("defaultApp.quickStart.code")})]}),_jsxs("section",{style:cardStyle,children:[_jsxs("h2",{style:{marginTop:0},children:["📚 ",$t("defaultApp.nextSteps.title")]}),_jsxs("ul",{style:{paddingLeft:20,marginBottom:0},children:[_jsx("li",{children:$t("defaultApp.nextSteps.step1")}),_jsx("li",{children:$t("defaultApp.nextSteps.step2")}),_jsx("li",{children:$t("defaultApp.nextSteps.step3")})]})]})]}),_jsx("p",{style:{textAlign:"center",color:"rgba(255,255,255,0.88)",marginTop:18},children:$t("defaultApp.footer")})]})})});DefaultApp.displayName="DefaultApp";export{DefaultApp};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get AppContextProvider(){return _AppContext.AppContextProvider},get BasicLayout(){return _BasicLayout.BasicLayout},get DefaultApp(){return _DefaultApp.DefaultApp},get useAppContext(){return _AppContext.useAppContext},get useConfig(){return _AppContext.useConfig},get useLocale(){return _AppContext.useLocale},get useStateManager(){return _AppContext.useStateManager},get useTheme(){return _AppContext.useTheme}});const _AppContext=require("./AppContext");const _DefaultApp=require("./DefaultApp");const _BasicLayout=require("./BasicLayout");
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用核心模块
|
|
3
|
-
*/
|
|
4
|
-
export { AppContextProvider, useAppContext, useTheme, useLocale, useConfig, useStateManager } from './AppContext';
|
|
5
|
-
export type { AppContextProviderProps } from './AppContext';
|
|
6
|
-
export type { AppContextValue, ThemeContextValue, LocaleContextValue, ConfigContextValue, StateManagerContextValue, ThemeConfig, AppConfig, } from './AppContext.types';
|
|
7
|
-
export { DefaultApp } from './DefaultApp';
|
|
8
|
-
export { BasicLayout } from './BasicLayout';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{AppContextProvider,useAppContext,useTheme,useLocale,useConfig,useStateManager}from"./AppContext";export{DefaultApp}from"./DefaultApp";export{BasicLayout}from"./BasicLayout";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"appConfig",{enumerable:true,get:function(){return appConfig}});function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}let AppConfigManager=class AppConfigManager{static getInstance(){if(!AppConfigManager.instance){AppConfigManager.instance=new AppConfigManager}return AppConfigManager.instance}initialize(config){this._config={theme:config.theme||{mode:"light"},locale:config.locale||"zh-CN",antdConfig:config.antdConfig,initializationContext:config.initializationContext}}getConfig(){return{...this._config}}getTheme(){return{...this._config.theme}}setTheme(theme){if(typeof theme==="function"){this._config.theme=theme(this._config.theme)}else{this._config.theme={...theme}}}getLocale(){return this._config.locale}setLocale(locale){this._config.locale=locale}getAntdConfig(){return this._config.antdConfig}setAntdConfig(config){this._config.antdConfig=config}getInitializationContext(){return this._config.initializationContext}setInitializationContext(context){this._config.initializationContext=context}constructor(){_define_property(this,"_config",void 0);this._config={theme:{mode:"light"},locale:"zh-CN"}}};_define_property(AppConfigManager,"instance",null);const appConfig=AppConfigManager.getInstance();
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { LangType } from '../../library/locale/types';
|
|
2
|
-
import type { InitializationContext } from '../initialization';
|
|
3
|
-
import type { AppConfig, ThemeConfig } from '../app';
|
|
4
|
-
import type { UIProviderConfig } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* 应用配置单例
|
|
7
|
-
*
|
|
8
|
-
* 用于在非 React 代码中访问全局配置
|
|
9
|
-
*/
|
|
10
|
-
declare class AppConfigManager {
|
|
11
|
-
private static instance;
|
|
12
|
-
private _config;
|
|
13
|
-
/**
|
|
14
|
-
* 私有构造函数,防止外部直接实例化
|
|
15
|
-
*/
|
|
16
|
-
private constructor();
|
|
17
|
-
/**
|
|
18
|
-
* 获取单例实例
|
|
19
|
-
*
|
|
20
|
-
* @returns 单例实例
|
|
21
|
-
*/
|
|
22
|
-
static getInstance(): AppConfigManager;
|
|
23
|
-
/**
|
|
24
|
-
* 初始化配置
|
|
25
|
-
*
|
|
26
|
-
* @param config - 应用配置
|
|
27
|
-
*/
|
|
28
|
-
initialize(config: Partial<AppConfig>): void;
|
|
29
|
-
/**
|
|
30
|
-
* 获取完整配置
|
|
31
|
-
*
|
|
32
|
-
* @returns 应用配置
|
|
33
|
-
*/
|
|
34
|
-
getConfig(): AppConfig;
|
|
35
|
-
/**
|
|
36
|
-
* 获取主题配置
|
|
37
|
-
*
|
|
38
|
-
* @returns 主题配置
|
|
39
|
-
*/
|
|
40
|
-
getTheme(): ThemeConfig;
|
|
41
|
-
/**
|
|
42
|
-
* 更新主题配置
|
|
43
|
-
*
|
|
44
|
-
* @param theme - 主题配置或更新函数
|
|
45
|
-
*/
|
|
46
|
-
setTheme(theme: ThemeConfig | ((prev: ThemeConfig) => ThemeConfig)): void;
|
|
47
|
-
/**
|
|
48
|
-
* 获取当前语言
|
|
49
|
-
*
|
|
50
|
-
* @returns 当前语言
|
|
51
|
-
*/
|
|
52
|
-
getLocale(): LangType;
|
|
53
|
-
/**
|
|
54
|
-
* 更新语言
|
|
55
|
-
*
|
|
56
|
-
* @param locale - 语言类型
|
|
57
|
-
*/
|
|
58
|
-
setLocale(locale: LangType): void;
|
|
59
|
-
/**
|
|
60
|
-
* 获取 Ant Design 配置
|
|
61
|
-
*
|
|
62
|
-
* @returns Ant Design 配置
|
|
63
|
-
*/
|
|
64
|
-
getAntdConfig(): UIProviderConfig | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* 更新 Ant Design 配置
|
|
67
|
-
*
|
|
68
|
-
* @param config - Ant Design 配置
|
|
69
|
-
*/
|
|
70
|
-
setAntdConfig(config: UIProviderConfig | undefined): void;
|
|
71
|
-
/**
|
|
72
|
-
* 获取初始化上下文
|
|
73
|
-
*
|
|
74
|
-
* @returns 初始化上下文
|
|
75
|
-
*/
|
|
76
|
-
getInitializationContext(): InitializationContext | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* 更新初始化上下文
|
|
79
|
-
*
|
|
80
|
-
* @param context - 初始化上下文
|
|
81
|
-
*/
|
|
82
|
-
setInitializationContext(context: InitializationContext | undefined): void;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* 应用配置单例实例
|
|
86
|
-
*/
|
|
87
|
-
export declare const appConfig: AppConfigManager;
|
|
88
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}let AppConfigManager=class AppConfigManager{static getInstance(){if(!AppConfigManager.instance){AppConfigManager.instance=new AppConfigManager}return AppConfigManager.instance}initialize(config){this._config={theme:config.theme||{mode:"light"},locale:config.locale||"zh-CN",antdConfig:config.antdConfig,initializationContext:config.initializationContext}}getConfig(){return{...this._config}}getTheme(){return{...this._config.theme}}setTheme(theme){if(typeof theme==="function"){this._config.theme=theme(this._config.theme)}else{this._config.theme={...theme}}}getLocale(){return this._config.locale}setLocale(locale){this._config.locale=locale}getAntdConfig(){return this._config.antdConfig}setAntdConfig(config){this._config.antdConfig=config}getInitializationContext(){return this._config.initializationContext}setInitializationContext(context){this._config.initializationContext=context}constructor(){_define_property(this,"_config",void 0);this._config={theme:{mode:"light"},locale:"zh-CN"}}};_define_property(AppConfigManager,"instance",null);export const appConfig=AppConfigManager.getInstance();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get ConfigFileFormat(){return ConfigFileFormat},get ConfigLoader(){return ConfigLoader}});const _logger=require("@vlian/logger");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}var ConfigFileFormat=/*#__PURE__*/function(ConfigFileFormat){ConfigFileFormat["JSON"]="json";ConfigFileFormat["YAML"]="yaml";return ConfigFileFormat}({});let ConfigChangeNotifier=class ConfigChangeNotifier{addListener(listener){this.listeners.add(listener);return()=>{this.listeners.delete(listener)}}removeListener(listener){this.listeners.delete(listener)}notify(newConfig,oldConfig){this.listeners.forEach(listener=>{try{listener(newConfig,oldConfig)}catch(error){_logger.logger.warn("配置变更监听器执行失败:",error)}})}clear(){this.listeners.clear()}constructor(){_define_property(this,"listeners",new Set)}};const configChangeNotifier=new ConfigChangeNotifier;let ConfigLoader=class ConfigLoader{static async loadFromJSON(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}return await response.json()}if(typeof require!=="undefined"){const fs=require("fs");const content=fs.readFileSync(path,"utf-8");return JSON.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){_logger.logger.error(`加载JSON配置文件失败: ${path}`,error);throw error}}static async loadFromYAML(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}const text=await response.text();if(typeof window.YAML!=="undefined"){return window.YAML.parse(text)}try{return JSON.parse(text)}catch{throw new Error("需要YAML解析库,请安装 yaml 包")}}if(typeof require!=="undefined"){const fs=require("fs");const yaml=require("yaml");const content=fs.readFileSync(path,"utf-8");return yaml.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){_logger.logger.error(`加载YAML配置文件失败: ${path}`,error);throw error}}static async loadFromFile(options){const{path,format="json",required=false,defaultConfig={}}=options;if(!path){if(required){throw new Error("配置文件路径未指定")}return defaultConfig}try{let config;switch(format){case"json":config=await this.loadFromJSON(path);break;case"yaml":config=await this.loadFromYAML(path);break;default:throw new Error(`不支持的配置文件格式: ${format}`)}_logger.logger.info(`成功加载配置文件: ${path}`);return config}catch(error){if(required){throw error}_logger.logger.warn(`配置文件加载失败,使用默认配置: ${path}`,error);return defaultConfig}}static mergeConfig(base,override){const merged={...base};for(const key in override){if(!Object.prototype.hasOwnProperty.call(override,key)){continue}const baseValue=merged[key];const overrideValue=override[key];if(baseValue&&overrideValue&&typeof baseValue==="object"&&typeof overrideValue==="object"&&!Array.isArray(baseValue)&&!Array.isArray(overrideValue)){merged[key]=this.mergeConfig(baseValue,overrideValue)}else{merged[key]=overrideValue}}return merged}static async loadFromMultipleSources(sources){let merged={};for(const source of sources){if("path"in source&&"format"in source){const fileConfig=await this.loadFromFile(source);merged=this.mergeConfig(merged,fileConfig)}else if(!("path"in source)&&!("format"in source)){merged=this.mergeConfig(merged,source)}}return merged}static loadFromEnv(prefix="FRAMEWORK_"){const config={};if(typeof process==="undefined"||!process.env){return config}for(const[key,value]of Object.entries(process.env)){if(!key.startsWith(prefix)){continue}const configKey=key.slice(prefix.length).toLowerCase().split("_").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");let parsedValue=value;if(value==="true"||value==="false"){parsedValue=value==="true"}else if(!isNaN(Number(value))){parsedValue=Number(value)}else if(value?.startsWith("{")||value?.startsWith("[")){try{parsedValue=JSON.parse(value)}catch{}}config[configKey]=parsedValue}_logger.logger.debug("从环境变量加载配置:",config);return config}static async loadFromAllSources(sources=[],defaultConfig={},includeEnv=true,envPrefix="FRAMEWORK_"){const oldConfig={...defaultConfig};let merged={...defaultConfig};const fileConfigs=await this.loadFromMultipleSources(sources.filter(source=>typeof source==="object"&&"path"in source));merged=this.mergeConfig(merged,fileConfigs);if(includeEnv){const envConfig=this.loadFromEnv(envPrefix);merged=this.mergeConfig(merged,envConfig)}const codeConfigs=sources.filter(source=>typeof source==="object"&&!("path"in source));for(const codeConfig of codeConfigs){merged=this.mergeConfig(merged,codeConfig)}configChangeNotifier.notify(merged,oldConfig);return merged}static onConfigChange(listener){return configChangeNotifier.addListener(listener)}static removeConfigChangeListener(listener){configChangeNotifier.removeListener(listener)}};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 配置文件加载模块
|
|
3
|
-
* 支持从JSON/YAML文件加载配置
|
|
4
|
-
* 优化:支持环境变量配置、配置热更新
|
|
5
|
-
*/
|
|
6
|
-
import type { StartOptions } from '../types';
|
|
7
|
-
/**
|
|
8
|
-
* 配置文件格式
|
|
9
|
-
*/
|
|
10
|
-
export declare enum ConfigFileFormat {
|
|
11
|
-
JSON = "json",
|
|
12
|
-
YAML = "yaml"
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* 配置文件加载选项
|
|
16
|
-
*/
|
|
17
|
-
export interface ConfigFileLoadOptions {
|
|
18
|
-
/**
|
|
19
|
-
* 配置文件路径
|
|
20
|
-
*/
|
|
21
|
-
path?: string;
|
|
22
|
-
/**
|
|
23
|
-
* 配置文件格式
|
|
24
|
-
*/
|
|
25
|
-
format?: ConfigFileFormat;
|
|
26
|
-
/**
|
|
27
|
-
* 是否必需(如果为false,文件不存在时不报错)
|
|
28
|
-
*/
|
|
29
|
-
required?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* 默认配置(文件不存在时使用)
|
|
32
|
-
*/
|
|
33
|
-
defaultConfig?: Partial<StartOptions>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 配置变更监听器
|
|
37
|
-
*/
|
|
38
|
-
export type ConfigChangeListener = (newConfig: Partial<StartOptions>, oldConfig: Partial<StartOptions>) => void;
|
|
39
|
-
/**
|
|
40
|
-
* 配置加载器
|
|
41
|
-
*/
|
|
42
|
-
export declare class ConfigLoader {
|
|
43
|
-
/**
|
|
44
|
-
* 从JSON文件加载配置
|
|
45
|
-
*
|
|
46
|
-
* @param path - 文件路径
|
|
47
|
-
* @returns 配置对象
|
|
48
|
-
*/
|
|
49
|
-
static loadFromJSON(path: string): Promise<Partial<StartOptions>>;
|
|
50
|
-
/**
|
|
51
|
-
* 从YAML文件加载配置
|
|
52
|
-
*
|
|
53
|
-
* @param path - 文件路径
|
|
54
|
-
* @returns 配置对象
|
|
55
|
-
*/
|
|
56
|
-
static loadFromYAML(path: string): Promise<Partial<StartOptions>>;
|
|
57
|
-
/**
|
|
58
|
-
* 从文件加载配置
|
|
59
|
-
*
|
|
60
|
-
* @param options - 加载选项
|
|
61
|
-
* @returns 配置对象
|
|
62
|
-
*/
|
|
63
|
-
static loadFromFile(options: ConfigFileLoadOptions): Promise<Partial<StartOptions>>;
|
|
64
|
-
/**
|
|
65
|
-
* 合并配置(深度合并)
|
|
66
|
-
*
|
|
67
|
-
* @param base - 基础配置
|
|
68
|
-
* @param override - 覆盖配置
|
|
69
|
-
* @returns 合并后的配置
|
|
70
|
-
*/
|
|
71
|
-
static mergeConfig(base: Partial<StartOptions>, override: Partial<StartOptions>): Partial<StartOptions>;
|
|
72
|
-
/**
|
|
73
|
-
* 从多个源加载并合并配置
|
|
74
|
-
*
|
|
75
|
-
* @param sources - 配置源列表(按优先级从低到高)
|
|
76
|
-
* @returns 合并后的配置
|
|
77
|
-
*/
|
|
78
|
-
static loadFromMultipleSources(sources: Array<Partial<StartOptions> | ConfigFileLoadOptions>): Promise<Partial<StartOptions>>;
|
|
79
|
-
/**
|
|
80
|
-
* 从环境变量加载配置
|
|
81
|
-
*
|
|
82
|
-
* 支持以下环境变量格式:
|
|
83
|
-
* - FRAMEWORK_LOGGER_LEVEL=DEBUG
|
|
84
|
-
* - FRAMEWORK_SHOW_SPLASH_SCREEN=always
|
|
85
|
-
* - FRAMEWORK_MIN_SPLASH_SCREEN_TIME=1000
|
|
86
|
-
*
|
|
87
|
-
* @param prefix - 环境变量前缀,默认为 'FRAMEWORK_'
|
|
88
|
-
* @returns 配置对象
|
|
89
|
-
*/
|
|
90
|
-
static loadFromEnv(prefix?: string): Partial<StartOptions>;
|
|
91
|
-
/**
|
|
92
|
-
* 从多个源加载配置(包括环境变量)
|
|
93
|
-
*
|
|
94
|
-
* 优化:明确优先级,从低到高:
|
|
95
|
-
* 1. 默认配置
|
|
96
|
-
* 2. 配置文件
|
|
97
|
-
* 3. 环境变量
|
|
98
|
-
* 4. 代码配置(通过 sources 参数传入)
|
|
99
|
-
*
|
|
100
|
-
* @param sources - 配置源列表(代码配置,优先级最高)
|
|
101
|
-
* @param defaultConfig - 默认配置(优先级最低)
|
|
102
|
-
* @param includeEnv - 是否包含环境变量,默认为 true
|
|
103
|
-
* @param envPrefix - 环境变量前缀,默认为 'FRAMEWORK_'
|
|
104
|
-
* @returns 合并后的配置
|
|
105
|
-
*/
|
|
106
|
-
static loadFromAllSources(sources?: Array<Partial<StartOptions> | ConfigFileLoadOptions>, defaultConfig?: Partial<StartOptions>, includeEnv?: boolean, envPrefix?: string): Promise<Partial<StartOptions>>;
|
|
107
|
-
/**
|
|
108
|
-
* 添加配置变更监听器
|
|
109
|
-
*
|
|
110
|
-
* @param listener - 配置变更监听器
|
|
111
|
-
* @returns 取消监听的函数
|
|
112
|
-
*/
|
|
113
|
-
static onConfigChange(listener: ConfigChangeListener): () => void;
|
|
114
|
-
/**
|
|
115
|
-
* 移除配置变更监听器
|
|
116
|
-
*/
|
|
117
|
-
static removeConfigChangeListener(listener: ConfigChangeListener): void;
|
|
118
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import{logger}from"@vlian/logger";export var ConfigFileFormat=/*#__PURE__*/function(ConfigFileFormat){ConfigFileFormat["JSON"]="json";ConfigFileFormat["YAML"]="yaml";return ConfigFileFormat}({});let ConfigChangeNotifier=class ConfigChangeNotifier{addListener(listener){this.listeners.add(listener);return()=>{this.listeners.delete(listener)}}removeListener(listener){this.listeners.delete(listener)}notify(newConfig,oldConfig){this.listeners.forEach(listener=>{try{listener(newConfig,oldConfig)}catch(error){logger.warn("配置变更监听器执行失败:",error)}})}clear(){this.listeners.clear()}constructor(){_define_property(this,"listeners",new Set)}};const configChangeNotifier=new ConfigChangeNotifier;export class ConfigLoader{static async loadFromJSON(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}return await response.json()}if(typeof require!=="undefined"){const fs=require("fs");const content=fs.readFileSync(path,"utf-8");return JSON.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){logger.error(`加载JSON配置文件失败: ${path}`,error);throw error}}static async loadFromYAML(path){try{if(typeof window!=="undefined"){const response=await fetch(path);if(!response.ok){throw new Error(`无法加载配置文件: ${path} (${response.status})`)}const text=await response.text();if(typeof window.YAML!=="undefined"){return window.YAML.parse(text)}try{return JSON.parse(text)}catch{throw new Error("需要YAML解析库,请安装 yaml 包")}}if(typeof require!=="undefined"){const fs=require("fs");const yaml=require("yaml");const content=fs.readFileSync(path,"utf-8");return yaml.parse(content)}throw new Error("不支持的环境:无法加载配置文件")}catch(error){logger.error(`加载YAML配置文件失败: ${path}`,error);throw error}}static async loadFromFile(options){const{path,format="json",required=false,defaultConfig={}}=options;if(!path){if(required){throw new Error("配置文件路径未指定")}return defaultConfig}try{let config;switch(format){case"json":config=await this.loadFromJSON(path);break;case"yaml":config=await this.loadFromYAML(path);break;default:throw new Error(`不支持的配置文件格式: ${format}`)}logger.info(`成功加载配置文件: ${path}`);return config}catch(error){if(required){throw error}logger.warn(`配置文件加载失败,使用默认配置: ${path}`,error);return defaultConfig}}static mergeConfig(base,override){const merged={...base};for(const key in override){if(!Object.prototype.hasOwnProperty.call(override,key)){continue}const baseValue=merged[key];const overrideValue=override[key];if(baseValue&&overrideValue&&typeof baseValue==="object"&&typeof overrideValue==="object"&&!Array.isArray(baseValue)&&!Array.isArray(overrideValue)){merged[key]=this.mergeConfig(baseValue,overrideValue)}else{merged[key]=overrideValue}}return merged}static async loadFromMultipleSources(sources){let merged={};for(const source of sources){if("path"in source&&"format"in source){const fileConfig=await this.loadFromFile(source);merged=this.mergeConfig(merged,fileConfig)}else if(!("path"in source)&&!("format"in source)){merged=this.mergeConfig(merged,source)}}return merged}static loadFromEnv(prefix="FRAMEWORK_"){const config={};if(typeof process==="undefined"||!process.env){return config}for(const[key,value]of Object.entries(process.env)){if(!key.startsWith(prefix)){continue}const configKey=key.slice(prefix.length).toLowerCase().split("_").map((part,index)=>index===0?part:part.charAt(0).toUpperCase()+part.slice(1)).join("");let parsedValue=value;if(value==="true"||value==="false"){parsedValue=value==="true"}else if(!isNaN(Number(value))){parsedValue=Number(value)}else if(value?.startsWith("{")||value?.startsWith("[")){try{parsedValue=JSON.parse(value)}catch{}}config[configKey]=parsedValue}logger.debug("从环境变量加载配置:",config);return config}static async loadFromAllSources(sources=[],defaultConfig={},includeEnv=true,envPrefix="FRAMEWORK_"){const oldConfig={...defaultConfig};let merged={...defaultConfig};const fileConfigs=await this.loadFromMultipleSources(sources.filter(source=>typeof source==="object"&&"path"in source));merged=this.mergeConfig(merged,fileConfigs);if(includeEnv){const envConfig=this.loadFromEnv(envPrefix);merged=this.mergeConfig(merged,envConfig)}const codeConfigs=sources.filter(source=>typeof source==="object"&&!("path"in source));for(const codeConfig of codeConfigs){merged=this.mergeConfig(merged,codeConfig)}configChangeNotifier.notify(merged,oldConfig);return merged}static onConfigChange(listener){return configChangeNotifier.addListener(listener)}static removeConfigChangeListener(listener){configChangeNotifier.removeListener(listener)}}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get ConfigValidationError(){return ConfigValidationError},get ConfigValidator(){return ConfigValidator}});const _zod=require("zod");function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}let ConfigValidationError=class ConfigValidationError extends Error{constructor(message,errors){super(message),_define_property(this,"errors",void 0),this.errors=errors;this.name="ConfigValidationError"}};let ConfigValidator=class ConfigValidator{static validate(config,schema){const result=schema.safeParse(config);if(!result.success){throw new ConfigValidationError("配置验证失败",result.error)}return result.data}static safeValidate(config,schema){const result=schema.safeParse(config);if(result.success){return{success:true,data:result.data}}return{success:false,error:result.error}}static createStartOptionsSchema(){return _zod.z.object({loggerLevel:_zod.z.enum(["DEBUG","INFO","WARN","ERROR"]).optional(),showSplashScreen:_zod.z.enum(["auto","always","never","first-time-only"]).optional(),minSplashScreenTime:_zod.z.number().positive().optional(),security:_zod.z.object({enableXSSProtection:_zod.z.boolean().optional(),validateConfig:_zod.z.boolean().optional(),sanitizeUserInput:_zod.z.boolean().optional(),csp:_zod.z.object({defaultSrc:_zod.z.array(_zod.z.string()).optional(),scriptSrc:_zod.z.array(_zod.z.string()).optional(),styleSrc:_zod.z.array(_zod.z.string()).optional(),imgSrc:_zod.z.array(_zod.z.string()).optional(),connectSrc:_zod.z.array(_zod.z.string()).optional(),fontSrc:_zod.z.array(_zod.z.string()).optional(),frameSrc:_zod.z.array(_zod.z.string()).optional(),allowUnsafeInline:_zod.z.boolean().optional(),allowUnsafeEval:_zod.z.boolean().optional()}).optional()}).optional()}).passthrough()}static validateWithFriendlyErrors(config,schema){const result=schema.safeParse(config);if(!result.success){const errorMessages=result.error.issues.map(issue=>{const path=issue.path.length>0?issue.path.join("."):"root";return`配置项 "${path}": ${issue.message}`});const friendlyMessage=`配置验证失败:
|
|
2
|
-
${errorMessages.join("\n")}`;throw new ConfigValidationError(friendlyMessage,result.error)}return result.data}};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 配置验证模块
|
|
3
|
-
* 使用Zod进行配置验证
|
|
4
|
-
*/
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
/**
|
|
7
|
-
* 配置验证错误
|
|
8
|
-
*/
|
|
9
|
-
export declare class ConfigValidationError extends Error {
|
|
10
|
-
readonly errors: z.ZodError;
|
|
11
|
-
constructor(message: string, errors: z.ZodError);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* 配置验证器
|
|
15
|
-
*/
|
|
16
|
-
export declare class ConfigValidator {
|
|
17
|
-
/**
|
|
18
|
-
* 验证配置
|
|
19
|
-
*
|
|
20
|
-
* @param config - 要验证的配置
|
|
21
|
-
* @param schema - Zod模式
|
|
22
|
-
* @returns 验证后的配置
|
|
23
|
-
* @throws ConfigValidationError 如果配置验证失败
|
|
24
|
-
*/
|
|
25
|
-
static validate<T>(config: unknown, schema: z.ZodSchema<T>): T;
|
|
26
|
-
/**
|
|
27
|
-
* 安全验证配置(不抛出异常)
|
|
28
|
-
*
|
|
29
|
-
* @param config - 要验证的配置
|
|
30
|
-
* @param schema - Zod模式
|
|
31
|
-
* @returns 验证结果
|
|
32
|
-
*/
|
|
33
|
-
static safeValidate<T>(config: unknown, schema: z.ZodSchema<T>): {
|
|
34
|
-
success: true;
|
|
35
|
-
data: T;
|
|
36
|
-
} | {
|
|
37
|
-
success: false;
|
|
38
|
-
error: z.ZodError;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* 创建StartOptions的部分验证模式
|
|
42
|
-
* 注意:这是一个基础模式,可以根据需要扩展
|
|
43
|
-
*/
|
|
44
|
-
static createStartOptionsSchema(): z.ZodObject<{
|
|
45
|
-
loggerLevel: z.ZodOptional<z.ZodEnum<{
|
|
46
|
-
DEBUG: "DEBUG";
|
|
47
|
-
INFO: "INFO";
|
|
48
|
-
WARN: "WARN";
|
|
49
|
-
ERROR: "ERROR";
|
|
50
|
-
}>>;
|
|
51
|
-
showSplashScreen: z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
auto: "auto";
|
|
53
|
-
always: "always";
|
|
54
|
-
never: "never";
|
|
55
|
-
"first-time-only": "first-time-only";
|
|
56
|
-
}>>;
|
|
57
|
-
minSplashScreenTime: z.ZodOptional<z.ZodNumber>;
|
|
58
|
-
security: z.ZodOptional<z.ZodObject<{
|
|
59
|
-
enableXSSProtection: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
validateConfig: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
-
sanitizeUserInput: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
-
csp: z.ZodOptional<z.ZodObject<{
|
|
63
|
-
defaultSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
-
scriptSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
-
styleSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
-
imgSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
-
connectSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
-
fontSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
-
frameSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
-
allowUnsafeInline: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
-
allowUnsafeEval: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
-
}, z.core.$strip>>;
|
|
73
|
-
}, z.core.$strip>>;
|
|
74
|
-
}, z.core.$loose>;
|
|
75
|
-
/**
|
|
76
|
-
* 验证配置并提供友好的错误信息
|
|
77
|
-
*
|
|
78
|
-
* @param config - 要验证的配置
|
|
79
|
-
* @param schema - Zod模式
|
|
80
|
-
* @returns 验证后的配置
|
|
81
|
-
* @throws ConfigValidationError 如果配置验证失败,包含详细的错误信息
|
|
82
|
-
*/
|
|
83
|
-
static validateWithFriendlyErrors<T>(config: unknown, schema: z.ZodSchema<T>): T;
|
|
84
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}import{z}from"zod";export class ConfigValidationError extends Error{constructor(message,errors){super(message),_define_property(this,"errors",void 0),this.errors=errors;this.name="ConfigValidationError"}}export class ConfigValidator{static validate(config,schema){const result=schema.safeParse(config);if(!result.success){throw new ConfigValidationError("配置验证失败",result.error)}return result.data}static safeValidate(config,schema){const result=schema.safeParse(config);if(result.success){return{success:true,data:result.data}}return{success:false,error:result.error}}static createStartOptionsSchema(){return z.object({loggerLevel:z.enum(["DEBUG","INFO","WARN","ERROR"]).optional(),showSplashScreen:z.enum(["auto","always","never","first-time-only"]).optional(),minSplashScreenTime:z.number().positive().optional(),security:z.object({enableXSSProtection:z.boolean().optional(),validateConfig:z.boolean().optional(),sanitizeUserInput:z.boolean().optional(),csp:z.object({defaultSrc:z.array(z.string()).optional(),scriptSrc:z.array(z.string()).optional(),styleSrc:z.array(z.string()).optional(),imgSrc:z.array(z.string()).optional(),connectSrc:z.array(z.string()).optional(),fontSrc:z.array(z.string()).optional(),frameSrc:z.array(z.string()).optional(),allowUnsafeInline:z.boolean().optional(),allowUnsafeEval:z.boolean().optional()}).optional()}).optional()}).passthrough()}static validateWithFriendlyErrors(config,schema){const result=schema.safeParse(config);if(!result.success){const errorMessages=result.error.issues.map(issue=>{const path=issue.path.length>0?issue.path.join("."):"root";return`配置项 "${path}": ${issue.message}`});const friendlyMessage=`配置验证失败:
|
|
2
|
-
${errorMessages.join("\n")}`;throw new ConfigValidationError(friendlyMessage,result.error)}return result.data}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"appConfig",{enumerable:true,get:function(){return _AppConfig.appConfig}});_export_star(require("./ConfigValidator"),exports);_export_star(require("./ConfigLoader"),exports);const _AppConfig=require("./AppConfig");function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export*from"./ConfigValidator";export*from"./ConfigLoader";export{appConfig}from"./AppConfig";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get DevTools(){return DevTools},get DevToolsTrigger(){return DevToolsTrigger}});const _jsxruntime=require("react/jsx-runtime");const _react=require("react");const _app=require("../app");function toPrettyJson(value){try{return JSON.stringify(value,null,2)}catch{return String(value)}}function DevTools({appInstance,visible,onClose}){const[performanceMetrics,setPerformanceMetrics]=(0,_react.useState)({});const stateManager=(0,_app.useStateManager)();(0,_react.useEffect)(()=>{if(!visible){return}const tracker=appInstance.getPerformanceTracker();if(!tracker){return}const metrics=tracker.getMetrics();setPerformanceMetrics({serviceInitDuration:metrics.serviceInitDuration||0,initializationDuration:metrics.initializationDuration||0,firstRenderDuration:metrics.firstRenderDuration||0,totalStartupDuration:metrics.totalStartupDuration||0,fcp:metrics.fcp||0,lcp:metrics.lcp||0,fid:metrics.fid||0,cls:metrics.cls||0})},[visible,appInstance]);if(!visible){return null}const options=appInstance.getOptions();const allStates=stateManager?.getAllStates?.()||[];return(0,_jsxruntime.jsxs)("div",{style:{position:"fixed",top:0,right:0,width:"min(680px, 95vw)",height:"100vh",zIndex:9999,background:"#fff",borderLeft:"1px solid #d9e2ec",padding:16,overflowY:"auto",boxShadow:"-8px 0 20px rgba(0, 0, 0, 0.08)"},children:[(0,_jsxruntime.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,_jsxruntime.jsx)("h3",{style:{margin:0},children:"DevTools"}),(0,_jsxruntime.jsx)("button",{onClick:onClose,style:{border:"none",background:"transparent",cursor:"pointer"},children:"关闭"})]}),(0,_jsxruntime.jsxs)("section",{style:{marginTop:12},children:[(0,_jsxruntime.jsx)("h4",{children:"实例"}),(0,_jsxruntime.jsxs)("div",{children:["id: ",appInstance.id]}),(0,_jsxruntime.jsxs)("div",{children:["initialized: ",String(appInstance.isInitialized())]})]}),(0,_jsxruntime.jsxs)("section",{style:{marginTop:12},children:[(0,_jsxruntime.jsx)("h4",{children:"性能"}),(0,_jsxruntime.jsx)("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8},children:toPrettyJson(performanceMetrics)})]}),(0,_jsxruntime.jsxs)("section",{style:{marginTop:12},children:[(0,_jsxruntime.jsx)("h4",{children:"状态管理"}),(0,_jsxruntime.jsxs)("div",{children:["stateCount: ",allStates.length]}),(0,_jsxruntime.jsx)("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8},children:toPrettyJson(allStates.slice(0,10))})]}),(0,_jsxruntime.jsxs)("section",{style:{marginTop:12},children:[(0,_jsxruntime.jsx)("h4",{children:"配置"}),(0,_jsxruntime.jsx)("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8,whiteSpace:"pre-wrap"},children:toPrettyJson(options)})]})]})}function resolvePosition(position){const style={position:"fixed",zIndex:9998};const pos=position||"bottom-right";if(pos.includes("bottom"))style.bottom=16;if(pos.includes("top"))style.top=16;if(pos.includes("right"))style.right=16;if(pos.includes("left"))style.left=16;return style}function DevToolsTrigger({appInstance,position="bottom-right"}){const[visible,setVisible]=(0,_react.useState)(false);if(process.env.NODE_ENV!=="development"){return null}return(0,_jsxruntime.jsxs)(_jsxruntime.Fragment,{children:[(0,_jsxruntime.jsx)("button",{onClick:()=>setVisible(true),style:{...resolvePosition(position),border:"none",background:"#2f80ed",color:"#fff",borderRadius:999,padding:"8px 14px",cursor:"pointer"},children:"DevTools"}),(0,_jsxruntime.jsx)(DevTools,{appInstance:appInstance,visible:visible,onClose:()=>setVisible(false)})]})}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 开发工具模块(无 UI 框架依赖)
|
|
3
|
-
*/
|
|
4
|
-
import type { ReactNode } from 'react';
|
|
5
|
-
import type { AppInstance } from '../startup/AppInstance';
|
|
6
|
-
export interface DevToolsProps {
|
|
7
|
-
appInstance: AppInstance;
|
|
8
|
-
visible?: boolean;
|
|
9
|
-
onClose?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function DevTools({ appInstance, visible, onClose }: DevToolsProps): ReactNode;
|
|
12
|
-
export interface DevToolsTriggerProps {
|
|
13
|
-
appInstance: AppInstance;
|
|
14
|
-
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
15
|
-
}
|
|
16
|
-
export declare function DevToolsTrigger({ appInstance, position }: DevToolsTriggerProps): ReactNode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";import{useState,useEffect}from"react";import{useStateManager}from"../app";function toPrettyJson(value){try{return JSON.stringify(value,null,2)}catch{return String(value)}}export function DevTools({appInstance,visible,onClose}){const[performanceMetrics,setPerformanceMetrics]=useState({});const stateManager=useStateManager();useEffect(()=>{if(!visible){return}const tracker=appInstance.getPerformanceTracker();if(!tracker){return}const metrics=tracker.getMetrics();setPerformanceMetrics({serviceInitDuration:metrics.serviceInitDuration||0,initializationDuration:metrics.initializationDuration||0,firstRenderDuration:metrics.firstRenderDuration||0,totalStartupDuration:metrics.totalStartupDuration||0,fcp:metrics.fcp||0,lcp:metrics.lcp||0,fid:metrics.fid||0,cls:metrics.cls||0})},[visible,appInstance]);if(!visible){return null}const options=appInstance.getOptions();const allStates=stateManager?.getAllStates?.()||[];return _jsxs("div",{style:{position:"fixed",top:0,right:0,width:"min(680px, 95vw)",height:"100vh",zIndex:9999,background:"#fff",borderLeft:"1px solid #d9e2ec",padding:16,overflowY:"auto",boxShadow:"-8px 0 20px rgba(0, 0, 0, 0.08)"},children:[_jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[_jsx("h3",{style:{margin:0},children:"DevTools"}),_jsx("button",{onClick:onClose,style:{border:"none",background:"transparent",cursor:"pointer"},children:"关闭"})]}),_jsxs("section",{style:{marginTop:12},children:[_jsx("h4",{children:"实例"}),_jsxs("div",{children:["id: ",appInstance.id]}),_jsxs("div",{children:["initialized: ",String(appInstance.isInitialized())]})]}),_jsxs("section",{style:{marginTop:12},children:[_jsx("h4",{children:"性能"}),_jsx("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8},children:toPrettyJson(performanceMetrics)})]}),_jsxs("section",{style:{marginTop:12},children:[_jsx("h4",{children:"状态管理"}),_jsxs("div",{children:["stateCount: ",allStates.length]}),_jsx("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8},children:toPrettyJson(allStates.slice(0,10))})]}),_jsxs("section",{style:{marginTop:12},children:[_jsx("h4",{children:"配置"}),_jsx("pre",{style:{background:"#f7fafc",padding:10,borderRadius:8,whiteSpace:"pre-wrap"},children:toPrettyJson(options)})]})]})}function resolvePosition(position){const style={position:"fixed",zIndex:9998};const pos=position||"bottom-right";if(pos.includes("bottom"))style.bottom=16;if(pos.includes("top"))style.top=16;if(pos.includes("right"))style.right=16;if(pos.includes("left"))style.left=16;return style}export function DevToolsTrigger({appInstance,position="bottom-right"}){const[visible,setVisible]=useState(false);if(process.env.NODE_ENV!=="development"){return null}return _jsxs(_Fragment,{children:[_jsx("button",{onClick:()=>setVisible(true),style:{...resolvePosition(position),border:"none",background:"#2f80ed",color:"#fff",borderRadius:999,padding:"8px 14px",cursor:"pointer"},children:"DevTools"}),_jsx(DevTools,{appInstance:appInstance,visible:visible,onClose:()=>setVisible(false)})]})}
|