@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
@@ -0,0 +1,569 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ /** Utils module. */
6
+ export var Utils;
7
+ (function (Utils) {
8
+ /** True if the current browser's vendor string indicates Apple (e.g., Safari on iOS/macOS). */
9
+ Utils.is_apple = navigator?.vendor?.includes('Apple');
10
+ /** True if the current browser is identified via vendor as Safari/Apple (same check as {@link is_apple}). */
11
+ Utils.is_safari = navigator?.vendor?.includes('Apple');
12
+ /**
13
+ * Determine whether the provided value is a string.
14
+ * @param value The value to check.
15
+ * @returns Returns true if the value is a string, otherwise false.
16
+ * @docs
17
+ */
18
+ function is_string(value) {
19
+ return typeof value === 'string' || value instanceof String;
20
+ }
21
+ Utils.is_string = is_string;
22
+ ;
23
+ /**
24
+ * Determine whether the provided value is a finite number.
25
+ * @param value The value to check.
26
+ * @returns Returns true if the value is a finite number, otherwise false.
27
+ * @docs
28
+ */
29
+ function is_numeric(value) {
30
+ return typeof value === 'number' && Number.isFinite(value);
31
+ }
32
+ Utils.is_numeric = is_numeric;
33
+ ;
34
+ /**
35
+ * Determine whether the provided value is an integer.
36
+ * @param value The value to check.
37
+ * @returns Returns true if the value is an integer, otherwise false.
38
+ * @docs
39
+ */
40
+ function is_int(value) {
41
+ return typeof value === 'number' && Number.isInteger(value);
42
+ }
43
+ Utils.is_int = is_int;
44
+ ;
45
+ /**
46
+ * Determine whether the provided value is a floating-point number.
47
+ * @param value The value to check.
48
+ * @returns Returns true if the value is a float, otherwise false.
49
+ * @docs
50
+ */
51
+ function is_float(value) {
52
+ return typeof value === 'number' && !Number.isNaN(value) && !Number.isInteger(value);
53
+ }
54
+ Utils.is_float = is_float;
55
+ ;
56
+ /**
57
+ * Determine whether the provided value is a function.
58
+ * @param value The value to check.
59
+ * @returns Returns true if the value is a function, otherwise false.
60
+ * @docs
61
+ */
62
+ function is_func(value) {
63
+ return typeof value === 'function';
64
+ }
65
+ Utils.is_func = is_func;
66
+ ;
67
+ /**
68
+ * Determine whether the provided value is an array.
69
+ * @param value The value to check.
70
+ * @returns Returns true if the value is an array, otherwise false.
71
+ * @docs
72
+ */
73
+ function is_array(value) {
74
+ return Array.isArray(value);
75
+ }
76
+ Utils.is_array = is_array;
77
+ ;
78
+ /**
79
+ * Determine whether the provided value is a non-array object.
80
+ * @param value The value to check.
81
+ * @returns Returns true if the value is an object and not an array, otherwise false.
82
+ * @docs
83
+ */
84
+ function is_obj(value) {
85
+ return value != null && typeof value === 'object' && !Array.isArray(value);
86
+ }
87
+ Utils.is_obj = is_obj;
88
+ ;
89
+ /**
90
+ * Determine whether the provided number is even.
91
+ * @param number The number to check.
92
+ * @returns Returns true if the number is even, otherwise false.
93
+ * @docs
94
+ */
95
+ function is_even(number) {
96
+ return number % 2 === 0;
97
+ }
98
+ Utils.is_even = is_even;
99
+ ;
100
+ /**
101
+ * Check if the user agent is a mobile device.
102
+ * @returns Returns true when a mobile user agent is detected.
103
+ * @docs
104
+ */
105
+ function is_mobile() {
106
+ return (!!navigator.userAgent.match(/Android/i) ||
107
+ !!navigator.userAgent.match(/webOS/i) ||
108
+ !!navigator.userAgent.match(/iPhone/i) ||
109
+ !!navigator.userAgent.match(/iPad/i) ||
110
+ !!navigator.userAgent.match(/iPod/i) ||
111
+ !!navigator.userAgent.match(/BlackBerry/i) ||
112
+ !!navigator.userAgent.match(/Windows Phone/i));
113
+ }
114
+ Utils.is_mobile = is_mobile;
115
+ ;
116
+ /**
117
+ * Make all objects of an array or object immutable. All nested objects will also be made immutable recursively.
118
+ * @param object The array or object to freeze.
119
+ * @docs
120
+ */
121
+ function make_immutable(object) {
122
+ if (Array.isArray(object)) {
123
+ object.forEach((item, index) => {
124
+ if (item != null && typeof item === "object") {
125
+ object[index] = Utils.make_immutable(item);
126
+ }
127
+ });
128
+ Object.freeze(object);
129
+ }
130
+ else if (object != null && typeof object === "object") {
131
+ Object.keys(object).forEach((key) => {
132
+ if (object[key] != null && typeof object[key] === "object") {
133
+ object[key] = Utils.make_immutable(object[key]);
134
+ }
135
+ });
136
+ Object.freeze(object);
137
+ }
138
+ return object;
139
+ }
140
+ Utils.make_immutable = make_immutable;
141
+ ;
142
+ /**
143
+ * Check if an element is a direct child of an element or the parent element itself.
144
+ * @param parent The parent element to test.
145
+ * @param target The target element to test.
146
+ * @docs
147
+ */
148
+ function is_child(parent, target) {
149
+ for (let i = 0; i < parent.children.length; i++) {
150
+ if (target === parent.children[i]) {
151
+ return true;
152
+ }
153
+ }
154
+ return false;
155
+ }
156
+ Utils.is_child = is_child;
157
+ ;
158
+ /**
159
+ * Check if an element is a recursively nested child of an element or the parent element itself.
160
+ * @param parent The parent element to test.
161
+ * @param target The target element to test.
162
+ * @param stop_node A node at which to stop checking if target is a parent of the current element.
163
+ * @docs
164
+ */
165
+ function is_nested_child(parent, target, stop_node = null) {
166
+ let e = target instanceof Element ? target : null;
167
+ while (e != null) {
168
+ if (e === parent) {
169
+ return true;
170
+ }
171
+ else if (e === stop_node) {
172
+ return false;
173
+ }
174
+ e = e.parentElement;
175
+ }
176
+ return false;
177
+ }
178
+ Utils.is_nested_child = is_nested_child;
179
+ ;
180
+ // Equals.
181
+ // eq(x, y) { return x == y; }
182
+ // not_eq(x, y) { return x != y; }
183
+ // Greater than.
184
+ // gt(x, y) { return x > y; }
185
+ // gt_eq(x, y) { return x >= y; }
186
+ // Lesser than.
187
+ // lt(x, y) { return x < y; }
188
+ // lt_eq(x, y) { return x <= y; }
189
+ /**
190
+ * Round a number to a specified number of decimal places.
191
+ * @param value The number to round.
192
+ * @param decimals The number of decimal places.
193
+ * @returns The rounded number.
194
+ * @docs
195
+ */
196
+ function round(value, decimals) {
197
+ const factor = 10 ** decimals;
198
+ return Math.round(value * factor) / factor;
199
+ }
200
+ Utils.round = round;
201
+ ;
202
+ /**
203
+ * Get the width of the device's viewport.
204
+ * @returns The width of the device's viewport.
205
+ * @docs
206
+ */
207
+ function device_width() {
208
+ return (window.innerWidth > 0) ? window.innerWidth : screen.width;
209
+ }
210
+ Utils.device_width = device_width;
211
+ ;
212
+ /**
213
+ * Get the height of the device's viewport.
214
+ * @returns The height of the device's viewport.
215
+ * @docs
216
+ */
217
+ function device_height() {
218
+ return (window.innerHeight > 0) ? window.innerHeight : screen.height;
219
+ }
220
+ Utils.device_height = device_height;
221
+ ;
222
+ /**
223
+ * Get the endpoint sub URL of a full domain URL. When parameter "url" is undefined, it uses the current URL.
224
+ * @param url The full domain URL.
225
+ * @returns The endpoint sub URL.
226
+ * @docs
227
+ */
228
+ function endpoint(url = null) {
229
+ if (url == null) {
230
+ return Utils.endpoint(window.location.href);
231
+ }
232
+ else {
233
+ // Strip http:// or https://
234
+ let endpoint = url.replace(/^https?:\/\//, "");
235
+ // Remove domain.
236
+ const firstSlash = endpoint.indexOf('/');
237
+ endpoint = firstSlash !== -1 ? endpoint.substring(firstSlash) : '/';
238
+ // Strip query.
239
+ const queryIndex = endpoint.indexOf("?");
240
+ if (queryIndex !== -1) {
241
+ endpoint = endpoint.substring(0, queryIndex);
242
+ }
243
+ // Clean.
244
+ endpoint = endpoint.replaceAll("//", "/");
245
+ // Remove trailing slashes.
246
+ if (endpoint.length === 0) {
247
+ return '/';
248
+ }
249
+ else {
250
+ while (endpoint.length > 1 && endpoint.endsWith('/')) {
251
+ endpoint = endpoint.slice(0, -1);
252
+ }
253
+ }
254
+ return endpoint;
255
+ }
256
+ }
257
+ Utils.endpoint = endpoint;
258
+ ;
259
+ /**
260
+ * Execute a function when the content is loaded, optionally handling a splash screen.
261
+ * @param func The function to execute when the content is loaded.
262
+ * @returns void
263
+ * @docs
264
+ */
265
+ async function on_load(func) {
266
+ // document.addEventListener("DOMContentLoaded", async () => {
267
+ const splash = document.getElementById("__volt_splash_screen");
268
+ if (splash != null) {
269
+ splash.remove();
270
+ }
271
+ let e = func();
272
+ if (e instanceof Promise) {
273
+ try {
274
+ e = await e;
275
+ }
276
+ catch (err) {
277
+ console.error(err);
278
+ return;
279
+ }
280
+ }
281
+ if (e != null && e instanceof HTMLElement) {
282
+ document.body.appendChild(e);
283
+ }
284
+ // });
285
+ }
286
+ Utils.on_load = on_load;
287
+ /**
288
+ * Redirect to a specified URL, optionally forcing the redirect even if the endpoint is the same.
289
+ * @param url The URL to redirect to.
290
+ * @param forced Whether to force the redirect even if the current endpoint is the same as the target URL.
291
+ * @docs
292
+ */
293
+ function redirect(url, forced = false) {
294
+ if (forced || Utils.endpoint() !== url) {
295
+ window.location.href = url;
296
+ }
297
+ }
298
+ Utils.redirect = redirect;
299
+ /**
300
+ * Get a URL parameter by name, with an optional default value.
301
+ * @param name The name of the URL parameter.
302
+ * @param def The default value to return if the parameter is not found.
303
+ * @returns The value of the URL parameter or the default value.
304
+ * @docs
305
+ */
306
+ function url_param(name, def = null) {
307
+ const params = new URLSearchParams(window.location.search);
308
+ const param = params.get(name);
309
+ if (param == null || param === "") {
310
+ return def;
311
+ }
312
+ switch (param.toLowerCase()) {
313
+ case "true": return true;
314
+ case "false": return false;
315
+ case "null": return null;
316
+ default: return param;
317
+ }
318
+ }
319
+ Utils.url_param = url_param;
320
+ /**
321
+ * Encode an object into a URL-encoded query string.
322
+ * @param params The parameters to encode.
323
+ * @returns The URL-encoded query string.
324
+ * @docs
325
+ */
326
+ function url_encode(params) {
327
+ const encodedParams = [];
328
+ Object.keys(params).forEach((key) => {
329
+ const encodedKey = encodeURIComponent(key);
330
+ const encodedValue = encodeURIComponent(params[key]);
331
+ encodedParams.push(`${encodedKey}=${encodedValue}`);
332
+ });
333
+ return encodedParams.join('&');
334
+ }
335
+ Utils.url_encode = url_encode;
336
+ /**
337
+ * Copy text to the clipboard.
338
+ * @param text The text to copy.
339
+ * @returns A Promise that resolves when the text is copied.
340
+ * @docs
341
+ */
342
+ async function copy_to_clipboard(text) {
343
+ return new Promise((resolve, reject) => {
344
+ navigator.clipboard.writeText(text)
345
+ .then(() => {
346
+ resolve();
347
+ })
348
+ .catch((err) => {
349
+ reject(err);
350
+ });
351
+ });
352
+ }
353
+ Utils.copy_to_clipboard = copy_to_clipboard;
354
+ // /**
355
+ // * Make a request with a specific generic typing, optionally passing
356
+ // * the request method, endpoint, request body and response body types.
357
+ // */
358
+ // export function request<Info extends RequestInfo>(
359
+ // options: Info extends RequestInfo<infer M, infer E, infer P>
360
+ // ? RequestOpts<M, E, P>
361
+ // : never
362
+ // ): Promise<Info extends RequestInfo<any, any, any, infer S, infer E> ? RequestResult<S, E> : never>;
363
+ // /** Request with success body. */
364
+ // export function request<
365
+ // SuccessBody extends ResponseBodyBase,
366
+ // >(
367
+ // options: RequestOpts<Utils.Method, string, unknown>
368
+ // ): Promise<RequestResult<SuccessBody, unknown>>;
369
+ // /** Request with success body & request body generics. */
370
+ // export function request<
371
+ // SuccessBody extends ResponseBodyBase,
372
+ // RequestBody extends RequestBodyBase
373
+ // >(
374
+ // options: RequestOpts<Utils.Method, string, RequestBody>
375
+ // ): Promise<RequestResult<SuccessBody, unknown>>;
376
+ // /** Request with success body & request info generics. */
377
+ // export function request<
378
+ // SuccessBody extends ResponseBodyBase,
379
+ // RequestInfo extends RegisteredEndpoint,
380
+ // >(
381
+ // options: RequestInfo extends RegisteredEndpoint<infer M, infer E, infer P>
382
+ // ? RequestOpts<M extends undefined ? "GET" : M, E, P>
383
+ // : RequestOpts<Utils.Method, string, unknown>
384
+ // ): Promise<RequestResult<SuccessBody, unknown>>;
385
+ // /** Request with success body, error body & request body generics. */
386
+ // export function request<
387
+ // SuccessBody extends ResponseBodyBase,
388
+ // ErrorBody extends ResponseBodyBase,
389
+ // RequestBody extends RequestBodyBase
390
+ // >(
391
+ // options: RequestOpts<Utils.Method, string, RequestBody>
392
+ // ): Promise<RequestResult<SuccessBody, ErrorBody>>;
393
+ // /** New request method. */
394
+ // export async function request(options: RequestOpts<Utils.Method, string, any>): Promise<RequestResult<any, any>> {
395
+ /**
396
+ * Create a debounced version of a function that delays invoking it until after a specified delay.
397
+ * @param delay The number of milliseconds to delay.
398
+ * @param func The function to debounce.
399
+ * @returns The debounced function.
400
+ * @docs
401
+ */
402
+ function debounce(delay, func) {
403
+ let timeout;
404
+ return function (...args) {
405
+ if (timeout !== undefined) {
406
+ clearTimeout(timeout);
407
+ }
408
+ timeout = window.setTimeout(() => func.apply(this, args), delay);
409
+ };
410
+ }
411
+ Utils.debounce = debounce;
412
+ /**
413
+ * @deprecated Use vlib.VDate instead.
414
+ * Convert a Unix timestamp in seconds or milliseconds to the user's date format.
415
+ * @param unix The Unix timestamp.
416
+ * @param mseconds Optional. Whether the Unix timestamp is in milliseconds.
417
+ * @returns The formatted date string.
418
+ * @docs
419
+ */
420
+ function unix_to_date(unix, mseconds = null) {
421
+ // Guess msec or sec.
422
+ if (mseconds == null) {
423
+ // As of now, Unix time in milliseconds is 13 digits and in seconds is 10 digits
424
+ const str = unix.toString();
425
+ if (str.length === 13) {
426
+ mseconds = true;
427
+ }
428
+ else if (str.length === 10) {
429
+ mseconds = false;
430
+ }
431
+ else {
432
+ // Future-proofing: When second-based timestamps eventually reach 11 digits
433
+ if (str.length > 10 && str.length < 13) {
434
+ // Check if adding three zeroes (to simulate milliseconds) results in a plausible future date
435
+ // This is a rough estimation and might not be accurate
436
+ const futureCheck = new Date(parseInt(str + "000", 10));
437
+ if (futureCheck.getFullYear() > new Date().getFullYear() && futureCheck.getFullYear() < 3000) {
438
+ mseconds = false;
439
+ }
440
+ }
441
+ }
442
+ }
443
+ // Format.
444
+ const date = new Date(mseconds ? unix : unix * 1000);
445
+ const lang = navigator.language || navigator.userLanguage;
446
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
447
+ let options = {
448
+ year: "numeric",
449
+ month: "2-digit",
450
+ day: "2-digit",
451
+ timeZone: tz,
452
+ };
453
+ const date_format = new Intl.DateTimeFormat(lang, options).format(date);
454
+ options = {
455
+ hour: "2-digit",
456
+ minute: "2-digit",
457
+ second: "2-digit",
458
+ hour12: lang.toLowerCase().includes("en"),
459
+ timeZone: tz,
460
+ };
461
+ const time_format = new Intl.DateTimeFormat(lang, options).format(date);
462
+ return `${date_format} ${time_format}`;
463
+ }
464
+ Utils.unix_to_date = unix_to_date;
465
+ // Get the brightness of a hex color (0.0 white 1.0 dark).
466
+ // @deprecated moved to `Colors`
467
+ // hex_brightness(color: string): number {
468
+ // // Remove the hash symbol if present
469
+ // color = color.replace(/^#/, '');
470
+ // // Convert hex to RGB
471
+ // const bigint = parseInt(color, 16);
472
+ // const r = (bigint >> 16) & 255;
473
+ // const g = (bigint >> 8) & 255;
474
+ // const b = bigint & 255;
475
+ // // Calculate perceived brightness using the relative luminance formula
476
+ // const brightness = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
477
+ // return brightness;
478
+ // },
479
+ // Hex to rgbA.
480
+ // @deprecated moved to `Colors`
481
+ // hex_to_rgb(hex: string): { r: number, g: number, b: number, a: number } {
482
+ // let index = hex.indexOf("#");
483
+ // if (index !== -1) {
484
+ // hex = hex.substr(index + 1);
485
+ // }
486
+ // let r = parseInt(hex.substring(0, 2), 16);
487
+ // let g = parseInt(hex.substring(2, 4), 16);
488
+ // let b = parseInt(hex.substring(4, 6), 16);
489
+ // let a = 1;
490
+ // if (hex.length > 6) {
491
+ // a = parseInt(hex.substring(6, 8)) / 100;
492
+ // }
493
+ // return { r, g, b, a };
494
+ // },
495
+ // Aggregate multiple classes into a single class, can be used to extend more than one class.
496
+ // aggregate(
497
+ // BaseClass: new (...args: any[]) => any,
498
+ // ...Mixins: Array<new (...args: any[]) => any>
499
+ // ) {
500
+ // class AggregatedClass extends BaseClass {
501
+ // constructor(...args: any[]) {
502
+ // super(...args);
503
+ // // Additional initialization if needed
504
+ // }
505
+ // }
506
+ // // Copy methods and properties from mixin classes to the AggregatedClass prototype
507
+ // Mixins.forEach(MixinClass => {
508
+ // // Copy instance methods and properties
509
+ // Object.getOwnPropertyNames(MixinClass.prototype).forEach(name => {
510
+ // if (name !== 'constructor') {
511
+ // Object.defineProperty(
512
+ // AggregatedClass.prototype,
513
+ // name,
514
+ // Object.getOwnPropertyDescriptor(MixinClass.prototype, name)!
515
+ // );
516
+ // }
517
+ // });
518
+ // // Copy static methods and properties if needed
519
+ // Object.getOwnPropertyNames(MixinClass).forEach(name => {
520
+ // if (name !== 'prototype' && name !== 'name' && name !== 'length') {
521
+ // Object.defineProperty(
522
+ // AggregatedClass,
523
+ // name,
524
+ // Object.getOwnPropertyDescriptor(MixinClass, name)!
525
+ // );
526
+ // }
527
+ // });
528
+ // });
529
+ // return AggregatedClass;
530
+ // },
531
+ })(Utils || (Utils = {}));
532
+ export { Utils as utils }; // also export as lowercase for compatibility.
533
+ // // ---------------------------------------
534
+ // // SMALL REQUESTS TESTS
535
+ // // 2 generics: <Success, Body> -> Error = unknown
536
+ // const res_1 = await Utils.request<
537
+ // { uid: string },
538
+ // { name: string }
539
+ // >({ method: 'POST', url: '/users', data: { name: 'Ada' } });
540
+ // if (res_1.error) {
541
+ // const e = res_1.error;
542
+ // } else {
543
+ // const d = res_1.data;
544
+ // }
545
+ // // 3 generics: <Success, Error, Body>
546
+ // const res_2 = await Utils.request<{ uid: string }, { unknown_uid: string }, { name: string }>({ method: 'POST', url: '/users', data: { name: 'Ada' } });
547
+ // if (res_2.error) {
548
+ // const e = res_2.error;
549
+ // const d = res_2.data;
550
+ // } else {
551
+ // const d = res_2.data;
552
+ // }
553
+ // // 1 generic: <Success> -> Body inferred from `data`, Error = unknown
554
+ // const res_3 = await Utils.request<{ uid: string }>({ method: 'POST', url: '/users', data: { name: 'Ada' } });
555
+ // if (res_3.error) {
556
+ // const e = res_3.error;
557
+ // } else {
558
+ // const d = res_3.data;
559
+ // }
560
+ // // missing data attr
561
+ // const res_4 = await Utils.request<
562
+ // { uid: string },
563
+ // { name: string, age: number }
564
+ // >({
565
+ // method: 'POST',
566
+ // url: '/users',
567
+ // // @ts-expect-error
568
+ // data: { name: 'Ada' }
569
+ // });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
+ */
5
+ /**
6
+ * Create a gradient object.
7
+ *
8
+ * Can also be constructed with wrapper function `Gradient`.
9
+ * @nav Frontend/Styling
10
+ * @returns Returns the `GradientType` object.
11
+ * @param ...args The arguments can either be of length 1, containing the full gradient string `new GradientType("linear-gradient(...)")`. Or the arguments can be as `new GradientType("linear", "black", "0%", "white", "100%")`.
12
+ * @docs
13
+ */
14
+ export declare class GradientType {
15
+ gradient?: string;
16
+ type?: string;
17
+ degree?: string;
18
+ colors?: {
19
+ color: string;
20
+ stop?: string;
21
+ }[];
22
+ constructor(gradient: string);
23
+ constructor(type: string, ...colors: string[]);
24
+ /**
25
+ * Cast to a CSS `*-gradient(...)` string. If `gradient` is unset but `colors` exist, it is built from `type`, `degree`, and `colors`, then cached.
26
+ * @returns The CSS gradient string, or an empty string when insufficient data is available.
27
+ */
28
+ toString(): string;
29
+ }
@@ -1,23 +1,15 @@
1
- /*
2
- * Author: Daan van den Bergh
3
- * Copyright: © 2022 - 2024 Daan van den Bergh.
1
+ /**
2
+ * @author Daan van den Bergh
3
+ * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
4
  */
5
- // Gradient.
6
- /* @docs:
7
- * @nav: Frontend
8
- * @chapter: Styling
9
- * @title: Gradient
10
- * @description:
11
- * Create a gradient object.
5
+ /**
6
+ * Create a gradient object.
12
7
  *
13
- * Can also be constructed with wrapper function `Gradient`.
14
- * @return:
15
- * Returns the `GradientType` object.
16
- * @parameter:
17
- * @name: ...args
18
- * @description:
19
- * The arguments can either be of length 1, containing the full gradient string `new GradientType ("linear-gradient(...)")`.
20
- * Or the arguments can be as `new GradientType("linear", "black", "0%", "white", "100%")`.
8
+ * Can also be constructed with wrapper function `Gradient`.
9
+ * @nav Frontend/Styling
10
+ * @returns Returns the `GradientType` object.
11
+ * @param ...args The arguments can either be of length 1, containing the full gradient string `new GradientType("linear-gradient(...)")`. Or the arguments can be as `new GradientType("linear", "black", "0%", "white", "100%")`.
12
+ * @docs
21
13
  */
22
14
  export class GradientType {
23
15
  gradient;
@@ -55,6 +47,10 @@ export class GradientType {
55
47
  console.error("Invalid number of arguments for class \"Gradient()\".");
56
48
  }
57
49
  }
50
+ /**
51
+ * Cast to a CSS `*-gradient(...)` string. If `gradient` is unset but `colors` exist, it is built from `type`, `degree`, and `colors`, then cached.
52
+ * @returns The CSS gradient string, or an empty string when insufficient data is available.
53
+ */
58
54
  // Cast to string.
59
55
  toString() {
60
56
  if (this.gradient == null && this.colors !== undefined) {