@saolabs/client 1.0.0
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/README.md +221 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins.d.ts +38 -0
- package/dist/plugins.d.ts.map +1 -0
- package/dist/plugins.js +61 -0
- package/dist/plugins.js.map +1 -0
- package/dist/src/core/app/Application.d.ts +159 -0
- package/dist/src/core/app/Application.d.ts.map +1 -0
- package/dist/src/core/app/Application.js +338 -0
- package/dist/src/core/app/Application.js.map +1 -0
- package/dist/src/core/bootstrap/app.d.ts +4 -0
- package/dist/src/core/bootstrap/app.d.ts.map +1 -0
- package/dist/src/core/bootstrap/app.js +49 -0
- package/dist/src/core/bootstrap/app.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/ApiServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts +6 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.js +21 -0
- package/dist/src/core/bootstrap/providers/CoreServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts +7 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.js +14 -0
- package/dist/src/core/bootstrap/providers/HelperServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/RouteServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts +38 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.js +41 -0
- package/dist/src/core/bootstrap/providers/ServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts +9 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.js +18 -0
- package/dist/src/core/bootstrap/providers/ViewServiceProvider.js.map +1 -0
- package/dist/src/core/bootstrap/providers/default-providers.d.ts +14 -0
- package/dist/src/core/bootstrap/providers/default-providers.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/default-providers.js +79 -0
- package/dist/src/core/bootstrap/providers/default-providers.js.map +1 -0
- package/dist/src/core/bootstrap/providers/index.d.ts +10 -0
- package/dist/src/core/bootstrap/providers/index.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/index.js +9 -0
- package/dist/src/core/bootstrap/providers/index.js.map +1 -0
- package/dist/src/core/bootstrap/providers/provider-order.d.ts +19 -0
- package/dist/src/core/bootstrap/providers/provider-order.d.ts.map +1 -0
- package/dist/src/core/bootstrap/providers/provider-order.js +51 -0
- package/dist/src/core/bootstrap/providers/provider-order.js.map +1 -0
- package/dist/src/core/cache/ViewCache.d.ts +46 -0
- package/dist/src/core/cache/ViewCache.d.ts.map +1 -0
- package/dist/src/core/cache/ViewCache.js +85 -0
- package/dist/src/core/cache/ViewCache.js.map +1 -0
- package/dist/src/core/cache/index.d.ts +2 -0
- package/dist/src/core/cache/index.d.ts.map +1 -0
- package/dist/src/core/cache/index.js +2 -0
- package/dist/src/core/cache/index.js.map +1 -0
- package/dist/src/core/contracts/ApiInterface.d.ts +11 -0
- package/dist/src/core/contracts/ApiInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ApiInterface.js +2 -0
- package/dist/src/core/contracts/ApiInterface.js.map +1 -0
- package/dist/src/core/contracts/ApplicationInterface.d.ts +66 -0
- package/dist/src/core/contracts/ApplicationInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ApplicationInterface.js +3 -0
- package/dist/src/core/contracts/ApplicationInterface.js.map +1 -0
- package/dist/src/core/contracts/BlockInterface.d.ts +67 -0
- package/dist/src/core/contracts/BlockInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/BlockInterface.js +2 -0
- package/dist/src/core/contracts/BlockInterface.js.map +1 -0
- package/dist/src/core/contracts/ComponentInterface.d.ts +24 -0
- package/dist/src/core/contracts/ComponentInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ComponentInterface.js +2 -0
- package/dist/src/core/contracts/ComponentInterface.js.map +1 -0
- package/dist/src/core/contracts/ElementInterface.d.ts +117 -0
- package/dist/src/core/contracts/ElementInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ElementInterface.js +2 -0
- package/dist/src/core/contracts/ElementInterface.js.map +1 -0
- package/dist/src/core/contracts/EventServiceInterface.d.ts +37 -0
- package/dist/src/core/contracts/EventServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/EventServiceInterface.js +3 -0
- package/dist/src/core/contracts/EventServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/HelperInterface.d.ts +231 -0
- package/dist/src/core/contracts/HelperInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/HelperInterface.js +3 -0
- package/dist/src/core/contracts/HelperInterface.js.map +1 -0
- package/dist/src/core/contracts/HttpServiceInterface.d.ts +38 -0
- package/dist/src/core/contracts/HttpServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/HttpServiceInterface.js +3 -0
- package/dist/src/core/contracts/HttpServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/LoggerServiceInterface.d.ts +37 -0
- package/dist/src/core/contracts/LoggerServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/LoggerServiceInterface.js +3 -0
- package/dist/src/core/contracts/LoggerServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/LoopContextInterface.d.ts +14 -0
- package/dist/src/core/contracts/LoopContextInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/LoopContextInterface.js +3 -0
- package/dist/src/core/contracts/LoopContextInterface.js.map +1 -0
- package/dist/src/core/contracts/MarkerInterface.d.ts +55 -0
- package/dist/src/core/contracts/MarkerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/MarkerInterface.js +2 -0
- package/dist/src/core/contracts/MarkerInterface.js.map +1 -0
- package/dist/src/core/contracts/ReactiveInterface.d.ts +38 -0
- package/dist/src/core/contracts/ReactiveInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ReactiveInterface.js +2 -0
- package/dist/src/core/contracts/ReactiveInterface.js.map +1 -0
- package/dist/src/core/contracts/RouterInterface.d.ts +58 -0
- package/dist/src/core/contracts/RouterInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/RouterInterface.js +2 -0
- package/dist/src/core/contracts/RouterInterface.js.map +1 -0
- package/dist/src/core/contracts/ServiceProviderInterface.d.ts +12 -0
- package/dist/src/core/contracts/ServiceProviderInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ServiceProviderInterface.js +2 -0
- package/dist/src/core/contracts/ServiceProviderInterface.js.map +1 -0
- package/dist/src/core/contracts/StorageServiceInterface.d.ts +43 -0
- package/dist/src/core/contracts/StorageServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/StorageServiceInterface.js +3 -0
- package/dist/src/core/contracts/StorageServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/StoreServiceInterface.d.ts +45 -0
- package/dist/src/core/contracts/StoreServiceInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/StoreServiceInterface.js +3 -0
- package/dist/src/core/contracts/StoreServiceInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewCacheInterface.d.ts +13 -0
- package/dist/src/core/contracts/ViewCacheInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewCacheInterface.js +3 -0
- package/dist/src/core/contracts/ViewCacheInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewControllerInterface.d.ts +115 -0
- package/dist/src/core/contracts/ViewControllerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewControllerInterface.js +2 -0
- package/dist/src/core/contracts/ViewControllerInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewInterface.d.ts +24 -0
- package/dist/src/core/contracts/ViewInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewInterface.js +2 -0
- package/dist/src/core/contracts/ViewInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewManagerInterface.d.ts +44 -0
- package/dist/src/core/contracts/ViewManagerInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewManagerInterface.js +2 -0
- package/dist/src/core/contracts/ViewManagerInterface.js.map +1 -0
- package/dist/src/core/contracts/ViewStateInterface.d.ts +40 -0
- package/dist/src/core/contracts/ViewStateInterface.d.ts.map +1 -0
- package/dist/src/core/contracts/ViewStateInterface.js +3 -0
- package/dist/src/core/contracts/ViewStateInterface.js.map +1 -0
- package/dist/src/core/contracts/common.d.ts +28 -0
- package/dist/src/core/contracts/common.d.ts.map +1 -0
- package/dist/src/core/contracts/common.js +29 -0
- package/dist/src/core/contracts/common.js.map +1 -0
- package/dist/src/core/contracts/utils.d.ts +20 -0
- package/dist/src/core/contracts/utils.d.ts.map +1 -0
- package/dist/src/core/contracts/utils.js +4 -0
- package/dist/src/core/contracts/utils.js.map +1 -0
- package/dist/src/core/contracts/views.d.ts +23 -0
- package/dist/src/core/contracts/views.d.ts.map +1 -0
- package/dist/src/core/contracts/views.js +2 -0
- package/dist/src/core/contracts/views.js.map +1 -0
- package/dist/src/core/elements/Block.d.ts +58 -0
- package/dist/src/core/elements/Block.d.ts.map +1 -0
- package/dist/src/core/elements/Block.js +77 -0
- package/dist/src/core/elements/Block.js.map +1 -0
- package/dist/src/core/elements/BlockOutlet.d.ts +34 -0
- package/dist/src/core/elements/BlockOutlet.d.ts.map +1 -0
- package/dist/src/core/elements/BlockOutlet.js +59 -0
- package/dist/src/core/elements/BlockOutlet.js.map +1 -0
- package/dist/src/core/elements/Component.d.ts +62 -0
- package/dist/src/core/elements/Component.d.ts.map +1 -0
- package/dist/src/core/elements/Component.js +72 -0
- package/dist/src/core/elements/Component.js.map +1 -0
- package/dist/src/core/elements/ElementManager.d.ts +23 -0
- package/dist/src/core/elements/ElementManager.d.ts.map +1 -0
- package/dist/src/core/elements/ElementManager.js +33 -0
- package/dist/src/core/elements/ElementManager.js.map +1 -0
- package/dist/src/core/elements/Fragment.d.ts +51 -0
- package/dist/src/core/elements/Fragment.d.ts.map +1 -0
- package/dist/src/core/elements/Fragment.js +133 -0
- package/dist/src/core/elements/Fragment.js.map +1 -0
- package/dist/src/core/elements/Html.d.ts +52 -0
- package/dist/src/core/elements/Html.d.ts.map +1 -0
- package/dist/src/core/elements/Html.js +299 -0
- package/dist/src/core/elements/Html.js.map +1 -0
- package/dist/src/core/elements/Output.d.ts +69 -0
- package/dist/src/core/elements/Output.d.ts.map +1 -0
- package/dist/src/core/elements/Output.js +121 -0
- package/dist/src/core/elements/Output.js.map +1 -0
- package/dist/src/core/elements/Reactive.d.ts +77 -0
- package/dist/src/core/elements/Reactive.d.ts.map +1 -0
- package/dist/src/core/elements/Reactive.js +199 -0
- package/dist/src/core/elements/Reactive.js.map +1 -0
- package/dist/src/core/elements/TextElement.d.ts +46 -0
- package/dist/src/core/elements/TextElement.d.ts.map +1 -0
- package/dist/src/core/elements/TextElement.js +94 -0
- package/dist/src/core/elements/TextElement.js.map +1 -0
- package/dist/src/core/elements/Wrapper.d.ts +50 -0
- package/dist/src/core/elements/Wrapper.d.ts.map +1 -0
- package/dist/src/core/elements/Wrapper.js +96 -0
- package/dist/src/core/elements/Wrapper.js.map +1 -0
- package/dist/src/core/elements/Yield.d.ts +34 -0
- package/dist/src/core/elements/Yield.d.ts.map +1 -0
- package/dist/src/core/elements/Yield.js +56 -0
- package/dist/src/core/elements/Yield.js.map +1 -0
- package/dist/src/core/elements/helpers.d.ts +8 -0
- package/dist/src/core/elements/helpers.d.ts.map +1 -0
- package/dist/src/core/elements/helpers.js +40 -0
- package/dist/src/core/elements/helpers.js.map +1 -0
- package/dist/src/core/elements/index.d.ts +12 -0
- package/dist/src/core/elements/index.d.ts.map +1 -0
- package/dist/src/core/elements/index.js +12 -0
- package/dist/src/core/elements/index.js.map +1 -0
- package/dist/src/core/hellpers/ApiClient.d.ts +58 -0
- package/dist/src/core/hellpers/ApiClient.d.ts.map +1 -0
- package/dist/src/core/hellpers/ApiClient.js +122 -0
- package/dist/src/core/hellpers/ApiClient.js.map +1 -0
- package/dist/src/core/hellpers/app.d.ts +3 -0
- package/dist/src/core/hellpers/app.d.ts.map +1 -0
- package/dist/src/core/hellpers/app.js +53 -0
- package/dist/src/core/hellpers/app.js.map +1 -0
- package/dist/src/core/hellpers/utils.d.ts +26 -0
- package/dist/src/core/hellpers/utils.d.ts.map +1 -0
- package/dist/src/core/hellpers/utils.js +96 -0
- package/dist/src/core/hellpers/utils.js.map +1 -0
- package/dist/src/core/routers/Router.d.ts +212 -0
- package/dist/src/core/routers/Router.d.ts.map +1 -0
- package/dist/src/core/routers/Router.js +623 -0
- package/dist/src/core/routers/Router.js.map +1 -0
- package/dist/src/core/routers/index.d.ts +3 -0
- package/dist/src/core/routers/index.d.ts.map +1 -0
- package/dist/src/core/routers/index.js +2 -0
- package/dist/src/core/routers/index.js.map +1 -0
- package/dist/src/core/services/BlockManager.d.ts +63 -0
- package/dist/src/core/services/BlockManager.d.ts.map +1 -0
- package/dist/src/core/services/BlockManager.js +191 -0
- package/dist/src/core/services/BlockManager.js.map +1 -0
- package/dist/src/core/services/DomService.d.ts +9 -0
- package/dist/src/core/services/DomService.d.ts.map +1 -0
- package/dist/src/core/services/DomService.js +18 -0
- package/dist/src/core/services/DomService.js.map +1 -0
- package/dist/src/core/services/EventService.d.ts +58 -0
- package/dist/src/core/services/EventService.d.ts.map +1 -0
- package/dist/src/core/services/EventService.js +212 -0
- package/dist/src/core/services/EventService.js.map +1 -0
- package/dist/src/core/services/HelperService.d.ts +443 -0
- package/dist/src/core/services/HelperService.d.ts.map +1 -0
- package/dist/src/core/services/HelperService.js +1650 -0
- package/dist/src/core/services/HelperService.js.map +1 -0
- package/dist/src/core/services/HttpService.d.ts +63 -0
- package/dist/src/core/services/HttpService.d.ts.map +1 -0
- package/dist/src/core/services/HttpService.js +182 -0
- package/dist/src/core/services/HttpService.js.map +1 -0
- package/dist/src/core/services/LoggerService.d.ts +56 -0
- package/dist/src/core/services/LoggerService.d.ts.map +1 -0
- package/dist/src/core/services/LoggerService.js +94 -0
- package/dist/src/core/services/LoggerService.js.map +1 -0
- package/dist/src/core/services/MarkerRegistry.d.ts +94 -0
- package/dist/src/core/services/MarkerRegistry.d.ts.map +1 -0
- package/dist/src/core/services/MarkerRegistry.js +199 -0
- package/dist/src/core/services/MarkerRegistry.js.map +1 -0
- package/dist/src/core/services/MarkerService.d.ts +299 -0
- package/dist/src/core/services/MarkerService.d.ts.map +1 -0
- package/dist/src/core/services/MarkerService.js +723 -0
- package/dist/src/core/services/MarkerService.js.map +1 -0
- package/dist/src/core/services/StorageService.d.ts +69 -0
- package/dist/src/core/services/StorageService.d.ts.map +1 -0
- package/dist/src/core/services/StorageService.js +243 -0
- package/dist/src/core/services/StorageService.js.map +1 -0
- package/dist/src/core/services/StoreService.d.ts +80 -0
- package/dist/src/core/services/StoreService.d.ts.map +1 -0
- package/dist/src/core/services/StoreService.js +301 -0
- package/dist/src/core/services/StoreService.js.map +1 -0
- package/dist/src/core/services/index.d.ts +9 -0
- package/dist/src/core/services/index.d.ts.map +1 -0
- package/dist/src/core/services/index.js +9 -0
- package/dist/src/core/services/index.js.map +1 -0
- package/dist/src/core/types/utils.d.ts +29 -0
- package/dist/src/core/types/utils.d.ts.map +1 -0
- package/dist/src/core/types/utils.js +22 -0
- package/dist/src/core/types/utils.js.map +1 -0
- package/dist/src/core/view/LoopContext.d.ts +38 -0
- package/dist/src/core/view/LoopContext.d.ts.map +1 -0
- package/dist/src/core/view/LoopContext.js +100 -0
- package/dist/src/core/view/LoopContext.js.map +1 -0
- package/dist/src/core/view/Section.d.ts +41 -0
- package/dist/src/core/view/Section.d.ts.map +1 -0
- package/dist/src/core/view/Section.js +67 -0
- package/dist/src/core/view/Section.js.map +1 -0
- package/dist/src/core/view/View.d.ts +63 -0
- package/dist/src/core/view/View.d.ts.map +1 -0
- package/dist/src/core/view/View.js +85 -0
- package/dist/src/core/view/View.js.map +1 -0
- package/dist/src/core/view/ViewController.d.ts +277 -0
- package/dist/src/core/view/ViewController.d.ts.map +1 -0
- package/dist/src/core/view/ViewController.js +862 -0
- package/dist/src/core/view/ViewController.js.map +1 -0
- package/dist/src/core/view/ViewManager.d.ts +141 -0
- package/dist/src/core/view/ViewManager.d.ts.map +1 -0
- package/dist/src/core/view/ViewManager.js +565 -0
- package/dist/src/core/view/ViewManager.js.map +1 -0
- package/dist/src/core/view/ViewState.d.ts +117 -0
- package/dist/src/core/view/ViewState.d.ts.map +1 -0
- package/dist/src/core/view/ViewState.js +410 -0
- package/dist/src/core/view/ViewState.js.map +1 -0
- package/dist/src/core/view/index.d.ts +6 -0
- package/dist/src/core/view/index.d.ts.map +1 -0
- package/dist/src/core/view/index.js +6 -0
- package/dist/src/core/view/index.js.map +1 -0
- package/index.ts +62 -0
- package/package.json +70 -0
- package/plugins.ts +77 -0
- package/src/core/app/Application.ts +410 -0
- package/src/core/bootstrap/app.ts +58 -0
- package/src/core/bootstrap/providers/ApiServiceProvider.ts +18 -0
- package/src/core/bootstrap/providers/CoreServiceProvider.ts +19 -0
- package/src/core/bootstrap/providers/HelperServiceProvider.ts +12 -0
- package/src/core/bootstrap/providers/RouteServiceProvider.ts +17 -0
- package/src/core/bootstrap/providers/ServiceProvider.ts +51 -0
- package/src/core/bootstrap/providers/ViewServiceProvider.ts +17 -0
- package/src/core/bootstrap/providers/default-providers.ts +94 -0
- package/src/core/bootstrap/providers/index.ts +9 -0
- package/src/core/bootstrap/providers/provider-order.test.ts +67 -0
- package/src/core/bootstrap/providers/provider-order.ts +66 -0
- package/src/core/cache/ViewCache.ts +102 -0
- package/src/core/cache/index.ts +1 -0
- package/src/core/contracts/ApiInterface.ts +11 -0
- package/src/core/contracts/ApplicationInterface.ts +79 -0
- package/src/core/contracts/BlockInterface.ts +76 -0
- package/src/core/contracts/ComponentInterface.ts +26 -0
- package/src/core/contracts/ElementInterface.ts +140 -0
- package/src/core/contracts/EventServiceInterface.ts +47 -0
- package/src/core/contracts/HelperInterface.ts +256 -0
- package/src/core/contracts/HttpServiceInterface.ts +51 -0
- package/src/core/contracts/LoggerServiceInterface.ts +48 -0
- package/src/core/contracts/LoopContextInterface.ts +15 -0
- package/src/core/contracts/MarkerInterface.ts +77 -0
- package/src/core/contracts/ReactiveInterface.ts +45 -0
- package/src/core/contracts/RouterInterface.ts +65 -0
- package/src/core/contracts/ServiceProviderInterface.ts +12 -0
- package/src/core/contracts/StorageServiceInterface.ts +48 -0
- package/src/core/contracts/StoreServiceInterface.ts +50 -0
- package/src/core/contracts/ViewCacheInterface.ts +14 -0
- package/src/core/contracts/ViewControllerInterface.ts +135 -0
- package/src/core/contracts/ViewInterface.ts +31 -0
- package/src/core/contracts/ViewManagerInterface.ts +45 -0
- package/src/core/contracts/ViewStateInterface.ts +47 -0
- package/src/core/contracts/common.ts +27 -0
- package/src/core/contracts/utils.ts +23 -0
- package/src/core/contracts/views.ts +23 -0
- package/src/core/elements/Block.ts +113 -0
- package/src/core/elements/BlockOutlet.ts +83 -0
- package/src/core/elements/Component.ts +114 -0
- package/src/core/elements/ElementManager.ts +48 -0
- package/src/core/elements/Fragment.ts +168 -0
- package/src/core/elements/Html.ts +364 -0
- package/src/core/elements/Output.ts +167 -0
- package/src/core/elements/Reactive.ts +253 -0
- package/src/core/elements/TextElement.ts +110 -0
- package/src/core/elements/Wrapper.ts +131 -0
- package/src/core/elements/Yield.ts +70 -0
- package/src/core/elements/helpers.ts +56 -0
- package/src/core/elements/index.ts +26 -0
- package/src/core/hellpers/ApiClient.ts +145 -0
- package/src/core/hellpers/app.ts +57 -0
- package/src/core/hellpers/utils.ts +109 -0
- package/src/core/routers/Router.ts +765 -0
- package/src/core/routers/index.ts +2 -0
- package/src/core/services/BlockManager.ts +210 -0
- package/src/core/services/DomService.ts +26 -0
- package/src/core/services/EventService.ts +266 -0
- package/src/core/services/HelperService.ts +1653 -0
- package/src/core/services/HttpService.ts +235 -0
- package/src/core/services/LoggerService.ts +139 -0
- package/src/core/services/MarkerRegistry.ts +239 -0
- package/src/core/services/MarkerService.ts +923 -0
- package/src/core/services/StorageService.ts +268 -0
- package/src/core/services/StoreService.ts +338 -0
- package/src/core/services/index.ts +8 -0
- package/src/core/types/utils.ts +30 -0
- package/src/core/view/LoopContext.ts +109 -0
- package/src/core/view/Section.ts +86 -0
- package/src/core/view/View.ts +109 -0
- package/src/core/view/ViewController.ts +1002 -0
- package/src/core/view/ViewManager.ts +700 -0
- package/src/core/view/ViewState.ts +453 -0
- package/src/core/view/index.ts +5 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ViewStateInterface {
|
|
2
|
+
/** StateManager accessor */
|
|
3
|
+
__: StateManagerInterface;
|
|
4
|
+
/** Subscribe to state changes */
|
|
5
|
+
on(key: string | number | string[] | Record<string, (value: any) => void>, callback?: (value: any) => void): () => void;
|
|
6
|
+
/** Unsubscribe */
|
|
7
|
+
off(key: string | number | string[] | Record<string, (value: any) => void>, callback?: (value: any) => void): void;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
export interface StateManagerInterface {
|
|
11
|
+
/** Create reactive state — returns [value, setter, key] */
|
|
12
|
+
useState(value: any, key?: string | number): [any, (newValue: any) => void, string | number];
|
|
13
|
+
/** Update state by key */
|
|
14
|
+
updateStateByKey(key: string | number, value: any): any;
|
|
15
|
+
/** Get state value by key (supports nested paths: 'user.name') */
|
|
16
|
+
getStateByKey(key: string | number): any;
|
|
17
|
+
/** Subscribe to state changes */
|
|
18
|
+
subscribe(key: string | number | string[] | Record<string, (value: any) => void>, callback?: (value: any) => void): () => void;
|
|
19
|
+
/** Unsubscribe */
|
|
20
|
+
unsubscribe(key: string | number | string[] | Record<string, (value: any) => void>, callback?: (value: any) => void): void;
|
|
21
|
+
/** Register shorthand — useState alias */
|
|
22
|
+
register(key: string | number, value: any): (newValue: any) => void;
|
|
23
|
+
/** Destroy — cleanup all listeners and states */
|
|
24
|
+
destroy(): void;
|
|
25
|
+
}
|
|
26
|
+
/** State listener callback */
|
|
27
|
+
export type StateListener = (value: any) => void;
|
|
28
|
+
/** Multi-key state listener */
|
|
29
|
+
export interface MultiKeyStateListener {
|
|
30
|
+
keys: Set<string | number>;
|
|
31
|
+
callback: (values: Record<string, any>) => void;
|
|
32
|
+
called: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** State item stored internally by StateManager */
|
|
35
|
+
export interface StateItem {
|
|
36
|
+
value: any;
|
|
37
|
+
setValue: (value: any) => void;
|
|
38
|
+
key: string | number;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=ViewStateInterface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewStateInterface.d.ts","sourceRoot":"","sources":["../../../../src/core/contracts/ViewStateInterface.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IAC/B,4BAA4B;IAC5B,EAAE,EAAE,qBAAqB,CAAC;IAC1B,iCAAiC;IACjC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACxH,kBAAkB;IAClB,GAAG,CAAC,GAAG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AAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACpE,iDAAiD;IACjD,OAAO,IAAI,IAAI,CAAC;CACnB;AAID,8BAA8B;AAC9B,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;AAEjD,+BAA+B;AAC/B,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAChD,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,mDAAmD;AACnD,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewStateInterface.js","sourceRoot":"","sources":["../../../../src/core/contracts/ViewStateInterface.ts"],"names":[],"mappings":"AAAA,oEAAoE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type InitMode = 'create' | 'hydrate';
|
|
2
|
+
export declare enum InitModes {
|
|
3
|
+
CREATE = "create",
|
|
4
|
+
HYDRATE = "hydrate"
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Common types and utilities for OneView contracts
|
|
8
|
+
* This file defines shared types and enums used across OneView's contracts, such as initialization modes and system keys for HTML elements.
|
|
9
|
+
*
|
|
10
|
+
* Key exports:
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* System keys for HTML elements used by OneView.
|
|
14
|
+
* These keys are used to store metadata on HTML elements, such as IDs and view information.
|
|
15
|
+
* @name ESK (Element System Keys)
|
|
16
|
+
* @enum {string}
|
|
17
|
+
* @property {string} ID - Key for unique element ID
|
|
18
|
+
* @property {string} VIEW_ID - Key for associated view ID
|
|
19
|
+
* @property {string} BLOCK_NAME - Key for block name in block outlets
|
|
20
|
+
* @property {string} BLOCKOUTLET_NAME - Key for block outlet name
|
|
21
|
+
*/
|
|
22
|
+
export declare enum ESK {
|
|
23
|
+
ID = "data-one-id",
|
|
24
|
+
VIEW_ID = "data-one-view-id",
|
|
25
|
+
BLOCK_NAME = "data-one-block-name",
|
|
26
|
+
BLOCKOUTLET_NAME = "data-one-blockoutlet-name"
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/core/contracts/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC5C,oBAAY,SAAS;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACtB;AACD;;;;;GAKG;AACH;;;;;;;;;GASG;AACH,oBAAY,GAAG;IACX,EAAE,gBAAgB;IAClB,OAAO,qBAAqB;IAC5B,UAAU,wBAAwB;IAClC,gBAAgB,8BAA8B;CACjD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export var InitModes;
|
|
2
|
+
(function (InitModes) {
|
|
3
|
+
InitModes["CREATE"] = "create";
|
|
4
|
+
InitModes["HYDRATE"] = "hydrate";
|
|
5
|
+
})(InitModes || (InitModes = {}));
|
|
6
|
+
/**
|
|
7
|
+
* Common types and utilities for OneView contracts
|
|
8
|
+
* This file defines shared types and enums used across OneView's contracts, such as initialization modes and system keys for HTML elements.
|
|
9
|
+
*
|
|
10
|
+
* Key exports:
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* System keys for HTML elements used by OneView.
|
|
14
|
+
* These keys are used to store metadata on HTML elements, such as IDs and view information.
|
|
15
|
+
* @name ESK (Element System Keys)
|
|
16
|
+
* @enum {string}
|
|
17
|
+
* @property {string} ID - Key for unique element ID
|
|
18
|
+
* @property {string} VIEW_ID - Key for associated view ID
|
|
19
|
+
* @property {string} BLOCK_NAME - Key for block name in block outlets
|
|
20
|
+
* @property {string} BLOCKOUTLET_NAME - Key for block outlet name
|
|
21
|
+
*/
|
|
22
|
+
export var ESK;
|
|
23
|
+
(function (ESK) {
|
|
24
|
+
ESK["ID"] = "data-one-id";
|
|
25
|
+
ESK["VIEW_ID"] = "data-one-view-id";
|
|
26
|
+
ESK["BLOCK_NAME"] = "data-one-block-name";
|
|
27
|
+
ESK["BLOCKOUTLET_NAME"] = "data-one-blockoutlet-name";
|
|
28
|
+
})(ESK || (ESK = {}));
|
|
29
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/core/contracts/common.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AACD;;;;;GAKG;AACH;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,GAKX;AALD,WAAY,GAAG;IACX,yBAAkB,CAAA;IAClB,mCAA4B,CAAA;IAC5B,yCAAkC,CAAA;IAClC,qDAA8C,CAAA;AAClD,CAAC,EALW,GAAG,KAAH,GAAG,QAKd"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { LoopContextInterface } from "./LoopContextInterface";
|
|
2
|
+
export type { ViewStateInterface, StateManagerInterface, StateListener, MultiKeyStateListener, StateItem } from "./ViewStateInterface";
|
|
3
|
+
export type { OneNodeInterface, HtmlInterface, TextInterface, OutputInterface, FragmentInterface, OneElementConfig, HtmlElementConfig, OneElementEventHandler, OneElementChildren, OneChildrenFactoryOutput, OneChildrenFactory } from "./ElementInterface";
|
|
4
|
+
export type { ReactiveInterface, ReactiveRenderFn, ReactiveChildrenFactory, ReactiveConfig } from "./ReactiveInterface";
|
|
5
|
+
export type { BlockInterface, BlockOutletInterface, BlockManagerInterface, BlockRenderFactory } from "./BlockInterface";
|
|
6
|
+
export type { ViewControllerInterface, ViewType, ViewConfig, ViewRuntimeConfig } from "./ViewControllerInterface";
|
|
7
|
+
export type { ViewInterface, ViewRenderFactory, ViewConstructor, ViewLifecycleHooks } from "./ViewInterface";
|
|
8
|
+
export type { ComponentInterface } from "./ComponentInterface";
|
|
9
|
+
export type { ApplicationInterface, AppFactory, ServiceKey, ServiceFactory, ServiceBinding } from "./ApplicationInterface";
|
|
10
|
+
export type { ServiceProviderInterface } from "./ServiceProviderInterface";
|
|
11
|
+
export type { ViewCacheInterface } from "./ViewCacheInterface";
|
|
12
|
+
export type { ViewManagerInterface, ActiveViewInfo } from "./ViewManagerInterface";
|
|
13
|
+
export type { RouterInterface } from "./RouterInterface";
|
|
14
|
+
export type { HelperInterface, CollectionProxyInterface } from "./HelperInterface";
|
|
15
|
+
export type { EventServiceInterface, EventCallback } from "./EventServiceInterface";
|
|
16
|
+
export type { HttpServiceInterface, HttpRequestConfig, HttpResponse, HttpInterceptor } from "./HttpServiceInterface";
|
|
17
|
+
export type { StoreServiceInterface } from "./StoreServiceInterface";
|
|
18
|
+
export type { StorageServiceInterface, StorageEventCallback } from "./StorageServiceInterface";
|
|
19
|
+
export type { LoggerServiceInterface, LoggerConfig, LogEntry, LogLevel } from "./LoggerServiceInterface";
|
|
20
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core/contracts/utils.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,aAAa,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACvI,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,E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C;AAC/F,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/core/contracts/utils.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,0EAA0E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HtmlInterface, OneElementChildren } from "./ElementInterface";
|
|
2
|
+
import { ViewControllerInterface } from "./utils";
|
|
3
|
+
export type SectionItemType = 'static' | 'dynamic' | 'async' | 'reactive';
|
|
4
|
+
export type SectionContentType = 'text' | 'html';
|
|
5
|
+
export type SectionContentRenderer = (parentElement?: HtmlInterface | null | undefined) => string | OneElementChildren;
|
|
6
|
+
export type SectionConstruvtorArgs = {
|
|
7
|
+
ctx?: ViewControllerInterface | null;
|
|
8
|
+
name: string;
|
|
9
|
+
type: SectionItemType;
|
|
10
|
+
contentType?: SectionContentType;
|
|
11
|
+
stateKeys?: string[];
|
|
12
|
+
renderFactory: SectionContentRenderer;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
export interface SectionInterface {
|
|
16
|
+
ctx?: ViewControllerInterface | null;
|
|
17
|
+
name: string;
|
|
18
|
+
type: SectionItemType;
|
|
19
|
+
contentType?: SectionContentType;
|
|
20
|
+
stateKeys?: string[];
|
|
21
|
+
renderFactory?: SectionContentRenderer;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../../src/core/contracts/views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAA;AAChD,MAAM,MAAM,sBAAsB,GAAG,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,GAAG,kBAAkB,CAAC;AACvH,MAAM,MAAM,sBAAsB,GAAG;IACjC,GAAG,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,sBAAsB,CAAC;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB,CAAA;AACD,MAAM,WAAW,gBAAgB;IAC7B,GAAG,CAAC,EAAG,uBAAuB,GAAG,IAAI,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,sBAAsB,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../../../../src/core/contracts/views.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { BlockInterface, BlockRenderFactory } from "../contracts/BlockInterface";
|
|
2
|
+
import { InitMode } from "../contracts/common";
|
|
3
|
+
import type { FragmentInterface, HtmlInterface } from "../contracts/ElementInterface";
|
|
4
|
+
import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
5
|
+
import type { OneObjectType } from "../types/utils";
|
|
6
|
+
/**
|
|
7
|
+
* Block — a named mounting slot used in layout views.
|
|
8
|
+
*
|
|
9
|
+
* In a layout (super view), you declare blocks like `@useBlock('content')`.
|
|
10
|
+
* Each block is a Reactive region that mounts/unmounts page view content.
|
|
11
|
+
*
|
|
12
|
+
* Key behaviors:
|
|
13
|
+
* - Only active when the layout view is active
|
|
14
|
+
* - Caches previously mounted view content (DOM nodes) so that
|
|
15
|
+
* navigating back doesn't re-render and lose user state
|
|
16
|
+
* - Tracks which viewId is currently active in this slot
|
|
17
|
+
*
|
|
18
|
+
* Flow:
|
|
19
|
+
* 1. Layout declares: `@useBlock('content')` → creates Block('content')
|
|
20
|
+
* 2. Router navigates to page → BlockManager.mount('content', viewId, factory)
|
|
21
|
+
* 3. Block caches old content, mounts new content
|
|
22
|
+
* 4. Browser back → BlockManager restores cached content without re-render
|
|
23
|
+
*/
|
|
24
|
+
export declare class Block implements BlockInterface {
|
|
25
|
+
oneType: OneObjectType;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
ctx: ViewControllerInterface;
|
|
29
|
+
viewId: string | null;
|
|
30
|
+
fragment: FragmentInterface | null;
|
|
31
|
+
contentRenderFactory: BlockRenderFactory | null;
|
|
32
|
+
openTag: Comment;
|
|
33
|
+
closeTag: Comment;
|
|
34
|
+
domChildren: Node[];
|
|
35
|
+
initMode?: InitMode | undefined;
|
|
36
|
+
parentElement: HtmlInterface | null;
|
|
37
|
+
readonly isOneBlock = true;
|
|
38
|
+
readonly isOneElement = false;
|
|
39
|
+
constructor({ ctx, name, viewId, contentRenderFactory, id, initMode }: {
|
|
40
|
+
ctx: ViewControllerInterface;
|
|
41
|
+
name: string;
|
|
42
|
+
viewId?: string | null;
|
|
43
|
+
contentRenderFactory?: BlockRenderFactory;
|
|
44
|
+
id?: string | null;
|
|
45
|
+
initMode?: InitMode;
|
|
46
|
+
});
|
|
47
|
+
/** Initialize the block */
|
|
48
|
+
init(): void;
|
|
49
|
+
/** Render the block's content into the parent element */
|
|
50
|
+
render(): void;
|
|
51
|
+
mount(mountCtx: ViewControllerInterface, parentElement: HtmlInterface): any;
|
|
52
|
+
unmount(): void;
|
|
53
|
+
destroy(): void;
|
|
54
|
+
update(): void;
|
|
55
|
+
/** Set the block's parent element (used for mounting) */
|
|
56
|
+
setParentElement(parentElement: HtmlInterface | null): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=Block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Block.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/Block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEtF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAGpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,KAAM,YAAW,cAAc;IACxC,OAAO,EAAE,aAAa,CAAW;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,uBAAuB,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC7B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAC1C,oBAAoB,EAAE,kBAAkB,GAAG,IAAI,CAAQ;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAElB,WAAW,EAAE,IAAI,EAAE,CAAM;IACzB,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAQ;IAE3C,SAAgB,UAAU,QAAQ;IAClC,SAAgB,YAAY,SAAS;gBAEzB,EACR,GAAG,EACH,IAAI,EACJ,MAAa,EACb,oBAA2D,EAC3D,EAAS,EACT,QAAmB,EACtB,EAAE;QACC,GAAG,EAAE,uBAAuB,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;QAC1C,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACvB;IAaD,2BAA2B;IAC3B,IAAI,IAAI,IAAI;IAQZ,yDAAyD;IACzD,MAAM,IAAI,IAAI;IASd,KAAK,CAAC,QAAQ,EAAE,uBAAuB,EAAE,aAAa,EAAE,aAAa,GAAG,GAAG;IAM3E,OAAO,IAAI,IAAI;IAGf,OAAO,IAAI,IAAI;IAGf,MAAM,IAAI,IAAI;IAIb,yDAAyD;IACzD,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;CAI/D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { generateUUID } from "../hellpers/utils";
|
|
2
|
+
import markerRegistry from "../services/MarkerRegistry";
|
|
3
|
+
/**
|
|
4
|
+
* Block — a named mounting slot used in layout views.
|
|
5
|
+
*
|
|
6
|
+
* In a layout (super view), you declare blocks like `@useBlock('content')`.
|
|
7
|
+
* Each block is a Reactive region that mounts/unmounts page view content.
|
|
8
|
+
*
|
|
9
|
+
* Key behaviors:
|
|
10
|
+
* - Only active when the layout view is active
|
|
11
|
+
* - Caches previously mounted view content (DOM nodes) so that
|
|
12
|
+
* navigating back doesn't re-render and lose user state
|
|
13
|
+
* - Tracks which viewId is currently active in this slot
|
|
14
|
+
*
|
|
15
|
+
* Flow:
|
|
16
|
+
* 1. Layout declares: `@useBlock('content')` → creates Block('content')
|
|
17
|
+
* 2. Router navigates to page → BlockManager.mount('content', viewId, factory)
|
|
18
|
+
* 3. Block caches old content, mounts new content
|
|
19
|
+
* 4. Browser back → BlockManager restores cached content without re-render
|
|
20
|
+
*/
|
|
21
|
+
export class Block {
|
|
22
|
+
constructor({ ctx, name, viewId = null, contentRenderFactory = (parentElement) => [], id = null, initMode = 'create' }) {
|
|
23
|
+
this.oneType = 'Block';
|
|
24
|
+
this.viewId = null;
|
|
25
|
+
this.fragment = null;
|
|
26
|
+
this.contentRenderFactory = null;
|
|
27
|
+
this.domChildren = [];
|
|
28
|
+
this.parentElement = null;
|
|
29
|
+
this.isOneBlock = true;
|
|
30
|
+
this.isOneElement = false;
|
|
31
|
+
this.id = `${this.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
32
|
+
this.ctx = ctx;
|
|
33
|
+
this.name = name;
|
|
34
|
+
this.viewId = viewId ?? ctx.viewId; // Associate block with current viewId
|
|
35
|
+
this.initMode = initMode;
|
|
36
|
+
this.contentRenderFactory = contentRenderFactory || ((parentElement) => []);
|
|
37
|
+
markerRegistry.register('block', this.id, { name, viewId }); // Register block in marker registry
|
|
38
|
+
this.openTag = markerRegistry.createMarkerStart('block', this.id);
|
|
39
|
+
this.closeTag = markerRegistry.createMarkerEnd('block', this.id);
|
|
40
|
+
}
|
|
41
|
+
/** Initialize the block */
|
|
42
|
+
init() {
|
|
43
|
+
if (this.initMode === 'hydrate') {
|
|
44
|
+
// Hydration logic here
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Creation logic here
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Render the block's content into the parent element */
|
|
51
|
+
render() {
|
|
52
|
+
if (!this.contentRenderFactory)
|
|
53
|
+
return;
|
|
54
|
+
// Generate content using the factory
|
|
55
|
+
const content = this.contentRenderFactory(this.parentElement);
|
|
56
|
+
}
|
|
57
|
+
mount(mountCtx, parentElement) {
|
|
58
|
+
if (this.fragment) {
|
|
59
|
+
this.fragment.parent = parentElement;
|
|
60
|
+
this.fragment.render();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
unmount() {
|
|
64
|
+
// Unmount logic (e.g. hide or remove DOM nodes, stop reactions)
|
|
65
|
+
}
|
|
66
|
+
destroy() {
|
|
67
|
+
// Cleanup logic (e.g. remove DOM nodes, clear caches)
|
|
68
|
+
}
|
|
69
|
+
update() {
|
|
70
|
+
// Update logic (e.g. re-render content on state change)
|
|
71
|
+
}
|
|
72
|
+
/** Set the block's parent element (used for mounting) */
|
|
73
|
+
setParentElement(parentElement) {
|
|
74
|
+
this.parentElement = parentElement;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=Block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Block.js","sourceRoot":"","sources":["../../../../src/core/elements/Block.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,cAAc,MAAM,4BAA4B,CAAC;AAGxD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,KAAK;IAkBd,YAAY,EACR,GAAG,EACH,IAAI,EACJ,MAAM,GAAG,IAAI,EACb,oBAAoB,GAAG,CAAC,aAA4B,EAAE,EAAE,CAAC,EAAE,EAC3D,EAAE,GAAG,IAAI,EACT,QAAQ,GAAG,QAAQ,EAQtB;QA/BD,YAAO,GAAkB,OAAO,CAAC;QAIjC,WAAM,GAAkB,IAAI,CAAC;QAC7B,aAAQ,GAA6B,IAAI,CAAC;QAC1C,yBAAoB,GAA8B,IAAI,CAAC;QAIvD,gBAAW,GAAW,EAAE,CAAC;QAEzB,kBAAa,GAAyB,IAAI,CAAC;QAE3B,eAAU,GAAG,IAAI,CAAC;QAClB,iBAAY,GAAG,KAAK,CAAC;QAiBjC,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,0BAA0B;QAChF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IA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IACzD,gBAAgB,CAAC,aAAmC;QACjD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;CAEJ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { BlockOutletInterface } from "../contracts/BlockInterface";
|
|
2
|
+
import { InitMode } from "../contracts/common";
|
|
3
|
+
import type { HtmlInterface } from "../contracts/ElementInterface";
|
|
4
|
+
import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
5
|
+
import type { OneObjectType } from "../types/utils";
|
|
6
|
+
export declare class BlockOutlet implements BlockOutletInterface {
|
|
7
|
+
oneType: OneObjectType;
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
openTag: Comment;
|
|
11
|
+
closeTag: Comment;
|
|
12
|
+
parent: HtmlInterface | null;
|
|
13
|
+
parentElement: HtmlInterface | null;
|
|
14
|
+
ctx: ViewControllerInterface;
|
|
15
|
+
initMode: InitMode;
|
|
16
|
+
constructor({ ctx, parentElement, name, id, initMode }: {
|
|
17
|
+
ctx: ViewControllerInterface;
|
|
18
|
+
parentElement?: HtmlInterface | null;
|
|
19
|
+
name: string;
|
|
20
|
+
id?: string | null;
|
|
21
|
+
initMode?: InitMode;
|
|
22
|
+
});
|
|
23
|
+
hydrate(): void;
|
|
24
|
+
render(): void;
|
|
25
|
+
destroy(): void;
|
|
26
|
+
start(): void;
|
|
27
|
+
stop(): void;
|
|
28
|
+
setParentElement(parentElement: HtmlInterface | null): void;
|
|
29
|
+
get isOneElement(): boolean;
|
|
30
|
+
set isOneElement(value: boolean);
|
|
31
|
+
get isOneBlockOutlet(): boolean;
|
|
32
|
+
set isOneBlockOutlet(value: boolean);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=BlockOutlet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockOutlet.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/BlockOutlet.ts"],"names":[],"mappings":"AAAA,OAAO,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,KAAK,EAAE,OAAO,EAElC;CACJ"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { generateUUID } from "../hellpers/utils";
|
|
2
|
+
import markerRegistry from "../services/MarkerRegistry";
|
|
3
|
+
export class BlockOutlet {
|
|
4
|
+
constructor({ ctx, parentElement = null, name, id = null, initMode = 'create' }) {
|
|
5
|
+
this.oneType = 'BlockOutlet';
|
|
6
|
+
this.parent = null;
|
|
7
|
+
this.parentElement = null;
|
|
8
|
+
this.initMode = 'create';
|
|
9
|
+
this.id = `${ctx.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
10
|
+
this.ctx = ctx;
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.parent = parentElement;
|
|
13
|
+
this.parentElement = parentElement;
|
|
14
|
+
this.initMode = initMode;
|
|
15
|
+
markerRegistry.register('blockoutlet', this.id, { name, viewId: ctx.viewId }); // Register this outlet in the MarkerRegistry
|
|
16
|
+
this.openTag = markerRegistry.createMarkerStart('blockoutlet', this.id);
|
|
17
|
+
this.closeTag = markerRegistry.createMarkerEnd('blockoutlet', this.id);
|
|
18
|
+
}
|
|
19
|
+
hydrate() {
|
|
20
|
+
// Hydration logic if needed (e.g. reattach event listeners)
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
if (!this.parentElement || !this.parentElement.element)
|
|
24
|
+
return;
|
|
25
|
+
const parentEl = this.parentElement.element;
|
|
26
|
+
// Place markers
|
|
27
|
+
parentEl.appendChild(this.openTag);
|
|
28
|
+
// Register this outlet in the MarkerRegistry for block mounting
|
|
29
|
+
parentEl.appendChild(this.closeTag);
|
|
30
|
+
}
|
|
31
|
+
destroy() {
|
|
32
|
+
// Remove markers from DOM
|
|
33
|
+
this.openTag.remove();
|
|
34
|
+
this.closeTag.remove();
|
|
35
|
+
}
|
|
36
|
+
start() {
|
|
37
|
+
// Placeholder for any setup needed when the outlet becomes active
|
|
38
|
+
}
|
|
39
|
+
stop() {
|
|
40
|
+
// Placeholder for any cleanup needed when the outlet becomes inactive
|
|
41
|
+
}
|
|
42
|
+
setParentElement(parentElement) {
|
|
43
|
+
this.parent = parentElement;
|
|
44
|
+
this.parentElement = parentElement;
|
|
45
|
+
}
|
|
46
|
+
get isOneElement() {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
set isOneElement(value) {
|
|
50
|
+
// No-op setter to satisfy OneElement interface
|
|
51
|
+
}
|
|
52
|
+
get isOneBlockOutlet() {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
set isOneBlockOutlet(value) {
|
|
56
|
+
// No-op setter to satisfy the Interface; this property is always true for BlockOutlet elements
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=BlockOutlet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockOutlet.js","sourceRoot":"","sources":["../../../../src/core/elements/BlockOutlet.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,cAAc,MAAO,4BAA4B,CAAC;AAGzD,MAAM,OAAO,WAAW;IAUpB,YAAY,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAiI;QAT9M,YAAO,GAAkB,aAAa,CAAC;QAKvC,WAAM,GAAyB,IAAI,CAAC;QACpC,kBAAa,GAAyB,IAAI,CAAC;QAE3C,aAAQ,GAAa,QAAQ,CAAC;QAE1B,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,IAAI,EAAE,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,0BAA0B;QAC/E,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;QAC5B,IAAI,CAAC,aAAa,GAA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AAI,gBAAgB;QAChB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,gBAAgB,CAAC,KAAc;QAC/B,+FAA+F;IACnG,CAAC;CACJ"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { InitMode } from "../contracts/common";
|
|
2
|
+
import { ComponentInterface } from "../contracts/ComponentInterface";
|
|
3
|
+
import { HtmlInterface } from "../contracts/ElementInterface";
|
|
4
|
+
import { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
5
|
+
import { ViewInterface } from "../contracts/ViewInterface";
|
|
6
|
+
import { OneObjectType } from "../types/utils";
|
|
7
|
+
export declare class Component implements ComponentInterface {
|
|
8
|
+
oneType: OneObjectType;
|
|
9
|
+
ctx: ViewControllerInterface;
|
|
10
|
+
parent: HtmlInterface | null;
|
|
11
|
+
domChildren: Node[];
|
|
12
|
+
stateKeys: string[];
|
|
13
|
+
data: Record<string, any>;
|
|
14
|
+
openTag: Comment;
|
|
15
|
+
closeTag: Comment;
|
|
16
|
+
viewRef: ViewInterface | null;
|
|
17
|
+
id: string;
|
|
18
|
+
path: string | null;
|
|
19
|
+
type: 'default' | 'if' | 'when';
|
|
20
|
+
condition: {
|
|
21
|
+
stateKeys: string[];
|
|
22
|
+
checker: () => any;
|
|
23
|
+
} | null;
|
|
24
|
+
initMode: InitMode;
|
|
25
|
+
subscribeFn: () => void;
|
|
26
|
+
unsubscribeFn: () => void;
|
|
27
|
+
dataFactory: ((parentElement: HtmlInterface | null) => Record<string, any>) | null;
|
|
28
|
+
constructor({ ctx, parent, id, stateKeys, data, dataFactory, path, type, condition, initMode, }: {
|
|
29
|
+
ctx: ViewControllerInterface;
|
|
30
|
+
parent?: HtmlInterface | null;
|
|
31
|
+
id?: string | null;
|
|
32
|
+
stateKeys?: string[];
|
|
33
|
+
data?: Record<string, any>;
|
|
34
|
+
dataFactory?: ((parentElement: HtmlInterface | null) => Record<string, any>) | null;
|
|
35
|
+
path?: string | null;
|
|
36
|
+
type?: 'default' | 'if' | 'when';
|
|
37
|
+
condition?: {
|
|
38
|
+
stateKeys: string[];
|
|
39
|
+
checker: () => any;
|
|
40
|
+
} | null;
|
|
41
|
+
initMode?: InitMode;
|
|
42
|
+
});
|
|
43
|
+
mergeData(newData: Record<string, any>): void;
|
|
44
|
+
setDataFactory(factory: (parentElement: HtmlInterface | null) => Record<string, any>): void;
|
|
45
|
+
setCondition(condition: {
|
|
46
|
+
stateKeys: string[];
|
|
47
|
+
checker: () => any;
|
|
48
|
+
}): void;
|
|
49
|
+
setStateKeys(stateKeys: string[]): void;
|
|
50
|
+
setParentElement(parent: HtmlInterface | null): void;
|
|
51
|
+
setView(view: ViewInterface): void;
|
|
52
|
+
setParent(parent: HtmlInterface | null): void;
|
|
53
|
+
start(): void;
|
|
54
|
+
stop(): void;
|
|
55
|
+
render(): void;
|
|
56
|
+
destroy(): void;
|
|
57
|
+
get isOneElement(): boolean;
|
|
58
|
+
set isOneElement(value: boolean);
|
|
59
|
+
get isOneComponent(): boolean;
|
|
60
|
+
set isOneComponent(value: boolean);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/Component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAsB,MAAM,+BAA+B,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBAAa,SAAU,YAAW,kBAAkB;IAChD,OAAO,EAAE,aAAa,CAAe;IACrC,GAAG,EAAE,uBAAuB,CAAC;IAC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AAG,CAAC,CAAC,GAAG,IAAI,CAAC;QACpF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;QACjC,SAAS,CAAC,EAAE;YAAC,SAAS,EAAE,MAAM,EAAE,CAAC;YAAC,OAAO,EAAE,MAAM,GAAG,CAAA;SAAC,GAAG,IAAI,CAAC;QAC7D,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACvB;IAeD,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAI7C,cAAc,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAGpF,YAAY,CAAC,SAAS,EAAE;QAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,CAAA;KAAC;IAGjE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE;IAGhC,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAIpD,OAAO,CAAC,IAAI,EAAE,aAAa;IAG3B,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAI7C,KAAK,IAAI,IAAI;IAGb,IAAI,IAAI,IAAI;IAGZ,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,IAAI;IAGf,IAAI,YAAY,IAAI,OAAO,CAE1B;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;IACD,IAAI,cAAc,IAAI,OAAO,CAE5B;IACD,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,EAEhC;CACJ"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { InitModes } from "../contracts/common";
|
|
2
|
+
import { generateUUID } from "../hellpers/utils";
|
|
3
|
+
export class Component {
|
|
4
|
+
constructor({ ctx, parent = null, id = null, stateKeys = [], data = {}, dataFactory = null, path = null, type = 'default', condition = null, initMode = InitModes.CREATE, }) {
|
|
5
|
+
this.oneType = 'Component';
|
|
6
|
+
this.domChildren = []; // For compatibility with HtmlInterface; Component itself doesn't have a single root element
|
|
7
|
+
this.viewRef = null;
|
|
8
|
+
this.path = null; // For dynamic imports
|
|
9
|
+
this.type = 'default';
|
|
10
|
+
this.condition = null; // For 'when' type components
|
|
11
|
+
this.initMode = InitModes.CREATE; // Default initialization mode
|
|
12
|
+
this.subscribeFn = () => { };
|
|
13
|
+
this.unsubscribeFn = () => { };
|
|
14
|
+
this.dataFactory = null;
|
|
15
|
+
this.ctx = ctx;
|
|
16
|
+
this.parent = parent;
|
|
17
|
+
this.stateKeys = stateKeys;
|
|
18
|
+
this.data = data || {};
|
|
19
|
+
this.openTag = document.createComment(`component-start`);
|
|
20
|
+
this.closeTag = document.createComment(`component-end`);
|
|
21
|
+
this.id = `${ctx.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
22
|
+
this.dataFactory = dataFactory;
|
|
23
|
+
this.path = path;
|
|
24
|
+
this.type = type;
|
|
25
|
+
this.condition = condition;
|
|
26
|
+
this.initMode = initMode ?? InitModes.CREATE;
|
|
27
|
+
}
|
|
28
|
+
mergeData(newData) {
|
|
29
|
+
this.data = { ...this.data, ...newData };
|
|
30
|
+
}
|
|
31
|
+
setDataFactory(factory) {
|
|
32
|
+
this.dataFactory = factory;
|
|
33
|
+
}
|
|
34
|
+
setCondition(condition) {
|
|
35
|
+
this.condition = condition;
|
|
36
|
+
}
|
|
37
|
+
setStateKeys(stateKeys) {
|
|
38
|
+
this.stateKeys = stateKeys;
|
|
39
|
+
}
|
|
40
|
+
setParentElement(parent) {
|
|
41
|
+
this.parent = parent;
|
|
42
|
+
}
|
|
43
|
+
setView(view) {
|
|
44
|
+
this.viewRef = view;
|
|
45
|
+
}
|
|
46
|
+
setParent(parent) {
|
|
47
|
+
this.parent = parent;
|
|
48
|
+
}
|
|
49
|
+
start() {
|
|
50
|
+
}
|
|
51
|
+
stop() {
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
// To be implemented by specific components
|
|
55
|
+
}
|
|
56
|
+
destroy() {
|
|
57
|
+
// To be implemented by specific components
|
|
58
|
+
}
|
|
59
|
+
get isOneElement() {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
set isOneElement(value) {
|
|
63
|
+
// No-op, just for type compatibility
|
|
64
|
+
}
|
|
65
|
+
get isOneComponent() {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
set isOneComponent(value) {
|
|
69
|
+
// No-op, just for type compatibility
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sourceRoot":"","sources":["../../../../src/core/elements/Component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAK1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,OAAO,SAAS;IAmBlB,YAAY,EACR,GAAG,EACH,MAAM,GAAG,IAAI,EACb,EAAE,GAAG,IAAI,EACT,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,EAAE,EACT,WAAW,GAAG,IAAI,EAClB,IAAI,GAAG,IAAI,EACX,IAAI,GAAG,SAAS,EAChB,SAAS,GAAG,IAAI,EAChB,QAAQ,GAAG,SAAS,CAAC,MAAM,GAY9B;QAxCD,YAAO,GAAkB,WAAW,CAAC;QAGrC,gBAAW,GAAW,EAAE,CAAC,CAAC,4FAA4F;QAKtH,YAAO,GAAyB,IAAI,CAAC;QAErC,SAAI,GAAkB,IAAI,CAAC,CAAC,sBAAsB;QAClD,SAAI,GAA8B,SAAS,CAAC;QAC5C,cAAS,GAAqD,IAAI,CAAC,CAAC,6BAA6B;QACjG,aAAQ,GAAa,SAAS,CAAC,MAAM,CAA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AAgB,CAAC,MAA4B;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,IAAmB;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IACD,SAAS,CAAC,MAA4B;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,KAAK;IACL,CAAC;IAED,IAAI;IACJ,CAAC;IAED,MAAM;QACF,2CAA2C;IAC/C,CAAC;IAED,OAAO;QACH,2CAA2C;IAC/C,CAAC;IACD,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,YAAY,CAAC,KAAc;QAC3B,qCAAqC;IACzC,CAAC;IACD,IAAI,cAAc;QACd,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,cAAc,CAAC,KAAc;QAC7B,qCAAqC;IACzC,CAAC;CACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OneElementManager — factory/registry for creating One elements.
|
|
3
|
+
*
|
|
4
|
+
* Provides shorthand functions so compiled output stays clean:
|
|
5
|
+
* oem.h(ctx, parent, 'div', config, children) → Html
|
|
6
|
+
* oem.t('Hello') → TextElement
|
|
7
|
+
* oem.r(ctx, parent, renderFn) → Reactive
|
|
8
|
+
* oem.f(ctx, parent, children) → Fragment
|
|
9
|
+
* oem.b(ctx, parent, 'content') → Block
|
|
10
|
+
*/
|
|
11
|
+
export declare class ElementManagerService {
|
|
12
|
+
/** Custom element factories (for user-defined components) */
|
|
13
|
+
private factories;
|
|
14
|
+
/** Register a custom component factory */
|
|
15
|
+
set(name: string, factory: (...args: any[]) => any): void;
|
|
16
|
+
/** Get a custom component factory */
|
|
17
|
+
get(name: string): ((...args: any[]) => any) | undefined;
|
|
18
|
+
/** Check if a custom component is registered */
|
|
19
|
+
has(name: string): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const ElementManager: ElementManagerService;
|
|
22
|
+
export default ElementManager;
|
|
23
|
+
//# sourceMappingURL=ElementManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementManager.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/ElementManager.ts"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,qBAAa,qBAAqB;IAC9B,6DAA6D;IAC7D,OAAO,CAAC,SAAS,CAAmD;IAQpE,0CAA0C;IAC1C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI;IAIzD,qCAAqC;IACrC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,SAAS;IAIxD,gDAAgD;IAChD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAG7B;AAED,eAAO,MAAM,cAAc,uBAA8B,CAAC;AAC1D,eAAe,cAAc,CAAC"}
|