@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,109 @@
|
|
|
1
|
+
import type { LoopContextInterface } from "../contracts/LoopContextInterface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* LoopContext — provides loop metadata for @foreach, @for, @while directives.
|
|
5
|
+
*
|
|
6
|
+
* Available properties inside loops:
|
|
7
|
+
* $loop.index — 0-based index
|
|
8
|
+
* $loop.iteration — 1-based iteration count
|
|
9
|
+
* $loop.count — total items (or -1 for @while)
|
|
10
|
+
* $loop.remaining — items left
|
|
11
|
+
* $loop.first — is first iteration
|
|
12
|
+
* $loop.last — is last iteration
|
|
13
|
+
* $loop.odd — is odd iteration (1-based)
|
|
14
|
+
* $loop.even — is even iteration (1-based)
|
|
15
|
+
* $loop.depth — nesting depth (starts at 1)
|
|
16
|
+
* $loop.parent — parent LoopContext (for nested loops)
|
|
17
|
+
*/
|
|
18
|
+
export class LoopContext implements LoopContextInterface {
|
|
19
|
+
public index: number = 0;
|
|
20
|
+
public iteration: number = 0;
|
|
21
|
+
public count: number = 0;
|
|
22
|
+
public remaining: number = -1;
|
|
23
|
+
public first: boolean = false;
|
|
24
|
+
public last: boolean = false;
|
|
25
|
+
public odd: boolean = true;
|
|
26
|
+
public even: boolean = false;
|
|
27
|
+
public depth: number = 1;
|
|
28
|
+
public parent: LoopContext | null;
|
|
29
|
+
|
|
30
|
+
private type: 'increment' | 'decrement' = 'increment';
|
|
31
|
+
|
|
32
|
+
constructor(parent: LoopContext | null = null) {
|
|
33
|
+
this.parent = parent;
|
|
34
|
+
if (parent) {
|
|
35
|
+
this.depth = parent.depth + 1;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setType(type: 'increment' | 'decrement'): void {
|
|
40
|
+
if (type === 'increment' || type === 'decrement') {
|
|
41
|
+
this.type = type;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
setCount(count: number): void {
|
|
46
|
+
this.count = count;
|
|
47
|
+
if (count === -1) {
|
|
48
|
+
// Unknown count (@while) — remaining/last unreliable
|
|
49
|
+
this.remaining = -1;
|
|
50
|
+
this.last = false;
|
|
51
|
+
} else {
|
|
52
|
+
this.remaining = count;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setCurrentTimes(index: number): void {
|
|
57
|
+
this.index = index;
|
|
58
|
+
this.iteration = index + 1;
|
|
59
|
+
this.first = index === 0;
|
|
60
|
+
this.last = this.count > 0 ? index === this.count - 1 : false;
|
|
61
|
+
this.odd = this.iteration % 2 === 1;
|
|
62
|
+
this.even = !this.odd;
|
|
63
|
+
if (this.count > 0) {
|
|
64
|
+
this.remaining = this.count - this.iteration;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
next(): void {
|
|
69
|
+
if (this.type === 'increment') {
|
|
70
|
+
this.increment();
|
|
71
|
+
} else {
|
|
72
|
+
this.decrement();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
reset(): void {
|
|
77
|
+
this.iteration = 0;
|
|
78
|
+
this.index = 0;
|
|
79
|
+
this.remaining = -1;
|
|
80
|
+
this.count = 0;
|
|
81
|
+
this.first = false;
|
|
82
|
+
this.last = false;
|
|
83
|
+
this.odd = true;
|
|
84
|
+
this.even = false;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private increment(): void {
|
|
88
|
+
this.iteration++;
|
|
89
|
+
this.index = this.iteration - 1;
|
|
90
|
+
if (this.remaining !== -1) {
|
|
91
|
+
this.remaining--;
|
|
92
|
+
}
|
|
93
|
+
this.first = this.index === 0;
|
|
94
|
+
this.last = this.count > 0 ? this.index === this.count - 1 : false;
|
|
95
|
+
this.odd = this.iteration % 2 === 1;
|
|
96
|
+
this.even = !this.odd;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
private decrement(): void {
|
|
100
|
+
this.iteration--;
|
|
101
|
+
this.index = this.iteration - 1;
|
|
102
|
+
if (this.remaining !== -1) {
|
|
103
|
+
this.remaining++;
|
|
104
|
+
}
|
|
105
|
+
this.last = this.count > 0 ? this.index === this.count - 1 : false;
|
|
106
|
+
this.odd = this.iteration % 2 === 1;
|
|
107
|
+
this.even = !this.odd;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { HtmlInterface } from "../contracts/ElementInterface";
|
|
2
|
+
import { ViewControllerInterface } from "../contracts/ViewControllerInterface";
|
|
3
|
+
import { SectionConstruvtorArgs, SectionContentRenderer, SectionContentType, SectionInterface, SectionItemType } from "../contracts/views";
|
|
4
|
+
|
|
5
|
+
export class Section implements SectionInterface {
|
|
6
|
+
ctx: ViewControllerInterface | undefined | null = null;
|
|
7
|
+
name: string;
|
|
8
|
+
type: SectionItemType;
|
|
9
|
+
contentType: SectionContentType;
|
|
10
|
+
stateKeys?: string[];
|
|
11
|
+
|
|
12
|
+
renderFactory: SectionContentRenderer;
|
|
13
|
+
subscribeFn: (() => void) | null = null;
|
|
14
|
+
unsubscribeFn: (() => void) | null = null;
|
|
15
|
+
|
|
16
|
+
content: any = null; // Can be string or OneElementChildren depending on contentType
|
|
17
|
+
|
|
18
|
+
parentElement: HtmlInterface | undefined | null = null; // For dynamic/reactive sections that need a parent element reference
|
|
19
|
+
|
|
20
|
+
isStarted: boolean = false; // Flag to indicate if this section is static (renders once) or dynamic/reactive (renders on state change)
|
|
21
|
+
|
|
22
|
+
constructor({ ctx, name, type = 'static', contentType = 'text', stateKeys, renderFactory }: SectionConstruvtorArgs) {
|
|
23
|
+
this.ctx = ctx ?? null;
|
|
24
|
+
this.name = name;
|
|
25
|
+
this.type = type;
|
|
26
|
+
this.contentType = contentType;
|
|
27
|
+
this.stateKeys = stateKeys;
|
|
28
|
+
this.renderFactory = renderFactory;
|
|
29
|
+
|
|
30
|
+
this.initialize();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
initialize() {
|
|
34
|
+
if (this.type === 'static') {
|
|
35
|
+
this.render();
|
|
36
|
+
}
|
|
37
|
+
this.start();
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
render(parentElement?: HtmlInterface | null | undefined) {
|
|
42
|
+
this.parentElement = parentElement ?? null;
|
|
43
|
+
this.content = this.renderFactory(this.parentElement);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
start() {
|
|
47
|
+
if(this.isStarted) return; // No need to subscribe for static sections
|
|
48
|
+
this.isStarted = true;
|
|
49
|
+
if ((this.type === 'reactive' || this.type === 'dynamic') && this.stateKeys && this.ctx) {
|
|
50
|
+
this.subscribeFn = () => {
|
|
51
|
+
this.render(this.parentElement);
|
|
52
|
+
};
|
|
53
|
+
this.unsubscribeFn = this.ctx.states.subscribe(this.stateKeys, this.subscribeFn);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
stop() {
|
|
59
|
+
if (!this.isStarted) return;
|
|
60
|
+
this.isStarted = false;
|
|
61
|
+
if (this.unsubscribeFn) {
|
|
62
|
+
this.unsubscribeFn();
|
|
63
|
+
this.unsubscribeFn = null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Note: The "Section" concept is being phased out in favor of a more flexible Block/BlockOutlet system.
|
|
70
|
+
* Sections are still supported for backward compatibility but may be deprecated in future versions.
|
|
71
|
+
* For new development, consider using Blocks instead of Sections for better flexibility and composability.
|
|
72
|
+
*
|
|
73
|
+
* --- CHANGELOG ---
|
|
74
|
+
* vX.X.X - Introduced Block/BlockOutlet system as a more flexible alternative to Sections.
|
|
75
|
+
* - Sections are now considered legacy and may be deprecated in future versions.
|
|
76
|
+
* - ViewController's section management is being refactored to support Blocks instead of Sections.
|
|
77
|
+
* - Updated documentation and examples to encourage use of Blocks over Sections.
|
|
78
|
+
*
|
|
79
|
+
* --- FUTURE PLANS ---
|
|
80
|
+
* - Phase out Sections entirely in favor of Blocks, which offer more composability and dynamic capabilities.
|
|
81
|
+
* - Provide migration guides for existing users to transition from Sections to Blocks.
|
|
82
|
+
* - Enhance Block system with features like nested blocks, dynamic block registration, and improved lifecycle management.
|
|
83
|
+
*
|
|
84
|
+
* --- CURRENT RECOMMENDATION ---
|
|
85
|
+
* For new views, prefer using Blocks and BlockOutlets for layout composition instead of Sections. Sections will still work but are not recommended for new development.
|
|
86
|
+
*/
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ViewControllerInterface, ViewType } from "../contracts/ViewControllerInterface";
|
|
2
|
+
import type { ViewInterface, ViewLifecycleHooks } from "../contracts/ViewInterface";
|
|
3
|
+
import type { OneObjectType } from "../types/utils";
|
|
4
|
+
import { ViewController } from "./ViewController";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* View — the base class for all views in OneView.
|
|
8
|
+
*
|
|
9
|
+
* A View is the unit that the user writes. It contains:
|
|
10
|
+
* - User-defined properties (reactive state, computed values)
|
|
11
|
+
* - User-defined methods (event handlers, business logic)
|
|
12
|
+
* - Lifecycle hooks (onInit, onMounted, onUpdated, onDestroy)
|
|
13
|
+
* - A ViewController (hidden as __ctrl__) that manages everything internally
|
|
14
|
+
*
|
|
15
|
+
* The ViewController is non-enumerable so it doesn't show up in serialization
|
|
16
|
+
* or when iterating over the View's properties.
|
|
17
|
+
*
|
|
18
|
+
* Usage:
|
|
19
|
+
* Typically the compiler generates a subclass of View with $__setup__
|
|
20
|
+
* that declares state, methods, and the render factory.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Compiled output from counter.one:
|
|
24
|
+
* class CounterView extends View {
|
|
25
|
+
* $__setup__() {
|
|
26
|
+
* const [count, setCount] = this.__ctrl__.states.__.useState(0, 'count');
|
|
27
|
+
* this.count = count;
|
|
28
|
+
* this.setCount = setCount;
|
|
29
|
+
* this.increment = () => setCount(this.count + 1);
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
export class View implements ViewInterface, ViewLifecycleHooks {
|
|
34
|
+
public __ctrl__!: ViewController;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
|
|
37
|
+
constructor(path: string, viewType: ViewType = 'view', viewControllerClass?: any) {
|
|
38
|
+
const CtrlClass = viewControllerClass ?? ViewController;
|
|
39
|
+
const controller = new CtrlClass(this, path, viewType);
|
|
40
|
+
|
|
41
|
+
// Store controller as non-enumerable, non-writable property
|
|
42
|
+
Object.defineProperty(this, '__ctrl__', {
|
|
43
|
+
value: controller,
|
|
44
|
+
writable: false,
|
|
45
|
+
enumerable: false,
|
|
46
|
+
configurable: false,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Setup hook — called by framework after construction.
|
|
52
|
+
* Compiled .one output overrides this to declare state, methods, render factory.
|
|
53
|
+
*
|
|
54
|
+
* @param __data__ — Route params, props, etc.
|
|
55
|
+
* @param systemData — System-level data (SSR data, global config, etc.)
|
|
56
|
+
*/
|
|
57
|
+
$__setup__(__data__: Record<string, any> = {}, systemData: Record<string, any> = {}): void {
|
|
58
|
+
// Override in subclass
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ─── Lifecycle Hooks ────────────────────────────────────────
|
|
62
|
+
// Users can override these in their view class
|
|
63
|
+
|
|
64
|
+
onInit?(): void | Promise<void>;
|
|
65
|
+
onMounted?(): void | Promise<void>;
|
|
66
|
+
onUpdated?(): void | Promise<void>;
|
|
67
|
+
onDestroy?(): void | Promise<void>;
|
|
68
|
+
onActivated?(): void | Promise<void>;
|
|
69
|
+
onDeactivated?(): void | Promise<void>;
|
|
70
|
+
|
|
71
|
+
// ─── Convenience Accessors ──────────────────────────────────
|
|
72
|
+
|
|
73
|
+
get path(): string {
|
|
74
|
+
return this.__ctrl__.path;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get viewType(): ViewType {
|
|
78
|
+
return this.__ctrl__.viewType;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Shortcut to controller */
|
|
82
|
+
get __(): ViewController {
|
|
83
|
+
return this.__ctrl__;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Shortcut to ViewState */
|
|
87
|
+
get $state(): any {
|
|
88
|
+
return this.__ctrl__.states;
|
|
89
|
+
}
|
|
90
|
+
get oneType(): OneObjectType {
|
|
91
|
+
return 'View';
|
|
92
|
+
}
|
|
93
|
+
set oneType(value: OneObjectType) {
|
|
94
|
+
// No-op setter to satisfy the Interface; this property is always 'View'
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get parent(): ViewInterface | null {
|
|
98
|
+
return this.__ctrl__.getParentView();
|
|
99
|
+
}
|
|
100
|
+
get children(): ViewInterface[] {
|
|
101
|
+
return this.__ctrl__.getChildrenViews();
|
|
102
|
+
}
|
|
103
|
+
get superView(): ViewInterface | null {
|
|
104
|
+
return this.__ctrl__.getSuperView();
|
|
105
|
+
}
|
|
106
|
+
get originView(): ViewInterface | null {
|
|
107
|
+
return this.__ctrl__.getOriginView();
|
|
108
|
+
}
|
|
109
|
+
}
|