@vandenberghinc/volt 1.2.6 → 1.2.8

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 (472) hide show
  1. package/.libris/config.json +82 -0
  2. package/backend/dist/cjs/backend/src/blacklist.d.ts +12 -0
  3. package/backend/dist/cjs/backend/src/blacklist.js +78 -0
  4. package/backend/dist/cjs/backend/src/cli.d.ts +2 -0
  5. package/backend/dist/cjs/backend/src/cli.js +198 -0
  6. package/backend/dist/cjs/backend/src/database/collection.d.ts +1765 -0
  7. package/backend/dist/cjs/backend/src/database/collection.js +3301 -0
  8. package/backend/dist/cjs/backend/src/database/database.d.ts +92 -0
  9. package/backend/dist/cjs/backend/src/database/database.js +170 -0
  10. package/backend/dist/cjs/backend/src/database/document.d.ts +1 -0
  11. package/backend/dist/cjs/backend/src/database/document.js +15 -0
  12. package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +6 -0
  13. package/backend/dist/cjs/backend/src/database/filters/filters.js +15 -0
  14. package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +223 -0
  15. package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +15 -0
  16. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.d.ts +1 -0
  17. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +443 -0
  18. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.d.ts +1 -0
  19. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +15 -0
  20. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
  21. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +15 -0
  22. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
  23. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +15 -0
  24. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
  25. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +15 -0
  26. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
  27. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +15 -0
  28. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  29. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +15 -0
  30. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
  31. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +355 -0
  32. package/backend/dist/cjs/backend/src/database/flatten.d.ts +78 -0
  33. package/backend/dist/cjs/backend/src/database/flatten.js +53 -0
  34. package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +1 -0
  35. package/backend/dist/cjs/backend/src/database/flatten_test.js +175 -0
  36. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +533 -0
  37. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +1046 -0
  38. package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +551 -0
  39. package/backend/dist/cjs/backend/src/database/quota/quota.js +1108 -0
  40. package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +534 -0
  41. package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +1087 -0
  42. package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +412 -0
  43. package/backend/dist/cjs/backend/src/database/quota/safe_int.js +745 -0
  44. package/backend/dist/cjs/backend/src/endpoint.d.ts +346 -0
  45. package/backend/dist/cjs/backend/src/endpoint.js +468 -0
  46. package/backend/dist/cjs/backend/src/errors/index.d.ts +7 -0
  47. package/backend/dist/cjs/backend/src/errors/index.js +25 -0
  48. package/backend/dist/cjs/backend/src/errors/internal_external.d.ts +52 -0
  49. package/backend/dist/cjs/backend/src/errors/internal_external.js +95 -0
  50. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +41 -0
  51. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +47 -0
  52. package/backend/dist/cjs/backend/src/errors/system_error.d.ts +261 -0
  53. package/backend/dist/cjs/backend/src/errors/system_error.js +436 -0
  54. package/backend/dist/cjs/backend/src/events.d.ts +97 -0
  55. package/backend/dist/cjs/backend/src/events.js +15 -0
  56. package/backend/dist/cjs/backend/src/frontend.d.ts +13 -0
  57. package/backend/dist/cjs/backend/src/frontend.js +56 -0
  58. package/backend/dist/cjs/backend/src/image_endpoint.d.ts +44 -0
  59. package/backend/dist/cjs/backend/src/image_endpoint.js +185 -0
  60. package/backend/dist/cjs/backend/src/index.d.ts +23 -0
  61. package/backend/dist/cjs/backend/src/index.js +70 -0
  62. package/backend/dist/cjs/backend/src/logger.d.ts +5 -0
  63. package/backend/dist/cjs/backend/src/logger.js +15 -0
  64. package/backend/dist/cjs/backend/src/meta.d.ts +112 -0
  65. package/backend/dist/cjs/backend/src/meta.js +181 -0
  66. package/backend/dist/cjs/backend/src/payments/paddle.d.ts +329 -0
  67. package/backend/dist/cjs/backend/src/payments/paddle.js +1996 -0
  68. package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +113 -0
  69. package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +295 -0
  70. package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +17 -0
  71. package/backend/dist/cjs/backend/src/payments/stripe/customers.js +164 -0
  72. package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +74 -0
  73. package/backend/dist/cjs/backend/src/payments/stripe/error.js +64 -0
  74. package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +155 -0
  75. package/backend/dist/cjs/backend/src/payments/stripe/events.js +15 -0
  76. package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +105 -0
  77. package/backend/dist/cjs/backend/src/payments/stripe/meters.js +230 -0
  78. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +58 -0
  79. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +109 -0
  80. package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +519 -0
  81. package/backend/dist/cjs/backend/src/payments/stripe/products.js +650 -0
  82. package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +215 -0
  83. package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +468 -0
  84. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +172 -0
  85. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +557 -0
  86. package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +63 -0
  87. package/backend/dist/cjs/backend/src/payments/stripe/utils.js +118 -0
  88. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +105 -0
  89. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +627 -0
  90. package/backend/dist/cjs/backend/src/plugins/browser.d.ts +1 -0
  91. package/backend/dist/cjs/backend/src/plugins/browser.js +15 -0
  92. package/backend/dist/cjs/backend/src/plugins/communication.d.ts +70 -0
  93. package/backend/dist/cjs/backend/src/plugins/communication.js +196 -0
  94. package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +255 -0
  95. package/backend/dist/cjs/backend/src/plugins/mail/mail.js +381 -0
  96. package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +297 -0
  97. package/backend/dist/cjs/backend/src/plugins/mail/ui.js +1370 -0
  98. package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +1 -0
  99. package/backend/dist/cjs/backend/src/plugins/pdf.js +1456 -0
  100. package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +18 -0
  101. package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +116 -0
  102. package/backend/dist/cjs/backend/src/rate_limit.d.ts +148 -0
  103. package/backend/dist/cjs/backend/src/rate_limit.js +543 -0
  104. package/backend/dist/cjs/backend/src/route.d.ts +39 -0
  105. package/backend/dist/cjs/backend/src/route.js +172 -0
  106. package/backend/dist/cjs/backend/src/server.d.ts +502 -0
  107. package/backend/dist/cjs/backend/src/server.js +1710 -0
  108. package/backend/dist/cjs/backend/src/server.old.d.ts +594 -0
  109. package/backend/dist/cjs/backend/src/server.old.js +2058 -0
  110. package/backend/dist/cjs/backend/src/splash_screen.d.ts +93 -0
  111. package/backend/dist/cjs/backend/src/splash_screen.js +119 -0
  112. package/backend/dist/cjs/backend/src/status.d.ts +89 -0
  113. package/backend/dist/cjs/backend/src/status.js +211 -0
  114. package/backend/dist/cjs/backend/src/stream.d.ts +494 -0
  115. package/backend/dist/cjs/backend/src/stream.js +1370 -0
  116. package/backend/dist/cjs/backend/src/users.d.ts +926 -0
  117. package/backend/dist/cjs/backend/src/users.js +2223 -0
  118. package/backend/dist/cjs/backend/src/utils.d.ts +22 -0
  119. package/backend/dist/cjs/backend/src/utils.js +626 -0
  120. package/backend/dist/cjs/backend/src/view.d.ts +115 -0
  121. package/backend/dist/cjs/backend/src/view.js +519 -0
  122. package/backend/dist/cjs/backend/src/vinc.d.ts +6 -0
  123. package/backend/dist/cjs/backend/src/vinc.js +40 -0
  124. package/backend/dist/cjs/backend/src/volt.d.ts +24 -0
  125. package/backend/dist/cjs/backend/src/volt.js +72 -0
  126. package/backend/dist/cjs/frontend/src/modules/request.d.ts +70 -0
  127. package/backend/dist/cjs/frontend/src/modules/request.js +99 -0
  128. package/backend/dist/cjs/package.json +1 -0
  129. package/backend/dist/esm/backend/src/blacklist.d.ts +12 -0
  130. package/backend/dist/esm/backend/src/blacklist.js +52 -0
  131. package/backend/dist/esm/backend/src/cli.d.ts +2 -0
  132. package/backend/dist/esm/backend/src/cli.js +211 -0
  133. package/backend/dist/esm/backend/src/database/collection.d.ts +1765 -0
  134. package/backend/dist/esm/backend/src/database/collection.js +3779 -0
  135. package/backend/dist/esm/backend/src/database/database.d.ts +92 -0
  136. package/backend/dist/esm/backend/src/database/database.js +214 -0
  137. package/backend/dist/esm/backend/src/database/document.d.ts +1 -0
  138. package/backend/dist/esm/backend/src/database/document.js +558 -0
  139. package/backend/dist/esm/backend/src/database/filters/filters.d.ts +6 -0
  140. package/backend/dist/esm/backend/src/database/filters/filters.js +1 -0
  141. package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +223 -0
  142. package/backend/dist/esm/backend/src/database/filters/strict_filter.js +3 -0
  143. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +1 -0
  144. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +505 -0
  145. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +1 -0
  146. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +712 -0
  147. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +50 -0
  148. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +5 -0
  149. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +76 -0
  150. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +44 -0
  151. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +75 -0
  152. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +5 -0
  153. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +219 -0
  154. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +1 -0
  155. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  156. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +5 -0
  157. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +5 -0
  158. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +415 -0
  159. package/backend/dist/esm/backend/src/database/flatten.d.ts +78 -0
  160. package/backend/dist/esm/backend/src/database/flatten.js +22 -0
  161. package/backend/dist/esm/backend/src/database/flatten_test.d.ts +1 -0
  162. package/backend/dist/esm/backend/src/database/flatten_test.js +174 -0
  163. package/backend/dist/esm/backend/src/database/quota/quoata_v2.d.ts +533 -0
  164. package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +1155 -0
  165. package/backend/dist/esm/backend/src/database/quota/quota.d.ts +551 -0
  166. package/backend/dist/esm/backend/src/database/quota/quota.js +1219 -0
  167. package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +534 -0
  168. package/backend/dist/esm/backend/src/database/quota/quota_v1.js +1242 -0
  169. package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +412 -0
  170. package/backend/dist/esm/backend/src/database/quota/safe_int.js +810 -0
  171. package/backend/dist/esm/backend/src/endpoint.d.ts +346 -0
  172. package/backend/dist/esm/backend/src/endpoint.js +479 -0
  173. package/backend/dist/esm/backend/src/errors/index.d.ts +7 -0
  174. package/backend/dist/esm/backend/src/errors/index.js +7 -0
  175. package/backend/dist/esm/backend/src/errors/internal_external.d.ts +52 -0
  176. package/backend/dist/esm/backend/src/errors/internal_external.js +86 -0
  177. package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +41 -0
  178. package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +33 -0
  179. package/backend/dist/esm/backend/src/errors/system_error.d.ts +261 -0
  180. package/backend/dist/esm/backend/src/errors/system_error.js +444 -0
  181. package/backend/dist/esm/backend/src/events.d.ts +97 -0
  182. package/backend/dist/esm/backend/src/events.js +5 -0
  183. package/backend/dist/esm/backend/src/frontend.d.ts +13 -0
  184. package/backend/dist/esm/backend/src/frontend.js +23 -0
  185. package/backend/dist/esm/backend/src/image_endpoint.d.ts +44 -0
  186. package/backend/dist/esm/backend/src/image_endpoint.js +196 -0
  187. package/backend/dist/esm/backend/src/index.d.ts +23 -0
  188. package/backend/dist/esm/backend/src/index.js +26 -0
  189. package/backend/dist/esm/backend/src/logger.d.ts +5 -0
  190. package/backend/dist/esm/backend/src/logger.js +8 -0
  191. package/backend/dist/esm/backend/src/meta.d.ts +112 -0
  192. package/backend/dist/esm/backend/src/meta.js +152 -0
  193. package/backend/dist/esm/backend/src/payments/paddle.d.ts +329 -0
  194. package/backend/dist/esm/backend/src/payments/paddle.js +2276 -0
  195. package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +113 -0
  196. package/backend/dist/esm/backend/src/payments/stripe/checkout.js +356 -0
  197. package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +17 -0
  198. package/backend/dist/esm/backend/src/payments/stripe/customers.js +193 -0
  199. package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +74 -0
  200. package/backend/dist/esm/backend/src/payments/stripe/error.js +51 -0
  201. package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +155 -0
  202. package/backend/dist/esm/backend/src/payments/stripe/events.js +5 -0
  203. package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +105 -0
  204. package/backend/dist/esm/backend/src/payments/stripe/meters.js +318 -0
  205. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +58 -0
  206. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +135 -0
  207. package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +519 -0
  208. package/backend/dist/esm/backend/src/payments/stripe/products.js +896 -0
  209. package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +215 -0
  210. package/backend/dist/esm/backend/src/payments/stripe/stripe.js +464 -0
  211. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +172 -0
  212. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +754 -0
  213. package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +63 -0
  214. package/backend/dist/esm/backend/src/payments/stripe/utils.js +131 -0
  215. package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +105 -0
  216. package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +752 -0
  217. package/backend/dist/esm/backend/src/plugins/browser.d.ts +1 -0
  218. package/backend/dist/esm/backend/src/plugins/browser.js +170 -0
  219. package/backend/dist/esm/backend/src/plugins/communication.d.ts +70 -0
  220. package/backend/dist/esm/backend/src/plugins/communication.js +169 -0
  221. package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +255 -0
  222. package/backend/dist/esm/backend/src/plugins/mail/mail.js +396 -0
  223. package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +297 -0
  224. package/backend/dist/esm/backend/src/plugins/mail/ui.js +1400 -0
  225. package/backend/dist/esm/backend/src/plugins/pdf.d.ts +1 -0
  226. package/backend/dist/esm/backend/src/plugins/pdf.js +1694 -0
  227. package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +18 -0
  228. package/backend/dist/esm/backend/src/plugins/thread_monitor.js +120 -0
  229. package/backend/dist/esm/backend/src/rate_limit.d.ts +148 -0
  230. package/backend/dist/esm/backend/src/rate_limit.js +667 -0
  231. package/backend/dist/esm/backend/src/route.d.ts +39 -0
  232. package/backend/dist/esm/backend/src/route.js +222 -0
  233. package/backend/dist/esm/backend/src/server.d.ts +502 -0
  234. package/backend/dist/esm/backend/src/server.js +2031 -0
  235. package/backend/dist/esm/backend/src/server.old.d.ts +594 -0
  236. package/backend/dist/esm/backend/src/server.old.js +2630 -0
  237. package/backend/dist/esm/backend/src/splash_screen.d.ts +93 -0
  238. package/backend/dist/esm/backend/src/splash_screen.js +156 -0
  239. package/backend/dist/esm/backend/src/status.d.ts +89 -0
  240. package/backend/dist/esm/backend/src/status.js +213 -0
  241. package/backend/dist/esm/backend/src/stream.d.ts +494 -0
  242. package/backend/dist/esm/backend/src/stream.js +1611 -0
  243. package/backend/dist/esm/backend/src/users.d.ts +926 -0
  244. package/backend/dist/esm/backend/src/users.js +2423 -0
  245. package/backend/dist/esm/backend/src/utils.d.ts +22 -0
  246. package/backend/dist/esm/backend/src/utils.js +463 -0
  247. package/backend/dist/esm/backend/src/view.d.ts +115 -0
  248. package/backend/dist/esm/backend/src/view.js +584 -0
  249. package/backend/dist/esm/backend/src/vinc.d.ts +6 -0
  250. package/backend/dist/esm/backend/src/vinc.js +6 -0
  251. package/backend/dist/esm/backend/src/volt.d.ts +24 -0
  252. package/backend/dist/esm/backend/src/volt.js +27 -0
  253. package/backend/dist/esm/frontend/src/modules/request.d.ts +70 -0
  254. package/backend/dist/esm/frontend/src/modules/request.js +117 -0
  255. package/backend/old/file_watcher.ts +359 -0
  256. package/backend/old/request.deprc.js +626 -0
  257. package/backend/old/response.deprc.js +354 -0
  258. package/frontend/dist/backend/src/database/collection.d.ts +1765 -0
  259. package/frontend/dist/backend/src/database/collection.js +3779 -0
  260. package/frontend/dist/backend/src/database/database.d.ts +92 -0
  261. package/frontend/dist/backend/src/database/database.js +214 -0
  262. package/frontend/dist/backend/src/database/filters/filters.d.ts +6 -0
  263. package/frontend/dist/backend/src/database/filters/filters.js +1 -0
  264. package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +223 -0
  265. package/frontend/dist/backend/src/database/filters/strict_filter.js +3 -0
  266. package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +165 -0
  267. package/frontend/dist/backend/src/database/filters/strict_update_filter.js +5 -0
  268. package/frontend/dist/backend/src/database/flatten.d.ts +78 -0
  269. package/frontend/dist/backend/src/database/flatten.js +22 -0
  270. package/frontend/dist/backend/src/endpoint.d.ts +346 -0
  271. package/frontend/dist/backend/src/endpoint.js +479 -0
  272. package/frontend/dist/backend/src/errors/index.d.ts +7 -0
  273. package/frontend/dist/backend/src/errors/index.js +7 -0
  274. package/frontend/dist/backend/src/errors/internal_external.d.ts +52 -0
  275. package/frontend/dist/backend/src/errors/internal_external.js +86 -0
  276. package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +41 -0
  277. package/frontend/dist/backend/src/errors/invalid_usage_error.js +33 -0
  278. package/frontend/dist/backend/src/errors/system_error.d.ts +261 -0
  279. package/frontend/dist/backend/src/errors/system_error.js +444 -0
  280. package/frontend/dist/backend/src/events.d.ts +97 -0
  281. package/frontend/dist/backend/src/events.js +5 -0
  282. package/frontend/dist/backend/src/frontend.d.ts +13 -0
  283. package/frontend/dist/backend/src/frontend.js +23 -0
  284. package/frontend/dist/backend/src/image_endpoint.d.ts +44 -0
  285. package/frontend/dist/backend/src/image_endpoint.js +196 -0
  286. package/frontend/dist/backend/src/meta.d.ts +112 -0
  287. package/frontend/dist/backend/src/meta.js +152 -0
  288. package/frontend/dist/backend/src/payments/paddle.d.ts +329 -0
  289. package/frontend/dist/backend/src/payments/paddle.js +2276 -0
  290. package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +113 -0
  291. package/frontend/dist/backend/src/payments/stripe/checkout.js +356 -0
  292. package/frontend/dist/backend/src/payments/stripe/customers.d.ts +17 -0
  293. package/frontend/dist/backend/src/payments/stripe/customers.js +193 -0
  294. package/frontend/dist/backend/src/payments/stripe/error.d.ts +74 -0
  295. package/frontend/dist/backend/src/payments/stripe/error.js +51 -0
  296. package/frontend/dist/backend/src/payments/stripe/events.d.ts +155 -0
  297. package/frontend/dist/backend/src/payments/stripe/events.js +5 -0
  298. package/frontend/dist/backend/src/payments/stripe/meters.d.ts +105 -0
  299. package/frontend/dist/backend/src/payments/stripe/meters.js +318 -0
  300. package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +58 -0
  301. package/frontend/dist/backend/src/payments/stripe/payment_methods.js +135 -0
  302. package/frontend/dist/backend/src/payments/stripe/products.d.ts +519 -0
  303. package/frontend/dist/backend/src/payments/stripe/products.js +896 -0
  304. package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +215 -0
  305. package/frontend/dist/backend/src/payments/stripe/stripe.js +464 -0
  306. package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +172 -0
  307. package/frontend/dist/backend/src/payments/stripe/subscriptions.js +754 -0
  308. package/frontend/dist/backend/src/payments/stripe/utils.d.ts +63 -0
  309. package/frontend/dist/backend/src/payments/stripe/utils.js +131 -0
  310. package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +105 -0
  311. package/frontend/dist/backend/src/payments/stripe/webhooks.js +752 -0
  312. package/frontend/dist/backend/src/plugins/mail/mail.d.ts +255 -0
  313. package/frontend/dist/backend/src/plugins/mail/mail.js +396 -0
  314. package/frontend/dist/backend/src/plugins/mail/ui.d.ts +297 -0
  315. package/frontend/dist/backend/src/plugins/mail/ui.js +1400 -0
  316. package/frontend/dist/backend/src/rate_limit.d.ts +148 -0
  317. package/frontend/dist/backend/src/rate_limit.js +667 -0
  318. package/frontend/dist/backend/src/route.d.ts +39 -0
  319. package/frontend/dist/backend/src/route.js +222 -0
  320. package/frontend/dist/backend/src/server.d.ts +502 -0
  321. package/frontend/dist/backend/src/server.js +2031 -0
  322. package/frontend/dist/backend/src/splash_screen.d.ts +93 -0
  323. package/frontend/dist/backend/src/splash_screen.js +156 -0
  324. package/frontend/dist/backend/src/status.d.ts +89 -0
  325. package/frontend/dist/backend/src/status.js +213 -0
  326. package/frontend/dist/backend/src/stream.d.ts +494 -0
  327. package/frontend/dist/backend/src/stream.js +1611 -0
  328. package/frontend/dist/backend/src/users.d.ts +926 -0
  329. package/frontend/dist/backend/src/users.js +2423 -0
  330. package/frontend/dist/backend/src/utils.d.ts +22 -0
  331. package/frontend/dist/backend/src/utils.js +463 -0
  332. package/frontend/dist/backend/src/view.d.ts +115 -0
  333. package/frontend/dist/backend/src/view.js +584 -0
  334. package/frontend/dist/frontend/src/css/adyen.css +92 -0
  335. package/frontend/dist/frontend/src/css/volt.css +75 -0
  336. package/frontend/dist/frontend/src/elements/base.d.ts +3743 -0
  337. package/frontend/dist/frontend/src/elements/base.js +12151 -0
  338. package/frontend/dist/frontend/src/elements/module.d.ts +95 -0
  339. package/frontend/dist/frontend/src/elements/module.js +216 -0
  340. package/frontend/dist/frontend/src/elements/register_element.d.ts +3 -0
  341. package/frontend/dist/frontend/src/elements/register_element.js +22 -0
  342. package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
  343. package/frontend/dist/frontend/src/elements/resize_query_manager.js +150 -0
  344. package/frontend/dist/frontend/src/elements/types.d.ts +52 -0
  345. package/frontend/dist/frontend/src/elements/types.js +5 -0
  346. package/frontend/dist/frontend/src/index.d.ts +21 -0
  347. package/frontend/dist/frontend/src/index.js +29 -0
  348. package/frontend/dist/frontend/src/modules/attachment.d.ts +126 -0
  349. package/frontend/dist/frontend/src/modules/attachment.js +306 -0
  350. package/frontend/dist/frontend/src/modules/auth.d.ts +44 -0
  351. package/frontend/dist/frontend/src/modules/auth.js +80 -0
  352. package/frontend/dist/frontend/src/modules/color.d.ts +160 -0
  353. package/frontend/dist/frontend/src/modules/color.js +316 -0
  354. package/frontend/dist/frontend/src/modules/compression.d.ts +39 -0
  355. package/frontend/dist/frontend/src/modules/compression.js +102 -0
  356. package/frontend/dist/frontend/src/modules/cookies.d.ts +44 -0
  357. package/frontend/dist/frontend/src/modules/cookies.js +143 -0
  358. package/frontend/dist/frontend/src/modules/events.d.ts +31 -0
  359. package/frontend/dist/frontend/src/modules/events.js +79 -0
  360. package/frontend/dist/frontend/src/modules/google.d.ts +23 -0
  361. package/frontend/dist/frontend/src/modules/google.js +52 -0
  362. package/frontend/dist/frontend/src/modules/meta.d.ts +14 -0
  363. package/frontend/dist/frontend/src/modules/meta.js +48 -0
  364. package/frontend/dist/frontend/src/modules/paddle.d.ts +1207 -0
  365. package/frontend/dist/frontend/src/modules/paddle.js +2594 -0
  366. package/frontend/dist/frontend/src/modules/request.d.ts +70 -0
  367. package/frontend/dist/frontend/src/modules/request.js +117 -0
  368. package/frontend/dist/frontend/src/modules/settings.d.ts +3 -0
  369. package/frontend/dist/frontend/src/modules/settings.js +5 -0
  370. package/frontend/dist/frontend/src/modules/statics.d.ts +21 -0
  371. package/frontend/dist/frontend/src/modules/statics.js +43 -0
  372. package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +112 -0
  373. package/frontend/dist/frontend/src/modules/stripe/cart.js +321 -0
  374. package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +7 -0
  375. package/frontend/dist/frontend/src/modules/stripe/checkout.js +37 -0
  376. package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +6 -0
  377. package/frontend/dist/frontend/src/modules/stripe/index.m.js +6 -0
  378. package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +58 -0
  379. package/frontend/dist/frontend/src/modules/stripe/payments.js +92 -0
  380. package/frontend/dist/frontend/src/modules/support.d.ts +30 -0
  381. package/frontend/dist/frontend/src/modules/support.js +53 -0
  382. package/frontend/dist/frontend/src/modules/theme.d.ts +133 -0
  383. package/frontend/dist/frontend/src/modules/theme.js +406 -0
  384. package/frontend/dist/frontend/src/modules/themes.d.ts +12 -0
  385. package/frontend/dist/frontend/src/modules/themes.js +22 -0
  386. package/frontend/dist/frontend/src/modules/user.d.ts +164 -0
  387. package/frontend/dist/frontend/src/modules/user.js +270 -0
  388. package/frontend/dist/frontend/src/modules/utils.d.ts +176 -0
  389. package/frontend/dist/frontend/src/modules/utils.js +569 -0
  390. package/frontend/dist/frontend/src/types/gradient.d.ts +29 -0
  391. package/frontend/dist/frontend/src/types/gradient.js +79 -0
  392. package/frontend/dist/frontend/src/ui/border_button.d.ts +94 -0
  393. package/frontend/dist/frontend/src/ui/border_button.js +228 -0
  394. package/frontend/dist/frontend/src/ui/button.d.ts +241 -0
  395. package/frontend/dist/frontend/src/ui/button.js +682 -0
  396. package/frontend/dist/frontend/src/ui/canvas.d.ts +138 -0
  397. package/frontend/dist/frontend/src/ui/canvas.js +444 -0
  398. package/frontend/dist/frontend/src/ui/checkbox.d.ts +74 -0
  399. package/frontend/dist/frontend/src/ui/checkbox.js +321 -0
  400. package/frontend/dist/frontend/src/ui/code.d.ts +235 -0
  401. package/frontend/dist/frontend/src/ui/code.js +1007 -0
  402. package/frontend/dist/frontend/src/ui/context_menu.d.ts +36 -0
  403. package/frontend/dist/frontend/src/ui/context_menu.js +205 -0
  404. package/frontend/dist/frontend/src/ui/css.d.ts +16 -0
  405. package/frontend/dist/frontend/src/ui/css.js +48 -0
  406. package/frontend/dist/frontend/src/ui/divider.d.ts +15 -0
  407. package/frontend/dist/frontend/src/ui/divider.js +78 -0
  408. package/frontend/dist/frontend/src/ui/dropdown.d.ts +176 -0
  409. package/frontend/dist/frontend/src/ui/dropdown.js +481 -0
  410. package/frontend/dist/frontend/src/ui/for_each.d.ts +37 -0
  411. package/frontend/dist/frontend/src/ui/for_each.js +92 -0
  412. package/frontend/dist/frontend/src/ui/form.d.ts +34 -0
  413. package/frontend/dist/frontend/src/ui/form.js +233 -0
  414. package/frontend/dist/frontend/src/ui/frame_modes.d.ts +37 -0
  415. package/frontend/dist/frontend/src/ui/frame_modes.js +108 -0
  416. package/frontend/dist/frontend/src/ui/google_map.d.ts +24 -0
  417. package/frontend/dist/frontend/src/ui/google_map.js +106 -0
  418. package/frontend/dist/frontend/src/ui/gradient.d.ts +25 -0
  419. package/frontend/dist/frontend/src/ui/gradient.js +131 -0
  420. package/frontend/dist/frontend/src/ui/image.d.ts +111 -0
  421. package/frontend/dist/frontend/src/ui/image.js +576 -0
  422. package/frontend/dist/frontend/src/ui/input.d.ts +392 -0
  423. package/frontend/dist/frontend/src/ui/input.js +1201 -0
  424. package/frontend/dist/frontend/src/ui/link.d.ts +25 -0
  425. package/frontend/dist/frontend/src/ui/link.js +140 -0
  426. package/frontend/dist/frontend/src/ui/list.d.ts +37 -0
  427. package/frontend/dist/frontend/src/ui/list.js +170 -0
  428. package/frontend/dist/frontend/src/ui/loader_button.d.ts +80 -0
  429. package/frontend/dist/frontend/src/ui/loader_button.js +193 -0
  430. package/frontend/dist/frontend/src/ui/loaders.d.ts +57 -0
  431. package/frontend/dist/frontend/src/ui/loaders.js +157 -0
  432. package/frontend/dist/frontend/src/ui/popup.d.ts +94 -0
  433. package/frontend/dist/frontend/src/ui/popup.js +510 -0
  434. package/frontend/dist/frontend/src/ui/pseudo.d.ts +44 -0
  435. package/frontend/dist/frontend/src/ui/pseudo.js +154 -0
  436. package/frontend/dist/frontend/src/ui/scroller.d.ts +105 -0
  437. package/frontend/dist/frontend/src/ui/scroller.js +1253 -0
  438. package/frontend/dist/frontend/src/ui/slider.d.ts +45 -0
  439. package/frontend/dist/frontend/src/ui/slider.js +217 -0
  440. package/frontend/dist/frontend/src/ui/spacer.d.ts +15 -0
  441. package/frontend/dist/frontend/src/ui/spacer.js +78 -0
  442. package/frontend/dist/frontend/src/ui/span.d.ts +15 -0
  443. package/frontend/dist/frontend/src/ui/span.js +73 -0
  444. package/frontend/dist/frontend/src/ui/stack.d.ts +66 -0
  445. package/frontend/dist/frontend/src/ui/stack.js +335 -0
  446. package/frontend/dist/frontend/src/ui/steps.d.ts +131 -0
  447. package/frontend/dist/frontend/src/ui/steps.js +308 -0
  448. package/frontend/dist/frontend/src/ui/style.d.ts +17 -0
  449. package/frontend/dist/frontend/src/ui/style.js +73 -0
  450. package/frontend/dist/frontend/src/ui/switch.d.ts +69 -0
  451. package/frontend/dist/frontend/src/ui/switch.js +357 -0
  452. package/frontend/dist/frontend/src/ui/table.d.ts +100 -0
  453. package/frontend/dist/frontend/src/ui/table.js +405 -0
  454. package/frontend/dist/frontend/src/ui/tabs.d.ts +111 -0
  455. package/frontend/dist/frontend/src/ui/tabs.js +424 -0
  456. package/frontend/dist/frontend/src/ui/text.d.ts +15 -0
  457. package/frontend/dist/frontend/src/ui/text.js +83 -0
  458. package/frontend/dist/frontend/src/ui/title.d.ts +91 -0
  459. package/frontend/dist/frontend/src/ui/title.js +272 -0
  460. package/frontend/dist/frontend/src/ui/ui.d.ts +35 -0
  461. package/frontend/dist/frontend/src/ui/ui.js +38 -0
  462. package/frontend/dist/frontend/src/ui/view.d.ts +15 -0
  463. package/frontend/dist/frontend/src/ui/view.js +88 -0
  464. package/frontend/dist/frontend/src/volt.d.ts +20 -0
  465. package/frontend/dist/frontend/src/volt.js +27 -0
  466. package/frontend/examples/theme/theme.ts +58 -0
  467. package/frontend/tools/bundle_d_ts.js +71 -0
  468. package/frontend/tools/convert_to_jsdoc_input.txt +9452 -0
  469. package/frontend/tools/convert_to_jsdoc_output.txt +7626 -0
  470. package/frontend/tools/convert_to_jsdoc_tmp.js +345 -0
  471. package/frontend/tools/scan_mixed_imports.js +69 -0
  472. package/package.json +1 -5
@@ -0,0 +1,1400 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ // The class.
6
+ export class Element {
7
+ // ---------------------------------------------------------
8
+ // Attributes.
9
+ // static element_tag: string = tag; // must remain static.
10
+ type;
11
+ element_type;
12
+ tag;
13
+ _style;
14
+ _attrs;
15
+ classes;
16
+ _inner_html;
17
+ children;
18
+ _lang;
19
+ _charset;
20
+ _viewport;
21
+ _title;
22
+ _links;
23
+ _disabled;
24
+ // ---------------------------------------------------------
25
+ // Constructor.
26
+ constructor({ type = "VElement", tag = "div", default_style = null, default_attributes = null, default_events = null, }) {
27
+ // Arguments.
28
+ this.type = type;
29
+ this.element_type = type;
30
+ this.tag = tag;
31
+ // Attributes.
32
+ this._style = {};
33
+ this._attrs = {};
34
+ this.classes = [];
35
+ this._inner_html = null;
36
+ this.children = [];
37
+ // Assign default style.
38
+ if (default_style != null) {
39
+ Object.keys(default_style).forEach((key) => {
40
+ this._style[key] = default_style[key];
41
+ });
42
+ }
43
+ // Assign default attributes.
44
+ if (default_attributes != null) {
45
+ Object.keys(default_attributes).forEach((key) => {
46
+ this._attrs[key] = default_attributes[key];
47
+ });
48
+ }
49
+ // Assign default events.
50
+ if (default_events != null) {
51
+ Object.keys(default_events).forEach((key) => {
52
+ this._attrs[key] = default_events[key];
53
+ });
54
+ }
55
+ }
56
+ // ---------------------------------------------------------
57
+ // Utils.
58
+ // Pad a numeric with px.
59
+ pad_numeric(value, padding = "px") {
60
+ if (typeof value === "number") {
61
+ return value + padding;
62
+ }
63
+ return value;
64
+ }
65
+ // ---------------------------------------------------------
66
+ // Build functions.
67
+ // Build the html.
68
+ html() {
69
+ // Vars.
70
+ let html = "", tag;
71
+ // A default element.
72
+ if (this.tag !== "mail") {
73
+ tag = this.tag;
74
+ }
75
+ // The parent mail element.
76
+ else {
77
+ tag = "body";
78
+ // Build header.
79
+ html += "<!DOCTYPE html>";
80
+ html += `<html lang="${this._lang || "en"}" style="height: 100%;">`;
81
+ html += `<head>`;
82
+ html += `<meta charset="${this._charset || "UTF-8"}">`;
83
+ html += `<meta name="viewport" charset="${this._viewport || "width=device-width, initial-scale=1.0"}">`;
84
+ html += `<meta name="color-scheme" content="light">`;
85
+ html += `<meta name="supported-color-schemes" content="light">`;
86
+ html += `<title>${this._title || ""}"</title>`;
87
+ html += "<style type=\"text/css\">* {box-sizing:border-box;}</style>";
88
+ // Links.
89
+ if (this._links !== undefined) {
90
+ this._links.forEach((url) => {
91
+ if (typeof url === "string") {
92
+ html += `<link rel="stylesheet" href="${url}">`;
93
+ }
94
+ else if (typeof url === "object") {
95
+ if (url.rel == null) {
96
+ url.rel = "stylesheet";
97
+ }
98
+ html += "<link";
99
+ Object.keys(url).forEach((key) => {
100
+ html += ` ${key}="${url[key]}"`;
101
+ });
102
+ html += ">";
103
+ }
104
+ else {
105
+ throw Error("Invalid type for a css include, the valid value types are \"string\" and \"object\".");
106
+ }
107
+ });
108
+ }
109
+ // Close header.
110
+ html += `</head>`;
111
+ // Set presentation role.
112
+ if (this.children.length > 0 && this.children[0].tag === "table") {
113
+ this.children[0]._attrs.role = "presentation";
114
+ }
115
+ }
116
+ // Open.
117
+ html += "<";
118
+ html += tag;
119
+ html += " ";
120
+ // Classes.
121
+ if (this.classes.length > 0) {
122
+ html += "class=\"";
123
+ let i = 0;
124
+ this.classes.forEach((key) => {
125
+ html += key;
126
+ if (i < this.classes.length - 1) {
127
+ html += " ";
128
+ }
129
+ ++i;
130
+ });
131
+ html += "\" ";
132
+ }
133
+ // Style.
134
+ if (Object.keys(this._style).length > 0) {
135
+ html += "style=\"";
136
+ Object.keys(this._style).forEach((key) => {
137
+ html += `${key}:${this._style[key].replaceAll('"', '\'')};`;
138
+ });
139
+ html += "\"";
140
+ }
141
+ // Attributes.
142
+ Object.keys(this._attrs).forEach((key) => {
143
+ html += ` ${key}="${this._attrs[key]}"`;
144
+ });
145
+ // End opening.
146
+ html += ">\n";
147
+ // Add inner html.
148
+ if (this._inner_html != null) {
149
+ html += this._inner_html;
150
+ }
151
+ // Add children.
152
+ this.children.forEach((child) => {
153
+ html += child.html();
154
+ });
155
+ // Close.
156
+ html += "</";
157
+ html += this.tag;
158
+ html += "";
159
+ html += ">\n";
160
+ // The parent mail element.
161
+ if (this.tag === "mail") {
162
+ html += "</html>";
163
+ }
164
+ // Response.
165
+ return html;
166
+ }
167
+ // Add links to the main MailElement.
168
+ links(links) {
169
+ if (this._links === undefined) {
170
+ this._links = [];
171
+ }
172
+ this._links = this._links.concat(links);
173
+ return this;
174
+ }
175
+ background_color(value) {
176
+ if (value == null)
177
+ return this._style["background-color"];
178
+ this._style["background-color"] = value;
179
+ return this;
180
+ }
181
+ display(value) {
182
+ if (value == null)
183
+ return this._style["display"];
184
+ this._style["display"] = value;
185
+ return this;
186
+ }
187
+ background_image(value) {
188
+ if (value == null)
189
+ return this._style["background-image"];
190
+ this._style["background-image"] = value;
191
+ return this;
192
+ }
193
+ background_repeat(value) {
194
+ if (value == null)
195
+ return this._style["background-repeat"];
196
+ this._style["background-repeat"] = value;
197
+ return this;
198
+ }
199
+ border_top(value) {
200
+ if (value == null)
201
+ return this._style["border-top"];
202
+ this._style["border-top"] = value;
203
+ return this;
204
+ }
205
+ border_bottom(value) {
206
+ if (value == null)
207
+ return this._style["border-bottom"];
208
+ this._style["border-bottom"] = value;
209
+ return this;
210
+ }
211
+ border_right(value) {
212
+ if (value == null)
213
+ return this._style["border-right"];
214
+ this._style["border-right"] = value;
215
+ return this;
216
+ }
217
+ border_left(value) {
218
+ if (value == null)
219
+ return this._style["border-left"];
220
+ this._style["border-left"] = value;
221
+ return this;
222
+ }
223
+ border_color(value) {
224
+ if (value == null)
225
+ return this._style["border-color"];
226
+ this._style["border-color"] = value;
227
+ return this;
228
+ }
229
+ border_style(value) {
230
+ if (value == null)
231
+ return this._style["border-style"];
232
+ this._style["border-style"] = value;
233
+ return this;
234
+ }
235
+ cursor(value) {
236
+ if (value == null)
237
+ return this._style["cursor"];
238
+ this._style["cursor"] = value;
239
+ return this;
240
+ }
241
+ justify_items(value) {
242
+ if (value == null)
243
+ return this._style["justify-items"];
244
+ this._style["justify-items"] = value;
245
+ return this;
246
+ }
247
+ letter_spacing(value) {
248
+ if (value == null)
249
+ return this._style["letter-spacing"];
250
+ this._style["letter-spacing"] = value;
251
+ return this;
252
+ }
253
+ line_height(value) {
254
+ if (value == null)
255
+ return this._style["line-height"];
256
+ this._style["line-height"] = value;
257
+ return this;
258
+ }
259
+ outline(value) {
260
+ if (value == null)
261
+ return this._style["outline"];
262
+ this._style["outline"] = value;
263
+ return this;
264
+ }
265
+ overflow(value) {
266
+ if (value == null)
267
+ return this._style["overflow"];
268
+ this._style["overflow"] = value;
269
+ return this;
270
+ }
271
+ overflow_x(value) {
272
+ if (value == null)
273
+ return this._style["overflow-x"];
274
+ this._style["overflow-x"] = value;
275
+ return this;
276
+ }
277
+ overflow_y(value) {
278
+ if (value == null)
279
+ return this._style["overflow-y"];
280
+ this._style["overflow-y"] = value;
281
+ return this;
282
+ }
283
+ text_align(value) {
284
+ if (value == null)
285
+ return this._style["text-align"];
286
+ this._style["text-align"] = value;
287
+ return this;
288
+ }
289
+ text_align_last(value) {
290
+ if (value == null)
291
+ return this._style["text-align-last"];
292
+ this._style["text-align-last"] = value;
293
+ return this;
294
+ }
295
+ text_decoration(value) {
296
+ if (value == null)
297
+ return this._style["text-decoration"];
298
+ this._style["text-decoration"] = value;
299
+ return this;
300
+ }
301
+ text_decoration_color(value) {
302
+ if (value == null)
303
+ return this._style["text-decoration-color"];
304
+ this._style["text-decoration-color"] = value;
305
+ return this;
306
+ }
307
+ text_wrap(value) {
308
+ if (value == null)
309
+ return this._style["text-wrap"];
310
+ this._style["text-wrap"] = value;
311
+ return this;
312
+ }
313
+ white_space(value) {
314
+ if (value == null)
315
+ return this._style["white-space"];
316
+ this._style["white-space"] = value;
317
+ return this;
318
+ }
319
+ overflow_wrap(value) {
320
+ if (value == null)
321
+ return this._style["overflow-wrap"];
322
+ this._style["overflow-wrap"] = value;
323
+ return this;
324
+ }
325
+ word_wrap(value) {
326
+ if (value == null)
327
+ return this._style["word-wrap"];
328
+ this._style["word-wrap"] = value;
329
+ return this;
330
+ }
331
+ box_shadow(value) {
332
+ if (value == null)
333
+ return this._style["box-shadow"];
334
+ this._style["box-shadow"] = value;
335
+ return this;
336
+ }
337
+ drop_shadow(value) {
338
+ if (value == null)
339
+ return this._style["drop-shadow"];
340
+ this._style["drop-shadow"] = value;
341
+ return this;
342
+ }
343
+ font_size(value) {
344
+ if (value == null)
345
+ return this._style["font-size"];
346
+ this._style["font-size"] = this.pad_numeric(value);
347
+ return this;
348
+ }
349
+ font(value) {
350
+ if (value == null)
351
+ return this._style["font"];
352
+ this._style["font"] = this.pad_numeric(value);
353
+ return this;
354
+ }
355
+ font_family(value) {
356
+ if (value == null)
357
+ return this._style["font-family"];
358
+ this._style["font-family"] = this.pad_numeric(value);
359
+ return this;
360
+ }
361
+ font_style(value) {
362
+ if (value == null)
363
+ return this._style["font-style"];
364
+ this._style["font-style"] = this.pad_numeric(value);
365
+ return this;
366
+ }
367
+ font_weight(value) {
368
+ if (value == null)
369
+ return this._style["font-weight"];
370
+ this._style["font-weight"] = this.pad_numeric(value);
371
+ return this;
372
+ }
373
+ width(value) {
374
+ if (value == null)
375
+ return this._style["width"];
376
+ this._style["width"] = this.pad_numeric(value);
377
+ return this;
378
+ }
379
+ min_width(value) {
380
+ if (value == null)
381
+ return this._style["min-width"];
382
+ this._style["min-width"] = this.pad_numeric(value);
383
+ return this;
384
+ }
385
+ max_width(value) {
386
+ if (value == null)
387
+ return this._style["max-width"];
388
+ this._style["max-width"] = this.pad_numeric(value);
389
+ return this;
390
+ }
391
+ height(value) {
392
+ if (value == null)
393
+ return this._style["height"];
394
+ this._style["height"] = this.pad_numeric(value);
395
+ return this;
396
+ }
397
+ min_height(value) {
398
+ if (value == null)
399
+ return this._style["min-height"];
400
+ this._style["min-height"] = this.pad_numeric(value);
401
+ return this;
402
+ }
403
+ max_height(value) {
404
+ if (value == null)
405
+ return this._style["max-height"];
406
+ this._style["max-height"] = this.pad_numeric(value);
407
+ return this;
408
+ }
409
+ margin_top(value) {
410
+ if (value == null)
411
+ return this._style["margin-top"];
412
+ this._style["margin-top"] = this.pad_numeric(value);
413
+ return this;
414
+ }
415
+ margin_bottom(value) {
416
+ if (value == null)
417
+ return this._style["margin-bottom"];
418
+ this._style["margin-bottom"] = this.pad_numeric(value);
419
+ return this;
420
+ }
421
+ margin_right(value) {
422
+ if (value == null)
423
+ return this._style["margin-right"];
424
+ this._style["margin-right"] = this.pad_numeric(value);
425
+ return this;
426
+ }
427
+ margin_left(value) {
428
+ if (value == null)
429
+ return this._style["margin-left"];
430
+ this._style["margin-left"] = this.pad_numeric(value);
431
+ return this;
432
+ }
433
+ padding_top(value) {
434
+ if (value == null)
435
+ return this._style["padding-top"];
436
+ this._style["padding-top"] = this.pad_numeric(value);
437
+ return this;
438
+ }
439
+ padding_bottom(value) {
440
+ if (value == null)
441
+ return this._style["padding-bottom"];
442
+ this._style["padding-bottom"] = this.pad_numeric(value);
443
+ return this;
444
+ }
445
+ padding_right(value) {
446
+ if (value == null)
447
+ return this._style["padding-right"];
448
+ this._style["padding-right"] = this.pad_numeric(value);
449
+ return this;
450
+ }
451
+ padding_left(value) {
452
+ if (value == null)
453
+ return this._style["padding-left"];
454
+ this._style["padding-left"] = this.pad_numeric(value);
455
+ return this;
456
+ }
457
+ border_width(value) {
458
+ if (value == null)
459
+ return this._style["border-width"];
460
+ this._style["border-width"] = this.pad_numeric(value);
461
+ return this;
462
+ }
463
+ align_items(value) {
464
+ if (value == null)
465
+ return this._style["align-items"];
466
+ this._style["align-items"] = value;
467
+ this._style["-ms-align-items"] = value;
468
+ this._style["-webkit-align-items"] = value;
469
+ this._style["-moz-align-items"] = value;
470
+ return this;
471
+ }
472
+ align_content(value) {
473
+ if (value == null)
474
+ return this._style["align-content"];
475
+ this._style["align-content"] = value;
476
+ this._style["-ms-align-content"] = value;
477
+ this._style["-webkit-align-content"] = value;
478
+ this._style["-moz-align-content"] = value;
479
+ return this;
480
+ }
481
+ background_size(value) {
482
+ if (value == null)
483
+ return this._style["background-size"];
484
+ this._style["background-size"] = value;
485
+ this._style["-ms-background-size"] = value;
486
+ this._style["-webkit-background-size"] = value;
487
+ this._style["-moz-background-size"] = value;
488
+ return this;
489
+ }
490
+ box_sizing(value) {
491
+ if (value == null)
492
+ return this._style["box-sizing"];
493
+ this._style["box-sizing"] = value;
494
+ this._style["-ms-box-sizing"] = value;
495
+ this._style["-webkit-box-sizing"] = value;
496
+ this._style["-moz-box-sizing"] = value;
497
+ return this;
498
+ }
499
+ flex(value) {
500
+ if (value == null)
501
+ return this._style["flex"];
502
+ this._style["flex"] = value;
503
+ this._style["-ms-flex"] = value;
504
+ this._style["-webkit-flex"] = value;
505
+ this._style["-moz-flex"] = value;
506
+ return this;
507
+ }
508
+ flex_grow(value) {
509
+ if (value == null)
510
+ return this._style["flex-grow"];
511
+ this._style["flex-grow"] = value;
512
+ this._style["-ms-flex-grow"] = value;
513
+ this._style["-webkit-flex-grow"] = value;
514
+ this._style["-moz-flex-grow"] = value;
515
+ return this;
516
+ }
517
+ flex_shrink(value) {
518
+ if (value == null)
519
+ return this._style["flex-shrink"];
520
+ this._style["flex-shrink"] = value;
521
+ this._style["-ms-flex-shrink"] = value;
522
+ this._style["-webkit-flex-shrink"] = value;
523
+ this._style["-moz-flex-shrink"] = value;
524
+ return this;
525
+ }
526
+ justify_content(value) {
527
+ if (value == null)
528
+ return this._style["justify-content"];
529
+ this._style["justify-content"] = value;
530
+ this._style["-ms-justify-content"] = value;
531
+ this._style["-webkit-justify-content"] = value;
532
+ this._style["-moz-justify-content"] = value;
533
+ return this;
534
+ }
535
+ mask(value) {
536
+ if (value == null)
537
+ return this._style["mask"];
538
+ this._style["mask"] = value;
539
+ this._style["-ms-mask"] = value;
540
+ this._style["-webkit-mask"] = value;
541
+ this._style["-moz-mask"] = value;
542
+ return this;
543
+ }
544
+ user_select(value) {
545
+ if (value == null)
546
+ return this._style["user-select"];
547
+ this._style["user-select"] = value;
548
+ this._style["-ms-user-select"] = value;
549
+ this._style["-webkit-user-select"] = value;
550
+ this._style["-moz-user-select"] = value;
551
+ return this;
552
+ }
553
+ // ---------------------------------------------------------
554
+ // Edit the element.
555
+ // Style the element.
556
+ styles(styles) {
557
+ Object.keys(styles).forEach((key) => {
558
+ this._style[key] = styles[key];
559
+ });
560
+ return this;
561
+ }
562
+ // Add attributes to the element.
563
+ attrs(attrs) {
564
+ Object.keys(attrs).forEach((key) => {
565
+ this._attrs[key] = attrs[key];
566
+ });
567
+ return this;
568
+ }
569
+ // Add events to the element.
570
+ events(events) {
571
+ Object.keys(events).forEach((key) => {
572
+ this._attrs[key] = events[key];
573
+ });
574
+ return this;
575
+ }
576
+ // Add class.
577
+ add_class(name) {
578
+ if (this.classes.includes(name) === false) {
579
+ this.classes.push(name);
580
+ }
581
+ return this;
582
+ }
583
+ // Remove class.
584
+ remove_class(name) {
585
+ this.classes = this.classes.filter((cls) => cls !== name);
586
+ return this;
587
+ }
588
+ // Append a child.
589
+ append(...children) {
590
+ children.forEach((child) => {
591
+ // Skip undefined.
592
+ if (child == null) {
593
+ return;
594
+ }
595
+ // Array.
596
+ else if (Array.isArray(child)) {
597
+ this.append(...child);
598
+ }
599
+ // Execute function.
600
+ else if (typeof child === "function") {
601
+ this.append(child(this));
602
+ }
603
+ // Default.
604
+ else {
605
+ this.children.push(child);
606
+ }
607
+ });
608
+ return this;
609
+ }
610
+ inner_html(value) {
611
+ if (value == null) {
612
+ return this._inner_html;
613
+ }
614
+ this._inner_html = value;
615
+ return this;
616
+ }
617
+ // ---------------------------------------------------------
618
+ // Styling.
619
+ // Center the data.
620
+ center() {
621
+ switch (this.tag) {
622
+ case "table":
623
+ case "tr":
624
+ case "td":
625
+ this._attrs["align"] = "center";
626
+ return this;
627
+ default:
628
+ this._style["text-align"] = "center";
629
+ return this;
630
+ }
631
+ }
632
+ padding(...values) {
633
+ if (values.length === 0) {
634
+ return this._style.padding;
635
+ }
636
+ else if (values.length === 1) {
637
+ this._style.padding = this.pad_numeric(values[0]);
638
+ }
639
+ else if (values.length === 2) {
640
+ if (values[0] != null) {
641
+ this._style["padding-top"] = this.pad_numeric(values[0]);
642
+ }
643
+ if (values[1] != null) {
644
+ this._style["padding-right"] = this.pad_numeric(values[1]);
645
+ }
646
+ if (values[0] != null) {
647
+ this._style["padding-bottom"] = this.pad_numeric(values[0]);
648
+ }
649
+ if (values[1] != null) {
650
+ this._style["padding-left"] = this.pad_numeric(values[1]);
651
+ }
652
+ }
653
+ else if (values.length === 4) {
654
+ this._style["padding-top"] = this.pad_numeric(values[0]);
655
+ if (values[1] != null) {
656
+ this._style["padding-right"] = this.pad_numeric(values[1]);
657
+ }
658
+ if (values[2] != null) {
659
+ this._style["padding-bottom"] = this.pad_numeric(values[2]);
660
+ }
661
+ if (values[3] != null) {
662
+ this._style["padding-left"] = this.pad_numeric(values[3]);
663
+ }
664
+ }
665
+ else {
666
+ console.error("Invalid number of arguments for function \"padding()\".");
667
+ }
668
+ return this;
669
+ }
670
+ margin(...values) {
671
+ if (values.length === 0) {
672
+ return this._style.margin;
673
+ }
674
+ else if (values.length === 1) {
675
+ this._style.margin = this.pad_numeric(values[0]);
676
+ }
677
+ else if (values.length === 2) {
678
+ this._style["margin-top"] = this.pad_numeric(values[0]);
679
+ if (values[1] != null) {
680
+ this._style["margin-left"] = this.pad_numeric(values[1]);
681
+ }
682
+ if (values[0] != null) {
683
+ this._style["margin-bottom"] = this.pad_numeric(values[0]);
684
+ }
685
+ if (values[1] != null) {
686
+ this._style["margin-left"] = this.pad_numeric(values[1]);
687
+ }
688
+ }
689
+ else if (values.length === 4) {
690
+ this._style["margin-top"] = this.pad_numeric(values[0]);
691
+ if (values[1] != null) {
692
+ this._style["margin-left"] = this.pad_numeric(values[1]);
693
+ }
694
+ if (values[2] != null) {
695
+ this._style["margin-bottom"] = this.pad_numeric(values[2]);
696
+ }
697
+ if (values[3] != null) {
698
+ this._style["margin-left"] = this.pad_numeric(values[3]);
699
+ }
700
+ }
701
+ else {
702
+ console.error("Invalid number of arguments for function \"margin()\".");
703
+ }
704
+ return this;
705
+ }
706
+ fixed_width(value) {
707
+ if (value == null) {
708
+ return this._style["min-width"];
709
+ }
710
+ value = this.pad_numeric(value);
711
+ this._style["width"] = value; // also required for for example image masks.
712
+ this._style["min-width"] = value;
713
+ this._style["max-width"] = value;
714
+ return this;
715
+ }
716
+ fixed_height(value) {
717
+ if (value == null) {
718
+ return this._style.height;
719
+ }
720
+ value = this.pad_numeric(value);
721
+ this._style["height"] = value; // also required for for example image masks.
722
+ this._style["min-height"] = value;
723
+ this._style["max-height"] = value;
724
+ return this;
725
+ }
726
+ // Frame.
727
+ frame(width, height) {
728
+ if (width != null) {
729
+ this.width(width);
730
+ }
731
+ if (height != null) {
732
+ this.height(height);
733
+ }
734
+ return this;
735
+ }
736
+ min_frame(width, height) {
737
+ if (width != null) {
738
+ this.min_width(width);
739
+ }
740
+ if (height != null) {
741
+ this.min_height(height);
742
+ }
743
+ return this;
744
+ }
745
+ max_frame(width, height) {
746
+ if (width != null) {
747
+ this.max_width(width);
748
+ }
749
+ if (height != null) {
750
+ this.max_height(height);
751
+ }
752
+ return this;
753
+ }
754
+ fixed_frame(width, height) {
755
+ if (width != null) {
756
+ width = this.pad_numeric(width);
757
+ this._style.width = width; // also required for for example image masks.
758
+ this._style["min-width"] = width;
759
+ this._style["max-width"] = width;
760
+ }
761
+ if (height != null) {
762
+ height = this.pad_numeric(height);
763
+ this._style.height = height; // also required for for example image masks.
764
+ this._style["min-height"] = height;
765
+ this._style["max-height"] = height;
766
+ }
767
+ return this;
768
+ }
769
+ color(value) {
770
+ if (value == null) {
771
+ return this._style.color;
772
+ }
773
+ if (value.startsWith("linear-gradient(") || value.startsWith("radial-gradient(")) {
774
+ this._style["background-image"] = value;
775
+ this._style["background-clip"] = "text";
776
+ this._style["-webkit-background-clip"] = "text";
777
+ this._style.color = "transparent";
778
+ }
779
+ else {
780
+ this._style.color = value;
781
+ }
782
+ return this;
783
+ }
784
+ border(...values) {
785
+ if (values.length === 0) {
786
+ return this._style.border;
787
+ }
788
+ else if (values.length === 1) {
789
+ this._style.border = values[0].toString();
790
+ }
791
+ else if (values.length === 2) {
792
+ this._style.border = `${this.pad_numeric(values[0])} solid ${values[1]}`;
793
+ }
794
+ else if (values.length === 3) {
795
+ this._style.border = `${this.pad_numeric(values[0])} ${values[1]} ${values[2]}`;
796
+ }
797
+ else {
798
+ console.error("Invalid number of arguments for function \"border()\".");
799
+ }
800
+ return this;
801
+ }
802
+ border_radius(value) {
803
+ if (value == null) {
804
+ return this._style["border-radius"];
805
+ }
806
+ const paddedValue = this.pad_numeric(value);
807
+ this._style["border-radius"] = paddedValue;
808
+ this._style["-ms-border-radius"] = paddedValue;
809
+ this._style["-webkit-border-radius"] = paddedValue;
810
+ this._style["-moz-border-radius"] = paddedValue;
811
+ return this;
812
+ }
813
+ background(value) {
814
+ if (value == null) {
815
+ return this._style.background;
816
+ }
817
+ if (typeof value === "string" && (value.startsWith("linear-gradient") || value.startsWith("radial-gradient"))) {
818
+ this._style.background = value;
819
+ this._style["background-image"] = value;
820
+ this._style["background-repeat"] = "no-repeat";
821
+ this._style["background-size"] = "cover";
822
+ }
823
+ else {
824
+ this._style.background = value;
825
+ }
826
+ return this;
827
+ }
828
+ ellipsis_overflow(to = true) {
829
+ if (to == null) {
830
+ return this._style["text-overflow"] === "ellipsis";
831
+ }
832
+ else if (to === true) {
833
+ this._style["text-overflow"] = "ellipsis";
834
+ this._style["white-space"] = "nowrap";
835
+ this._style.overflow = "hidden";
836
+ this._style["text-wrap"] = "wrap";
837
+ this._style["overflow-wrap"] = "break-word";
838
+ }
839
+ else if (to === false) {
840
+ this._style["text-overflow"] = "default";
841
+ this._style["white-space"] = "default";
842
+ this._style.overflow = "default";
843
+ this._style["text-wrap"] = "default";
844
+ this._style["overflow-wrap"] = "default";
845
+ }
846
+ return this;
847
+ }
848
+ on_click(callback) {
849
+ if (callback == null) {
850
+ return this._attrs.onclick;
851
+ }
852
+ this._style.cursor = "pointer";
853
+ const e = this;
854
+ this._attrs.onclick = (t) => {
855
+ if (this._disabled !== true) {
856
+ callback(e, t);
857
+ }
858
+ };
859
+ return this;
860
+ }
861
+ lang(value) {
862
+ if (value == null) {
863
+ return this._lang;
864
+ }
865
+ this._lang = value;
866
+ return this;
867
+ }
868
+ charset(value) {
869
+ if (value == null) {
870
+ return this._charset;
871
+ }
872
+ this._charset = value;
873
+ return this;
874
+ }
875
+ viewport(value) {
876
+ if (value == null) {
877
+ return this._viewport;
878
+ }
879
+ this._viewport = value;
880
+ return this;
881
+ }
882
+ title(value) {
883
+ if (value == null) {
884
+ return this._title;
885
+ }
886
+ this._title = value;
887
+ return this;
888
+ }
889
+ }
890
+ // Create a constructor wrapper.
891
+ function wrapper(constructor) {
892
+ return (...args) => new constructor(...args);
893
+ }
894
+ // Create a shared null element mainly for typescript types.
895
+ function create_null(target_class) {
896
+ let instance;
897
+ return () => {
898
+ if (instance === undefined) {
899
+ instance = new target_class();
900
+ }
901
+ return instance;
902
+ };
903
+ }
904
+ // ---------------------------------------------------------
905
+ // Title.
906
+ export class TitleElement extends Element {
907
+ // Constructor.
908
+ constructor(text) {
909
+ // Initialize base class.
910
+ super({
911
+ type: "Title",
912
+ tag: "h1",
913
+ default_style: {
914
+ "margin": "0px 0px 0px 0px",
915
+ "color": "inherit",
916
+ "white-space": "wrap",
917
+ "text-align": "inherit",
918
+ "font-size": "26px",
919
+ "line-height": "1.2em",
920
+ },
921
+ });
922
+ // Set text.
923
+ if (text) {
924
+ this._inner_html = text;
925
+ }
926
+ }
927
+ }
928
+ export const Title = wrapper(TitleElement);
929
+ export const NullTitle = create_null(TitleElement);
930
+ // ---------------------------------------------------------
931
+ // Subtitle.
932
+ export class SubtitleElement extends Element {
933
+ // Constructor.
934
+ constructor(text) {
935
+ // Initialize base class.
936
+ super({
937
+ type: "Subtitle",
938
+ tag: "h2",
939
+ default_style: {
940
+ "margin": "0px",
941
+ "color": "inherit",
942
+ "white-space": "wrap",
943
+ "text-align": "inherit",
944
+ "font-size": "22px",
945
+ "line-height": "1.2em",
946
+ },
947
+ });
948
+ // Set text.
949
+ if (text) {
950
+ this._inner_html = text;
951
+ }
952
+ }
953
+ }
954
+ export const Subtitle = wrapper(SubtitleElement);
955
+ export const NullSubtitle = create_null(SubtitleElement);
956
+ // ---------------------------------------------------------
957
+ // Text.
958
+ export class TextElement extends Element {
959
+ // Constructor.
960
+ constructor(text) {
961
+ // Initialize base class.
962
+ super({
963
+ type: "Text",
964
+ tag: "p",
965
+ default_style: {
966
+ "margin": "0px",
967
+ "padding": "0px",
968
+ "font-size": "18px",
969
+ "line-height": "1.4em",
970
+ "color": "inherit",
971
+ "text-align": "inherit",
972
+ "white-space": "wrap",
973
+ },
974
+ });
975
+ // Set text.
976
+ if (text) {
977
+ this._inner_html = text;
978
+ }
979
+ }
980
+ }
981
+ export const Text = wrapper(TextElement);
982
+ export const NullText = create_null(TextElement);
983
+ // ---------------------------------------------------------
984
+ // Image.
985
+ export class ImageElement extends Element {
986
+ // Constructor.
987
+ constructor(src) {
988
+ // Initialize base class.
989
+ super({
990
+ type: "Image",
991
+ tag: "img",
992
+ default_style: {
993
+ "margin": "0px",
994
+ "padding": "0px",
995
+ "object-fit": "cover",
996
+ },
997
+ });
998
+ // Set src.
999
+ if (src) {
1000
+ this._attrs.src = src;
1001
+ }
1002
+ }
1003
+ }
1004
+ export const Image = wrapper(ImageElement);
1005
+ export const NullImageElement = create_null(ImageElement);
1006
+ // ---------------------------------------------------------
1007
+ // ImageMask.
1008
+ export class ImageMaskElement extends Element {
1009
+ mask_child;
1010
+ _src;
1011
+ // Constructor.
1012
+ constructor(src) {
1013
+ // Initialize base class.
1014
+ super({
1015
+ type: "ImageMask",
1016
+ tag: "div",
1017
+ default_style: {
1018
+ "margin": "0px",
1019
+ "padding": "0px",
1020
+ "object-fit": "cover",
1021
+ "display": "inline-block",
1022
+ },
1023
+ });
1024
+ // Append child.
1025
+ this.mask_child = VStack()
1026
+ .width("100%")
1027
+ .height("100%")
1028
+ .background("black");
1029
+ if (src != null) {
1030
+ this.mask_child.mask(`url('${src}') no-repeat center/contain`);
1031
+ }
1032
+ this.append(this.mask_child);
1033
+ // Set src.
1034
+ if (src) {
1035
+ this.src(src);
1036
+ }
1037
+ }
1038
+ mask_color(value) {
1039
+ if (value == null) {
1040
+ return this.mask_child._style.background;
1041
+ }
1042
+ this.mask_child._style.background = value;
1043
+ return this;
1044
+ }
1045
+ src(value) {
1046
+ if (value == null) {
1047
+ return this._src;
1048
+ }
1049
+ this.mask_child.mask(`url('${value}') no-repeat center/contain`);
1050
+ this._src = value;
1051
+ return this;
1052
+ }
1053
+ mask(value) {
1054
+ if (value == null) {
1055
+ return this.mask_child.mask();
1056
+ }
1057
+ this.mask_child.mask(value);
1058
+ return this;
1059
+ }
1060
+ }
1061
+ export const ImageMask = wrapper(ImageMaskElement);
1062
+ export const NullImageMaskElement = create_null(ImageMaskElement);
1063
+ // ---------------------------------------------------------
1064
+ // VStack.
1065
+ export class VStackElement extends Element {
1066
+ // Constructor.
1067
+ constructor(...children) {
1068
+ // Initialize base class.
1069
+ super({
1070
+ type: "VStack",
1071
+ tag: "div",
1072
+ });
1073
+ // Add children.
1074
+ this.append(...children);
1075
+ }
1076
+ }
1077
+ export const VStack = wrapper(VStackElement);
1078
+ export const NullVStackElement = create_null(VStackElement);
1079
+ // ---------------------------------------------------------
1080
+ // Divider.
1081
+ export class DividerElement extends Element {
1082
+ // Constructor.
1083
+ constructor(text) {
1084
+ // Initialize base class.
1085
+ super({
1086
+ type: "Divider",
1087
+ tag: "div",
1088
+ default_style: {
1089
+ "margin": "0px",
1090
+ "padding": "0px",
1091
+ "width": "100%",
1092
+ "height": "1px",
1093
+ "min-height": "1px",
1094
+ // "background": "black",
1095
+ },
1096
+ });
1097
+ // Set text.
1098
+ if (text) {
1099
+ this._inner_html = text;
1100
+ }
1101
+ }
1102
+ }
1103
+ export const Divider = wrapper(DividerElement);
1104
+ export const NullDividerElement = create_null(DividerElement);
1105
+ // ---------------------------------------------------------
1106
+ // Table data.
1107
+ export class TableDataElement extends Element {
1108
+ // Constructor.
1109
+ constructor(...children) {
1110
+ // Initialize base class.
1111
+ super({
1112
+ type: "TableData",
1113
+ tag: "td",
1114
+ default_style: {
1115
+ "width": "100%",
1116
+ },
1117
+ default_attributes: {}
1118
+ });
1119
+ // Add children.
1120
+ this.append(...children);
1121
+ }
1122
+ // Center the data.
1123
+ center() {
1124
+ this.attrs({ align: "center" });
1125
+ return this;
1126
+ }
1127
+ // Vertically center.
1128
+ center_vertical() {
1129
+ this._style["vertical-align"] = "middle";
1130
+ return this;
1131
+ }
1132
+ leading_vertical() {
1133
+ this._style["vertical-align"] = "top";
1134
+ return this;
1135
+ }
1136
+ trailing_vertical() {
1137
+ this._style["vertical-align"] = "bottom";
1138
+ return this;
1139
+ }
1140
+ }
1141
+ export const TableData = wrapper(TableDataElement);
1142
+ export const NullTableDataElement = create_null(TableDataElement);
1143
+ // ---------------------------------------------------------
1144
+ // Table row.
1145
+ export class TableRowElement extends Element {
1146
+ current_cell;
1147
+ _wrap = false;
1148
+ // Constructor.
1149
+ constructor(...children) {
1150
+ // Initialize base class.
1151
+ super({
1152
+ type: "TableRow",
1153
+ tag: "tr",
1154
+ default_style: {
1155
+ "width": "100%",
1156
+ },
1157
+ default_attributes: {}
1158
+ });
1159
+ // Add children.
1160
+ this.append(...children);
1161
+ }
1162
+ // Append.
1163
+ append(...children) {
1164
+ for (let i = 0; i < children.length; i++) {
1165
+ const child = children[i];
1166
+ // Skip undefined.
1167
+ if (child == null) {
1168
+ continue;
1169
+ }
1170
+ // Array.
1171
+ else if (Array.isArray(child)) {
1172
+ this.append(...child);
1173
+ }
1174
+ // Execute function.
1175
+ else if (typeof child === "function") {
1176
+ this.append(child(this));
1177
+ }
1178
+ // Table data.
1179
+ else if (child instanceof TableDataElement) {
1180
+ this.current_cell = child;
1181
+ this.children.push(child);
1182
+ }
1183
+ // Default.
1184
+ else {
1185
+ if (this.current_cell == null) {
1186
+ this.current_cell = TableData();
1187
+ this.children.push(this.current_cell);
1188
+ if (this._attrs["align"] === "center") {
1189
+ this.current_cell.attrs({ align: "center" });
1190
+ }
1191
+ if (this._style["vertical-align"] === "middle") {
1192
+ this.current_cell._style["align"] = "middle";
1193
+ }
1194
+ }
1195
+ if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
1196
+ if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
1197
+ child._style.display = "inline";
1198
+ }
1199
+ else {
1200
+ child._style.display = "inline-block";
1201
+ }
1202
+ }
1203
+ this.current_cell.append(child);
1204
+ }
1205
+ }
1206
+ return this;
1207
+ }
1208
+ wrap(value) {
1209
+ if (value == null) {
1210
+ return this._wrap;
1211
+ }
1212
+ this._wrap = value;
1213
+ const set_display_inline = (child) => {
1214
+ if (child instanceof TableDataElement) {
1215
+ child.children.forEach(set_display_inline);
1216
+ }
1217
+ else {
1218
+ if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
1219
+ if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
1220
+ child._style.display = "inline";
1221
+ }
1222
+ else {
1223
+ child._style.display = "inline-block";
1224
+ }
1225
+ }
1226
+ else if ((child._style.display === "inline" || child._style.display === "inline-block") && this._wrap === false) {
1227
+ child._style.display = "default";
1228
+ }
1229
+ }
1230
+ };
1231
+ this.children.forEach(set_display_inline);
1232
+ return this;
1233
+ }
1234
+ // Center.
1235
+ center() {
1236
+ this._attrs["align"] = "center";
1237
+ this.children.forEach((child) => {
1238
+ if (child instanceof TableDataElement) {
1239
+ child.attrs({ align: "center" });
1240
+ }
1241
+ });
1242
+ return this;
1243
+ }
1244
+ // Vertically center.
1245
+ center_vertical() {
1246
+ this._style["vertical-align"] = "middle";
1247
+ this.children.forEach((child) => {
1248
+ child._style["vertical-align"] = "middle";
1249
+ if (child instanceof TableDataElement) {
1250
+ child.children.forEach((nested) => {
1251
+ nested._style["vertical-align"] = "middle";
1252
+ });
1253
+ }
1254
+ });
1255
+ return this;
1256
+ }
1257
+ leading_vertical() {
1258
+ this._style["vertical-align"] = "top";
1259
+ this.children.forEach((child) => {
1260
+ child._style["vertical-align"] = "top";
1261
+ if (child instanceof TableDataElement) {
1262
+ child.children.forEach((nested) => {
1263
+ nested._style["vertical-align"] = "top";
1264
+ });
1265
+ }
1266
+ });
1267
+ return this;
1268
+ }
1269
+ trailing_vertical() {
1270
+ this._style["vertical-align"] = "bottom";
1271
+ this.children.forEach((child) => {
1272
+ child._style["vertical-align"] = "bottom";
1273
+ if (child instanceof TableDataElement) {
1274
+ child.children.forEach((nested) => {
1275
+ nested._style["vertical-align"] = "bottom";
1276
+ });
1277
+ }
1278
+ });
1279
+ return this;
1280
+ }
1281
+ }
1282
+ export const TableRow = wrapper(TableRowElement);
1283
+ export const NullTableRowElement = create_null(TableRowElement);
1284
+ // ---------------------------------------------------------
1285
+ // Table, automatically inserts table rows and optionally table data's when the appended object is not already a table data.
1286
+ export class TableElement extends Element {
1287
+ current_cell;
1288
+ current_row;
1289
+ // Constructor.
1290
+ constructor(...children) {
1291
+ // Initialize base class.
1292
+ super({
1293
+ type: "Stack",
1294
+ tag: "table",
1295
+ default_style: {
1296
+ "width": "100%",
1297
+ },
1298
+ default_attributes: {
1299
+ "cellspacing": "0",
1300
+ "cellpadding": "0",
1301
+ "border": "0",
1302
+ }
1303
+ });
1304
+ // Add children.
1305
+ this.current_row = TableRow();
1306
+ this.children.append(this.current_row);
1307
+ this.append(...children);
1308
+ }
1309
+ // Add a row.
1310
+ row(...children) {
1311
+ this.current_row = TableRow();
1312
+ this.children.push(this.current_row);
1313
+ this.current_cell = undefined;
1314
+ this.append(...children);
1315
+ return this;
1316
+ }
1317
+ // Append.
1318
+ append(...children) {
1319
+ for (let i = 0; i < children.length; i++) {
1320
+ const child = children[i];
1321
+ // Skip undefined.
1322
+ if (child == null) {
1323
+ continue;
1324
+ }
1325
+ // Array.
1326
+ else if (Array.isArray(child)) {
1327
+ this.append(...child);
1328
+ }
1329
+ // Execute function.
1330
+ else if (typeof child === "function") {
1331
+ this.append(child(this));
1332
+ }
1333
+ // Table row.
1334
+ else if (child instanceof TableRowElement) {
1335
+ this.current_row = child;
1336
+ this.children.push(child);
1337
+ }
1338
+ // Default.
1339
+ else {
1340
+ if (this.current_row == null) {
1341
+ this.current_row = TableRow();
1342
+ this.children.push(this.current_row);
1343
+ }
1344
+ this.current_row.append(child);
1345
+ }
1346
+ }
1347
+ return this;
1348
+ }
1349
+ }
1350
+ export const Table = wrapper(TableElement);
1351
+ export const NullTableElement = create_null(TableElement);
1352
+ // ---------------------------------------------------------
1353
+ // CSS.
1354
+ export class CSSElement extends Element {
1355
+ // Constructor.
1356
+ constructor(style) {
1357
+ // Initialize base class.
1358
+ super({
1359
+ type: "CSS",
1360
+ tag: "style",
1361
+ });
1362
+ // Add inner html.
1363
+ if (style) {
1364
+ this._inner_html = style;
1365
+ }
1366
+ }
1367
+ }
1368
+ export const CSS = wrapper(CSSElement);
1369
+ export const NullCSSElement = create_null(CSSElement);
1370
+ // ---------------------------------------------------------
1371
+ // Mail.
1372
+ export class MailElement extends Element {
1373
+ _subject;
1374
+ // Constructor.
1375
+ constructor(...children) {
1376
+ // Initialize base class.
1377
+ super({
1378
+ type: "Mail",
1379
+ tag: "mail",
1380
+ default_style: {
1381
+ "width": "100% !important",
1382
+ "min-height": "100% !important",
1383
+ "box-sizing": "border-box",
1384
+ "padding": "0px", // this is required, sometimes it glitches and makes it scrolling without zero padding.
1385
+ "margin": "0px",
1386
+ },
1387
+ });
1388
+ // Add children.
1389
+ this.append(...children);
1390
+ }
1391
+ subject(subj) {
1392
+ if (subj == null) {
1393
+ return this._subject;
1394
+ }
1395
+ this._subject = subj;
1396
+ return this;
1397
+ }
1398
+ }
1399
+ export const Mail = wrapper(MailElement);
1400
+ export const NullMailElement = create_null(MailElement);