@adaas/are-html 0.0.2

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 (365) hide show
  1. package/.conf/tsconfig.base.json +87 -0
  2. package/.conf/tsconfig.browser.json +34 -0
  3. package/.conf/tsconfig.node.json +35 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE +13 -0
  6. package/README.md +678 -0
  7. package/dist/browser/index.d.mts +521 -0
  8. package/dist/browser/index.mjs +1782 -0
  9. package/dist/browser/index.mjs.map +1 -0
  10. package/dist/node/AreBinding.attribute-C6JasbJL.d.ts +110 -0
  11. package/dist/node/AreBinding.attribute-C6qrxN8K.d.mts +110 -0
  12. package/dist/node/attributes/AreBinding.attribute.d.mts +4 -0
  13. package/dist/node/attributes/AreBinding.attribute.d.ts +4 -0
  14. package/dist/node/attributes/AreBinding.attribute.js +15 -0
  15. package/dist/node/attributes/AreBinding.attribute.js.map +1 -0
  16. package/dist/node/attributes/AreBinding.attribute.mjs +14 -0
  17. package/dist/node/attributes/AreBinding.attribute.mjs.map +1 -0
  18. package/dist/node/attributes/AreDirective.attribute.d.mts +4 -0
  19. package/dist/node/attributes/AreDirective.attribute.d.ts +4 -0
  20. package/dist/node/attributes/AreDirective.attribute.js +20 -0
  21. package/dist/node/attributes/AreDirective.attribute.js.map +1 -0
  22. package/dist/node/attributes/AreDirective.attribute.mjs +19 -0
  23. package/dist/node/attributes/AreDirective.attribute.mjs.map +1 -0
  24. package/dist/node/attributes/AreEvent.attribute.d.mts +4 -0
  25. package/dist/node/attributes/AreEvent.attribute.d.ts +4 -0
  26. package/dist/node/attributes/AreEvent.attribute.js +10 -0
  27. package/dist/node/attributes/AreEvent.attribute.js.map +1 -0
  28. package/dist/node/attributes/AreEvent.attribute.mjs +9 -0
  29. package/dist/node/attributes/AreEvent.attribute.mjs.map +1 -0
  30. package/dist/node/attributes/AreStatic.attribute.d.mts +4 -0
  31. package/dist/node/attributes/AreStatic.attribute.d.ts +4 -0
  32. package/dist/node/attributes/AreStatic.attribute.js +10 -0
  33. package/dist/node/attributes/AreStatic.attribute.js.map +1 -0
  34. package/dist/node/attributes/AreStatic.attribute.mjs +9 -0
  35. package/dist/node/attributes/AreStatic.attribute.mjs.map +1 -0
  36. package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
  37. package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
  38. package/dist/node/directives/AreComponent.directive.d.mts +2 -0
  39. package/dist/node/directives/AreComponent.directive.d.ts +2 -0
  40. package/dist/node/directives/AreComponent.directive.js +4 -0
  41. package/dist/node/directives/AreComponent.directive.js.map +1 -0
  42. package/dist/node/directives/AreComponent.directive.mjs +3 -0
  43. package/dist/node/directives/AreComponent.directive.mjs.map +1 -0
  44. package/dist/node/directives/AreDirectiveFor.directive.d.mts +41 -0
  45. package/dist/node/directives/AreDirectiveFor.directive.d.ts +41 -0
  46. package/dist/node/directives/AreDirectiveFor.directive.js +206 -0
  47. package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -0
  48. package/dist/node/directives/AreDirectiveFor.directive.mjs +196 -0
  49. package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -0
  50. package/dist/node/directives/AreDirectiveIf.directive.d.mts +15 -0
  51. package/dist/node/directives/AreDirectiveIf.directive.d.ts +15 -0
  52. package/dist/node/directives/AreDirectiveIf.directive.js +91 -0
  53. package/dist/node/directives/AreDirectiveIf.directive.js.map +1 -0
  54. package/dist/node/directives/AreDirectiveIf.directive.mjs +81 -0
  55. package/dist/node/directives/AreDirectiveIf.directive.mjs.map +1 -0
  56. package/dist/node/engine/AreHTML.compiler.d.mts +27 -0
  57. package/dist/node/engine/AreHTML.compiler.d.ts +27 -0
  58. package/dist/node/engine/AreHTML.compiler.js +150 -0
  59. package/dist/node/engine/AreHTML.compiler.js.map +1 -0
  60. package/dist/node/engine/AreHTML.compiler.mjs +140 -0
  61. package/dist/node/engine/AreHTML.compiler.mjs.map +1 -0
  62. package/dist/node/engine/AreHTML.constants.d.mts +2 -0
  63. package/dist/node/engine/AreHTML.constants.d.ts +2 -0
  64. package/dist/node/engine/AreHTML.constants.js +4 -0
  65. package/dist/node/engine/AreHTML.constants.js.map +1 -0
  66. package/dist/node/engine/AreHTML.constants.mjs +3 -0
  67. package/dist/node/engine/AreHTML.constants.mjs.map +1 -0
  68. package/dist/node/engine/AreHTML.context.d.mts +108 -0
  69. package/dist/node/engine/AreHTML.context.d.ts +108 -0
  70. package/dist/node/engine/AreHTML.context.js +155 -0
  71. package/dist/node/engine/AreHTML.context.js.map +1 -0
  72. package/dist/node/engine/AreHTML.context.mjs +154 -0
  73. package/dist/node/engine/AreHTML.context.mjs.map +1 -0
  74. package/dist/node/engine/AreHTML.engine.d.mts +21 -0
  75. package/dist/node/engine/AreHTML.engine.d.ts +21 -0
  76. package/dist/node/engine/AreHTML.engine.js +191 -0
  77. package/dist/node/engine/AreHTML.engine.js.map +1 -0
  78. package/dist/node/engine/AreHTML.engine.mjs +181 -0
  79. package/dist/node/engine/AreHTML.engine.mjs.map +1 -0
  80. package/dist/node/engine/AreHTML.interpreter.d.mts +28 -0
  81. package/dist/node/engine/AreHTML.interpreter.d.ts +28 -0
  82. package/dist/node/engine/AreHTML.interpreter.js +340 -0
  83. package/dist/node/engine/AreHTML.interpreter.js.map +1 -0
  84. package/dist/node/engine/AreHTML.interpreter.mjs +330 -0
  85. package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -0
  86. package/dist/node/engine/AreHTML.lifecycle.d.mts +17 -0
  87. package/dist/node/engine/AreHTML.lifecycle.d.ts +17 -0
  88. package/dist/node/engine/AreHTML.lifecycle.js +91 -0
  89. package/dist/node/engine/AreHTML.lifecycle.js.map +1 -0
  90. package/dist/node/engine/AreHTML.lifecycle.mjs +79 -0
  91. package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -0
  92. package/dist/node/engine/AreHTML.tokenizer.d.mts +13 -0
  93. package/dist/node/engine/AreHTML.tokenizer.d.ts +13 -0
  94. package/dist/node/engine/AreHTML.tokenizer.js +83 -0
  95. package/dist/node/engine/AreHTML.tokenizer.js.map +1 -0
  96. package/dist/node/engine/AreHTML.tokenizer.mjs +71 -0
  97. package/dist/node/engine/AreHTML.tokenizer.mjs.map +1 -0
  98. package/dist/node/engine/AreHTML.transformer.d.mts +11 -0
  99. package/dist/node/engine/AreHTML.transformer.d.ts +11 -0
  100. package/dist/node/engine/AreHTML.transformer.js +44 -0
  101. package/dist/node/engine/AreHTML.transformer.js.map +1 -0
  102. package/dist/node/engine/AreHTML.transformer.mjs +32 -0
  103. package/dist/node/engine/AreHTML.transformer.mjs.map +1 -0
  104. package/dist/node/engine/AreHTML.types.d.mts +6 -0
  105. package/dist/node/engine/AreHTML.types.d.ts +6 -0
  106. package/dist/node/engine/AreHTML.types.js +4 -0
  107. package/dist/node/engine/AreHTML.types.js.map +1 -0
  108. package/dist/node/engine/AreHTML.types.mjs +3 -0
  109. package/dist/node/engine/AreHTML.types.mjs.map +1 -0
  110. package/dist/node/index.d.mts +39 -0
  111. package/dist/node/index.d.ts +39 -0
  112. package/dist/node/index.js +294 -0
  113. package/dist/node/index.js.map +1 -0
  114. package/dist/node/index.mjs +43 -0
  115. package/dist/node/index.mjs.map +1 -0
  116. package/dist/node/instructions/AddAttribute.instruction.d.mts +9 -0
  117. package/dist/node/instructions/AddAttribute.instruction.d.ts +9 -0
  118. package/dist/node/instructions/AddAttribute.instruction.js +32 -0
  119. package/dist/node/instructions/AddAttribute.instruction.js.map +1 -0
  120. package/dist/node/instructions/AddAttribute.instruction.mjs +25 -0
  121. package/dist/node/instructions/AddAttribute.instruction.mjs.map +1 -0
  122. package/dist/node/instructions/AddComment.instruction.d.mts +9 -0
  123. package/dist/node/instructions/AddComment.instruction.d.ts +9 -0
  124. package/dist/node/instructions/AddComment.instruction.js +35 -0
  125. package/dist/node/instructions/AddComment.instruction.js.map +1 -0
  126. package/dist/node/instructions/AddComment.instruction.mjs +28 -0
  127. package/dist/node/instructions/AddComment.instruction.mjs.map +1 -0
  128. package/dist/node/instructions/AddElement.instruction.d.mts +8 -0
  129. package/dist/node/instructions/AddElement.instruction.d.ts +8 -0
  130. package/dist/node/instructions/AddElement.instruction.js +32 -0
  131. package/dist/node/instructions/AddElement.instruction.js.map +1 -0
  132. package/dist/node/instructions/AddElement.instruction.mjs +25 -0
  133. package/dist/node/instructions/AddElement.instruction.mjs.map +1 -0
  134. package/dist/node/instructions/AddInterpolation.instruction.d.mts +8 -0
  135. package/dist/node/instructions/AddInterpolation.instruction.d.ts +8 -0
  136. package/dist/node/instructions/AddInterpolation.instruction.js +32 -0
  137. package/dist/node/instructions/AddInterpolation.instruction.js.map +1 -0
  138. package/dist/node/instructions/AddInterpolation.instruction.mjs +25 -0
  139. package/dist/node/instructions/AddInterpolation.instruction.mjs.map +1 -0
  140. package/dist/node/instructions/AddListener.instruction.d.mts +8 -0
  141. package/dist/node/instructions/AddListener.instruction.d.ts +8 -0
  142. package/dist/node/instructions/AddListener.instruction.js +32 -0
  143. package/dist/node/instructions/AddListener.instruction.js.map +1 -0
  144. package/dist/node/instructions/AddListener.instruction.mjs +25 -0
  145. package/dist/node/instructions/AddListener.instruction.mjs.map +1 -0
  146. package/dist/node/instructions/AddStyle.instruction.d.mts +8 -0
  147. package/dist/node/instructions/AddStyle.instruction.d.ts +8 -0
  148. package/dist/node/instructions/AddStyle.instruction.js +32 -0
  149. package/dist/node/instructions/AddStyle.instruction.js.map +1 -0
  150. package/dist/node/instructions/AddStyle.instruction.mjs +25 -0
  151. package/dist/node/instructions/AddStyle.instruction.mjs.map +1 -0
  152. package/dist/node/instructions/AddText.instruction.d.mts +8 -0
  153. package/dist/node/instructions/AddText.instruction.d.ts +8 -0
  154. package/dist/node/instructions/AddText.instruction.js +32 -0
  155. package/dist/node/instructions/AddText.instruction.js.map +1 -0
  156. package/dist/node/instructions/AddText.instruction.mjs +25 -0
  157. package/dist/node/instructions/AddText.instruction.mjs.map +1 -0
  158. package/dist/node/instructions/AreHTML.instructions.constants.d.mts +11 -0
  159. package/dist/node/instructions/AreHTML.instructions.constants.d.ts +11 -0
  160. package/dist/node/instructions/AreHTML.instructions.constants.js +15 -0
  161. package/dist/node/instructions/AreHTML.instructions.constants.js.map +1 -0
  162. package/dist/node/instructions/AreHTML.instructions.constants.mjs +15 -0
  163. package/dist/node/instructions/AreHTML.instructions.constants.mjs.map +1 -0
  164. package/dist/node/instructions/AreHTML.instructions.types.d.mts +46 -0
  165. package/dist/node/instructions/AreHTML.instructions.types.d.ts +46 -0
  166. package/dist/node/instructions/AreHTML.instructions.types.js +4 -0
  167. package/dist/node/instructions/AreHTML.instructions.types.js.map +1 -0
  168. package/dist/node/instructions/AreHTML.instructions.types.mjs +3 -0
  169. package/dist/node/instructions/AreHTML.instructions.types.mjs.map +1 -0
  170. package/dist/node/lib/AreDirective/AreDirective.component.d.mts +4 -0
  171. package/dist/node/lib/AreDirective/AreDirective.component.d.ts +4 -0
  172. package/dist/node/lib/AreDirective/AreDirective.component.js +117 -0
  173. package/dist/node/lib/AreDirective/AreDirective.component.js.map +1 -0
  174. package/dist/node/lib/AreDirective/AreDirective.component.mjs +107 -0
  175. package/dist/node/lib/AreDirective/AreDirective.component.mjs.map +1 -0
  176. package/dist/node/lib/AreDirective/AreDirective.constants.d.mts +16 -0
  177. package/dist/node/lib/AreDirective/AreDirective.constants.d.ts +16 -0
  178. package/dist/node/lib/AreDirective/AreDirective.constants.js +20 -0
  179. package/dist/node/lib/AreDirective/AreDirective.constants.js.map +1 -0
  180. package/dist/node/lib/AreDirective/AreDirective.constants.mjs +20 -0
  181. package/dist/node/lib/AreDirective/AreDirective.constants.mjs.map +1 -0
  182. package/dist/node/lib/AreDirective/AreDirective.context.d.mts +9 -0
  183. package/dist/node/lib/AreDirective/AreDirective.context.d.ts +9 -0
  184. package/dist/node/lib/AreDirective/AreDirective.context.js +14 -0
  185. package/dist/node/lib/AreDirective/AreDirective.context.js.map +1 -0
  186. package/dist/node/lib/AreDirective/AreDirective.context.mjs +13 -0
  187. package/dist/node/lib/AreDirective/AreDirective.context.mjs.map +1 -0
  188. package/dist/node/lib/AreDirective/AreDirective.meta.d.mts +7 -0
  189. package/dist/node/lib/AreDirective/AreDirective.meta.d.ts +7 -0
  190. package/dist/node/lib/AreDirective/AreDirective.meta.js +14 -0
  191. package/dist/node/lib/AreDirective/AreDirective.meta.js.map +1 -0
  192. package/dist/node/lib/AreDirective/AreDirective.meta.mjs +13 -0
  193. package/dist/node/lib/AreDirective/AreDirective.meta.mjs.map +1 -0
  194. package/dist/node/lib/AreDirective/AreDirective.types.d.mts +17 -0
  195. package/dist/node/lib/AreDirective/AreDirective.types.d.ts +17 -0
  196. package/dist/node/lib/AreDirective/AreDirective.types.js +4 -0
  197. package/dist/node/lib/AreDirective/AreDirective.types.js.map +1 -0
  198. package/dist/node/lib/AreDirective/AreDirective.types.mjs +3 -0
  199. package/dist/node/lib/AreDirective/AreDirective.types.mjs.map +1 -0
  200. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.mts +13 -0
  201. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.ts +13 -0
  202. package/dist/node/lib/AreHTML/AreHTML.tokenizer.js +82 -0
  203. package/dist/node/lib/AreHTML/AreHTML.tokenizer.js.map +1 -0
  204. package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs +70 -0
  205. package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs.map +1 -0
  206. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.mts +4 -0
  207. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.ts +4 -0
  208. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js +13 -0
  209. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js.map +1 -0
  210. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs +12 -0
  211. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs.map +1 -0
  212. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.mts +4 -0
  213. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.ts +4 -0
  214. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js +82 -0
  215. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js.map +1 -0
  216. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs +75 -0
  217. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs.map +1 -0
  218. package/dist/node/lib/AreRoot/AreRoot.component.d.mts +13 -0
  219. package/dist/node/lib/AreRoot/AreRoot.component.d.ts +13 -0
  220. package/dist/node/lib/AreRoot/AreRoot.component.js +117 -0
  221. package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -0
  222. package/dist/node/lib/AreRoot/AreRoot.component.mjs +107 -0
  223. package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -0
  224. package/dist/node/lib/AreStyle/AreStyle.context.d.mts +8 -0
  225. package/dist/node/lib/AreStyle/AreStyle.context.d.ts +8 -0
  226. package/dist/node/lib/AreStyle/AreStyle.context.js +16 -0
  227. package/dist/node/lib/AreStyle/AreStyle.context.js.map +1 -0
  228. package/dist/node/lib/AreStyle/AreStyle.context.mjs +15 -0
  229. package/dist/node/lib/AreStyle/AreStyle.context.mjs.map +1 -0
  230. package/dist/node/lib/AreStyle/AreStyle.types.d.mts +2 -0
  231. package/dist/node/lib/AreStyle/AreStyle.types.d.ts +2 -0
  232. package/dist/node/lib/AreStyle/AreStyle.types.js +4 -0
  233. package/dist/node/lib/AreStyle/AreStyle.types.js.map +1 -0
  234. package/dist/node/lib/AreStyle/AreStyle.types.mjs +3 -0
  235. package/dist/node/lib/AreStyle/AreStyle.types.mjs.map +1 -0
  236. package/dist/node/lib/AreWatcher/AreWatcher.component.d.mts +18 -0
  237. package/dist/node/lib/AreWatcher/AreWatcher.component.d.ts +18 -0
  238. package/dist/node/lib/AreWatcher/AreWatcher.component.js +78 -0
  239. package/dist/node/lib/AreWatcher/AreWatcher.component.js.map +1 -0
  240. package/dist/node/lib/AreWatcher/AreWatcher.component.mjs +71 -0
  241. package/dist/node/lib/AreWatcher/AreWatcher.component.mjs.map +1 -0
  242. package/dist/node/nodes/AreComment.d.mts +10 -0
  243. package/dist/node/nodes/AreComment.d.ts +10 -0
  244. package/dist/node/nodes/AreComment.js +19 -0
  245. package/dist/node/nodes/AreComment.js.map +1 -0
  246. package/dist/node/nodes/AreComment.mjs +18 -0
  247. package/dist/node/nodes/AreComment.mjs.map +1 -0
  248. package/dist/node/nodes/AreComponent.d.mts +17 -0
  249. package/dist/node/nodes/AreComponent.d.ts +17 -0
  250. package/dist/node/nodes/AreComponent.js +35 -0
  251. package/dist/node/nodes/AreComponent.js.map +1 -0
  252. package/dist/node/nodes/AreComponent.mjs +28 -0
  253. package/dist/node/nodes/AreComponent.mjs.map +1 -0
  254. package/dist/node/nodes/AreInterpolation.d.mts +10 -0
  255. package/dist/node/nodes/AreInterpolation.d.ts +10 -0
  256. package/dist/node/nodes/AreInterpolation.js +19 -0
  257. package/dist/node/nodes/AreInterpolation.js.map +1 -0
  258. package/dist/node/nodes/AreInterpolation.mjs +18 -0
  259. package/dist/node/nodes/AreInterpolation.mjs.map +1 -0
  260. package/dist/node/nodes/AreRoot.d.mts +21 -0
  261. package/dist/node/nodes/AreRoot.d.ts +21 -0
  262. package/dist/node/nodes/AreRoot.js +41 -0
  263. package/dist/node/nodes/AreRoot.js.map +1 -0
  264. package/dist/node/nodes/AreRoot.mjs +34 -0
  265. package/dist/node/nodes/AreRoot.mjs.map +1 -0
  266. package/dist/node/nodes/AreText.d.mts +10 -0
  267. package/dist/node/nodes/AreText.d.ts +10 -0
  268. package/dist/node/nodes/AreText.js +19 -0
  269. package/dist/node/nodes/AreText.js.map +1 -0
  270. package/dist/node/nodes/AreText.mjs +18 -0
  271. package/dist/node/nodes/AreText.mjs.map +1 -0
  272. package/dist/node/signals/AreRoute.signal.d.mts +12 -0
  273. package/dist/node/signals/AreRoute.signal.d.ts +12 -0
  274. package/dist/node/signals/AreRoute.signal.js +25 -0
  275. package/dist/node/signals/AreRoute.signal.js.map +1 -0
  276. package/dist/node/signals/AreRoute.signal.mjs +24 -0
  277. package/dist/node/signals/AreRoute.signal.mjs.map +1 -0
  278. package/docs/a-logo-docs.png +0 -0
  279. package/examples/dashboard/concept.ts +60 -0
  280. package/examples/dashboard/containers/UI.container.ts +233 -0
  281. package/examples/dashboard/dist/index.html +22 -0
  282. package/examples/dashboard/dist/mnzfypsd-6zjt7w.js +11454 -0
  283. package/examples/dashboard/dist/styles.css +792 -0
  284. package/examples/dashboard/public/index.html +22 -0
  285. package/examples/dashboard/public/styles.css +792 -0
  286. package/examples/dashboard/src/components/DashboardApp.component.ts +31 -0
  287. package/examples/dashboard/src/components/DashboardHeader.component.ts +40 -0
  288. package/examples/dashboard/src/components/DashboardLogo.component.ts +29 -0
  289. package/examples/dashboard/src/components/DashboardMain.component.ts +57 -0
  290. package/examples/dashboard/src/components/DashboardMenu.component.ts +94 -0
  291. package/examples/dashboard/src/components/DashboardNav.component.ts +28 -0
  292. package/examples/dashboard/src/components/DashboardNavItem.component.ts +32 -0
  293. package/examples/dashboard/src/components/DashboardSidebar.component.ts +43 -0
  294. package/examples/dashboard/src/components/DashboardStatCard.component.ts +71 -0
  295. package/examples/dashboard/src/components/DashboardStats.component.ts +28 -0
  296. package/examples/dashboard/src/components/DashboardTable.component.ts +138 -0
  297. package/examples/dashboard/src/components/DashboardUserCard.component.ts +39 -0
  298. package/examples/dashboard/src/concept.ts +93 -0
  299. package/examples/jumpstart/concept.ts +60 -0
  300. package/examples/jumpstart/containers/UI.container.ts +233 -0
  301. package/examples/jumpstart/dist/index.html +104 -0
  302. package/examples/jumpstart/dist/mnpl1g4i-nobz9g.js +10882 -0
  303. package/examples/jumpstart/dist/static/css/main.css +40 -0
  304. package/examples/jumpstart/dist/static/img/test.png +0 -0
  305. package/examples/jumpstart/public/index.html +104 -0
  306. package/examples/jumpstart/public/static/css/main.css +40 -0
  307. package/examples/jumpstart/public/static/img/test.png +0 -0
  308. package/examples/jumpstart/src/components/A-Btn.component.ts +150 -0
  309. package/examples/jumpstart/src/components/A-Input.component.ts +78 -0
  310. package/examples/jumpstart/src/components/A-Navigation.component.ts +167 -0
  311. package/examples/jumpstart/src/components/List.component.ts +138 -0
  312. package/examples/jumpstart/src/components/PromptTextArea.component.ts +359 -0
  313. package/examples/jumpstart/src/components/SignInComponent.component.ts +127 -0
  314. package/examples/jumpstart/src/concept.ts +105 -0
  315. package/jest.config.ts +61 -0
  316. package/package.json +110 -0
  317. package/src/attributes/AreBinding.attribute.ts +19 -0
  318. package/src/attributes/AreDirective.attribute.ts +26 -0
  319. package/src/attributes/AreEvent.attribute.ts +5 -0
  320. package/src/attributes/AreStatic.attribute.ts +6 -0
  321. package/src/directives/AreComponent.directive.ts +0 -0
  322. package/src/directives/AreDirectiveFor.directive.ts +322 -0
  323. package/src/directives/AreDirectiveIf.directive.ts +130 -0
  324. package/src/engine/AreHTML.compiler.ts +226 -0
  325. package/src/engine/AreHTML.constants.ts +2 -0
  326. package/src/engine/AreHTML.context.ts +196 -0
  327. package/src/engine/AreHTML.engine.ts +210 -0
  328. package/src/engine/AreHTML.interpreter.ts +466 -0
  329. package/src/engine/AreHTML.lifecycle.ts +96 -0
  330. package/src/engine/AreHTML.tokenizer.ts +90 -0
  331. package/src/engine/AreHTML.transformer.ts +37 -0
  332. package/src/engine/AreHTML.types.ts +6 -0
  333. package/src/index.ts +80 -0
  334. package/src/instructions/AddAttribute.instruction.ts +25 -0
  335. package/src/instructions/AddComment.instruction.ts +27 -0
  336. package/src/instructions/AddElement.instruction.ts +22 -0
  337. package/src/instructions/AddInterpolation.instruction.ts +24 -0
  338. package/src/instructions/AddListener.instruction.ts +24 -0
  339. package/src/instructions/AddStyle.instruction.ts +24 -0
  340. package/src/instructions/AddText.instruction.ts +21 -0
  341. package/src/instructions/AreHTML.instructions.constants.ts +11 -0
  342. package/src/instructions/AreHTML.instructions.types.ts +51 -0
  343. package/src/lib/AreDirective/AreDirective.component.ts +124 -0
  344. package/src/lib/AreDirective/AreDirective.constants.ts +16 -0
  345. package/src/lib/AreDirective/AreDirective.context.ts +16 -0
  346. package/src/lib/AreDirective/AreDirective.meta.ts +9 -0
  347. package/src/lib/AreDirective/AreDirective.types.ts +14 -0
  348. package/src/lib/AreHTML/AreHTML.tokenizer.ts +86 -0
  349. package/src/lib/AreHTMLAttribute/AreHTML.attribute.ts +13 -0
  350. package/src/lib/AreHTMLNode/AreHTMLNode.ts +84 -0
  351. package/src/lib/AreRoot/AreRoot.component.ts +134 -0
  352. package/src/lib/AreStyle/AreStyle.context.ts +20 -0
  353. package/src/lib/AreStyle/AreStyle.types.ts +0 -0
  354. package/src/lib/AreWatcher/AreWatcher.component.ts +84 -0
  355. package/src/nodes/AreComment.ts +17 -0
  356. package/src/nodes/AreComponent.ts +25 -0
  357. package/src/nodes/AreInterpolation.ts +16 -0
  358. package/src/nodes/AreRoot.ts +29 -0
  359. package/src/nodes/AreText.ts +17 -0
  360. package/src/signals/AreRoute.signal.ts +27 -0
  361. package/tests/AreTokenizer.test.ts +260 -0
  362. package/tests/jest.setup.ts +30 -0
  363. package/tsconfig.json +60 -0
  364. package/tslint.json +98 -0
  365. package/tsup.config.ts +108 -0
@@ -0,0 +1,81 @@
1
+ import { __decorateClass, __decorateParam } from '../chunk-EQQGB2QZ.mjs';
2
+ import { A_Inject, A_Caller, A_Scope } from '@adaas/a-concept';
3
+ import { A_Logger } from '@adaas/a-utils/a-logger';
4
+ import { AreStore, AreScene, AreSyntax } from '@adaas/are';
5
+ import { AreDirective } from '@adaas/are-html/directive/AreDirective.component';
6
+ import { AddCommentInstruction } from '@adaas/are-html/instructions/AddComment.instruction';
7
+ import { AreDirectiveContext } from '@adaas/are-html/directive/AreDirective.context';
8
+
9
+ let AreDirectiveIf = class extends AreDirective {
10
+ transform(attribute, scope, store, scene, logger, ...args) {
11
+ logger.debug(`[Transform] directive $IF for <${attribute.owner.aseid.toString()}>`);
12
+ const node = attribute.owner;
13
+ const ifTemplate = node.cloneWithScope();
14
+ const ifAttr = ifTemplate.attributes.find((d) => d.name === attribute.name);
15
+ if (ifAttr) {
16
+ ifTemplate.scope.deregister(ifAttr);
17
+ node.scope.register(ifAttr);
18
+ }
19
+ node.init();
20
+ node.addChild(ifTemplate);
21
+ ifTemplate.scene.deactivate();
22
+ attribute.template = ifTemplate;
23
+ }
24
+ compile(attribute, store, scene, syntax, directiveContext, ...args) {
25
+ console.log('Compiling directive "if" with attribute content:', attribute);
26
+ attribute.value = syntax.evaluate(attribute.content, store, {
27
+ ...directiveContext?.scope || {}
28
+ });
29
+ const hostInstruction = scene.host;
30
+ const commentIdentifier = ` --- if: ${attribute.template.id} --- `;
31
+ const declaration = new AddCommentInstruction({ content: commentIdentifier });
32
+ scene.setHost(declaration);
33
+ scene.planBefore(declaration, hostInstruction);
34
+ scene.unPlan(hostInstruction);
35
+ if (attribute.value)
36
+ attribute.template.scene.activate();
37
+ else
38
+ attribute.template.scene.deactivate();
39
+ }
40
+ update(attribute, store, scope, syntax, scene, ...args) {
41
+ attribute.value = syntax.evaluate(attribute.content, store);
42
+ if (attribute.value) {
43
+ attribute.template.scene.activate();
44
+ attribute.template.mount();
45
+ } else {
46
+ attribute.template.unmount();
47
+ attribute.template.scene.deactivate();
48
+ }
49
+ }
50
+ };
51
+ __decorateClass([
52
+ AreDirective.Transform,
53
+ __decorateParam(0, A_Inject(A_Caller)),
54
+ __decorateParam(1, A_Inject(A_Scope)),
55
+ __decorateParam(2, A_Inject(AreStore)),
56
+ __decorateParam(3, A_Inject(AreScene)),
57
+ __decorateParam(4, A_Inject(A_Logger))
58
+ ], AreDirectiveIf.prototype, "transform", 1);
59
+ __decorateClass([
60
+ AreDirective.Compile,
61
+ __decorateParam(0, A_Inject(A_Caller)),
62
+ __decorateParam(1, A_Inject(AreStore)),
63
+ __decorateParam(2, A_Inject(AreScene)),
64
+ __decorateParam(3, A_Inject(AreSyntax)),
65
+ __decorateParam(4, A_Inject(AreDirectiveContext))
66
+ ], AreDirectiveIf.prototype, "compile", 1);
67
+ __decorateClass([
68
+ AreDirective.Update,
69
+ __decorateParam(0, A_Inject(A_Caller)),
70
+ __decorateParam(1, A_Inject(AreStore)),
71
+ __decorateParam(2, A_Inject(A_Scope)),
72
+ __decorateParam(3, A_Inject(AreSyntax)),
73
+ __decorateParam(4, A_Inject(AreScene))
74
+ ], AreDirectiveIf.prototype, "update", 1);
75
+ AreDirectiveIf = __decorateClass([
76
+ AreDirective.Priority(2)
77
+ ], AreDirectiveIf);
78
+
79
+ export { AreDirectiveIf };
80
+ //# sourceMappingURL=AreDirectiveIf.directive.mjs.map
81
+ //# sourceMappingURL=AreDirectiveIf.directive.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/directives/AreDirectiveIf.directive.ts"],"names":[],"mappings":";;;;;;;;AAWO,IAAM,cAAA,GAAN,cAA6B,YAAA,CAAa;AAAA,EAI7C,UACwB,SAAA,EACD,KAAA,EAEC,KAAA,EACA,KAAA,EACA,WACjB,IAAA,EACL;AACE,IAAA,MAAA,CAAO,MAAM,CAAA,+BAAA,EAAkC,SAAA,CAAU,MAAM,KAAA,CAAM,QAAA,EAAU,CAAA,CAAA,CAAG,CAAA;AAElF,IAAA,MAAM,OAAO,SAAA,CAAU,KAAA;AAKvB,IAAA,MAAM,UAAA,GAAa,KAAK,cAAA,EAAe;AAEvC,IAAA,MAAM,MAAA,GAAS,WAAW,UAAA,CAAW,IAAA,CAAK,OAAK,CAAA,CAAE,IAAA,KAAS,UAAU,IAAI,CAAA;AAExE,IAAA,IAAI,MAAA,EAAQ;AACR,MAAA,UAAA,CAAW,KAAA,CAAM,WAAW,MAAM,CAAA;AAClC,MAAA,IAAA,CAAK,KAAA,CAAM,SAAS,MAAM,CAAA;AAAA,IAC9B;AAEA,IAAA,IAAA,CAAK,IAAA,EAAK;AAEV,IAAA,IAAA,CAAK,SAAS,UAAU,CAAA;AAYxB,IAAA,UAAA,CAAW,MAAM,UAAA,EAAW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AU,SAAU,OAAA,EAAQ;AAE5B,MAAA,SAAA,CAAU,QAAA,CAAU,MAAM,UAAA,EAAW;AAAA,IACzC;AAAA,EACJ;AAEJ;AAlHI,eAAA,CAAA;AAAA,EADC,YAAA,CAAa,SAAA;AAAA,EAET,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,OAAO,CAAA,CAAA;AAAA,EAEhB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA;AAAA,CAAA,EAVb,cAAA,CAIT,SAAA,EAAA,WAAA,EAAA,CAAA,CAAA;AA+CA,eAAA,CAAA;AAAA,EADC,YAAA,CAAa,OAAA;AAAA,EAET,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,SAAS,CAAA,CAAA;AAAA,EAElB,4BAAS,mBAAmB,CAAA;AAAA,CAAA,EAzDxB,cAAA,CAmDT,SAAA,EAAA,SAAA,EAAA,CAAA,CAAA;AAyCA,eAAA,CAAA;AAAA,EADC,YAAA,CAAa,MAAA;AAAA,EAET,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,OAAO,CAAA,CAAA;AAAA,EAChB,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,QAAQ,CAAA;AAAA,CAAA,EAjGb,cAAA,CA4FT,SAAA,EAAA,QAAA,EAAA,CAAA,CAAA;AA5FS,cAAA,GAAN,eAAA,CAAA;AAAA,EADN,YAAA,CAAa,SAAS,CAAC;AAAA,CAAA,EACX,cAAA,CAAA","file":"AreDirectiveIf.directive.mjs","sourcesContent":["import { A_Caller, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreScene, AreStore, AreSyntax } from \"@adaas/are\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\n\n\n\n@AreDirective.Priority(2)\nexport class AreDirectiveIf extends AreDirective {\n\n\n @AreDirective.Transform\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger: A_Logger,\n ...args: any[]\n ) {\n logger.debug(`[Transform] directive $IF for <${attribute.owner.aseid.toString()}>`)\n\n const node = attribute.owner;\n\n /**\n * We have to keep this node as a group node, and copy all data into the child node that would be actual node. \n */\n const ifTemplate = node.cloneWithScope();\n\n const ifAttr = ifTemplate.attributes.find(d => d.name === attribute.name);\n\n if (ifAttr) {\n ifTemplate.scope.deregister(ifAttr);\n node.scope.register(ifAttr);\n }\n\n node.init();\n\n node.addChild(ifTemplate);\n\n /**\n * Resolve or create a directive context for the item node. This is needed to hold the item-specific store values (e.g. the \"item\" and \"index\" in a \"for\" loop) that the template's bindings will reference during compile and update. The context is shared among all clones of the same template, but that's fine because each clone gets its own scope values assigned here.\n */\n // let directiveContext = ifTemplate.scope.resolveFlat(AreDirectiveContext);\n\n // if (!directiveContext) {\n // directiveContext = new AreDirectiveContext(ifTemplate.aseid);\n // ifTemplate.scope.register(directiveContext);\n // }\n\n ifTemplate.scene.deactivate();\n\n attribute.template = ifTemplate;\n\n }\n\n\n @AreDirective.Compile\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n ...args: any[]\n ): void {\n\n console.log('Compiling directive \"if\" with attribute content:', attribute);\n\n /**\n * 1. Extract the value from the store based on the attribute content \n * (which is the path to the value in the store)\n */\n attribute.value = syntax.evaluate(attribute.content, store, {\n ...(directiveContext?.scope || {}),\n });\n\n /**\n * 2. If the value is falsy, remove the node from the scene by planning a RemoveElement instruction.\n * If the value is truthy, ensure the node is in the scene by planning an AddElement instruction if it's not already planned.\n */\n const hostInstruction = scene.host!;\n const commentIdentifier = ` --- if: ${attribute.template!.id} --- `;\n const declaration = new AddCommentInstruction({ content: commentIdentifier })\n\n scene.setHost(declaration);\n scene.planBefore(declaration, hostInstruction);\n scene.unPlan(hostInstruction);\n\n if (attribute.value)\n attribute.template!.scene.activate();\n else\n attribute.template!.scene.deactivate();\n }\n\n\n\n @AreDirective.Update\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * 1. Extract the value from the store based on the attribute content \n * (which is the path to the value in the store)\n */\n attribute.value = syntax.evaluate(attribute.content, store);\n\n if (attribute.value) {\n attribute.template!.scene.activate();\n\n attribute.template!.mount()\n }\n else {\n attribute.template!.unmount();\n\n attribute.template!.scene.deactivate();\n }\n }\n\n}"]}
@@ -0,0 +1,27 @@
1
+ import { A_Feature } from '@adaas/a-concept';
2
+ import { A_Logger } from '@adaas/a-utils/a-logger';
3
+ import { AreCompiler, AreScene, AreStore } from '@adaas/are';
4
+ import { f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-C6qrxN8K.mjs';
5
+ import { AreInterpolation } from '../nodes/AreInterpolation.mjs';
6
+ import { AreText } from '../nodes/AreText.mjs';
7
+ import '../lib/AreStyle/AreStyle.context.mjs';
8
+
9
+ declare class AreHTMLCompiler extends AreCompiler {
10
+ /**
11
+ * Default compile method for interpolations, which can be overridden by specific implementations if needed.
12
+ *
13
+ * @param interpolation
14
+ * @param scope
15
+ * @param scene
16
+ * @param store
17
+ * @param feature
18
+ */
19
+ compileInterpolation(interpolation: AreInterpolation, scene: AreScene, store: AreStore, logger?: A_Logger, ...args: any[]): void;
20
+ compileText(text: AreText, scene: AreScene, logger?: A_Logger, ...args: any[]): void;
21
+ compileStaticAttribute(attribute: AreStaticAttribute, scene: AreScene, ...args: any[]): void;
22
+ compileDirectiveAttribute(directive: AreDirectiveAttribute, store: AreStore, feature: A_Feature, logger?: A_Logger, ...args: any[]): void;
23
+ compileEventAttribute(attribute: AreEventAttribute, scene: AreScene, ...args: any[]): void;
24
+ compileBindingAttribute(attribute: AreBindingAttribute, scene: AreScene, parentStore: AreStore, store: AreStore, ...args: any[]): void;
25
+ }
26
+
27
+ export { AreHTMLCompiler };
@@ -0,0 +1,27 @@
1
+ import { A_Feature } from '@adaas/a-concept';
2
+ import { A_Logger } from '@adaas/a-utils/a-logger';
3
+ import { AreCompiler, AreScene, AreStore } from '@adaas/are';
4
+ import { f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-C6JasbJL.js';
5
+ import { AreInterpolation } from '../nodes/AreInterpolation.js';
6
+ import { AreText } from '../nodes/AreText.js';
7
+ import '../lib/AreStyle/AreStyle.context.js';
8
+
9
+ declare class AreHTMLCompiler extends AreCompiler {
10
+ /**
11
+ * Default compile method for interpolations, which can be overridden by specific implementations if needed.
12
+ *
13
+ * @param interpolation
14
+ * @param scope
15
+ * @param scene
16
+ * @param store
17
+ * @param feature
18
+ */
19
+ compileInterpolation(interpolation: AreInterpolation, scene: AreScene, store: AreStore, logger?: A_Logger, ...args: any[]): void;
20
+ compileText(text: AreText, scene: AreScene, logger?: A_Logger, ...args: any[]): void;
21
+ compileStaticAttribute(attribute: AreStaticAttribute, scene: AreScene, ...args: any[]): void;
22
+ compileDirectiveAttribute(directive: AreDirectiveAttribute, store: AreStore, feature: A_Feature, logger?: A_Logger, ...args: any[]): void;
23
+ compileEventAttribute(attribute: AreEventAttribute, scene: AreScene, ...args: any[]): void;
24
+ compileBindingAttribute(attribute: AreBindingAttribute, scene: AreScene, parentStore: AreStore, store: AreStore, ...args: any[]): void;
25
+ }
26
+
27
+ export { AreHTMLCompiler };
@@ -0,0 +1,150 @@
1
+ 'use strict';
2
+
3
+ var aConcept = require('@adaas/a-concept');
4
+ var aLogger = require('@adaas/a-utils/a-logger');
5
+ var aFrame = require('@adaas/a-frame');
6
+ var are = require('@adaas/are');
7
+ var AreDirective_attribute = require('@adaas/are-html/attributes/AreDirective.attribute');
8
+ var AreStatic_attribute = require('@adaas/are-html/attributes/AreStatic.attribute');
9
+ var AreDirective_constants = require('@adaas/are-html/directive/AreDirective.constants');
10
+ var AreEvent_attribute = require('@adaas/are-html/attributes/AreEvent.attribute');
11
+ var AreBinding_attribute = require('@adaas/are-html/attributes/AreBinding.attribute');
12
+ var AreInterpolation = require('@adaas/are-html/nodes/AreInterpolation');
13
+ var AreText = require('@adaas/are-html/nodes/AreText');
14
+ var AddAttribute_instruction = require('@adaas/are-html/instructions/AddAttribute.instruction');
15
+ var AddText_instruction = require('@adaas/are-html/instructions/AddText.instruction');
16
+ var AddListener_instruction = require('@adaas/are-html/instructions/AddListener.instruction');
17
+
18
+ var __defProp = Object.defineProperty;
19
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
20
+ var __decorateClass = (decorators, target, key, kind) => {
21
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
22
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
23
+ if (decorator = decorators[i])
24
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
25
+ if (kind && result) __defProp(target, key, result);
26
+ return result;
27
+ };
28
+ var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
29
+ exports.AreHTMLCompiler = class AreHTMLCompiler extends are.AreCompiler {
30
+ compileInterpolation(interpolation, scene, store, logger, ...args) {
31
+ scene.plan(new AddText_instruction.AddTextInstruction({ content: interpolation.content, evaluate: true }));
32
+ }
33
+ compileText(text, scene, logger, ...args) {
34
+ logger?.debug("cyan", `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: "${text.content}"`);
35
+ if (scene.host)
36
+ scene.unPlan(scene.host);
37
+ scene.plan(new AddText_instruction.AddTextInstruction({ content: text.content }));
38
+ }
39
+ compileStaticAttribute(attribute, scene, ...args) {
40
+ if (!scene.host)
41
+ throw new are.AreCompilerError({
42
+ title: "Scene Host Not Found",
43
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
44
+ });
45
+ scene.plan(new AddAttribute_instruction.AddAttributeInstruction(scene.host, {
46
+ name: attribute.name,
47
+ content: attribute.content
48
+ }));
49
+ }
50
+ compileDirectiveAttribute(directive, store, feature, logger, ...args) {
51
+ store.watch(directive);
52
+ if (directive.component) {
53
+ feature.chain(directive.component, AreDirective_constants.AreDirectiveFeatures.Compile, directive.owner.scope);
54
+ } else {
55
+ logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named "AreDirective${aConcept.A_FormatterHelper.toPascalCase(directive.name)}" to handle this directive.`);
56
+ }
57
+ store.unwatch(directive);
58
+ }
59
+ compileEventAttribute(attribute, scene, ...args) {
60
+ if (!scene.host)
61
+ throw new are.AreCompilerError({
62
+ title: "Scene Host Not Found",
63
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
64
+ });
65
+ scene.plan(new AddListener_instruction.AddListenerInstruction(scene.host, {
66
+ name: attribute.name,
67
+ handler: attribute.content
68
+ }));
69
+ }
70
+ compileBindingAttribute(attribute, scene, parentStore, store, ...args) {
71
+ if (!scene.host)
72
+ throw new are.AreCompilerError({
73
+ title: "Scene Host Not Found",
74
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
75
+ });
76
+ const node = attribute.owner;
77
+ if (node.component && node.component.props[attribute.name]) {
78
+ const propDefinition = node.component.props[attribute.name];
79
+ let value = parentStore.get(attribute.content);
80
+ if (propDefinition.type) {
81
+ switch (propDefinition.type) {
82
+ case "string":
83
+ value = String(value);
84
+ break;
85
+ case "number":
86
+ value = Number(value);
87
+ break;
88
+ case "boolean":
89
+ value = Boolean(value);
90
+ break;
91
+ }
92
+ }
93
+ store.set(attribute.name, value);
94
+ } else {
95
+ const instruction = new AddAttribute_instruction.AddAttributeInstruction(scene.host, {
96
+ name: attribute.name,
97
+ content: attribute.content,
98
+ evaluate: true
99
+ });
100
+ scene.plan(instruction);
101
+ }
102
+ }
103
+ };
104
+ __decorateClass([
105
+ are.AreCompiler.Compile(AreInterpolation.AreInterpolation),
106
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
107
+ __decorateParam(1, aConcept.A_Inject(are.AreScene)),
108
+ __decorateParam(2, aConcept.A_Inject(are.AreStore)),
109
+ __decorateParam(3, aConcept.A_Inject(aLogger.A_Logger))
110
+ ], exports.AreHTMLCompiler.prototype, "compileInterpolation", 1);
111
+ __decorateClass([
112
+ are.AreCompiler.Compile(AreText.AreText),
113
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
114
+ __decorateParam(1, aConcept.A_Inject(are.AreScene)),
115
+ __decorateParam(2, aConcept.A_Inject(aLogger.A_Logger))
116
+ ], exports.AreHTMLCompiler.prototype, "compileText", 1);
117
+ __decorateClass([
118
+ are.AreCompiler.Compile(AreStatic_attribute.AreStaticAttribute),
119
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
120
+ __decorateParam(1, aConcept.A_Inject(are.AreScene))
121
+ ], exports.AreHTMLCompiler.prototype, "compileStaticAttribute", 1);
122
+ __decorateClass([
123
+ are.AreCompiler.Compile(AreDirective_attribute.AreDirectiveAttribute),
124
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
125
+ __decorateParam(1, aConcept.A_Inject(are.AreStore)),
126
+ __decorateParam(2, aConcept.A_Inject(aConcept.A_Feature)),
127
+ __decorateParam(3, aConcept.A_Inject(aLogger.A_Logger))
128
+ ], exports.AreHTMLCompiler.prototype, "compileDirectiveAttribute", 1);
129
+ __decorateClass([
130
+ are.AreCompiler.Compile(AreEvent_attribute.AreEventAttribute),
131
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
132
+ __decorateParam(1, aConcept.A_Inject(are.AreScene))
133
+ ], exports.AreHTMLCompiler.prototype, "compileEventAttribute", 1);
134
+ __decorateClass([
135
+ are.AreCompiler.Compile(AreBinding_attribute.AreBindingAttribute),
136
+ __decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
137
+ __decorateParam(1, aConcept.A_Inject(are.AreScene)),
138
+ __decorateParam(2, aConcept.A_Dependency.Parent()),
139
+ __decorateParam(2, aConcept.A_Inject(are.AreStore)),
140
+ __decorateParam(3, aConcept.A_Inject(are.AreStore))
141
+ ], exports.AreHTMLCompiler.prototype, "compileBindingAttribute", 1);
142
+ exports.AreHTMLCompiler = __decorateClass([
143
+ aFrame.A_Frame.Component({
144
+ namespace: "A-ARE",
145
+ name: "AreHTMLCompiler",
146
+ description: "HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments."
147
+ })
148
+ ], exports.AreHTMLCompiler);
149
+ //# sourceMappingURL=AreHTML.compiler.js.map
150
+ //# sourceMappingURL=AreHTML.compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":["AreHTMLCompiler","AreCompiler","AddTextInstruction","AreCompilerError","AddAttributeInstruction","AreDirectiveFeatures","A_FormatterHelper","AddListenerInstruction","AreInterpolation","A_Caller","AreScene","AreStore","A_Logger","AreText","AreStaticAttribute","AreDirectiveAttribute","A_Feature","AreEventAttribute","AreBind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AAAA,EACjB,qCAASA,YAAQ,CAAA;AAAA,CAAA,EArJbX,uBAAA,CAgJT,SAAA,EAAA,yBAAA,EAAA,CAAA,CAAA;AAhJSA,uBAAA,GAAN,eAAA,CAAA;AAAA,EALNmB,eAAQ,SAAA,CAAU;AAAA,IACf,SAAA,EAAW,OAAA;AAAA,IACX,IAAA,EAAM,iBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYnB,uBAAA,CAAA","file":"AreHTML.compiler.js","sourcesContent":["import { A_Caller, A_Dependency, A_Feature, A_FormatterHelper, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreCompiler, AreScene, AreCompilerError, AreStore } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AddAttributeInstruction} from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddTextInstruction} from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddListenerInstruction} from \"@adaas/are-html/instructions/AddListener.instruction\";\n\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreHTMLCompiler',\n description: 'HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments.'\n})\nexport class AreHTMLCompiler extends AreCompiler {\n\n // compile(\n // @A_Inject(A_Caller) node: AreHTMLNode,\n // @A_Inject(AreScene) scene: AreScene,\n // ...args: any[]\n // ): void {\n // super.compile(node, scene, ...args);\n // }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Interpolation Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Default compile method for interpolations, which can be overridden by specific implementations if needed.\n * \n * @param interpolation \n * @param scope \n * @param scene \n * @param store \n * @param feature \n */\n @AreCompiler.Compile(AreInterpolation)\n compileInterpolation(\n @A_Inject(A_Caller) interpolation: AreInterpolation,\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n // if (scene.host)\n // console.log('Scene Host: ', scene.host);\n\n // let content = '';\n\n // logger?.debug('green', `AreHTMLCompiler: compile interpolation <${interpolation.aseid.toString()}> with key: \"${interpolation.content}\"`, store.get(interpolation.content));\n\n // try {\n // content = AreCommonHelper.evaluate(interpolation.content, store);\n\n // } catch (error) {\n // content = ''\n // }\n\n scene.plan(new AddTextInstruction({ content: interpolation.content, evaluate: true }));\n }\n\n // -----------------------------------------------------------------------------------------\n // ------------------------------Are-Text Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n @AreCompiler.Compile(AreText)\n compileText(\n @A_Inject(A_Caller) text: AreText,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n logger?.debug('cyan', `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: \"${text.content}\"`);\n if (scene.host)\n scene.unPlan(scene.host);\n\n scene.plan(new AddTextInstruction({ content: text.content }));\n\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Attribute Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n\n @AreCompiler.Compile(AreStaticAttribute)\n compileStaticAttribute(\n @A_Inject(A_Caller) attribute: AreStaticAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * Default case when attribute was not able to be identified as a binding, directive, or event, we just want to add it as a regular attribute to the node. This is the most basic case for attributes that don't have any special behavior or processing logic, and it ensures that they are still rendered on the node even if they don't have any dynamic functionality.\n */\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content\n }));\n }\n\n @AreCompiler.Compile(AreDirectiveAttribute)\n compileDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Compile, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n\n\n @AreCompiler.Compile(AreEventAttribute)\n compileEventAttribute(\n @A_Inject(A_Caller) attribute: AreEventAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * 2. In case the attribute is an event listener, then \n * we should simply add a callback handler that will be used to proxy an event \n * into the ComponentNode component. \n *[!] In this case AreAttribute is AreEventAttribute that has prepared callback function to be used \n * in the event listener. It is important to store callback function once \n * to prevent duplicated functions in case of multiple compilations during development.\n */\n scene.plan(new AddListenerInstruction(scene.host, {\n name: attribute.name,\n handler: attribute.content\n }));\n }\n\n\n @AreCompiler.Compile(AreBindingAttribute)\n compileBindingAttribute(\n @A_Inject(A_Caller) attribute: AreBindingAttribute,\n @A_Inject(AreScene) scene: AreScene,\n @A_Dependency.Parent()\n @A_Inject(AreStore) parentStore: AreStore,\n @A_Inject(AreStore) store: AreStore,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n\n const node = attribute.owner;\n\n /**\n * 1. If the binding is related to a component prop, then we should set the value to the component props, so it can be used in the component logic and rendering.\n * This is a special case for component props, since they are not regular attributes and have a special meaning and usage in the component. By setting the value directly to the component props, we can ensure that it is properly reactive and can influence the component's behavior and rendering based on its value.\n */\n if (node.component && node.component.props[attribute.name]) {\n const propDefinition = node.component.props[attribute.name];\n let value = parentStore.get(attribute.content);\n\n if (propDefinition.type) {\n switch (propDefinition.type) {\n case 'string':\n value = String(value);\n break;\n case 'number':\n value = Number(value);\n break;\n case 'boolean':\n value = Boolean(value);\n break;\n default:\n break;\n }\n }\n\n store.set(attribute.name, value);\n }\n /**\n * 2. In other cases, we just want to add it as a regular attribute to the node, since it can be used in the template and rendering as a dynamic value that can change based on the store value. By adding it as a regular attribute, we can ensure that it is properly rendered and updated in the DOM based on its value in the store.\n */\n else {\n const instruction = new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content,\n evaluate: true\n })\n\n scene.plan(instruction);\n }\n }\n\n\n}"]}
@@ -0,0 +1,140 @@
1
+ import { __decorateClass, __decorateParam } from '../chunk-EQQGB2QZ.mjs';
2
+ import { A_Inject, A_Caller, A_Feature, A_Dependency, A_FormatterHelper } from '@adaas/a-concept';
3
+ import { A_Logger } from '@adaas/a-utils/a-logger';
4
+ import { A_Frame } from '@adaas/a-frame';
5
+ import { AreCompiler, AreScene, AreStore, AreCompilerError } from '@adaas/are';
6
+ import { AreDirectiveAttribute } from '@adaas/are-html/attributes/AreDirective.attribute';
7
+ import { AreStaticAttribute } from '@adaas/are-html/attributes/AreStatic.attribute';
8
+ import { AreDirectiveFeatures } from '@adaas/are-html/directive/AreDirective.constants';
9
+ import { AreEventAttribute } from '@adaas/are-html/attributes/AreEvent.attribute';
10
+ import { AreBindingAttribute } from '@adaas/are-html/attributes/AreBinding.attribute';
11
+ import { AreInterpolation } from '@adaas/are-html/nodes/AreInterpolation';
12
+ import { AreText } from '@adaas/are-html/nodes/AreText';
13
+ import { AddAttributeInstruction } from '@adaas/are-html/instructions/AddAttribute.instruction';
14
+ import { AddTextInstruction } from '@adaas/are-html/instructions/AddText.instruction';
15
+ import { AddListenerInstruction } from '@adaas/are-html/instructions/AddListener.instruction';
16
+
17
+ let AreHTMLCompiler = class extends AreCompiler {
18
+ compileInterpolation(interpolation, scene, store, logger, ...args) {
19
+ scene.plan(new AddTextInstruction({ content: interpolation.content, evaluate: true }));
20
+ }
21
+ compileText(text, scene, logger, ...args) {
22
+ logger?.debug("cyan", `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: "${text.content}"`);
23
+ if (scene.host)
24
+ scene.unPlan(scene.host);
25
+ scene.plan(new AddTextInstruction({ content: text.content }));
26
+ }
27
+ compileStaticAttribute(attribute, scene, ...args) {
28
+ if (!scene.host)
29
+ throw new AreCompilerError({
30
+ title: "Scene Host Not Found",
31
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
32
+ });
33
+ scene.plan(new AddAttributeInstruction(scene.host, {
34
+ name: attribute.name,
35
+ content: attribute.content
36
+ }));
37
+ }
38
+ compileDirectiveAttribute(directive, store, feature, logger, ...args) {
39
+ store.watch(directive);
40
+ if (directive.component) {
41
+ feature.chain(directive.component, AreDirectiveFeatures.Compile, directive.owner.scope);
42
+ } else {
43
+ logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named "AreDirective${A_FormatterHelper.toPascalCase(directive.name)}" to handle this directive.`);
44
+ }
45
+ store.unwatch(directive);
46
+ }
47
+ compileEventAttribute(attribute, scene, ...args) {
48
+ if (!scene.host)
49
+ throw new AreCompilerError({
50
+ title: "Scene Host Not Found",
51
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
52
+ });
53
+ scene.plan(new AddListenerInstruction(scene.host, {
54
+ name: attribute.name,
55
+ handler: attribute.content
56
+ }));
57
+ }
58
+ compileBindingAttribute(attribute, scene, parentStore, store, ...args) {
59
+ if (!scene.host)
60
+ throw new AreCompilerError({
61
+ title: "Scene Host Not Found",
62
+ description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`
63
+ });
64
+ const node = attribute.owner;
65
+ if (node.component && node.component.props[attribute.name]) {
66
+ const propDefinition = node.component.props[attribute.name];
67
+ let value = parentStore.get(attribute.content);
68
+ if (propDefinition.type) {
69
+ switch (propDefinition.type) {
70
+ case "string":
71
+ value = String(value);
72
+ break;
73
+ case "number":
74
+ value = Number(value);
75
+ break;
76
+ case "boolean":
77
+ value = Boolean(value);
78
+ break;
79
+ }
80
+ }
81
+ store.set(attribute.name, value);
82
+ } else {
83
+ const instruction = new AddAttributeInstruction(scene.host, {
84
+ name: attribute.name,
85
+ content: attribute.content,
86
+ evaluate: true
87
+ });
88
+ scene.plan(instruction);
89
+ }
90
+ }
91
+ };
92
+ __decorateClass([
93
+ AreCompiler.Compile(AreInterpolation),
94
+ __decorateParam(0, A_Inject(A_Caller)),
95
+ __decorateParam(1, A_Inject(AreScene)),
96
+ __decorateParam(2, A_Inject(AreStore)),
97
+ __decorateParam(3, A_Inject(A_Logger))
98
+ ], AreHTMLCompiler.prototype, "compileInterpolation", 1);
99
+ __decorateClass([
100
+ AreCompiler.Compile(AreText),
101
+ __decorateParam(0, A_Inject(A_Caller)),
102
+ __decorateParam(1, A_Inject(AreScene)),
103
+ __decorateParam(2, A_Inject(A_Logger))
104
+ ], AreHTMLCompiler.prototype, "compileText", 1);
105
+ __decorateClass([
106
+ AreCompiler.Compile(AreStaticAttribute),
107
+ __decorateParam(0, A_Inject(A_Caller)),
108
+ __decorateParam(1, A_Inject(AreScene))
109
+ ], AreHTMLCompiler.prototype, "compileStaticAttribute", 1);
110
+ __decorateClass([
111
+ AreCompiler.Compile(AreDirectiveAttribute),
112
+ __decorateParam(0, A_Inject(A_Caller)),
113
+ __decorateParam(1, A_Inject(AreStore)),
114
+ __decorateParam(2, A_Inject(A_Feature)),
115
+ __decorateParam(3, A_Inject(A_Logger))
116
+ ], AreHTMLCompiler.prototype, "compileDirectiveAttribute", 1);
117
+ __decorateClass([
118
+ AreCompiler.Compile(AreEventAttribute),
119
+ __decorateParam(0, A_Inject(A_Caller)),
120
+ __decorateParam(1, A_Inject(AreScene))
121
+ ], AreHTMLCompiler.prototype, "compileEventAttribute", 1);
122
+ __decorateClass([
123
+ AreCompiler.Compile(AreBindingAttribute),
124
+ __decorateParam(0, A_Inject(A_Caller)),
125
+ __decorateParam(1, A_Inject(AreScene)),
126
+ __decorateParam(2, A_Dependency.Parent()),
127
+ __decorateParam(2, A_Inject(AreStore)),
128
+ __decorateParam(3, A_Inject(AreStore))
129
+ ], AreHTMLCompiler.prototype, "compileBindingAttribute", 1);
130
+ AreHTMLCompiler = __decorateClass([
131
+ A_Frame.Component({
132
+ namespace: "A-ARE",
133
+ name: "AreHTMLCompiler",
134
+ description: "HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments."
135
+ })
136
+ ], AreHTMLCompiler);
137
+
138
+ export { AreHTMLCompiler };
139
+ //# sourceMappingURL=AreHTML.compiler.mjs.map
140
+ //# sourceMappingURL=AreHTML.compiler.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAA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AQ,SAAA,CAAU;AAAA,IACf,SAAA,EAAW,OAAA;AAAA,IACX,IAAA,EAAM,iBAAA;AAAA,IACN,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,eAAA,CAAA","file":"AreHTML.compiler.mjs","sourcesContent":["import { A_Caller, A_Dependency, A_Feature, A_FormatterHelper, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Frame } from \"@adaas/a-frame\";\nimport { AreCompiler, AreScene, AreCompilerError, AreStore } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AddAttributeInstruction} from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddTextInstruction} from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddListenerInstruction} from \"@adaas/are-html/instructions/AddListener.instruction\";\n\n\n\n\n@A_Frame.Component({\n namespace: 'A-ARE',\n name: 'AreHTMLCompiler',\n description: 'HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments.'\n})\nexport class AreHTMLCompiler extends AreCompiler {\n\n // compile(\n // @A_Inject(A_Caller) node: AreHTMLNode,\n // @A_Inject(AreScene) scene: AreScene,\n // ...args: any[]\n // ): void {\n // super.compile(node, scene, ...args);\n // }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Interpolation Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Default compile method for interpolations, which can be overridden by specific implementations if needed.\n * \n * @param interpolation \n * @param scope \n * @param scene \n * @param store \n * @param feature \n */\n @AreCompiler.Compile(AreInterpolation)\n compileInterpolation(\n @A_Inject(A_Caller) interpolation: AreInterpolation,\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n // if (scene.host)\n // console.log('Scene Host: ', scene.host);\n\n // let content = '';\n\n // logger?.debug('green', `AreHTMLCompiler: compile interpolation <${interpolation.aseid.toString()}> with key: \"${interpolation.content}\"`, store.get(interpolation.content));\n\n // try {\n // content = AreCommonHelper.evaluate(interpolation.content, store);\n\n // } catch (error) {\n // content = ''\n // }\n\n scene.plan(new AddTextInstruction({ content: interpolation.content, evaluate: true }));\n }\n\n // -----------------------------------------------------------------------------------------\n // ------------------------------Are-Text Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n @AreCompiler.Compile(AreText)\n compileText(\n @A_Inject(A_Caller) text: AreText,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n logger?.debug('cyan', `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: \"${text.content}\"`);\n if (scene.host)\n scene.unPlan(scene.host);\n\n scene.plan(new AddTextInstruction({ content: text.content }));\n\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Attribute Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n\n @AreCompiler.Compile(AreStaticAttribute)\n compileStaticAttribute(\n @A_Inject(A_Caller) attribute: AreStaticAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * Default case when attribute was not able to be identified as a binding, directive, or event, we just want to add it as a regular attribute to the node. This is the most basic case for attributes that don't have any special behavior or processing logic, and it ensures that they are still rendered on the node even if they don't have any dynamic functionality.\n */\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content\n }));\n }\n\n @AreCompiler.Compile(AreDirectiveAttribute)\n compileDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Compile, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n\n\n @AreCompiler.Compile(AreEventAttribute)\n compileEventAttribute(\n @A_Inject(A_Caller) attribute: AreEventAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * 2. In case the attribute is an event listener, then \n * we should simply add a callback handler that will be used to proxy an event \n * into the ComponentNode component. \n *[!] In this case AreAttribute is AreEventAttribute that has prepared callback function to be used \n * in the event listener. It is important to store callback function once \n * to prevent duplicated functions in case of multiple compilations during development.\n */\n scene.plan(new AddListenerInstruction(scene.host, {\n name: attribute.name,\n handler: attribute.content\n }));\n }\n\n\n @AreCompiler.Compile(AreBindingAttribute)\n compileBindingAttribute(\n @A_Inject(A_Caller) attribute: AreBindingAttribute,\n @A_Inject(AreScene) scene: AreScene,\n @A_Dependency.Parent()\n @A_Inject(AreStore) parentStore: AreStore,\n @A_Inject(AreStore) store: AreStore,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n\n const node = attribute.owner;\n\n /**\n * 1. If the binding is related to a component prop, then we should set the value to the component props, so it can be used in the component logic and rendering.\n * This is a special case for component props, since they are not regular attributes and have a special meaning and usage in the component. By setting the value directly to the component props, we can ensure that it is properly reactive and can influence the component's behavior and rendering based on its value.\n */\n if (node.component && node.component.props[attribute.name]) {\n const propDefinition = node.component.props[attribute.name];\n let value = parentStore.get(attribute.content);\n\n if (propDefinition.type) {\n switch (propDefinition.type) {\n case 'string':\n value = String(value);\n break;\n case 'number':\n value = Number(value);\n break;\n case 'boolean':\n value = Boolean(value);\n break;\n default:\n break;\n }\n }\n\n store.set(attribute.name, value);\n }\n /**\n * 2. In other cases, we just want to add it as a regular attribute to the node, since it can be used in the template and rendering as a dynamic value that can change based on the store value. By adding it as a regular attribute, we can ensure that it is properly rendered and updated in the DOM based on its value in the store.\n */\n else {\n const instruction = new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content,\n evaluate: true\n })\n\n scene.plan(instruction);\n }\n }\n\n\n}"]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+
3
+ //# sourceMappingURL=AreHTML.constants.js.map
4
+ //# sourceMappingURL=AreHTML.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AreHTML.constants.js"}
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=AreHTML.constants.mjs.map
3
+ //# sourceMappingURL=AreHTML.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"AreHTML.constants.mjs"}