@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.
Files changed (383) hide show
  1. package/README.md +221 -0
  2. package/dist/index.d.ts +46 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +38 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/plugins.d.ts +38 -0
  7. package/dist/plugins.d.ts.map +1 -0
  8. package/dist/plugins.js +61 -0
  9. package/dist/plugins.js.map +1 -0
  10. package/dist/src/core/app/Application.d.ts +159 -0
  11. package/dist/src/core/app/Application.d.ts.map +1 -0
  12. package/dist/src/core/app/Application.js +338 -0
  13. package/dist/src/core/app/Application.js.map +1 -0
  14. package/dist/src/core/bootstrap/app.d.ts +4 -0
  15. package/dist/src/core/bootstrap/app.d.ts.map +1 -0
  16. package/dist/src/core/bootstrap/app.js +49 -0
  17. package/dist/src/core/bootstrap/app.js.map +1 -0
  18. package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts +9 -0
  19. package/dist/src/core/bootstrap/providers/ApiServiceProvider.d.ts.map +1 -0
  20. package/dist/src/core/bootstrap/providers/ApiServiceProvider.js +18 -0
  21. package/dist/src/core/bootstrap/providers/ApiServiceProvider.js.map +1 -0
  22. package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts +6 -0
  23. package/dist/src/core/bootstrap/providers/CoreServiceProvider.d.ts.map +1 -0
  24. package/dist/src/core/bootstrap/providers/CoreServiceProvider.js +21 -0
  25. package/dist/src/core/bootstrap/providers/CoreServiceProvider.js.map +1 -0
  26. package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts +7 -0
  27. package/dist/src/core/bootstrap/providers/HelperServiceProvider.d.ts.map +1 -0
  28. package/dist/src/core/bootstrap/providers/HelperServiceProvider.js +14 -0
  29. package/dist/src/core/bootstrap/providers/HelperServiceProvider.js.map +1 -0
  30. package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts +9 -0
  31. package/dist/src/core/bootstrap/providers/RouteServiceProvider.d.ts.map +1 -0
  32. package/dist/src/core/bootstrap/providers/RouteServiceProvider.js +18 -0
  33. package/dist/src/core/bootstrap/providers/RouteServiceProvider.js.map +1 -0
  34. package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts +38 -0
  35. package/dist/src/core/bootstrap/providers/ServiceProvider.d.ts.map +1 -0
  36. package/dist/src/core/bootstrap/providers/ServiceProvider.js +41 -0
  37. package/dist/src/core/bootstrap/providers/ServiceProvider.js.map +1 -0
  38. package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts +9 -0
  39. package/dist/src/core/bootstrap/providers/ViewServiceProvider.d.ts.map +1 -0
  40. package/dist/src/core/bootstrap/providers/ViewServiceProvider.js +18 -0
  41. package/dist/src/core/bootstrap/providers/ViewServiceProvider.js.map +1 -0
  42. package/dist/src/core/bootstrap/providers/default-providers.d.ts +14 -0
  43. package/dist/src/core/bootstrap/providers/default-providers.d.ts.map +1 -0
  44. package/dist/src/core/bootstrap/providers/default-providers.js +79 -0
  45. package/dist/src/core/bootstrap/providers/default-providers.js.map +1 -0
  46. package/dist/src/core/bootstrap/providers/index.d.ts +10 -0
  47. package/dist/src/core/bootstrap/providers/index.d.ts.map +1 -0
  48. package/dist/src/core/bootstrap/providers/index.js +9 -0
  49. package/dist/src/core/bootstrap/providers/index.js.map +1 -0
  50. package/dist/src/core/bootstrap/providers/provider-order.d.ts +19 -0
  51. package/dist/src/core/bootstrap/providers/provider-order.d.ts.map +1 -0
  52. package/dist/src/core/bootstrap/providers/provider-order.js +51 -0
  53. package/dist/src/core/bootstrap/providers/provider-order.js.map +1 -0
  54. package/dist/src/core/cache/ViewCache.d.ts +46 -0
  55. package/dist/src/core/cache/ViewCache.d.ts.map +1 -0
  56. package/dist/src/core/cache/ViewCache.js +85 -0
  57. package/dist/src/core/cache/ViewCache.js.map +1 -0
  58. package/dist/src/core/cache/index.d.ts +2 -0
  59. package/dist/src/core/cache/index.d.ts.map +1 -0
  60. package/dist/src/core/cache/index.js +2 -0
  61. package/dist/src/core/cache/index.js.map +1 -0
  62. package/dist/src/core/contracts/ApiInterface.d.ts +11 -0
  63. package/dist/src/core/contracts/ApiInterface.d.ts.map +1 -0
  64. package/dist/src/core/contracts/ApiInterface.js +2 -0
  65. package/dist/src/core/contracts/ApiInterface.js.map +1 -0
  66. package/dist/src/core/contracts/ApplicationInterface.d.ts +66 -0
  67. package/dist/src/core/contracts/ApplicationInterface.d.ts.map +1 -0
  68. package/dist/src/core/contracts/ApplicationInterface.js +3 -0
  69. package/dist/src/core/contracts/ApplicationInterface.js.map +1 -0
  70. package/dist/src/core/contracts/BlockInterface.d.ts +67 -0
  71. package/dist/src/core/contracts/BlockInterface.d.ts.map +1 -0
  72. package/dist/src/core/contracts/BlockInterface.js +2 -0
  73. package/dist/src/core/contracts/BlockInterface.js.map +1 -0
  74. package/dist/src/core/contracts/ComponentInterface.d.ts +24 -0
  75. package/dist/src/core/contracts/ComponentInterface.d.ts.map +1 -0
  76. package/dist/src/core/contracts/ComponentInterface.js +2 -0
  77. package/dist/src/core/contracts/ComponentInterface.js.map +1 -0
  78. package/dist/src/core/contracts/ElementInterface.d.ts +117 -0
  79. package/dist/src/core/contracts/ElementInterface.d.ts.map +1 -0
  80. package/dist/src/core/contracts/ElementInterface.js +2 -0
  81. package/dist/src/core/contracts/ElementInterface.js.map +1 -0
  82. package/dist/src/core/contracts/EventServiceInterface.d.ts +37 -0
  83. package/dist/src/core/contracts/EventServiceInterface.d.ts.map +1 -0
  84. package/dist/src/core/contracts/EventServiceInterface.js +3 -0
  85. package/dist/src/core/contracts/EventServiceInterface.js.map +1 -0
  86. package/dist/src/core/contracts/HelperInterface.d.ts +231 -0
  87. package/dist/src/core/contracts/HelperInterface.d.ts.map +1 -0
  88. package/dist/src/core/contracts/HelperInterface.js +3 -0
  89. package/dist/src/core/contracts/HelperInterface.js.map +1 -0
  90. package/dist/src/core/contracts/HttpServiceInterface.d.ts +38 -0
  91. package/dist/src/core/contracts/HttpServiceInterface.d.ts.map +1 -0
  92. package/dist/src/core/contracts/HttpServiceInterface.js +3 -0
  93. package/dist/src/core/contracts/HttpServiceInterface.js.map +1 -0
  94. package/dist/src/core/contracts/LoggerServiceInterface.d.ts +37 -0
  95. package/dist/src/core/contracts/LoggerServiceInterface.d.ts.map +1 -0
  96. package/dist/src/core/contracts/LoggerServiceInterface.js +3 -0
  97. package/dist/src/core/contracts/LoggerServiceInterface.js.map +1 -0
  98. package/dist/src/core/contracts/LoopContextInterface.d.ts +14 -0
  99. package/dist/src/core/contracts/LoopContextInterface.d.ts.map +1 -0
  100. package/dist/src/core/contracts/LoopContextInterface.js +3 -0
  101. package/dist/src/core/contracts/LoopContextInterface.js.map +1 -0
  102. package/dist/src/core/contracts/MarkerInterface.d.ts +55 -0
  103. package/dist/src/core/contracts/MarkerInterface.d.ts.map +1 -0
  104. package/dist/src/core/contracts/MarkerInterface.js +2 -0
  105. package/dist/src/core/contracts/MarkerInterface.js.map +1 -0
  106. package/dist/src/core/contracts/ReactiveInterface.d.ts +38 -0
  107. package/dist/src/core/contracts/ReactiveInterface.d.ts.map +1 -0
  108. package/dist/src/core/contracts/ReactiveInterface.js +2 -0
  109. package/dist/src/core/contracts/ReactiveInterface.js.map +1 -0
  110. package/dist/src/core/contracts/RouterInterface.d.ts +58 -0
  111. package/dist/src/core/contracts/RouterInterface.d.ts.map +1 -0
  112. package/dist/src/core/contracts/RouterInterface.js +2 -0
  113. package/dist/src/core/contracts/RouterInterface.js.map +1 -0
  114. package/dist/src/core/contracts/ServiceProviderInterface.d.ts +12 -0
  115. package/dist/src/core/contracts/ServiceProviderInterface.d.ts.map +1 -0
  116. package/dist/src/core/contracts/ServiceProviderInterface.js +2 -0
  117. package/dist/src/core/contracts/ServiceProviderInterface.js.map +1 -0
  118. package/dist/src/core/contracts/StorageServiceInterface.d.ts +43 -0
  119. package/dist/src/core/contracts/StorageServiceInterface.d.ts.map +1 -0
  120. package/dist/src/core/contracts/StorageServiceInterface.js +3 -0
  121. package/dist/src/core/contracts/StorageServiceInterface.js.map +1 -0
  122. package/dist/src/core/contracts/StoreServiceInterface.d.ts +45 -0
  123. package/dist/src/core/contracts/StoreServiceInterface.d.ts.map +1 -0
  124. package/dist/src/core/contracts/StoreServiceInterface.js +3 -0
  125. package/dist/src/core/contracts/StoreServiceInterface.js.map +1 -0
  126. package/dist/src/core/contracts/ViewCacheInterface.d.ts +13 -0
  127. package/dist/src/core/contracts/ViewCacheInterface.d.ts.map +1 -0
  128. package/dist/src/core/contracts/ViewCacheInterface.js +3 -0
  129. package/dist/src/core/contracts/ViewCacheInterface.js.map +1 -0
  130. package/dist/src/core/contracts/ViewControllerInterface.d.ts +115 -0
  131. package/dist/src/core/contracts/ViewControllerInterface.d.ts.map +1 -0
  132. package/dist/src/core/contracts/ViewControllerInterface.js +2 -0
  133. package/dist/src/core/contracts/ViewControllerInterface.js.map +1 -0
  134. package/dist/src/core/contracts/ViewInterface.d.ts +24 -0
  135. package/dist/src/core/contracts/ViewInterface.d.ts.map +1 -0
  136. package/dist/src/core/contracts/ViewInterface.js +2 -0
  137. package/dist/src/core/contracts/ViewInterface.js.map +1 -0
  138. package/dist/src/core/contracts/ViewManagerInterface.d.ts +44 -0
  139. package/dist/src/core/contracts/ViewManagerInterface.d.ts.map +1 -0
  140. package/dist/src/core/contracts/ViewManagerInterface.js +2 -0
  141. package/dist/src/core/contracts/ViewManagerInterface.js.map +1 -0
  142. package/dist/src/core/contracts/ViewStateInterface.d.ts +40 -0
  143. package/dist/src/core/contracts/ViewStateInterface.d.ts.map +1 -0
  144. package/dist/src/core/contracts/ViewStateInterface.js +3 -0
  145. package/dist/src/core/contracts/ViewStateInterface.js.map +1 -0
  146. package/dist/src/core/contracts/common.d.ts +28 -0
  147. package/dist/src/core/contracts/common.d.ts.map +1 -0
  148. package/dist/src/core/contracts/common.js +29 -0
  149. package/dist/src/core/contracts/common.js.map +1 -0
  150. package/dist/src/core/contracts/utils.d.ts +20 -0
  151. package/dist/src/core/contracts/utils.d.ts.map +1 -0
  152. package/dist/src/core/contracts/utils.js +4 -0
  153. package/dist/src/core/contracts/utils.js.map +1 -0
  154. package/dist/src/core/contracts/views.d.ts +23 -0
  155. package/dist/src/core/contracts/views.d.ts.map +1 -0
  156. package/dist/src/core/contracts/views.js +2 -0
  157. package/dist/src/core/contracts/views.js.map +1 -0
  158. package/dist/src/core/elements/Block.d.ts +58 -0
  159. package/dist/src/core/elements/Block.d.ts.map +1 -0
  160. package/dist/src/core/elements/Block.js +77 -0
  161. package/dist/src/core/elements/Block.js.map +1 -0
  162. package/dist/src/core/elements/BlockOutlet.d.ts +34 -0
  163. package/dist/src/core/elements/BlockOutlet.d.ts.map +1 -0
  164. package/dist/src/core/elements/BlockOutlet.js +59 -0
  165. package/dist/src/core/elements/BlockOutlet.js.map +1 -0
  166. package/dist/src/core/elements/Component.d.ts +62 -0
  167. package/dist/src/core/elements/Component.d.ts.map +1 -0
  168. package/dist/src/core/elements/Component.js +72 -0
  169. package/dist/src/core/elements/Component.js.map +1 -0
  170. package/dist/src/core/elements/ElementManager.d.ts +23 -0
  171. package/dist/src/core/elements/ElementManager.d.ts.map +1 -0
  172. package/dist/src/core/elements/ElementManager.js +33 -0
  173. package/dist/src/core/elements/ElementManager.js.map +1 -0
  174. package/dist/src/core/elements/Fragment.d.ts +51 -0
  175. package/dist/src/core/elements/Fragment.d.ts.map +1 -0
  176. package/dist/src/core/elements/Fragment.js +133 -0
  177. package/dist/src/core/elements/Fragment.js.map +1 -0
  178. package/dist/src/core/elements/Html.d.ts +52 -0
  179. package/dist/src/core/elements/Html.d.ts.map +1 -0
  180. package/dist/src/core/elements/Html.js +299 -0
  181. package/dist/src/core/elements/Html.js.map +1 -0
  182. package/dist/src/core/elements/Output.d.ts +69 -0
  183. package/dist/src/core/elements/Output.d.ts.map +1 -0
  184. package/dist/src/core/elements/Output.js +121 -0
  185. package/dist/src/core/elements/Output.js.map +1 -0
  186. package/dist/src/core/elements/Reactive.d.ts +77 -0
  187. package/dist/src/core/elements/Reactive.d.ts.map +1 -0
  188. package/dist/src/core/elements/Reactive.js +199 -0
  189. package/dist/src/core/elements/Reactive.js.map +1 -0
  190. package/dist/src/core/elements/TextElement.d.ts +46 -0
  191. package/dist/src/core/elements/TextElement.d.ts.map +1 -0
  192. package/dist/src/core/elements/TextElement.js +94 -0
  193. package/dist/src/core/elements/TextElement.js.map +1 -0
  194. package/dist/src/core/elements/Wrapper.d.ts +50 -0
  195. package/dist/src/core/elements/Wrapper.d.ts.map +1 -0
  196. package/dist/src/core/elements/Wrapper.js +96 -0
  197. package/dist/src/core/elements/Wrapper.js.map +1 -0
  198. package/dist/src/core/elements/Yield.d.ts +34 -0
  199. package/dist/src/core/elements/Yield.d.ts.map +1 -0
  200. package/dist/src/core/elements/Yield.js +56 -0
  201. package/dist/src/core/elements/Yield.js.map +1 -0
  202. package/dist/src/core/elements/helpers.d.ts +8 -0
  203. package/dist/src/core/elements/helpers.d.ts.map +1 -0
  204. package/dist/src/core/elements/helpers.js +40 -0
  205. package/dist/src/core/elements/helpers.js.map +1 -0
  206. package/dist/src/core/elements/index.d.ts +12 -0
  207. package/dist/src/core/elements/index.d.ts.map +1 -0
  208. package/dist/src/core/elements/index.js +12 -0
  209. package/dist/src/core/elements/index.js.map +1 -0
  210. package/dist/src/core/hellpers/ApiClient.d.ts +58 -0
  211. package/dist/src/core/hellpers/ApiClient.d.ts.map +1 -0
  212. package/dist/src/core/hellpers/ApiClient.js +122 -0
  213. package/dist/src/core/hellpers/ApiClient.js.map +1 -0
  214. package/dist/src/core/hellpers/app.d.ts +3 -0
  215. package/dist/src/core/hellpers/app.d.ts.map +1 -0
  216. package/dist/src/core/hellpers/app.js +53 -0
  217. package/dist/src/core/hellpers/app.js.map +1 -0
  218. package/dist/src/core/hellpers/utils.d.ts +26 -0
  219. package/dist/src/core/hellpers/utils.d.ts.map +1 -0
  220. package/dist/src/core/hellpers/utils.js +96 -0
  221. package/dist/src/core/hellpers/utils.js.map +1 -0
  222. package/dist/src/core/routers/Router.d.ts +212 -0
  223. package/dist/src/core/routers/Router.d.ts.map +1 -0
  224. package/dist/src/core/routers/Router.js +623 -0
  225. package/dist/src/core/routers/Router.js.map +1 -0
  226. package/dist/src/core/routers/index.d.ts +3 -0
  227. package/dist/src/core/routers/index.d.ts.map +1 -0
  228. package/dist/src/core/routers/index.js +2 -0
  229. package/dist/src/core/routers/index.js.map +1 -0
  230. package/dist/src/core/services/BlockManager.d.ts +63 -0
  231. package/dist/src/core/services/BlockManager.d.ts.map +1 -0
  232. package/dist/src/core/services/BlockManager.js +191 -0
  233. package/dist/src/core/services/BlockManager.js.map +1 -0
  234. package/dist/src/core/services/DomService.d.ts +9 -0
  235. package/dist/src/core/services/DomService.d.ts.map +1 -0
  236. package/dist/src/core/services/DomService.js +18 -0
  237. package/dist/src/core/services/DomService.js.map +1 -0
  238. package/dist/src/core/services/EventService.d.ts +58 -0
  239. package/dist/src/core/services/EventService.d.ts.map +1 -0
  240. package/dist/src/core/services/EventService.js +212 -0
  241. package/dist/src/core/services/EventService.js.map +1 -0
  242. package/dist/src/core/services/HelperService.d.ts +443 -0
  243. package/dist/src/core/services/HelperService.d.ts.map +1 -0
  244. package/dist/src/core/services/HelperService.js +1650 -0
  245. package/dist/src/core/services/HelperService.js.map +1 -0
  246. package/dist/src/core/services/HttpService.d.ts +63 -0
  247. package/dist/src/core/services/HttpService.d.ts.map +1 -0
  248. package/dist/src/core/services/HttpService.js +182 -0
  249. package/dist/src/core/services/HttpService.js.map +1 -0
  250. package/dist/src/core/services/LoggerService.d.ts +56 -0
  251. package/dist/src/core/services/LoggerService.d.ts.map +1 -0
  252. package/dist/src/core/services/LoggerService.js +94 -0
  253. package/dist/src/core/services/LoggerService.js.map +1 -0
  254. package/dist/src/core/services/MarkerRegistry.d.ts +94 -0
  255. package/dist/src/core/services/MarkerRegistry.d.ts.map +1 -0
  256. package/dist/src/core/services/MarkerRegistry.js +199 -0
  257. package/dist/src/core/services/MarkerRegistry.js.map +1 -0
  258. package/dist/src/core/services/MarkerService.d.ts +299 -0
  259. package/dist/src/core/services/MarkerService.d.ts.map +1 -0
  260. package/dist/src/core/services/MarkerService.js +723 -0
  261. package/dist/src/core/services/MarkerService.js.map +1 -0
  262. package/dist/src/core/services/StorageService.d.ts +69 -0
  263. package/dist/src/core/services/StorageService.d.ts.map +1 -0
  264. package/dist/src/core/services/StorageService.js +243 -0
  265. package/dist/src/core/services/StorageService.js.map +1 -0
  266. package/dist/src/core/services/StoreService.d.ts +80 -0
  267. package/dist/src/core/services/StoreService.d.ts.map +1 -0
  268. package/dist/src/core/services/StoreService.js +301 -0
  269. package/dist/src/core/services/StoreService.js.map +1 -0
  270. package/dist/src/core/services/index.d.ts +9 -0
  271. package/dist/src/core/services/index.d.ts.map +1 -0
  272. package/dist/src/core/services/index.js +9 -0
  273. package/dist/src/core/services/index.js.map +1 -0
  274. package/dist/src/core/types/utils.d.ts +29 -0
  275. package/dist/src/core/types/utils.d.ts.map +1 -0
  276. package/dist/src/core/types/utils.js +22 -0
  277. package/dist/src/core/types/utils.js.map +1 -0
  278. package/dist/src/core/view/LoopContext.d.ts +38 -0
  279. package/dist/src/core/view/LoopContext.d.ts.map +1 -0
  280. package/dist/src/core/view/LoopContext.js +100 -0
  281. package/dist/src/core/view/LoopContext.js.map +1 -0
  282. package/dist/src/core/view/Section.d.ts +41 -0
  283. package/dist/src/core/view/Section.d.ts.map +1 -0
  284. package/dist/src/core/view/Section.js +67 -0
  285. package/dist/src/core/view/Section.js.map +1 -0
  286. package/dist/src/core/view/View.d.ts +63 -0
  287. package/dist/src/core/view/View.d.ts.map +1 -0
  288. package/dist/src/core/view/View.js +85 -0
  289. package/dist/src/core/view/View.js.map +1 -0
  290. package/dist/src/core/view/ViewController.d.ts +277 -0
  291. package/dist/src/core/view/ViewController.d.ts.map +1 -0
  292. package/dist/src/core/view/ViewController.js +862 -0
  293. package/dist/src/core/view/ViewController.js.map +1 -0
  294. package/dist/src/core/view/ViewManager.d.ts +141 -0
  295. package/dist/src/core/view/ViewManager.d.ts.map +1 -0
  296. package/dist/src/core/view/ViewManager.js +565 -0
  297. package/dist/src/core/view/ViewManager.js.map +1 -0
  298. package/dist/src/core/view/ViewState.d.ts +117 -0
  299. package/dist/src/core/view/ViewState.d.ts.map +1 -0
  300. package/dist/src/core/view/ViewState.js +410 -0
  301. package/dist/src/core/view/ViewState.js.map +1 -0
  302. package/dist/src/core/view/index.d.ts +6 -0
  303. package/dist/src/core/view/index.d.ts.map +1 -0
  304. package/dist/src/core/view/index.js +6 -0
  305. package/dist/src/core/view/index.js.map +1 -0
  306. package/index.ts +62 -0
  307. package/package.json +70 -0
  308. package/plugins.ts +77 -0
  309. package/src/core/app/Application.ts +410 -0
  310. package/src/core/bootstrap/app.ts +58 -0
  311. package/src/core/bootstrap/providers/ApiServiceProvider.ts +18 -0
  312. package/src/core/bootstrap/providers/CoreServiceProvider.ts +19 -0
  313. package/src/core/bootstrap/providers/HelperServiceProvider.ts +12 -0
  314. package/src/core/bootstrap/providers/RouteServiceProvider.ts +17 -0
  315. package/src/core/bootstrap/providers/ServiceProvider.ts +51 -0
  316. package/src/core/bootstrap/providers/ViewServiceProvider.ts +17 -0
  317. package/src/core/bootstrap/providers/default-providers.ts +94 -0
  318. package/src/core/bootstrap/providers/index.ts +9 -0
  319. package/src/core/bootstrap/providers/provider-order.test.ts +67 -0
  320. package/src/core/bootstrap/providers/provider-order.ts +66 -0
  321. package/src/core/cache/ViewCache.ts +102 -0
  322. package/src/core/cache/index.ts +1 -0
  323. package/src/core/contracts/ApiInterface.ts +11 -0
  324. package/src/core/contracts/ApplicationInterface.ts +79 -0
  325. package/src/core/contracts/BlockInterface.ts +76 -0
  326. package/src/core/contracts/ComponentInterface.ts +26 -0
  327. package/src/core/contracts/ElementInterface.ts +140 -0
  328. package/src/core/contracts/EventServiceInterface.ts +47 -0
  329. package/src/core/contracts/HelperInterface.ts +256 -0
  330. package/src/core/contracts/HttpServiceInterface.ts +51 -0
  331. package/src/core/contracts/LoggerServiceInterface.ts +48 -0
  332. package/src/core/contracts/LoopContextInterface.ts +15 -0
  333. package/src/core/contracts/MarkerInterface.ts +77 -0
  334. package/src/core/contracts/ReactiveInterface.ts +45 -0
  335. package/src/core/contracts/RouterInterface.ts +65 -0
  336. package/src/core/contracts/ServiceProviderInterface.ts +12 -0
  337. package/src/core/contracts/StorageServiceInterface.ts +48 -0
  338. package/src/core/contracts/StoreServiceInterface.ts +50 -0
  339. package/src/core/contracts/ViewCacheInterface.ts +14 -0
  340. package/src/core/contracts/ViewControllerInterface.ts +135 -0
  341. package/src/core/contracts/ViewInterface.ts +31 -0
  342. package/src/core/contracts/ViewManagerInterface.ts +45 -0
  343. package/src/core/contracts/ViewStateInterface.ts +47 -0
  344. package/src/core/contracts/common.ts +27 -0
  345. package/src/core/contracts/utils.ts +23 -0
  346. package/src/core/contracts/views.ts +23 -0
  347. package/src/core/elements/Block.ts +113 -0
  348. package/src/core/elements/BlockOutlet.ts +83 -0
  349. package/src/core/elements/Component.ts +114 -0
  350. package/src/core/elements/ElementManager.ts +48 -0
  351. package/src/core/elements/Fragment.ts +168 -0
  352. package/src/core/elements/Html.ts +364 -0
  353. package/src/core/elements/Output.ts +167 -0
  354. package/src/core/elements/Reactive.ts +253 -0
  355. package/src/core/elements/TextElement.ts +110 -0
  356. package/src/core/elements/Wrapper.ts +131 -0
  357. package/src/core/elements/Yield.ts +70 -0
  358. package/src/core/elements/helpers.ts +56 -0
  359. package/src/core/elements/index.ts +26 -0
  360. package/src/core/hellpers/ApiClient.ts +145 -0
  361. package/src/core/hellpers/app.ts +57 -0
  362. package/src/core/hellpers/utils.ts +109 -0
  363. package/src/core/routers/Router.ts +765 -0
  364. package/src/core/routers/index.ts +2 -0
  365. package/src/core/services/BlockManager.ts +210 -0
  366. package/src/core/services/DomService.ts +26 -0
  367. package/src/core/services/EventService.ts +266 -0
  368. package/src/core/services/HelperService.ts +1653 -0
  369. package/src/core/services/HttpService.ts +235 -0
  370. package/src/core/services/LoggerService.ts +139 -0
  371. package/src/core/services/MarkerRegistry.ts +239 -0
  372. package/src/core/services/MarkerService.ts +923 -0
  373. package/src/core/services/StorageService.ts +268 -0
  374. package/src/core/services/StoreService.ts +338 -0
  375. package/src/core/services/index.ts +8 -0
  376. package/src/core/types/utils.ts +30 -0
  377. package/src/core/view/LoopContext.ts +109 -0
  378. package/src/core/view/Section.ts +86 -0
  379. package/src/core/view/View.ts +109 -0
  380. package/src/core/view/ViewController.ts +1002 -0
  381. package/src/core/view/ViewManager.ts +700 -0
  382. package/src/core/view/ViewState.ts +453 -0
  383. package/src/core/view/index.ts +5 -0
@@ -0,0 +1,50 @@
1
+ import { InitMode } from "../contracts/common";
2
+ import type { HtmlInterface, OneChildrenFactory, OneElementChildren, WrapperInterface } from "../contracts/ElementInterface";
3
+ import type { ViewControllerInterface } from "../contracts/ViewControllerInterface";
4
+ import type { OneObjectType } from "../types/utils";
5
+ /**
6
+ * Wrapper — renders multiple root nodes into a parent without a wrapping tag.
7
+ *
8
+ * Use case: when a ViewController's render() returns multiple sibling elements
9
+ * (e.g. `<h1>` + `<p>` + `<div>`) without a single root wrapper.
10
+ *
11
+ * Wrapper uses open/close Comment markers to track its region in the DOM,
12
+ * similar to Reactive but without the reactivity overhead.
13
+ */
14
+ export declare class Wrapper implements WrapperInterface {
15
+ oneType: OneObjectType;
16
+ parent: HtmlInterface | null;
17
+ nodes: Node[];
18
+ /** Tracked child element wrappers (Html, Output, Reactive, TextElement, etc.) */
19
+ children: OneElementChildren;
20
+ private ctx;
21
+ private childrenFactory;
22
+ openTag: Comment;
23
+ closeTag: Comment;
24
+ id: string;
25
+ initMode: InitMode;
26
+ domChildren: Node[];
27
+ constructor({ ctx, initMode, parentElement, childrenFactory }: {
28
+ ctx: ViewControllerInterface;
29
+ initMode?: InitMode;
30
+ parentElement?: HtmlInterface | null;
31
+ childrenFactory: OneChildrenFactory;
32
+ });
33
+ setParentElement(parent: HtmlInterface | null): void;
34
+ render(): void;
35
+ setChildrenFactory(factory: OneChildrenFactory): void;
36
+ /** Hydrate lifecycle — reattach event listeners or perform other setup */
37
+ hydrate(): void;
38
+ /** Start lifecycle — recursively activate children's reactive subscriptions */
39
+ start(): void;
40
+ /** Stop lifecycle — recursively deactivate children's reactive subscriptions */
41
+ stop(): void;
42
+ /** Remove all nodes between markers from the DOM */
43
+ clear(): void;
44
+ destroy(): void;
45
+ get isOneElement(): boolean;
46
+ set isOneElement(value: boolean);
47
+ get isOneFragment(): boolean;
48
+ set isOneFragment(value: boolean);
49
+ }
50
+ //# sourceMappingURL=Wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wrapper.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/Wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAqB,aAAa,EAAE,kBAAkB,EAA4B,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC1K,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;;;;GAQG;AACH,qBAAa,OAAQ,YAAW,gBAAgB;IAC5C,OAAO,EAAE,aAAa,CAAa;IAC5B,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAM;IAC1B,iFAAiF;IAC1E,QAAQ,EAAE,kBAAkB,CAAM;IACzC,OAAO,CAAC,GAAG,CAA0B;IACrC,OAAO,CAAC,eAAe,CAAqB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAoB;IAE7C,WAAW,EAAE,IAAI,EAAE,CAAM;gBAEb,EACR,GAAG,EACH,QAA2B,EAC3B,aAAoB,EACpB,eAAe,EAClB,EAAE;QACC,GAAG,EAAE,uBAAuB,CAAC;QAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;QACrC,eAAe,EAAE,kBAAkB,CAAA;KACtC;IAWD,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAGpD,MAAM,IAAI,IAAI;IAId,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAIrD,0EAA0E;IAE1E,OAAO,IAAI,IAAI;IAQf,+EAA+E;IAC/E,KAAK,IAAI,IAAI;IAQb,gFAAgF;IAChF,IAAI,IAAI,IAAI;IAQZ,oDAAoD;IACpD,KAAK,IAAI,IAAI;IAmBb,OAAO,IAAI,IAAI;IAOf,IAAI,YAAY,IAAI,OAAO,CAE1B;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;IAED,IAAI,aAAa,IAAI,OAAO,CAE3B;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAE/B;CACJ"}
@@ -0,0 +1,96 @@
1
+ import { InitModes } from "../contracts/common";
2
+ /**
3
+ * Wrapper — renders multiple root nodes into a parent without a wrapping tag.
4
+ *
5
+ * Use case: when a ViewController's render() returns multiple sibling elements
6
+ * (e.g. `<h1>` + `<p>` + `<div>`) without a single root wrapper.
7
+ *
8
+ * Wrapper uses open/close Comment markers to track its region in the DOM,
9
+ * similar to Reactive but without the reactivity overhead.
10
+ */
11
+ export class Wrapper {
12
+ constructor({ ctx, initMode = InitModes.CREATE, parentElement = null, childrenFactory }) {
13
+ this.oneType = 'Wrapper';
14
+ this.nodes = [];
15
+ /** Tracked child element wrappers (Html, Output, Reactive, TextElement, etc.) */
16
+ this.children = [];
17
+ this.initMode = InitModes.CREATE;
18
+ this.domChildren = []; // For compatibility with HtmlInterface; Wrapper itself doesn't have a single root element
19
+ this.ctx = ctx;
20
+ this.parent = parentElement;
21
+ this.childrenFactory = childrenFactory;
22
+ this.id = ctx.viewId;
23
+ this.initMode = initMode;
24
+ this.openTag = document.createComment('wrapper-start');
25
+ this.closeTag = document.createComment('wrapper-end');
26
+ }
27
+ setParentElement(parent) {
28
+ this.parent = parent;
29
+ }
30
+ render() {
31
+ }
32
+ setChildrenFactory(factory) {
33
+ this.childrenFactory = factory;
34
+ }
35
+ /** Hydrate lifecycle — reattach event listeners or perform other setup */
36
+ hydrate() {
37
+ for (const child of this.children) {
38
+ if ('hydrate' in child && typeof child.hydrate === 'function') {
39
+ child.hydrate();
40
+ }
41
+ }
42
+ }
43
+ /** Start lifecycle — recursively activate children's reactive subscriptions */
44
+ start() {
45
+ for (const child of this.children) {
46
+ if ('start' in child && typeof child.start === 'function') {
47
+ child.start();
48
+ }
49
+ }
50
+ }
51
+ /** Stop lifecycle — recursively deactivate children's reactive subscriptions */
52
+ stop() {
53
+ for (const child of this.children) {
54
+ if ('stop' in child && typeof child.stop === 'function') {
55
+ child.stop();
56
+ }
57
+ }
58
+ }
59
+ /** Remove all nodes between markers from the DOM */
60
+ clear() {
61
+ // Destroy managed children first
62
+ for (const child of this.children) {
63
+ if ('destroy' in child && typeof child.destroy === 'function') {
64
+ child.destroy();
65
+ }
66
+ }
67
+ this.children = [];
68
+ // Remove remaining DOM nodes between markers
69
+ let current = this.openTag.nextSibling;
70
+ while (current && current !== this.closeTag) {
71
+ const next = current.nextSibling;
72
+ current.remove();
73
+ current = next;
74
+ }
75
+ this.nodes = [];
76
+ }
77
+ destroy() {
78
+ this.clear();
79
+ this.openTag.remove();
80
+ this.closeTag.remove();
81
+ this.parent = null;
82
+ }
83
+ get isOneElement() {
84
+ return true;
85
+ }
86
+ set isOneElement(value) {
87
+ // No-op setter to satisfy the Interface; this property is always true for Fragment elements
88
+ }
89
+ get isOneFragment() {
90
+ return true;
91
+ }
92
+ set isOneFragment(value) {
93
+ // No-op setter to satisfy the Interface; this property is always true for Fragment elements
94
+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AAO;QACH,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,YAAY,CAAC,KAAc;QAC3B,4FAA4F;IAChG,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,aAAa,CAAC,KAAc;QAC5B,4FAA4F;IAChG,CAAC;CACJ"}
@@ -0,0 +1,34 @@
1
+ import { InitMode } from "../contracts/common";
2
+ import { HtmlInterface, OneChildrenFactoryOutput, YieldInterface } from "../contracts/ElementInterface";
3
+ import { ViewControllerInterface } from "../contracts/ViewControllerInterface";
4
+ import { OneObjectType } from "../types/utils";
5
+ export declare class YieldElement implements YieldInterface {
6
+ oneType: OneObjectType;
7
+ ctx: ViewControllerInterface;
8
+ name: string;
9
+ id: string;
10
+ contentFactory: () => OneChildrenFactoryOutput;
11
+ openTag: Comment;
12
+ closeTag: Comment;
13
+ initMode: InitMode;
14
+ domChildren: Node[];
15
+ parent: HtmlInterface | null;
16
+ defaultValue: string;
17
+ constructor({ ctx, name, initMode, id, defaultValue }: {
18
+ ctx: ViewControllerInterface;
19
+ name: string;
20
+ initMode?: InitMode;
21
+ id?: string | null;
22
+ defaultValue?: string;
23
+ });
24
+ private createMarkers;
25
+ setParentElement(parent: HtmlInterface | null): void;
26
+ setContentFactory(factory: () => OneChildrenFactoryOutput): void;
27
+ render(): void;
28
+ destroy(): void;
29
+ get isOneElement(): boolean;
30
+ set isOneElement(_: boolean);
31
+ get isOneYield(): boolean;
32
+ set isOneYield(_: boolean);
33
+ }
34
+ //# sourceMappingURL=Yield.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Yield.d.ts","sourceRoot":"","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I;IAC/B,IAAI,UAAU,IAAI,OAAO,CAAiB;IAC1C,IAAI,UAAU,CAAC,CAAC,EAAE,OAAO,EAAI;CAChC"}
@@ -0,0 +1,56 @@
1
+ import { InitModes } from "../contracts/common";
2
+ import { generateUUID } from "../hellpers/utils";
3
+ import { OneMarker } from "../services/MarkerService";
4
+ export class YieldElement {
5
+ constructor({ ctx, name = '', initMode = InitModes.CREATE, id = null, defaultValue = '' }) {
6
+ this.oneType = "Yield";
7
+ this.contentFactory = () => [];
8
+ this.initMode = InitModes.CREATE;
9
+ this.domChildren = [];
10
+ this.parent = null;
11
+ this.defaultValue = '';
12
+ this.ctx = ctx;
13
+ this.name = name;
14
+ this.initMode = initMode;
15
+ this.id = id && id.length > 0 ? id : generateUUID();
16
+ this.defaultValue = defaultValue;
17
+ const yeildMarker = (this.initMode === InitModes.HYDRATE) ? OneMarker.first('yield', this.id) : null;
18
+ if (yeildMarker) {
19
+ this.openTag = yeildMarker.openTag;
20
+ this.closeTag = yeildMarker.closeTag;
21
+ this.domChildren = yeildMarker.nodes.map((el) => el);
22
+ }
23
+ else {
24
+ this.createMarkers();
25
+ }
26
+ }
27
+ createMarkers() {
28
+ const key = OneMarker.addRegistry('yield', this.id, { name: this.name });
29
+ this.openTag = OneMarker.createOpenMarker('yield', this.id);
30
+ this.closeTag = OneMarker.createCloseMarker('yield', this.id);
31
+ }
32
+ setParentElement(parent) {
33
+ this.parent = parent;
34
+ }
35
+ setContentFactory(factory) {
36
+ this.contentFactory = factory;
37
+ }
38
+ render() {
39
+ if (!this.parent?.element)
40
+ return;
41
+ const parentEl = this.parent.element;
42
+ parentEl.appendChild(this.openTag);
43
+ parentEl.appendChild(this.closeTag);
44
+ }
45
+ destroy() {
46
+ this.openTag?.remove();
47
+ this.closeTag?.remove();
48
+ this.domChildren = [];
49
+ this.parent = null;
50
+ }
51
+ get isOneElement() { return true; }
52
+ set isOneElement(_) { }
53
+ get isOneYield() { return true; }
54
+ set isOneYield(_) { }
55
+ }
56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,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,YAAY,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IAC5C,IAAI,YAAY,CAAC,CAAU,IAAG,CAAC;IAC/B,IAAI,UAAU,KAAc,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAI,UAAU,CAAC,CAAU,IAAG,CAAC;CAChC"}
@@ -0,0 +1,8 @@
1
+ import { BlockOutletInterface } from "../contracts/BlockInterface";
2
+ import { FragmentInterface, HtmlInterface, OutputInterface, OneChildrenFactoryOutput, OneElementChildren } from "../contracts/ElementInterface";
3
+ import { ReactiveInterface } from "../contracts/ReactiveInterface";
4
+ import { ViewControllerInterface } from "../contracts/ViewControllerInterface";
5
+ import { OneObjectType } from "../types/utils";
6
+ export declare function getOneObjectType(instance: any): OneObjectType | null;
7
+ export declare function parseElementChildren(oneElement: HtmlInterface | ReactiveInterface | BlockOutletInterface | OutputInterface | FragmentInterface | ViewControllerInterface, parentElement: HTMLElement, children: OneChildrenFactoryOutput): OneElementChildren;
8
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAChJ,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,aAAa,GAAG,IAAI,CAKpE;AAED,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,aAAa,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,eAAe,GAAG,iBAAiB,GAAG,uBAAuB,EACpI,aAAa,EAAE,WAAW,EAC1B,QAAQ,EAAE,wBAAwB,GACnC,kBAAkB,CAsCpB"}
@@ -0,0 +1,40 @@
1
+ export function getOneObjectType(instance) {
2
+ if (instance && typeof instance === 'object' && 'oneType' in instance) {
3
+ return instance.oneType;
4
+ }
5
+ return null;
6
+ }
7
+ export function parseElementChildren(oneElement, parentElement, children) {
8
+ const parsedChildren = [];
9
+ if (!children || !Array.isArray(children)) {
10
+ console.warn('Children factory returned invalid output (not an array):', children);
11
+ return parsedChildren;
12
+ }
13
+ children.forEach(child => {
14
+ if (typeof child === 'string' || typeof child === 'number') {
15
+ const textNode = document.createTextNode(String(child));
16
+ parsedChildren.push(textNode);
17
+ return;
18
+ }
19
+ if (child instanceof Node) {
20
+ // Direct DOM node (e.g. from a third-party library) — append as-is
21
+ parsedChildren.push(child);
22
+ return;
23
+ }
24
+ if (!child || typeof child !== 'object' || child === null) {
25
+ // Skip invalid child types (null, undefined, non-objects, non-DOM nodes)
26
+ console.warn('Skipping invalid child:', child);
27
+ return;
28
+ }
29
+ let childType = getOneObjectType(child);
30
+ if (!childType) {
31
+ return;
32
+ }
33
+ switch (childType) {
34
+ case 'Html':
35
+ break;
36
+ }
37
+ });
38
+ return parsedChildren;
39
+ }
40
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/core/elements/helpers.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,gBAAgB,CAAC,QAAa;IAC1C,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,SAAS,IAAI,QAAQ,EAAE,CAAC;QACpE,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAChC,UAAoI,EACpI,aAA0B,EAC1B,QAAkC;IAElC,MAAM,cAAc,GAAuB,EAAE,CAAC;IAE9C,IAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,0DAA0D,EAAE,QAAQ,CAAC,CAAC;QACnF,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACzD,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACxD,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO;QACX,CAAC;QACD,IAAG,KAAK,YAAY,IAAI,EAAE,CAAC;YACvB,mEAAmE;YACnE,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3B,OAAO;QACX,CAAC;QACD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACxD,yEAAyE;YACzE,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;YAC/C,OAAO;QACX,CAAC;QACD,IAAI,SAAS,GAAkB,gBAAgB,CAAC,KAAK,CAAC,CAAC;QACvD,IAAG,CAAC,SAAS,EAAE,CAAC;YACZ,OAAO;QACX,CAAC;QACD,QAAQ,SAAS,EAAE,CAAC;YAChB,KAAK,MAAM;gBAGX,MAAM;QACV,CAAC;IACL,CAAC,CAAC,CAAC;IAGH,OAAO,cAAc,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from "./Block";
2
+ export * from "./BlockOutlet";
3
+ export * from './Component';
4
+ export * from "./ElementManager";
5
+ export * from "./Fragment";
6
+ export * from "./helpers";
7
+ export * from "./Html";
8
+ export * from "./Output";
9
+ export * from './Reactive';
10
+ export * from "./TextElement";
11
+ export * from "./Yield";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/elements/index.ts"],"names":[],"mappings":"AAeA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,12 @@
1
+ export * from "./Block";
2
+ export * from "./BlockOutlet";
3
+ export * from './Component';
4
+ export * from "./ElementManager";
5
+ export * from "./Fragment";
6
+ export * from "./helpers";
7
+ export * from "./Html";
8
+ export * from "./Output";
9
+ export * from './Reactive';
10
+ export * from "./TextElement";
11
+ export * from "./Yield";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/elements/index.ts"],"names":[],"mappings":"AAeA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * API Module - V2 TypeScript
3
+ * Centralized API service for backend communication
4
+ */
5
+ import { APIClientInterface } from '../contracts/ApiInterface.js';
6
+ import { HttpService } from '../services/HttpService.js';
7
+ export interface APIEndpoints {
8
+ system?: {
9
+ config?: string;
10
+ data?: string;
11
+ };
12
+ [key: string]: any;
13
+ }
14
+ export declare class ApiClient implements APIClientInterface {
15
+ private http;
16
+ private endpoints;
17
+ constructor();
18
+ /**
19
+ * Setup default headers including CSRF token
20
+ * @private
21
+ */
22
+ private setupDefaultHeaders;
23
+ init(config: Record<string, any>): void;
24
+ /**
25
+ * Load API endpoints from config
26
+ * @private
27
+ */
28
+ private loadEndpoints;
29
+ /**
30
+ * Get view data for specific URI
31
+ * V1 compatible: returns response.data if status=true, else {}
32
+ */
33
+ getViewData(uri: string): Promise<any>;
34
+ /**
35
+ * Get system configuration
36
+ * V1 compatible
37
+ */
38
+ getSystemConfig(): Promise<any>;
39
+ /**
40
+ * Get system data
41
+ * V1 compatible
42
+ */
43
+ getSystemData(): Promise<any>;
44
+ /**
45
+ * Get data for current URI
46
+ * Optimization: SSR-safe window access
47
+ */
48
+ getURIData(): Promise<any>;
49
+ /**
50
+ * Set custom endpoint
51
+ */
52
+ setEndpoint(key: string, value: string): void;
53
+ /**
54
+ * Get HTTP service instance for custom requests
55
+ */
56
+ getHttpService(): HttpService;
57
+ }
58
+ //# sourceMappingURL=ApiClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":["../../../../src/core/hellpers/ApiClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,qBAAa,SAAU,YAAW,kBAAkB;IAChD,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,SAAS,CAAe;;IAQhC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAkB3B,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAIvC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAOrB;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAU5C;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;IAerC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC;IAenC;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;IAShC;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAO7C;;OAEG;IACH,cAAc,IAAI,WAAW;CAGhC"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * API Module - V2 TypeScript
3
+ * Centralized API service for backend communication
4
+ */
5
+ import { HttpService } from '../services/HttpService.js';
6
+ export class ApiClient {
7
+ constructor() {
8
+ this.http = new HttpService();
9
+ this.setupDefaultHeaders();
10
+ this.endpoints = this.loadEndpoints();
11
+ }
12
+ /**
13
+ * Setup default headers including CSRF token
14
+ * @private
15
+ */
16
+ setupDefaultHeaders() {
17
+ this.http.setHeader('Content-Type', 'application/json');
18
+ this.http.setHeader('Accept', 'application/json');
19
+ this.http.setHeader('X-Requested-With', 'XMLHttpRequest');
20
+ this.http.setHeader('X-DATA-TYPE', 'json');
21
+ // Get CSRF token from meta tag (SSR support)
22
+ if (typeof document !== 'undefined') {
23
+ const csrfToken = document.querySelector('meta[name="csrf-token"]');
24
+ if (csrfToken) {
25
+ const token = csrfToken.getAttribute('content');
26
+ if (token) {
27
+ this.http.setHeader('X-CSRF-TOKEN', token);
28
+ }
29
+ }
30
+ }
31
+ }
32
+ init(config) {
33
+ // Placeholder for any future initialization logic
34
+ }
35
+ /**
36
+ * Load API endpoints from config
37
+ * @private
38
+ */
39
+ loadEndpoints() {
40
+ if (typeof window === 'undefined') {
41
+ return {};
42
+ }
43
+ return window.ONE_CONFIGS?.api?.endpoints || {};
44
+ }
45
+ /**
46
+ * Get view data for specific URI
47
+ * V1 compatible: returns response.data if status=true, else {}
48
+ */
49
+ async getViewData(uri) {
50
+ try {
51
+ const response = await this.http.get(uri);
52
+ return response.status ? response.data : {};
53
+ }
54
+ catch (error) {
55
+ console.error('[API] Error getting view data:', error);
56
+ return {};
57
+ }
58
+ }
59
+ /**
60
+ * Get system configuration
61
+ * V1 compatible
62
+ */
63
+ async getSystemConfig() {
64
+ const endpoint = this.endpoints?.system?.config;
65
+ if (!endpoint) {
66
+ return {};
67
+ }
68
+ try {
69
+ const response = await this.http.get(endpoint);
70
+ return response.status ? response.data : {};
71
+ }
72
+ catch (error) {
73
+ console.error('[API] Error getting system config:', error);
74
+ return {};
75
+ }
76
+ }
77
+ /**
78
+ * Get system data
79
+ * V1 compatible
80
+ */
81
+ async getSystemData() {
82
+ const endpoint = this.endpoints?.system?.data;
83
+ if (!endpoint) {
84
+ return {};
85
+ }
86
+ try {
87
+ const response = await this.http.get(endpoint);
88
+ return response.status ? response.data : {};
89
+ }
90
+ catch (error) {
91
+ console.error('[API] Error getting system data:', error);
92
+ return {};
93
+ }
94
+ }
95
+ /**
96
+ * Get data for current URI
97
+ * Optimization: SSR-safe window access
98
+ */
99
+ async getURIData() {
100
+ if (typeof window === 'undefined') {
101
+ return {};
102
+ }
103
+ const uri = window.location.pathname + window.location.search;
104
+ return this.getViewData(uri);
105
+ }
106
+ /**
107
+ * Set custom endpoint
108
+ */
109
+ setEndpoint(key, value) {
110
+ if (!this.endpoints[key]) {
111
+ this.endpoints[key] = {};
112
+ }
113
+ Object.assign(this.endpoints[key], typeof value === 'string' ? { url: value } : value);
114
+ }
115
+ /**
116
+ * Get HTTP service instance for custom requests
117
+ */
118
+ getHttpService() {
119
+ return this.http;
120
+ }
121
+ }
122
+ //# sourceMappingURL=ApiClient.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AM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC/C,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;YACzD,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU;QACZ,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAChC,OAAO,EAAE,CAAC;QACd,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,GAAW,EAAE,KAAa;QAClC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ"}
@@ -0,0 +1,3 @@
1
+ import { AppFactory } from "../contracts/ApplicationInterface";
2
+ export declare const app: AppFactory;
3
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/core/hellpers/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAc,MAAM,mCAAmC,CAAC;AAuD3E,eAAO,MAAM,GAAG,EAAiB,UAAU,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Application } from "../app/Application";
2
+ /**
3
+ * Container instance để quản lý services
4
+ * Tương tự Laravel's app container
5
+ */
6
+ const AppInstance = new Application();
7
+ /**
8
+ * Helper function để lấy/đăng ký services
9
+ * Cách dùng:
10
+ * - app() - trả về container instance
11
+ * - app('service_name') - lấy service
12
+ * - app('key', value) - đăng ký instance
13
+ *
14
+ * @param key - Tên service (optional)
15
+ * @param value - Giá trị service (optional)
16
+ * @returns Container instance, service, hoặc void
17
+ *
18
+ * @example
19
+ * // Lấy container
20
+ * const container = app();
21
+ * container.singleton('store', Store);
22
+ *
23
+ * // Lấy service trực tiếp
24
+ * const store = app('store');
25
+ *
26
+ * // Đăng ký instance
27
+ * app('config', { api: 'https://api.example.com' });
28
+ */
29
+ const appFactory = (key, value) => {
30
+ if (key === undefined || key === null) {
31
+ // Không truyền gì → trả về container
32
+ return AppInstance;
33
+ }
34
+ if (value !== undefined) {
35
+ // Truyền 2 tham số → đăng ký instance
36
+ AppInstance.instance(key, value);
37
+ return;
38
+ }
39
+ // Truyền 1 tham số → lấy service
40
+ return AppInstance.make(key);
41
+ };
42
+ // Add make method to app function for TypeScript compatibility
43
+ appFactory.make = (name) => AppInstance.make(name);
44
+ appFactory.instance = (name, value) => AppInstance.instance(name, value);
45
+ appFactory.resolve = (name, defaultValue) => AppInstance.resolve(name, defaultValue);
46
+ appFactory.register = (name, factory) => AppInstance.bind(name, factory);
47
+ appFactory.bind = (name, factory) => AppInstance.bind(name, factory);
48
+ appFactory.singleton = (name, factory) => AppInstance.singleton(name, factory);
49
+ appFactory.has = (name) => AppInstance.has(name);
50
+ appFactory.flush = () => { AppInstance.flush(); };
51
+ appFactory.destroy = () => { AppInstance.destroy(); };
52
+ export const app = appFactory;
53
+ //#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AAe,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1G,UAAU,CAAC,SAAS,GAAG,CAAI,IAAgB,EAAE,OAAgB,EAAe,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpH,UAAU,CAAC,GAAG,GAAG,CAAC,IAAgB,EAAW,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACtE,UAAU,CAAC,KAAK,GAAG,GAAS,EAAE,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AACxD,UAAU,CAAC,OAAO,GAAG,GAAS,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,GAAG,GAAG,UAAwB,CAAC"}
@@ -0,0 +1,26 @@
1
+ export declare function generateUUID(length?: number): string;
2
+ export declare function escapeHTML(str: string): string;
3
+ export declare function isEmpty(value: any): boolean;
4
+ export declare function isObject(value: any): boolean;
5
+ export declare function hasProperty(obj: any, prop: string): boolean;
6
+ export declare function hasMethod(obj: any, method: string): boolean;
7
+ export declare function hasAnyProperty(obj: any, props: string[]): boolean;
8
+ export declare function hasData(value: any): boolean;
9
+ export declare function isArray(value: any): boolean;
10
+ export declare function isString(value: any): boolean;
11
+ export declare function isNumber(value: any): boolean;
12
+ export declare function isBoolean(value: any): boolean;
13
+ export declare function isFunction(value: any): boolean;
14
+ export declare function isPromise(value: any): boolean;
15
+ export declare function isHTMLElement(value: any): boolean;
16
+ export declare function isNode(value: any): boolean;
17
+ export declare function isCommentNode(value: any): boolean;
18
+ export declare function isTextNode(value: any): boolean;
19
+ export declare function isOneElement(value: any): boolean;
20
+ export declare function isOneHtml(value: any): boolean;
21
+ export declare function isOneText(value: any): boolean;
22
+ export declare function isOneNativeElement(value: any): boolean;
23
+ export declare function isOneReactive(value: any): boolean;
24
+ export declare function isOneFragment(value: any): boolean;
25
+ export declare function isOneBlock(value: any): boolean;
26
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/core/hellpers/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,MAAM,GAAE,MAAW,GAAG,MAAM,CAMxD;AAUD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAM3C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE5C;AACD,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE3D;AACD,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D;AACD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAEjE;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE3C;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE3C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE5C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE5C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE7C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE9C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAEjD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,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