@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,83 @@
|
|
|
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 { generateUUID } from "../hellpers/utils";
|
|
6
|
+
import markerRegistry from "../services/MarkerRegistry";
|
|
7
|
+
import type { OneObjectType } from "../types/utils";
|
|
8
|
+
|
|
9
|
+
export class BlockOutlet implements BlockOutletInterface {
|
|
10
|
+
oneType: OneObjectType = 'BlockOutlet';
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
openTag: Comment;
|
|
14
|
+
closeTag: Comment;
|
|
15
|
+
parent: HtmlInterface | null = null;
|
|
16
|
+
parentElement: HtmlInterface | null = null;
|
|
17
|
+
ctx: ViewControllerInterface;
|
|
18
|
+
initMode: InitMode = 'create';
|
|
19
|
+
constructor({ ctx, parentElement = null, name, id = null, initMode = 'create' }: { ctx: ViewControllerInterface, parentElement?: HtmlInterface | null, name: string, id?: string | null, initMode?: InitMode }) {
|
|
20
|
+
this.id = `${ctx.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
21
|
+
this.ctx = ctx;
|
|
22
|
+
this.name = name;
|
|
23
|
+
this.parent = parentElement;
|
|
24
|
+
this.parentElement = parentElement;
|
|
25
|
+
this.initMode = initMode;
|
|
26
|
+
|
|
27
|
+
markerRegistry.register('blockoutlet', this.id, { name, viewId: ctx.viewId }); // Register this outlet in the MarkerRegistry
|
|
28
|
+
|
|
29
|
+
this.openTag = markerRegistry.createMarkerStart('blockoutlet', this.id);
|
|
30
|
+
this.closeTag = markerRegistry.createMarkerEnd('blockoutlet', this.id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
hydrate(): void {
|
|
34
|
+
// Hydration logic if needed (e.g. reattach event listeners)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
render(): void {
|
|
38
|
+
if (!this.parentElement || !this.parentElement.element) return;
|
|
39
|
+
|
|
40
|
+
const parentEl = this.parentElement.element;
|
|
41
|
+
|
|
42
|
+
// Place markers
|
|
43
|
+
parentEl.appendChild(this.openTag);
|
|
44
|
+
// Register this outlet in the MarkerRegistry for block mounting
|
|
45
|
+
parentEl.appendChild(this.closeTag);
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
destroy(): void {
|
|
50
|
+
// Remove markers from DOM
|
|
51
|
+
this.openTag.remove();
|
|
52
|
+
this.closeTag.remove();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
start(): void {
|
|
56
|
+
// Placeholder for any setup needed when the outlet becomes active
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
stop(): void {
|
|
60
|
+
// Placeholder for any cleanup needed when the outlet becomes inactive
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setParentElement(parentElement: HtmlInterface | null): void {
|
|
64
|
+
this.parent = parentElement;
|
|
65
|
+
this.parentElement = parentElement;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get isOneElement(): boolean {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
set isOneElement(value: boolean) {
|
|
73
|
+
// No-op setter to satisfy OneElement interface
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
get isOneBlockOutlet(): boolean {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
set isOneBlockOutlet(value: boolean) {
|
|
81
|
+
// No-op setter to satisfy the Interface; this property is always true for BlockOutlet elements
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { InitMode, InitModes } from "../contracts/common";
|
|
2
|
+
import { ComponentInterface } from "../contracts/ComponentInterface";
|
|
3
|
+
import { HtmlInterface, OneChildrenFactory } from "../contracts/ElementInterface";
|
|
4
|
+
import { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
5
|
+
import { ViewInterface } from "../contracts/ViewInterface";
|
|
6
|
+
import { generateUUID } from "../hellpers/utils";
|
|
7
|
+
import { OneObjectType } from "../types/utils";
|
|
8
|
+
|
|
9
|
+
export class Component implements ComponentInterface {
|
|
10
|
+
oneType: OneObjectType = 'Component';
|
|
11
|
+
ctx: ViewControllerInterface;
|
|
12
|
+
parent: HtmlInterface | null;
|
|
13
|
+
domChildren: Node[] = []; // For compatibility with HtmlInterface; Component itself doesn't have a single root element
|
|
14
|
+
stateKeys: string[];
|
|
15
|
+
data: Record<string, any>;
|
|
16
|
+
openTag: Comment;
|
|
17
|
+
closeTag: Comment;
|
|
18
|
+
viewRef: ViewInterface | null = null;
|
|
19
|
+
id: string;
|
|
20
|
+
path: string | null = null; // For dynamic imports
|
|
21
|
+
type: 'default' | 'if' | 'when' = 'default';
|
|
22
|
+
condition: {stateKeys: string[], checker: () => any} | null = null; // For 'when' type components
|
|
23
|
+
initMode: InitMode = InitModes.CREATE; // Default initialization mode
|
|
24
|
+
subscribeFn: () => void = () => {};
|
|
25
|
+
unsubscribeFn: () => void = () => {};
|
|
26
|
+
dataFactory: ((parentElement: HtmlInterface | null) => Record<string, any>) | null = null;
|
|
27
|
+
|
|
28
|
+
constructor({
|
|
29
|
+
ctx,
|
|
30
|
+
parent = null,
|
|
31
|
+
id = null,
|
|
32
|
+
stateKeys = [],
|
|
33
|
+
data = {},
|
|
34
|
+
dataFactory = null,
|
|
35
|
+
path = null,
|
|
36
|
+
type = 'default',
|
|
37
|
+
condition = null,
|
|
38
|
+
initMode = InitModes.CREATE,
|
|
39
|
+
}: {
|
|
40
|
+
ctx: ViewControllerInterface;
|
|
41
|
+
parent?: HtmlInterface | null;
|
|
42
|
+
id?: string | null;
|
|
43
|
+
stateKeys?: string[];
|
|
44
|
+
data?: Record<string, any>;
|
|
45
|
+
dataFactory?: ((parentElement: HtmlInterface | null) => Record<string, any>) | null;
|
|
46
|
+
path?: string | null;
|
|
47
|
+
type?: 'default' | 'if' | 'when';
|
|
48
|
+
condition?: {stateKeys: string[], checker: () => any} | null;
|
|
49
|
+
initMode?: InitMode;
|
|
50
|
+
}) {
|
|
51
|
+
this.ctx = ctx;
|
|
52
|
+
this.parent = parent;
|
|
53
|
+
this.stateKeys = stateKeys;
|
|
54
|
+
this.data = data || {};
|
|
55
|
+
this.openTag = document.createComment(`component-start`);
|
|
56
|
+
this.closeTag = document.createComment(`component-end`);
|
|
57
|
+
this.id = `${ctx.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
58
|
+
this.dataFactory = dataFactory;
|
|
59
|
+
this.path = path;
|
|
60
|
+
this.type = type;
|
|
61
|
+
this.condition = condition;
|
|
62
|
+
this.initMode = initMode ?? InitModes.CREATE;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
mergeData(newData: Record<string, any>): void {
|
|
66
|
+
this.data = { ...this.data, ...newData };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
setDataFactory(factory: (parentElement: HtmlInterface | null) => Record<string, any>) {
|
|
70
|
+
this.dataFactory = factory;
|
|
71
|
+
}
|
|
72
|
+
setCondition(condition: {stateKeys: string[], checker: () => any}) {
|
|
73
|
+
this.condition = condition;
|
|
74
|
+
}
|
|
75
|
+
setStateKeys(stateKeys: string[]) {
|
|
76
|
+
this.stateKeys = stateKeys;
|
|
77
|
+
}
|
|
78
|
+
setParentElement(parent: HtmlInterface | null): void {
|
|
79
|
+
this.parent = parent;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
setView(view: ViewInterface) {
|
|
83
|
+
this.viewRef = view;
|
|
84
|
+
}
|
|
85
|
+
setParent(parent: HtmlInterface | null): void {
|
|
86
|
+
this.parent = parent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
start(): void {
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
stop(): void {
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
render(): void {
|
|
96
|
+
// To be implemented by specific components
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
destroy(): void {
|
|
100
|
+
// To be implemented by specific components
|
|
101
|
+
}
|
|
102
|
+
get isOneElement(): boolean {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
set isOneElement(value: boolean) {
|
|
106
|
+
// No-op, just for type compatibility
|
|
107
|
+
}
|
|
108
|
+
get isOneComponent(): boolean {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
set isOneComponent(value: boolean) {
|
|
112
|
+
// No-op, just for type compatibility
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BlockRenderFactory } from "../contracts/BlockInterface";
|
|
2
|
+
import type { HtmlInterface, OneElementConfig, OneChildrenFactory } from "../contracts/ElementInterface";
|
|
3
|
+
import type { ReactiveRenderFn } from "../contracts/ReactiveInterface";
|
|
4
|
+
import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
5
|
+
import { Html } from "./Html";
|
|
6
|
+
import { TextElement } from "./TextElement";
|
|
7
|
+
import { Reactive } from "./Reactive";
|
|
8
|
+
import { Fragment } from "./Fragment";
|
|
9
|
+
import { Block } from "./Block";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* OneElementManager — factory/registry for creating One elements.
|
|
13
|
+
*
|
|
14
|
+
* Provides shorthand functions so compiled output stays clean:
|
|
15
|
+
* oem.h(ctx, parent, 'div', config, children) → Html
|
|
16
|
+
* oem.t('Hello') → TextElement
|
|
17
|
+
* oem.r(ctx, parent, renderFn) → Reactive
|
|
18
|
+
* oem.f(ctx, parent, children) → Fragment
|
|
19
|
+
* oem.b(ctx, parent, 'content') → Block
|
|
20
|
+
*/
|
|
21
|
+
export class ElementManagerService {
|
|
22
|
+
/** Custom element factories (for user-defined components) */
|
|
23
|
+
private factories: Map<string, (...args: any[]) => any> = new Map();
|
|
24
|
+
|
|
25
|
+
// ─── Element Shorthand Factories ────────────────────────────
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// ─── Custom Component Registry ─────────────────────────────
|
|
30
|
+
|
|
31
|
+
/** Register a custom component factory */
|
|
32
|
+
set(name: string, factory: (...args: any[]) => any): void {
|
|
33
|
+
this.factories.set(name, factory);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Get a custom component factory */
|
|
37
|
+
get(name: string): ((...args: any[]) => any) | undefined {
|
|
38
|
+
return this.factories.get(name);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Check if a custom component is registered */
|
|
42
|
+
has(name: string): boolean {
|
|
43
|
+
return this.factories.has(name);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const ElementManager = new ElementManagerService();
|
|
48
|
+
export default ElementManager;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { InitMode, InitModes } from "../contracts/common";
|
|
2
|
+
import type { FragmentInterface, HtmlInterface, OneChildrenFactory, OneChildrenFactoryOutput, OneElementChildren } from "../contracts/ElementInterface";
|
|
3
|
+
import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
4
|
+
import { generateUUID } from "../hellpers/utils";
|
|
5
|
+
import type { OneObjectType } from "../types/utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Fragment — renders multiple root nodes into a parent without a wrapping tag.
|
|
9
|
+
*
|
|
10
|
+
* Use case: when a ViewController's render() returns multiple sibling elements
|
|
11
|
+
* (e.g. `<h1>` + `<p>` + `<div>`) without a single root wrapper.
|
|
12
|
+
*
|
|
13
|
+
* Fragment uses open/close Comment markers to track its region in the DOM,
|
|
14
|
+
* similar to Reactive but without the reactivity overhead.
|
|
15
|
+
*/
|
|
16
|
+
export class Fragment implements FragmentInterface {
|
|
17
|
+
oneType: OneObjectType = 'Fragment';
|
|
18
|
+
public parent: HtmlInterface | null;
|
|
19
|
+
public nodes: Node[] = [];
|
|
20
|
+
/** Tracked child element wrappers (Html, Output, Reactive, TextElement, etc.) */
|
|
21
|
+
public children: OneElementChildren = [];
|
|
22
|
+
private ctx: ViewControllerInterface;
|
|
23
|
+
private childrenFactory: OneChildrenFactory;
|
|
24
|
+
public openTag: Comment;
|
|
25
|
+
public closeTag: Comment;
|
|
26
|
+
public id: string; // Unique ID for debugging and marker registry
|
|
27
|
+
public initMode: InitMode = InitModes.CREATE;
|
|
28
|
+
|
|
29
|
+
domChildren: Node[] = []; // For compatibility with HtmlInterface; Fragment itself doesn't have a single root element
|
|
30
|
+
|
|
31
|
+
constructor({
|
|
32
|
+
ctx,
|
|
33
|
+
id = null,
|
|
34
|
+
initMode = InitModes.CREATE,
|
|
35
|
+
parentElement = null,
|
|
36
|
+
childrenFactory
|
|
37
|
+
}: {
|
|
38
|
+
ctx: ViewControllerInterface,
|
|
39
|
+
id?: string | null,
|
|
40
|
+
initMode?: InitMode,
|
|
41
|
+
parentElement?: HtmlInterface | null,
|
|
42
|
+
childrenFactory: OneChildrenFactory
|
|
43
|
+
}) {
|
|
44
|
+
this.ctx = ctx;
|
|
45
|
+
this.parent = parentElement;
|
|
46
|
+
this.childrenFactory = childrenFactory;
|
|
47
|
+
this.openTag = document.createComment('fragment-start');
|
|
48
|
+
this.closeTag = document.createComment('fragment-end');
|
|
49
|
+
this.id = `${ctx.viewId}-${id ?? generateUUID(10)}`; // Unique ID for debugging
|
|
50
|
+
this.initMode = initMode;
|
|
51
|
+
}
|
|
52
|
+
setParentElement(parent: HtmlInterface | null): void {
|
|
53
|
+
this.parent = parent;
|
|
54
|
+
}
|
|
55
|
+
render(): void {
|
|
56
|
+
if (!this.parent || !this.parent.element) return;
|
|
57
|
+
|
|
58
|
+
const parentEl = this.parent.element;
|
|
59
|
+
|
|
60
|
+
// Place start marker
|
|
61
|
+
parentEl.appendChild(this.openTag);
|
|
62
|
+
|
|
63
|
+
// Build children — compiled output uses (parentElement) => [...] signature
|
|
64
|
+
const output: OneChildrenFactoryOutput = this.childrenFactory(this.parent);
|
|
65
|
+
|
|
66
|
+
for (const child of output) {
|
|
67
|
+
if (typeof child === 'string' || typeof child === 'number') {
|
|
68
|
+
const textNode = document.createTextNode(String(child));
|
|
69
|
+
parentEl.appendChild(textNode);
|
|
70
|
+
this.nodes.push(textNode);
|
|
71
|
+
} else if (child && typeof child === 'object') {
|
|
72
|
+
if ('element' in child) {
|
|
73
|
+
// HtmlInterface, TextInterface — append their DOM element
|
|
74
|
+
parentEl.appendChild(child.element);
|
|
75
|
+
this.nodes.push(child.element);
|
|
76
|
+
this.children.push(child);
|
|
77
|
+
child.render();
|
|
78
|
+
} else if ('openTag' in child) {
|
|
79
|
+
// Reactive, nested Fragment, Output — they self-append markers
|
|
80
|
+
if ('parent' in child) {
|
|
81
|
+
(child as any).parent = this.parent;
|
|
82
|
+
}
|
|
83
|
+
if ('parentElement' in child) {
|
|
84
|
+
(child as any).parentElement = this.parent;
|
|
85
|
+
}
|
|
86
|
+
this.children.push(child);
|
|
87
|
+
child.render();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Place end marker
|
|
93
|
+
parentEl.appendChild(this.closeTag);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
setChildrenFactory(factory: OneChildrenFactory): void {
|
|
97
|
+
this.childrenFactory = factory;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Hydrate lifecycle — reattach event listeners or perform other setup */
|
|
101
|
+
|
|
102
|
+
hydrate(): void {
|
|
103
|
+
for (const child of this.children) {
|
|
104
|
+
if ('hydrate' in child && typeof (child as any).hydrate === 'function') {
|
|
105
|
+
(child as any).hydrate();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** Start lifecycle — recursively activate children's reactive subscriptions */
|
|
111
|
+
start(): void {
|
|
112
|
+
for (const child of this.children) {
|
|
113
|
+
if ('start' in child && typeof (child as any).start === 'function') {
|
|
114
|
+
(child as any).start();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Stop lifecycle — recursively deactivate children's reactive subscriptions */
|
|
120
|
+
stop(): void {
|
|
121
|
+
for (const child of this.children) {
|
|
122
|
+
if ('stop' in child && typeof (child as any).stop === 'function') {
|
|
123
|
+
(child as any).stop();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Remove all nodes between markers from the DOM */
|
|
129
|
+
clear(): void {
|
|
130
|
+
// Destroy managed children first
|
|
131
|
+
for (const child of this.children) {
|
|
132
|
+
if ('destroy' in child && typeof child.destroy === 'function') {
|
|
133
|
+
child.destroy();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
this.children = [];
|
|
137
|
+
|
|
138
|
+
// Remove remaining DOM nodes between markers
|
|
139
|
+
let current = this.openTag.nextSibling;
|
|
140
|
+
while (current && current !== this.closeTag) {
|
|
141
|
+
const next = current.nextSibling;
|
|
142
|
+
current.remove();
|
|
143
|
+
current = next;
|
|
144
|
+
}
|
|
145
|
+
this.nodes = [];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
destroy(): void {
|
|
149
|
+
this.clear();
|
|
150
|
+
this.openTag.remove();
|
|
151
|
+
this.closeTag.remove();
|
|
152
|
+
this.parent = null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
get isOneElement(): boolean {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
set isOneElement(value: boolean) {
|
|
159
|
+
// No-op setter to satisfy the Interface; this property is always true for Fragment elements
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
get isOneFragment(): boolean {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
set isOneFragment(value: boolean) {
|
|
166
|
+
// No-op setter to satisfy the Interface; this property is always true for Fragment elements
|
|
167
|
+
}
|
|
168
|
+
}
|