@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,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Module - V2 TypeScript
|
|
3
|
+
* Centralized API service for backend communication
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { APIClientInterface } from '../contracts/ApiInterface.js';
|
|
7
|
+
import { HttpService } from '../services/HttpService.js';
|
|
8
|
+
|
|
9
|
+
export interface APIEndpoints {
|
|
10
|
+
system?: {
|
|
11
|
+
config?: string;
|
|
12
|
+
data?: string;
|
|
13
|
+
};
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class ApiClient implements APIClientInterface {
|
|
18
|
+
private http: HttpService;
|
|
19
|
+
private endpoints: APIEndpoints;
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
this.http = new HttpService();
|
|
23
|
+
this.setupDefaultHeaders();
|
|
24
|
+
this.endpoints = this.loadEndpoints();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Setup default headers including CSRF token
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
private setupDefaultHeaders(): void {
|
|
32
|
+
this.http.setHeader('Content-Type', 'application/json');
|
|
33
|
+
this.http.setHeader('Accept', 'application/json');
|
|
34
|
+
this.http.setHeader('X-Requested-With', 'XMLHttpRequest');
|
|
35
|
+
this.http.setHeader('X-DATA-TYPE', 'json');
|
|
36
|
+
|
|
37
|
+
// Get CSRF token from meta tag (SSR support)
|
|
38
|
+
if (typeof document !== 'undefined') {
|
|
39
|
+
const csrfToken = document.querySelector('meta[name="csrf-token"]');
|
|
40
|
+
if (csrfToken) {
|
|
41
|
+
const token = csrfToken.getAttribute('content');
|
|
42
|
+
if (token) {
|
|
43
|
+
this.http.setHeader('X-CSRF-TOKEN', token);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
init(config: Record<string, any>): void {
|
|
50
|
+
// Placeholder for any future initialization logic
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Load API endpoints from config
|
|
55
|
+
* @private
|
|
56
|
+
*/
|
|
57
|
+
private loadEndpoints(): APIEndpoints {
|
|
58
|
+
if (typeof window === 'undefined') {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
return (window as any).ONE_CONFIGS?.api?.endpoints || {};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get view data for specific URI
|
|
66
|
+
* V1 compatible: returns response.data if status=true, else {}
|
|
67
|
+
*/
|
|
68
|
+
async getViewData(uri: string): Promise<any> {
|
|
69
|
+
try {
|
|
70
|
+
const response = await this.http.get(uri);
|
|
71
|
+
return response.status ? response.data : {};
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error('[API] Error getting view data:', error);
|
|
74
|
+
return {};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Get system configuration
|
|
80
|
+
* V1 compatible
|
|
81
|
+
*/
|
|
82
|
+
async getSystemConfig(): Promise<any> {
|
|
83
|
+
const endpoint = this.endpoints?.system?.config;
|
|
84
|
+
if (!endpoint) {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const response = await this.http.get(endpoint);
|
|
90
|
+
return response.status ? response.data : {};
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error('[API] Error getting system config:', error);
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get system data
|
|
99
|
+
* V1 compatible
|
|
100
|
+
*/
|
|
101
|
+
async getSystemData(): Promise<any> {
|
|
102
|
+
const endpoint = this.endpoints?.system?.data;
|
|
103
|
+
if (!endpoint) {
|
|
104
|
+
return {};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const response = await this.http.get(endpoint);
|
|
109
|
+
return response.status ? response.data : {};
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error('[API] Error getting system data:', error);
|
|
112
|
+
return {};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get data for current URI
|
|
118
|
+
* Optimization: SSR-safe window access
|
|
119
|
+
*/
|
|
120
|
+
async getURIData(): Promise<any> {
|
|
121
|
+
if (typeof window === 'undefined') {
|
|
122
|
+
return {};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const uri = window.location.pathname + window.location.search;
|
|
126
|
+
return this.getViewData(uri);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Set custom endpoint
|
|
131
|
+
*/
|
|
132
|
+
setEndpoint(key: string, value: string): void {
|
|
133
|
+
if (!this.endpoints[key]) {
|
|
134
|
+
this.endpoints[key] = {};
|
|
135
|
+
}
|
|
136
|
+
Object.assign(this.endpoints[key], typeof value === 'string' ? { url: value } : value);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Get HTTP service instance for custom requests
|
|
141
|
+
*/
|
|
142
|
+
getHttpService(): HttpService {
|
|
143
|
+
return this.http;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Application } from "../app/Application";
|
|
2
|
+
import { AppFactory, ServiceKey } from "../contracts/ApplicationInterface";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Container instance để quản lý services
|
|
7
|
+
* Tương tự Laravel's app container
|
|
8
|
+
*/
|
|
9
|
+
const AppInstance = new Application();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Helper function để lấy/đăng ký services
|
|
13
|
+
* Cách dùng:
|
|
14
|
+
* - app() - trả về container instance
|
|
15
|
+
* - app('service_name') - lấy service
|
|
16
|
+
* - app('key', value) - đăng ký instance
|
|
17
|
+
*
|
|
18
|
+
* @param key - Tên service (optional)
|
|
19
|
+
* @param value - Giá trị service (optional)
|
|
20
|
+
* @returns Container instance, service, hoặc void
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Lấy container
|
|
24
|
+
* const container = app();
|
|
25
|
+
* container.singleton('store', Store);
|
|
26
|
+
*
|
|
27
|
+
* // Lấy service trực tiếp
|
|
28
|
+
* const store = app('store');
|
|
29
|
+
*
|
|
30
|
+
* // Đăng ký instance
|
|
31
|
+
* app('config', { api: 'https://api.example.com' });
|
|
32
|
+
*/
|
|
33
|
+
const appFactory = <T>(key?: ServiceKey, value?: any): Application | T | any | void => {
|
|
34
|
+
if (key === undefined || key === null) {
|
|
35
|
+
// Không truyền gì → trả về container
|
|
36
|
+
return AppInstance;
|
|
37
|
+
}
|
|
38
|
+
if (value !== undefined) {
|
|
39
|
+
// Truyền 2 tham số → đăng ký instance
|
|
40
|
+
AppInstance.instance(key, value);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Truyền 1 tham số → lấy service
|
|
44
|
+
return AppInstance.make(key);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Add make method to app function for TypeScript compatibility
|
|
48
|
+
appFactory.make = <T>(name: ServiceKey): T => AppInstance.make(name);
|
|
49
|
+
appFactory.instance = <T>(name: ServiceKey, value: T): Application => AppInstance.instance(name, value);
|
|
50
|
+
appFactory.resolve = <T>(name: ServiceKey, defaultValue?: T): T => AppInstance.resolve(name, defaultValue);
|
|
51
|
+
appFactory.register = <T>(name: ServiceKey, factory: () => T): Application => AppInstance.bind(name, factory);
|
|
52
|
+
appFactory.bind = <T>(name: ServiceKey, factory: () => T): Application => AppInstance.bind(name, factory);
|
|
53
|
+
appFactory.singleton = <T>(name: ServiceKey, factory: () => T): Application => AppInstance.singleton(name, factory);
|
|
54
|
+
appFactory.has = (name: ServiceKey): boolean => AppInstance.has(name);
|
|
55
|
+
appFactory.flush = (): void => { AppInstance.flush(); };
|
|
56
|
+
appFactory.destroy = (): void => { AppInstance.destroy(); };
|
|
57
|
+
export const app = appFactory as AppFactory;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export function generateUUID(length: number = 36): string {
|
|
2
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
3
|
+
const r = (Math.random() * 16) | 0;
|
|
4
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
5
|
+
return v.toString(16);
|
|
6
|
+
}).substring(0, length);
|
|
7
|
+
}
|
|
8
|
+
const htmlEscapeMap: Record<string, string> = {
|
|
9
|
+
'&': '&',
|
|
10
|
+
'<': '<',
|
|
11
|
+
'>': '>',
|
|
12
|
+
'"': '"',
|
|
13
|
+
"'": ''',
|
|
14
|
+
};
|
|
15
|
+
const htmlEscapeRe = /[&<>"']/g;
|
|
16
|
+
|
|
17
|
+
export function escapeHTML(str: string): string {
|
|
18
|
+
return str.replace(htmlEscapeRe, (ch) => htmlEscapeMap[ch]);
|
|
19
|
+
}
|
|
20
|
+
export function isEmpty(value: any): boolean {
|
|
21
|
+
if (value == null) return true;
|
|
22
|
+
if (typeof value === 'string' && value.trim() === '') return true;
|
|
23
|
+
if (Array.isArray(value) && value.length === 0) return true;
|
|
24
|
+
if (typeof value === 'object' && Object.keys(value).length === 0) return true;
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isObject(value: any): boolean {
|
|
29
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
30
|
+
}
|
|
31
|
+
export function hasProperty(obj: any, prop: string): boolean {
|
|
32
|
+
return obj != null && Object.prototype.hasOwnProperty.call(obj, prop);
|
|
33
|
+
}
|
|
34
|
+
export function hasMethod(obj: any, method: string): boolean {
|
|
35
|
+
return obj != null && typeof obj[method] === 'function';
|
|
36
|
+
}
|
|
37
|
+
export function hasAnyProperty(obj: any, props: string[]): boolean {
|
|
38
|
+
return obj != null && props.some(prop => Object.prototype.hasOwnProperty.call(obj, prop));
|
|
39
|
+
}
|
|
40
|
+
export function hasData(value: any): boolean {
|
|
41
|
+
return isObject(value) && Object.keys(value).length > 0;
|
|
42
|
+
}
|
|
43
|
+
export function isArray(value: any): boolean {
|
|
44
|
+
return Array.isArray(value);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function isString(value: any): boolean {
|
|
48
|
+
return typeof value === 'string';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function isNumber(value: any): boolean {
|
|
52
|
+
return typeof value === 'number' && !isNaN(value);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function isBoolean(value: any): boolean {
|
|
56
|
+
return typeof value === 'boolean';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function isFunction(value: any): boolean {
|
|
60
|
+
return typeof value === 'function';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function isPromise(value: any): boolean {
|
|
64
|
+
return value instanceof Promise || (value !== null && typeof value === 'object' && typeof value.then === 'function');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function isHTMLElement(value: any): boolean {
|
|
68
|
+
return value instanceof HTMLElement;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isNode(value: any): boolean {
|
|
72
|
+
return value instanceof Node;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function isCommentNode(value: any): boolean {
|
|
76
|
+
return value instanceof Comment;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function isTextNode(value: any): boolean {
|
|
80
|
+
return value instanceof Text;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isOneElement(value: any): boolean {
|
|
84
|
+
return value && typeof value === 'object' && 'isOneElement' in value && value.isOneElement === true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function isOneHtml(value: any): boolean {
|
|
88
|
+
return value && typeof value === 'object' && 'isOneHtml' in value && value.isOneHtml === true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function isOneText(value: any): boolean {
|
|
92
|
+
return value && typeof value === 'object' && 'isOneText' in value && value.isOneText === true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function isOneNativeElement(value: any): boolean {
|
|
96
|
+
return value && typeof value === 'object' && 'isOneNativeElement' in value && value.isOneNativeElement === true;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function isOneReactive(value: any): boolean {
|
|
100
|
+
return value && typeof value === 'object' && 'isOneReactive' in value && value.isOneReactive === true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function isOneFragment(value: any): boolean {
|
|
104
|
+
return value && typeof value === 'object' && 'isOneFragment' in value && value.isOneFragment === true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function isOneBlock(value: any): boolean {
|
|
108
|
+
return value && typeof value === 'object' && 'isOneBlock' in value && value.isOneBlock === true;
|
|
109
|
+
}
|