@vandenberghinc/volt 1.1.5 → 1.1.7

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 (287) hide show
  1. package/backend/dist/cjs/database.d.ts +41 -68
  2. package/backend/dist/cjs/database.js +127 -76
  3. package/backend/dist/cjs/endpoint.d.ts +23 -9
  4. package/backend/dist/cjs/endpoint.js +98 -21
  5. package/backend/dist/cjs/frontend.d.ts +0 -2
  6. package/backend/dist/cjs/frontend.js +9 -9
  7. package/backend/dist/cjs/image_endpoint.d.ts +3 -1
  8. package/backend/dist/cjs/image_endpoint.js +2 -1
  9. package/backend/dist/cjs/payments/paddle.js +10 -2
  10. package/backend/dist/cjs/plugins/css.d.ts +6 -5
  11. package/backend/dist/cjs/plugins/css.js +32 -7
  12. package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
  13. package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
  14. package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
  15. package/backend/dist/cjs/server.d.ts +7 -13
  16. package/backend/dist/cjs/server.js +184 -303
  17. package/backend/dist/cjs/status.d.ts +1 -0
  18. package/backend/dist/cjs/status.js +2 -1
  19. package/backend/dist/cjs/stream.d.ts +5 -3
  20. package/backend/dist/cjs/stream.js +13 -4
  21. package/backend/dist/cjs/users.d.ts +1 -1
  22. package/backend/dist/cjs/users.js +87 -72
  23. package/backend/dist/cjs/utils.d.ts +17 -9
  24. package/backend/dist/cjs/utils.js +22 -64
  25. package/backend/dist/cjs/view.d.ts +2 -2
  26. package/backend/dist/cjs/view.js +38 -40
  27. package/backend/dist/cjs/volt.d.ts +3 -2
  28. package/backend/dist/cjs/volt.js +2 -2
  29. package/backend/dist/css/volt.css +5 -0
  30. package/backend/dist/esm/database.d.ts +41 -68
  31. package/backend/dist/esm/database.js +127 -76
  32. package/backend/dist/esm/endpoint.d.ts +23 -9
  33. package/backend/dist/esm/endpoint.js +99 -22
  34. package/backend/dist/esm/frontend.d.ts +0 -2
  35. package/backend/dist/esm/frontend.js +9 -9
  36. package/backend/dist/esm/image_endpoint.d.ts +3 -1
  37. package/backend/dist/esm/image_endpoint.js +2 -1
  38. package/backend/dist/esm/payments/paddle.js +11 -3
  39. package/backend/dist/esm/plugins/css.d.ts +6 -5
  40. package/backend/dist/esm/plugins/css.js +32 -6
  41. package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
  42. package/backend/dist/esm/plugins/ts/compiler.js +26 -2
  43. package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
  44. package/backend/dist/esm/server.d.ts +7 -13
  45. package/backend/dist/esm/server.js +182 -301
  46. package/backend/dist/esm/status.d.ts +1 -0
  47. package/backend/dist/esm/status.js +1 -0
  48. package/backend/dist/esm/stream.d.ts +5 -3
  49. package/backend/dist/esm/stream.js +13 -4
  50. package/backend/dist/esm/users.d.ts +1 -1
  51. package/backend/dist/esm/users.js +87 -72
  52. package/backend/dist/esm/utils.d.ts +17 -9
  53. package/backend/dist/esm/utils.js +21 -62
  54. package/backend/dist/esm/view.d.ts +2 -2
  55. package/backend/dist/esm/view.js +38 -40
  56. package/backend/dist/esm/volt.d.ts +3 -2
  57. package/backend/dist/esm/volt.js +2 -1
  58. package/backend/dist/esm-dev/blacklist.js +1 -1
  59. package/backend/dist/esm-dev/cli.js +2 -2
  60. package/backend/dist/esm-dev/database.d.ts +41 -68
  61. package/backend/dist/esm-dev/database.js +128 -77
  62. package/backend/dist/esm-dev/endpoint.d.ts +23 -9
  63. package/backend/dist/esm-dev/endpoint.js +100 -23
  64. package/backend/dist/esm-dev/file_watcher.js +1 -1
  65. package/backend/dist/esm-dev/frontend.d.ts +0 -2
  66. package/backend/dist/esm-dev/frontend.js +9 -9
  67. package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
  68. package/backend/dist/esm-dev/image_endpoint.js +2 -1
  69. package/backend/dist/esm-dev/logger.js +1 -1
  70. package/backend/dist/esm-dev/payments/paddle.js +12 -4
  71. package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
  72. package/backend/dist/esm-dev/plugins/css.js +33 -7
  73. package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
  74. package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
  75. package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
  76. package/backend/dist/esm-dev/rate_limit.js +1 -1
  77. package/backend/dist/esm-dev/server.d.ts +7 -13
  78. package/backend/dist/esm-dev/server.js +184 -303
  79. package/backend/dist/esm-dev/status.d.ts +1 -0
  80. package/backend/dist/esm-dev/status.js +1 -0
  81. package/backend/dist/esm-dev/stream.d.ts +5 -3
  82. package/backend/dist/esm-dev/stream.js +13 -4
  83. package/backend/dist/esm-dev/users.d.ts +1 -1
  84. package/backend/dist/esm-dev/users.js +88 -73
  85. package/backend/dist/esm-dev/utils.d.ts +17 -9
  86. package/backend/dist/esm-dev/utils.js +22 -63
  87. package/backend/dist/esm-dev/view.d.ts +2 -2
  88. package/backend/dist/esm-dev/view.js +39 -41
  89. package/backend/dist/esm-dev/volt.d.ts +3 -2
  90. package/backend/dist/esm-dev/volt.js +2 -1
  91. package/backend/src/database.ts +163 -152
  92. package/backend/src/endpoint.ts +123 -31
  93. package/backend/src/frontend.ts +9 -8
  94. package/backend/src/image_endpoint.ts +4 -0
  95. package/backend/src/payments/paddle.ts +11 -3
  96. package/backend/src/plugins/css.ts +36 -8
  97. package/backend/src/plugins/ts/compiler.ts +37 -1
  98. package/backend/src/plugins/ts/preprocessing.ts +5 -3
  99. package/backend/src/server.ts +167 -306
  100. package/backend/src/status.ts +1 -0
  101. package/backend/src/stream.ts +28 -8
  102. package/backend/src/users.ts +87 -72
  103. package/backend/src/utils.ts +58 -25
  104. package/backend/src/view.ts +30 -28
  105. package/backend/src/{volt.js → volt.ts} +2 -1
  106. package/backend/tsconfig.cjs.json +3 -3
  107. package/backend/tsconfig.esm.json +3 -3
  108. package/frontend/dist/elements/base.d.ts +397 -415
  109. package/frontend/dist/elements/base.js +565 -328
  110. package/frontend/dist/elements/module.d.ts +26 -12
  111. package/frontend/dist/elements/module.js +69 -32
  112. package/frontend/dist/elements/register_element.d.ts +3 -0
  113. package/frontend/dist/elements/register_element.js +22 -0
  114. package/frontend/dist/modules/auth.d.ts +1 -0
  115. package/frontend/dist/modules/auth.js +6 -5
  116. package/frontend/dist/modules/color.d.ts +159 -0
  117. package/frontend/dist/modules/color.js +315 -0
  118. package/frontend/dist/modules/colors.d.ts +1 -26
  119. package/frontend/dist/modules/colors.js +417 -338
  120. package/frontend/dist/modules/cookies.d.ts +1 -0
  121. package/frontend/dist/modules/cookies.js +1 -0
  122. package/frontend/dist/modules/events.d.ts +1 -0
  123. package/frontend/dist/modules/events.js +1 -0
  124. package/frontend/dist/modules/google.d.ts +1 -0
  125. package/frontend/dist/modules/google.js +1 -0
  126. package/frontend/dist/modules/meta.d.ts +1 -0
  127. package/frontend/dist/modules/meta.js +1 -0
  128. package/frontend/dist/modules/mutex.d.ts +1 -2
  129. package/frontend/dist/modules/mutex.js +3 -4
  130. package/frontend/dist/modules/paddle.d.ts +1 -0
  131. package/frontend/dist/modules/paddle.js +14 -13
  132. package/frontend/dist/modules/scheme.d.ts +1 -0
  133. package/frontend/dist/modules/scheme.js +4 -2
  134. package/frontend/dist/modules/statics.d.ts +1 -0
  135. package/frontend/dist/modules/statics.js +1 -0
  136. package/frontend/dist/modules/support.d.ts +1 -0
  137. package/frontend/dist/modules/support.js +3 -2
  138. package/frontend/dist/modules/theme.d.ts +56 -0
  139. package/frontend/dist/{ui → modules}/theme.js +186 -75
  140. package/frontend/dist/modules/themes.d.ts +1 -1
  141. package/frontend/dist/modules/themes.js +1 -0
  142. package/frontend/dist/modules/user.d.ts +1 -0
  143. package/frontend/dist/modules/user.js +11 -10
  144. package/frontend/dist/modules/utils.d.ts +23 -2
  145. package/frontend/dist/modules/utils.js +93 -1
  146. package/frontend/dist/types/gradient.js +4 -0
  147. package/frontend/dist/ui/border_button.d.ts +0 -25
  148. package/frontend/dist/ui/border_button.js +50 -51
  149. package/frontend/dist/ui/button.d.ts +0 -21
  150. package/frontend/dist/ui/button.js +41 -46
  151. package/frontend/dist/ui/canvas.js +15 -15
  152. package/frontend/dist/ui/checkbox.d.ts +3 -17
  153. package/frontend/dist/ui/checkbox.js +36 -30
  154. package/frontend/dist/ui/code.d.ts +15 -82
  155. package/frontend/dist/ui/code.js +150 -125
  156. package/frontend/dist/ui/color.d.ts +0 -1
  157. package/frontend/dist/ui/color.js +1 -1
  158. package/frontend/dist/ui/context_menu.d.ts +4 -2
  159. package/frontend/dist/ui/context_menu.js +16 -17
  160. package/frontend/dist/ui/css.js +2 -0
  161. package/frontend/dist/ui/divider.d.ts +0 -7
  162. package/frontend/dist/ui/divider.js +21 -25
  163. package/frontend/dist/ui/dropdown.d.ts +13 -7
  164. package/frontend/dist/ui/dropdown.js +65 -30
  165. package/frontend/dist/ui/for_each.d.ts +0 -5
  166. package/frontend/dist/ui/for_each.js +17 -22
  167. package/frontend/dist/ui/form.d.ts +17 -12
  168. package/frontend/dist/ui/form.js +21 -18
  169. package/frontend/dist/ui/frame_modes.d.ts +9 -12
  170. package/frontend/dist/ui/frame_modes.js +8 -10
  171. package/frontend/dist/ui/google_map.d.ts +0 -11
  172. package/frontend/dist/ui/google_map.js +23 -28
  173. package/frontend/dist/ui/gradient.d.ts +0 -5
  174. package/frontend/dist/ui/gradient.js +17 -22
  175. package/frontend/dist/ui/image.d.ts +27 -58
  176. package/frontend/dist/ui/image.js +99 -93
  177. package/frontend/dist/ui/input.d.ts +20 -97
  178. package/frontend/dist/ui/input.js +192 -170
  179. package/frontend/dist/ui/link.d.ts +0 -18
  180. package/frontend/dist/ui/link.js +42 -48
  181. package/frontend/dist/ui/list.js +36 -37
  182. package/frontend/dist/ui/loader_button.d.ts +4 -19
  183. package/frontend/dist/ui/loader_button.js +35 -37
  184. package/frontend/dist/ui/loaders.d.ts +0 -8
  185. package/frontend/dist/ui/loaders.js +20 -25
  186. package/frontend/dist/ui/popup.d.ts +11 -8
  187. package/frontend/dist/ui/popup.js +183 -24
  188. package/frontend/dist/ui/pseudo.d.ts +3 -3
  189. package/frontend/dist/ui/pseudo.js +14 -17
  190. package/frontend/dist/ui/scroller.d.ts +10 -48
  191. package/frontend/dist/ui/scroller.js +306 -300
  192. package/frontend/dist/ui/slider.d.ts +9 -3
  193. package/frontend/dist/ui/slider.js +31 -17
  194. package/frontend/dist/ui/spacer.d.ts +0 -9
  195. package/frontend/dist/ui/spacer.js +21 -26
  196. package/frontend/dist/ui/span.js +13 -15
  197. package/frontend/dist/ui/stack.d.ts +14 -75
  198. package/frontend/dist/ui/stack.js +166 -169
  199. package/frontend/dist/ui/steps.d.ts +10 -23
  200. package/frontend/dist/ui/steps.js +47 -34
  201. package/frontend/dist/ui/style.d.ts +4 -3
  202. package/frontend/dist/ui/style.js +13 -18
  203. package/frontend/dist/ui/switch.d.ts +10 -4
  204. package/frontend/dist/ui/switch.js +24 -16
  205. package/frontend/dist/ui/table.d.ts +0 -23
  206. package/frontend/dist/ui/table.js +113 -119
  207. package/frontend/dist/ui/tabs.d.ts +3 -19
  208. package/frontend/dist/ui/tabs.js +35 -29
  209. package/frontend/dist/ui/text.d.ts +0 -8
  210. package/frontend/dist/ui/text.js +20 -25
  211. package/frontend/dist/ui/title.d.ts +0 -15
  212. package/frontend/dist/ui/title.js +39 -45
  213. package/frontend/dist/ui/ui.d.ts +0 -2
  214. package/frontend/dist/ui/ui.js +0 -2
  215. package/frontend/dist/ui/view.d.ts +3 -17
  216. package/frontend/dist/ui/view.js +27 -32
  217. package/frontend/dist/volt.d.ts +2 -1
  218. package/frontend/dist/volt.js +3 -1
  219. package/frontend/examples/dashboard/dashboard.ts +774 -0
  220. package/frontend/examples/theme/theme.ts +58 -0
  221. package/frontend/src/css/volt.css +5 -0
  222. package/frontend/src/elements/base.ts +767 -545
  223. package/frontend/src/elements/module.ts +90 -29
  224. package/frontend/src/elements/register_element.ts +24 -0
  225. package/frontend/src/modules/auth.ts +7 -6
  226. package/frontend/src/modules/color.ts +348 -0
  227. package/frontend/src/modules/colors.ts +468 -449
  228. package/frontend/src/modules/cookies.ts +1 -0
  229. package/frontend/src/modules/events.ts +1 -0
  230. package/frontend/src/modules/google.ts +1 -0
  231. package/frontend/src/modules/meta.ts +2 -1
  232. package/frontend/src/modules/mutex.ts +2 -4
  233. package/frontend/src/modules/paddle.ts +21 -20
  234. package/frontend/src/modules/scheme.ts +4 -3
  235. package/frontend/src/modules/statics.ts +2 -1
  236. package/frontend/src/modules/support.ts +3 -2
  237. package/frontend/src/modules/theme.ts +413 -0
  238. package/frontend/src/modules/themes.ts +2 -1
  239. package/frontend/src/modules/user.ts +12 -11
  240. package/frontend/src/modules/utils.ts +125 -2
  241. package/frontend/src/ui/border_button.ts +41 -37
  242. package/frontend/src/ui/button.ts +33 -32
  243. package/frontend/src/ui/canvas.ts +5 -2
  244. package/frontend/src/ui/checkbox.ts +21 -22
  245. package/frontend/src/ui/code.ts +92 -86
  246. package/frontend/src/ui/context_menu.ts +7 -5
  247. package/frontend/src/ui/css.ts +1 -1
  248. package/frontend/src/ui/divider.ts +15 -10
  249. package/frontend/src/ui/dropdown.ts +38 -21
  250. package/frontend/src/ui/for_each.ts +9 -8
  251. package/frontend/src/ui/form.ts +26 -21
  252. package/frontend/src/ui/frame_modes.ts +13 -17
  253. package/frontend/src/ui/google_map.ts +15 -13
  254. package/frontend/src/ui/gradient.ts +9 -8
  255. package/frontend/src/ui/image.ts +108 -86
  256. package/frontend/src/ui/input.ts +145 -144
  257. package/frontend/src/ui/link.ts +25 -23
  258. package/frontend/src/ui/list.ts +12 -6
  259. package/frontend/src/ui/loader_button.ts +26 -25
  260. package/frontend/src/ui/loaders.ts +12 -11
  261. package/frontend/src/ui/popup.ts +168 -14
  262. package/frontend/src/ui/pseudo.ts +5 -3
  263. package/frontend/src/ui/scroller.ts +303 -294
  264. package/frontend/src/ui/slider.ts +15 -10
  265. package/frontend/src/ui/spacer.ts +14 -11
  266. package/frontend/src/ui/span.ts +6 -2
  267. package/frontend/src/ui/stack.ts +196 -183
  268. package/frontend/src/ui/steps.ts +38 -22
  269. package/frontend/src/ui/style.ts +7 -4
  270. package/frontend/src/ui/switch.ts +16 -11
  271. package/frontend/src/ui/table.ts +42 -34
  272. package/frontend/src/ui/tabs.ts +20 -19
  273. package/frontend/src/ui/text.ts +12 -11
  274. package/frontend/src/ui/title.ts +22 -20
  275. package/frontend/src/ui/ui.ts +0 -2
  276. package/frontend/src/ui/view.ts +20 -19
  277. package/frontend/src/volt.ts +3 -1
  278. package/frontend/{compile.js → tools/compile.old.js} +2 -2
  279. package/frontend/tools/embed_scripts.js +69 -0
  280. package/frontend/tsconfig.json +26 -0
  281. package/package.json +8 -8
  282. package/frontend/dist/ui/theme.d.ts +0 -25
  283. package/frontend/exports.json +0 -1340
  284. package/frontend/src/modules/date.js +0 -535
  285. package/frontend/src/ui/color.ts +0 -117
  286. package/frontend/src/ui/theme.ts +0 -279
  287. /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
@@ -15,3 +15,4 @@ declare const Cookies: {
15
15
  _init(): void;
16
16
  };
17
17
  export { Cookies };
18
+ export { Cookies as cookies };
@@ -164,3 +164,4 @@ const Cookies = {
164
164
  Cookies._init();
165
165
  // Export.
166
166
  export { Cookies };
167
+ export { Cookies as cookies }; // also export as lowercase for compatibility.
@@ -5,3 +5,4 @@ declare const Events: {
5
5
  remove<T extends object>(id: string, element: T, callback?: (element: T, args: Record<string, any>) => void): void;
6
6
  };
7
7
  export { Events };
8
+ export { Events as events };
@@ -88,3 +88,4 @@ window.onload = () => {
88
88
  };
89
89
  // Export.
90
90
  export { Events };
91
+ export { Events as events }; // also export as lowercase for compatibility.
@@ -8,3 +8,4 @@ declare const Google: {
8
8
  };
9
9
  };
10
10
  export { Google };
11
+ export { Google as google };
@@ -51,3 +51,4 @@ const Google = {
51
51
  Google._initialize();
52
52
  // Exports.
53
53
  export { Google };
54
+ export { Google as google }; // also export as lowercase for compatibility.
@@ -7,3 +7,4 @@ export declare const Meta: {
7
7
  favicon?: string;
8
8
  }): void;
9
9
  };
10
+ export { Meta as meta };
@@ -43,3 +43,4 @@ export const Meta = {
43
43
  }
44
44
  },
45
45
  };
46
+ export { Meta as meta }; // also export as lowercase for compatibility.
@@ -1,8 +1,7 @@
1
- export declare class MutexType {
1
+ export declare class Mutex {
2
2
  locked: boolean;
3
3
  queue: Array<() => void>;
4
4
  constructor();
5
5
  lock(): Promise<void>;
6
6
  unlock(): void;
7
7
  }
8
- export declare const Mutex: <Extensions extends object = {}>() => MutexType & Extensions;
@@ -2,11 +2,11 @@
2
2
  * Author: Daan van den Bergh
3
3
  * Copyright: © 2022 - 2024 Daan van den Bergh.
4
4
  */
5
- // Imports.
6
- import { Elements } from "../elements/module.js";
7
5
  // ---------------------------------------------------------
8
6
  // Mutex class.
9
- export class MutexType {
7
+ export class Mutex {
8
+ locked;
9
+ queue;
10
10
  constructor() {
11
11
  this.locked = false;
12
12
  this.queue = [];
@@ -49,4 +49,3 @@ export class MutexType {
49
49
  }
50
50
  }
51
51
  }
52
- export const Mutex = Elements.wrapper(MutexType);
@@ -1401,3 +1401,4 @@ declare const Payments: {
1401
1401
  };
1402
1402
  };
1403
1403
  export { Payments };
1404
+ export { Payments as payments };
@@ -17,7 +17,7 @@ import { Divider } from "../ui/divider";
17
17
  import { Input, ExtendedSelect, ExtendedInput } from "../ui/input";
18
18
  import { Spacer } from "../ui/spacer";
19
19
  import { Form } from "../ui/form";
20
- import { Popup } from "../ui/popup";
20
+ import { YesNoPopup } from "../ui/popup";
21
21
  // ---------------------------------------------------------
22
22
  // Payments Object.
23
23
  const Payments = {
@@ -393,7 +393,7 @@ const Payments = {
393
393
  if (this._sign_in_redirect != null && !User.is_authenticated()) {
394
394
  Utils.redirect(this._sign_in_redirect);
395
395
  }
396
- const response = await Utils.request({
396
+ const response = await Utils.request_v1({
397
397
  method: "POST",
398
398
  url: "/volt/payments/init",
399
399
  data: {
@@ -1313,7 +1313,7 @@ const Payments = {
1313
1313
  .hover_brightness(...style.button.hover_brightness)
1314
1314
  .font_weight("bold")
1315
1315
  .on_click(() => {
1316
- document.body.appendChild(Popup({
1316
+ document.body.appendChild(YesNoPopup({
1317
1317
  title: "Request Refund",
1318
1318
  text: `You are about to request a refund for payment <span style='border-radius: 7px; background: ${style.bg_1}; padding: 1px 4px; font-size: 0.9em;'>${payment.id}</span>, do you wish to proceed?`,
1319
1319
  no: "No",
@@ -2200,7 +2200,7 @@ const Payments = {
2200
2200
  if (this._products !== undefined) {
2201
2201
  return resolve(this._products);
2202
2202
  }
2203
- Utils.request({
2203
+ Utils.request_v1({
2204
2204
  method: "GET",
2205
2205
  url: "/volt/payments/products",
2206
2206
  })
@@ -2268,7 +2268,7 @@ const Payments = {
2268
2268
  * @desc: The id of the payment.
2269
2269
  */
2270
2270
  get_payment: async function (id) {
2271
- return Utils.request({
2271
+ return Utils.request_v1({
2272
2272
  method: "GET",
2273
2273
  url: "/volt/payments/payment",
2274
2274
  data: {
@@ -2306,7 +2306,7 @@ const Payments = {
2306
2306
  * @desc: Payments that are paid.
2307
2307
  */
2308
2308
  get_payments: async function ({ days = 30, limit = null, status = null, } = {}) {
2309
- return Utils.request({
2309
+ return Utils.request_v1({
2310
2310
  method: "GET",
2311
2311
  url: "/volt/payments/payments",
2312
2312
  data: {
@@ -2333,7 +2333,7 @@ const Payments = {
2333
2333
  * @desc: Limit the amount of response payment objects.
2334
2334
  */
2335
2335
  get_refundable_payments: async function ({ days = 30, limit = null, } = {}) {
2336
- return Utils.request({
2336
+ return Utils.request_v1({
2337
2337
  method: "GET",
2338
2338
  url: "/volt/payments/payments/refundable",
2339
2339
  data: {
@@ -2359,7 +2359,7 @@ const Payments = {
2359
2359
  * @desc: Limit the amount of response payment objects.
2360
2360
  */
2361
2361
  get_refunded_payments: async function ({ days = 30, limit = null, } = {}) {
2362
- return Utils.request({
2362
+ return Utils.request_v1({
2363
2363
  method: "GET",
2364
2364
  url: "/volt/payments/payments/refunded",
2365
2365
  data: {
@@ -2385,7 +2385,7 @@ const Payments = {
2385
2385
  * @desc: Limit the amount of response payment objects.
2386
2386
  */
2387
2387
  get_refunding_payments: async function ({ days = null, limit = null, } = {}) {
2388
- return Utils.request({
2388
+ return Utils.request_v1({
2389
2389
  method: "GET",
2390
2390
  url: "/volt/payments/payments/refunding",
2391
2391
  data: {
@@ -2418,7 +2418,7 @@ const Payments = {
2418
2418
  * @desc: The refund reason.
2419
2419
  */
2420
2420
  create_refund: async function (payment, line_items = null, reason = "refund") {
2421
- return Utils.request({
2421
+ return Utils.request_v1({
2422
2422
  method: "POST",
2423
2423
  url: "/volt/payments/refund",
2424
2424
  data: {
@@ -2443,7 +2443,7 @@ const Payments = {
2443
2443
  * @desc: The product id.
2444
2444
  */
2445
2445
  cancel_subscription: async function (product) {
2446
- return Utils.request({
2446
+ return Utils.request_v1({
2447
2447
  method: "DELETE",
2448
2448
  url: "/volt/payments/subscription",
2449
2449
  data: {
@@ -2465,7 +2465,7 @@ const Payments = {
2465
2465
  * @desc: The product id.
2466
2466
  */
2467
2467
  is_subscribed: async function (product) {
2468
- return Utils.request({
2468
+ return Utils.request_v1({
2469
2469
  method: "GET",
2470
2470
  url: "/volt/payments/subscribed",
2471
2471
  data: {
@@ -2482,7 +2482,7 @@ const Payments = {
2482
2482
  * @desc: Get the active subscriptions of the authenticated user.
2483
2483
  */
2484
2484
  get_active_subscriptions: async function () {
2485
- return Utils.request({
2485
+ return Utils.request_v1({
2486
2486
  method: "GET",
2487
2487
  url: "/volt/payments/active_subscriptions",
2488
2488
  });
@@ -2639,3 +2639,4 @@ const Payments = {
2639
2639
  };
2640
2640
  // Exports.
2641
2641
  export { Payments };
2642
+ export { Payments as payments }; // also export as lowercase for compatibility.
@@ -195,6 +195,7 @@ export declare const Scheme: {
195
195
  throw_err?: boolean;
196
196
  }, value?: any, type?: SchemeType, throw_err?: boolean) => string;
197
197
  };
198
+ export { Scheme as SchemeType };
198
199
  declare global {
199
200
  interface Error {
200
201
  json?: {
@@ -7,7 +7,6 @@
7
7
  * Therefore, it must be a standalone script not depending on anything from vlib except for Array.iterate.
8
8
  * And beware that `vlib` will be replaced with `vweb`.
9
9
  */
10
- import { Colors } from "./colors.js";
11
10
  /** @docs
12
11
  * @title Scheme
13
12
  * @desc The scheme validation module
@@ -450,7 +449,9 @@ export const Scheme = {
450
449
  if (last !== -1) {
451
450
  stack = stack.slice(last);
452
451
  }
453
- console.warn(`${Colors.end}[Scheme.verify] ${Colors.yellow}Warning${Colors.end}: Attribute "callback" is deprecated and replaced by attribute "verify" and will be removed in future versions.\n${stack.join('\n')}`);
452
+ const color_end = "\u001b[0m";
453
+ const color_yellow = "\u001b[33m";
454
+ console.warn(`${color_end}[Scheme.verify] ${color_yellow}Warning${color_end}: Attribute "callback" is deprecated and replaced by attribute "verify" and will be removed in future versions.\n${stack.join('\n')}`);
454
455
  // Still proceed as normal.
455
456
  const err = scheme_item.callback(object[key], object, key);
456
457
  if (err) {
@@ -646,4 +647,5 @@ export const Scheme = {
646
647
  return err;
647
648
  }
648
649
  };
650
+ export { Scheme as SchemeType }; // also export as lowercase for compatibility.
649
651
  export default Scheme;
@@ -2,3 +2,4 @@ export declare const Statics: {
2
2
  aspect_ratios: any;
3
3
  aspect_ratio(endpoint: string): any;
4
4
  };
5
+ export { Statics as statics };
@@ -43,3 +43,4 @@ export const Statics = {
43
43
  return this.aspect_ratios[endpoint];
44
44
  }
45
45
  };
46
+ export { Statics as statics }; // also export as lowercase for compatibility.
@@ -16,3 +16,4 @@ declare const Support: {
16
16
  get_pin(): Promise<any>;
17
17
  };
18
18
  export { Support };
19
+ export { Support as support };
@@ -71,7 +71,7 @@ const Support = {
71
71
  * @type: object
72
72
  */
73
73
  submit(data = {}) {
74
- return Utils.request({
74
+ return Utils.request_v1({
75
75
  method: "POST",
76
76
  url: "/volt/support/submit",
77
77
  data: data,
@@ -92,7 +92,7 @@ const Support = {
92
92
  * @type: string
93
93
  */
94
94
  get_pin() {
95
- return Utils.request({
95
+ return Utils.request_v1({
96
96
  method: "GET",
97
97
  url: "/volt/support/pin",
98
98
  });
@@ -100,3 +100,4 @@ const Support = {
100
100
  };
101
101
  // Export.
102
102
  export { Support };
103
+ export { Support as support }; // also export as lowercase for compatibility.
@@ -0,0 +1,56 @@
1
+ type ThemeAttributeName = string;
2
+ type ThemeId = "dark" | "light";
3
+ type ThemesOptions<ThemeOptions extends {}> = {
4
+ dark: ThemeOptions;
5
+ light: ThemeOptions;
6
+ };
7
+ type OnActivateCallback<ThemeOptions extends {}> = (themes_class: Theme<ThemeOptions>, active_id: ThemeId) => void;
8
+ export declare class Theme<ThemeOptions extends {}> {
9
+ active_id: ThemeId;
10
+ active: ThemeOptions;
11
+ _attrs: string[];
12
+ _css_vars: Record<string, string | String>;
13
+ _id: string;
14
+ _on_activate_callback?: OnActivateCallback<ThemeOptions>;
15
+ constructor(id: string, themes: ThemesOptions<ThemeOptions>);
16
+ /**
17
+ * Initialize a specific theme.
18
+ * @note This function should be called after the constructor to ensure the most recent theme is activated, argument "id" can be left undefined.
19
+ */
20
+ initialize(id?: ThemeId): this;
21
+ /** Get full active theme id. */
22
+ get id(): string;
23
+ get_active_id_cached(): string;
24
+ activate(id: ThemeId, apply_theme_update?: boolean): this;
25
+ on_activate(): OnActivateCallback<ThemeOptions> | undefined;
26
+ on_activate(callback: OnActivateCallback<ThemeOptions>): this;
27
+ toggle(apply_theme_update?: boolean): this;
28
+ _add_attr(id: string, theme?: ThemeId): void;
29
+ set(theme: ThemeId, key: string, value: any): this;
30
+ get raw(): ThemeOptions;
31
+ value(id: ThemeAttributeName): any;
32
+ create<T = string>(id: string, create_theme_value: (theme_id: ThemeId, theme: ThemeOptions) => T): void;
33
+ /**
34
+ * Auto darken lighten a color from the theme
35
+ * Safe to call multiple times, caching is implemented.
36
+ *
37
+ * @warning The input color must be a hex / rgb(a) string.
38
+ * @param theme_attr The name of the original theme color.
39
+ * @param percent Percentage between 0. and 1.0.
40
+ */
41
+ auto_darken_lighten(theme_attr: ThemeAttributeName, percent?: number, reversed?: boolean): string;
42
+ opacity(theme_attr: ThemeAttributeName, opacity?: number): string;
43
+ /**
44
+ * Create a new value by multiplying a numeric attribute.
45
+ * @warning argument `id` should be the name of a numeric theme attribute.
46
+ * @param theme_attr The name of a numeric attribute
47
+ * @param x The number by which to multiply the attribute, `attribute * x`.
48
+ */
49
+ multiply(theme_attr: ThemeAttributeName, x?: number): string;
50
+ /** Function to disable all transition attributes on all elements. */
51
+ disable_transitions(): this;
52
+ /** Function to re-enable all transition attributes on all elements. */
53
+ enable_transitions(delay?: number): this;
54
+ }
55
+ export type ExtendTheme<ThemeOptions extends {}> = Theme<ThemeOptions> & ThemeOptions;
56
+ export {};