@vandenberghinc/volt 1.1.26 → 1.1.28

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