@vandenberghinc/volt 1.1.4 → 1.1.6

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 (290) hide show
  1. package/backend/dist/cjs/database.d.ts +41 -68
  2. package/backend/dist/cjs/database.js +136 -78
  3. package/backend/dist/cjs/endpoint.d.ts +23 -9
  4. package/backend/dist/cjs/endpoint.js +98 -21
  5. package/backend/dist/cjs/file_watcher.js +2 -2
  6. package/backend/dist/cjs/frontend.d.ts +0 -2
  7. package/backend/dist/cjs/frontend.js +9 -9
  8. package/backend/dist/cjs/image_endpoint.d.ts +3 -1
  9. package/backend/dist/cjs/image_endpoint.js +2 -1
  10. package/backend/dist/cjs/payments/paddle.js +10 -2
  11. package/backend/dist/cjs/plugins/css.d.ts +6 -5
  12. package/backend/dist/cjs/plugins/css.js +32 -7
  13. package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
  14. package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
  15. package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
  16. package/backend/dist/cjs/server.d.ts +7 -13
  17. package/backend/dist/cjs/server.js +184 -303
  18. package/backend/dist/cjs/status.d.ts +1 -0
  19. package/backend/dist/cjs/status.js +2 -1
  20. package/backend/dist/cjs/stream.d.ts +5 -3
  21. package/backend/dist/cjs/stream.js +13 -4
  22. package/backend/dist/cjs/users.d.ts +1 -1
  23. package/backend/dist/cjs/users.js +87 -72
  24. package/backend/dist/cjs/utils.d.ts +17 -9
  25. package/backend/dist/cjs/utils.js +22 -64
  26. package/backend/dist/cjs/view.d.ts +2 -2
  27. package/backend/dist/cjs/view.js +38 -40
  28. package/backend/dist/cjs/volt.d.ts +3 -2
  29. package/backend/dist/cjs/volt.js +2 -2
  30. package/backend/dist/css/volt.css +5 -0
  31. package/backend/dist/esm/database.d.ts +41 -68
  32. package/backend/dist/esm/database.js +137 -79
  33. package/backend/dist/esm/endpoint.d.ts +23 -9
  34. package/backend/dist/esm/endpoint.js +99 -22
  35. package/backend/dist/esm/file_watcher.js +2 -2
  36. package/backend/dist/esm/frontend.d.ts +0 -2
  37. package/backend/dist/esm/frontend.js +9 -9
  38. package/backend/dist/esm/image_endpoint.d.ts +3 -1
  39. package/backend/dist/esm/image_endpoint.js +2 -1
  40. package/backend/dist/esm/payments/paddle.js +11 -3
  41. package/backend/dist/esm/plugins/css.d.ts +6 -5
  42. package/backend/dist/esm/plugins/css.js +32 -6
  43. package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
  44. package/backend/dist/esm/plugins/ts/compiler.js +26 -2
  45. package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
  46. package/backend/dist/esm/server.d.ts +7 -13
  47. package/backend/dist/esm/server.js +182 -301
  48. package/backend/dist/esm/status.d.ts +1 -0
  49. package/backend/dist/esm/status.js +1 -0
  50. package/backend/dist/esm/stream.d.ts +5 -3
  51. package/backend/dist/esm/stream.js +13 -4
  52. package/backend/dist/esm/users.d.ts +1 -1
  53. package/backend/dist/esm/users.js +87 -72
  54. package/backend/dist/esm/utils.d.ts +17 -9
  55. package/backend/dist/esm/utils.js +21 -62
  56. package/backend/dist/esm/view.d.ts +2 -2
  57. package/backend/dist/esm/view.js +38 -40
  58. package/backend/dist/esm/volt.d.ts +3 -2
  59. package/backend/dist/esm/volt.js +2 -1
  60. package/backend/dist/esm-dev/blacklist.js +1 -1
  61. package/backend/dist/esm-dev/cli.js +2 -2
  62. package/backend/dist/esm-dev/database.d.ts +41 -68
  63. package/backend/dist/esm-dev/database.js +138 -80
  64. package/backend/dist/esm-dev/endpoint.d.ts +23 -9
  65. package/backend/dist/esm-dev/endpoint.js +100 -23
  66. package/backend/dist/esm-dev/file_watcher.js +3 -3
  67. package/backend/dist/esm-dev/frontend.d.ts +0 -2
  68. package/backend/dist/esm-dev/frontend.js +9 -9
  69. package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
  70. package/backend/dist/esm-dev/image_endpoint.js +2 -1
  71. package/backend/dist/esm-dev/logger.js +1 -1
  72. package/backend/dist/esm-dev/payments/paddle.js +12 -4
  73. package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
  74. package/backend/dist/esm-dev/plugins/css.js +33 -7
  75. package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
  76. package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
  77. package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
  78. package/backend/dist/esm-dev/rate_limit.js +1 -1
  79. package/backend/dist/esm-dev/server.d.ts +7 -13
  80. package/backend/dist/esm-dev/server.js +184 -303
  81. package/backend/dist/esm-dev/status.d.ts +1 -0
  82. package/backend/dist/esm-dev/status.js +1 -0
  83. package/backend/dist/esm-dev/stream.d.ts +5 -3
  84. package/backend/dist/esm-dev/stream.js +13 -4
  85. package/backend/dist/esm-dev/users.d.ts +1 -1
  86. package/backend/dist/esm-dev/users.js +88 -73
  87. package/backend/dist/esm-dev/utils.d.ts +17 -9
  88. package/backend/dist/esm-dev/utils.js +22 -63
  89. package/backend/dist/esm-dev/view.d.ts +2 -2
  90. package/backend/dist/esm-dev/view.js +39 -41
  91. package/backend/dist/esm-dev/volt.d.ts +3 -2
  92. package/backend/dist/esm-dev/volt.js +2 -1
  93. package/backend/src/database.ts +173 -155
  94. package/backend/src/endpoint.ts +123 -31
  95. package/backend/src/file_watcher.ts +2 -2
  96. package/backend/src/frontend.ts +9 -8
  97. package/backend/src/image_endpoint.ts +4 -0
  98. package/backend/src/payments/paddle.ts +11 -3
  99. package/backend/src/plugins/css.ts +36 -8
  100. package/backend/src/plugins/ts/compiler.ts +37 -1
  101. package/backend/src/plugins/ts/preprocessing.ts +5 -3
  102. package/backend/src/server.ts +167 -306
  103. package/backend/src/status.ts +1 -0
  104. package/backend/src/stream.ts +28 -8
  105. package/backend/src/users.ts +87 -72
  106. package/backend/src/utils.ts +58 -25
  107. package/backend/src/view.ts +30 -28
  108. package/backend/src/{volt.js → volt.ts} +2 -1
  109. package/backend/tsconfig.cjs.json +3 -3
  110. package/backend/tsconfig.esm.json +3 -3
  111. package/frontend/dist/elements/base.d.ts +414 -432
  112. package/frontend/dist/elements/base.js +566 -329
  113. package/frontend/dist/elements/module.d.ts +26 -12
  114. package/frontend/dist/elements/module.js +69 -32
  115. package/frontend/dist/elements/register_element.d.ts +3 -0
  116. package/frontend/dist/elements/register_element.js +22 -0
  117. package/frontend/dist/modules/auth.d.ts +1 -0
  118. package/frontend/dist/modules/auth.js +6 -5
  119. package/frontend/dist/modules/color.d.ts +159 -0
  120. package/frontend/dist/modules/color.js +315 -0
  121. package/frontend/dist/modules/colors.d.ts +1 -26
  122. package/frontend/dist/modules/colors.js +417 -340
  123. package/frontend/dist/modules/cookies.d.ts +1 -0
  124. package/frontend/dist/modules/cookies.js +1 -0
  125. package/frontend/dist/modules/events.d.ts +1 -0
  126. package/frontend/dist/modules/events.js +1 -0
  127. package/frontend/dist/modules/google.d.ts +1 -0
  128. package/frontend/dist/modules/google.js +1 -0
  129. package/frontend/dist/modules/meta.d.ts +1 -0
  130. package/frontend/dist/modules/meta.js +1 -0
  131. package/frontend/dist/modules/mutex.d.ts +1 -2
  132. package/frontend/dist/modules/mutex.js +3 -4
  133. package/frontend/dist/modules/paddle.d.ts +1 -0
  134. package/frontend/dist/modules/paddle.js +14 -13
  135. package/frontend/dist/modules/scheme.d.ts +1 -0
  136. package/frontend/dist/modules/scheme.js +5 -3
  137. package/frontend/dist/modules/statics.d.ts +1 -0
  138. package/frontend/dist/modules/statics.js +1 -0
  139. package/frontend/dist/modules/support.d.ts +1 -0
  140. package/frontend/dist/modules/support.js +3 -2
  141. package/frontend/dist/modules/theme.d.ts +56 -0
  142. package/frontend/dist/{ui → modules}/theme.js +186 -75
  143. package/frontend/dist/modules/themes.d.ts +1 -1
  144. package/frontend/dist/modules/themes.js +1 -0
  145. package/frontend/dist/modules/user.d.ts +1 -0
  146. package/frontend/dist/modules/user.js +11 -10
  147. package/frontend/dist/modules/utils.d.ts +23 -2
  148. package/frontend/dist/modules/utils.js +93 -1
  149. package/frontend/dist/types/gradient.js +4 -0
  150. package/frontend/dist/ui/border_button.d.ts +0 -25
  151. package/frontend/dist/ui/border_button.js +50 -51
  152. package/frontend/dist/ui/button.d.ts +0 -21
  153. package/frontend/dist/ui/button.js +41 -46
  154. package/frontend/dist/ui/canvas.js +15 -15
  155. package/frontend/dist/ui/checkbox.d.ts +3 -17
  156. package/frontend/dist/ui/checkbox.js +36 -30
  157. package/frontend/dist/ui/code.d.ts +15 -82
  158. package/frontend/dist/ui/code.js +150 -125
  159. package/frontend/dist/ui/color.d.ts +0 -1
  160. package/frontend/dist/ui/color.js +1 -1
  161. package/frontend/dist/ui/context_menu.d.ts +4 -2
  162. package/frontend/dist/ui/context_menu.js +16 -17
  163. package/frontend/dist/ui/css.js +2 -0
  164. package/frontend/dist/ui/divider.d.ts +0 -7
  165. package/frontend/dist/ui/divider.js +21 -25
  166. package/frontend/dist/ui/dropdown.d.ts +13 -7
  167. package/frontend/dist/ui/dropdown.js +65 -30
  168. package/frontend/dist/ui/for_each.d.ts +0 -5
  169. package/frontend/dist/ui/for_each.js +17 -22
  170. package/frontend/dist/ui/form.d.ts +17 -12
  171. package/frontend/dist/ui/form.js +21 -18
  172. package/frontend/dist/ui/frame_modes.d.ts +9 -12
  173. package/frontend/dist/ui/frame_modes.js +8 -10
  174. package/frontend/dist/ui/google_map.d.ts +0 -11
  175. package/frontend/dist/ui/google_map.js +23 -28
  176. package/frontend/dist/ui/gradient.d.ts +0 -5
  177. package/frontend/dist/ui/gradient.js +17 -22
  178. package/frontend/dist/ui/image.d.ts +27 -58
  179. package/frontend/dist/ui/image.js +99 -93
  180. package/frontend/dist/ui/input.d.ts +20 -97
  181. package/frontend/dist/ui/input.js +192 -170
  182. package/frontend/dist/ui/link.d.ts +0 -18
  183. package/frontend/dist/ui/link.js +42 -48
  184. package/frontend/dist/ui/list.js +36 -37
  185. package/frontend/dist/ui/loader_button.d.ts +4 -19
  186. package/frontend/dist/ui/loader_button.js +35 -37
  187. package/frontend/dist/ui/loaders.d.ts +0 -8
  188. package/frontend/dist/ui/loaders.js +20 -25
  189. package/frontend/dist/ui/popup.d.ts +11 -8
  190. package/frontend/dist/ui/popup.js +183 -24
  191. package/frontend/dist/ui/pseudo.d.ts +3 -3
  192. package/frontend/dist/ui/pseudo.js +14 -17
  193. package/frontend/dist/ui/scroller.d.ts +10 -48
  194. package/frontend/dist/ui/scroller.js +306 -300
  195. package/frontend/dist/ui/slider.d.ts +9 -3
  196. package/frontend/dist/ui/slider.js +31 -17
  197. package/frontend/dist/ui/spacer.d.ts +0 -9
  198. package/frontend/dist/ui/spacer.js +21 -26
  199. package/frontend/dist/ui/span.js +13 -15
  200. package/frontend/dist/ui/stack.d.ts +14 -75
  201. package/frontend/dist/ui/stack.js +166 -169
  202. package/frontend/dist/ui/steps.d.ts +10 -23
  203. package/frontend/dist/ui/steps.js +47 -34
  204. package/frontend/dist/ui/style.d.ts +4 -3
  205. package/frontend/dist/ui/style.js +13 -18
  206. package/frontend/dist/ui/switch.d.ts +10 -4
  207. package/frontend/dist/ui/switch.js +24 -16
  208. package/frontend/dist/ui/table.d.ts +0 -23
  209. package/frontend/dist/ui/table.js +113 -119
  210. package/frontend/dist/ui/tabs.d.ts +3 -19
  211. package/frontend/dist/ui/tabs.js +35 -29
  212. package/frontend/dist/ui/text.d.ts +0 -8
  213. package/frontend/dist/ui/text.js +20 -25
  214. package/frontend/dist/ui/title.d.ts +0 -15
  215. package/frontend/dist/ui/title.js +39 -45
  216. package/frontend/dist/ui/ui.d.ts +0 -2
  217. package/frontend/dist/ui/ui.js +0 -2
  218. package/frontend/dist/ui/view.d.ts +3 -17
  219. package/frontend/dist/ui/view.js +27 -32
  220. package/frontend/dist/volt.d.ts +2 -1
  221. package/frontend/dist/volt.js +3 -1
  222. package/frontend/examples/dashboard/dashboard.ts +774 -0
  223. package/frontend/examples/theme/theme.ts +58 -0
  224. package/frontend/src/css/volt.css +5 -0
  225. package/frontend/src/elements/base.ts +767 -545
  226. package/frontend/src/elements/module.ts +90 -29
  227. package/frontend/src/elements/register_element.ts +24 -0
  228. package/frontend/src/modules/auth.ts +7 -6
  229. package/frontend/src/modules/color.ts +348 -0
  230. package/frontend/src/modules/colors.ts +468 -449
  231. package/frontend/src/modules/cookies.ts +1 -0
  232. package/frontend/src/modules/events.ts +1 -0
  233. package/frontend/src/modules/google.ts +1 -0
  234. package/frontend/src/modules/meta.ts +2 -1
  235. package/frontend/src/modules/mutex.ts +2 -4
  236. package/frontend/src/modules/paddle.ts +21 -20
  237. package/frontend/src/modules/scheme.ts +5 -4
  238. package/frontend/src/modules/statics.ts +2 -1
  239. package/frontend/src/modules/support.ts +3 -2
  240. package/frontend/src/modules/theme.ts +413 -0
  241. package/frontend/src/modules/themes.ts +2 -1
  242. package/frontend/src/modules/user.ts +12 -11
  243. package/frontend/src/modules/utils.ts +125 -2
  244. package/frontend/src/ui/border_button.ts +41 -37
  245. package/frontend/src/ui/button.ts +33 -32
  246. package/frontend/src/ui/canvas.ts +5 -2
  247. package/frontend/src/ui/checkbox.ts +21 -22
  248. package/frontend/src/ui/code.ts +92 -86
  249. package/frontend/src/ui/context_menu.ts +7 -5
  250. package/frontend/src/ui/css.ts +1 -1
  251. package/frontend/src/ui/divider.ts +15 -10
  252. package/frontend/src/ui/dropdown.ts +38 -21
  253. package/frontend/src/ui/for_each.ts +9 -8
  254. package/frontend/src/ui/form.ts +26 -21
  255. package/frontend/src/ui/frame_modes.ts +13 -17
  256. package/frontend/src/ui/google_map.ts +15 -13
  257. package/frontend/src/ui/gradient.ts +9 -8
  258. package/frontend/src/ui/image.ts +108 -86
  259. package/frontend/src/ui/input.ts +145 -144
  260. package/frontend/src/ui/link.ts +25 -23
  261. package/frontend/src/ui/list.ts +12 -6
  262. package/frontend/src/ui/loader_button.ts +26 -25
  263. package/frontend/src/ui/loaders.ts +12 -11
  264. package/frontend/src/ui/popup.ts +168 -14
  265. package/frontend/src/ui/pseudo.ts +5 -3
  266. package/frontend/src/ui/scroller.ts +303 -294
  267. package/frontend/src/ui/slider.ts +15 -10
  268. package/frontend/src/ui/spacer.ts +14 -11
  269. package/frontend/src/ui/span.ts +6 -2
  270. package/frontend/src/ui/stack.ts +196 -183
  271. package/frontend/src/ui/steps.ts +38 -22
  272. package/frontend/src/ui/style.ts +7 -4
  273. package/frontend/src/ui/switch.ts +16 -11
  274. package/frontend/src/ui/table.ts +42 -34
  275. package/frontend/src/ui/tabs.ts +20 -19
  276. package/frontend/src/ui/text.ts +12 -11
  277. package/frontend/src/ui/title.ts +22 -20
  278. package/frontend/src/ui/ui.ts +0 -2
  279. package/frontend/src/ui/view.ts +20 -19
  280. package/frontend/src/volt.ts +3 -1
  281. package/frontend/{compile.js → tools/compile.old.js} +2 -2
  282. package/frontend/tools/embed_scripts.js +69 -0
  283. package/frontend/tsconfig.json +26 -0
  284. package/package.json +7 -6
  285. package/frontend/dist/ui/theme.d.ts +0 -25
  286. package/frontend/exports.json +0 -1340
  287. package/frontend/src/modules/date.js +0 -535
  288. package/frontend/src/ui/color.ts +0 -117
  289. package/frontend/src/ui/theme.ts +0 -279
  290. /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
@@ -4,13 +4,13 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, isVElement } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, isVElement, VElementTagMap } from "../elements/module.js"
8
8
  import { VStack, VStackElement, HStack, HStackElement } from "./stack"
9
9
  import { Divider, DividerElement } from "./divider"
10
10
  import { Span } from "./span"
11
11
  import { ForEach } from "./for_each"
12
12
 
13
- interface ContentObject {
13
+ export interface StepContentOptions {
14
14
  content: any[];
15
15
  title?: string;
16
16
  hstack?: boolean;
@@ -50,24 +50,26 @@ interface ContentObject {
50
50
  @type: string, number
51
51
  @default: "1.25em"
52
52
  */
53
- @Elements.register
54
- export class StepsElement extends VStackElement {
55
-
56
- static default_style = {
57
- ...VStackElement.default_style,
58
- "--steps-tint": "gray",
59
- "--steps-tint-opac": 1,
60
- "--steps-step-bg": "gray",
61
- "--steps-step-border": "gray",
62
- "--steps-step-border-radius": "50%",
63
- "--steps-div-bg": "gray",
64
- };
53
+ @Elements.create({
54
+ name: "StepsElement",
55
+ default_style: {
56
+ ...VStackElement.default_style,
57
+ "--steps-tint": "gray",
58
+ "--steps-tint-opac": 1,
59
+ "--steps-step-bg": "gray",
60
+ "--steps-step-border": "gray",
61
+ "--steps-step-border-radius": "50%",
62
+ "--steps-div-bg": "gray",
63
+ },
64
+ })
65
+ export class StepsElement extends (VStackElement as any as VElementBaseSignature) {
65
66
 
66
67
  public _tint: string;
67
68
  public _tint_opac: number;
68
69
  public _step_bg: string;
69
70
  public _step_border: string;
70
71
  public _step_border_radius: string;
72
+ public _step_margin_right: string = "1em";
71
73
  public _div_bg: string;
72
74
  public _step_nr_nodes: (VStackElement & { bg: VStackElement }) [] = [];
73
75
  public _step_nodes: HStackElement[] = [];
@@ -77,15 +79,13 @@ export class StepsElement extends VStackElement {
77
79
  // Constructor.
78
80
  constructor({
79
81
  content = [],
80
- spacing = "1.25em",
81
82
  }: {
82
- content: any[] | any[][] | ContentObject[],
83
- spacing?: string | number,
83
+ content: any[] | any[][] | StepContentOptions[],
84
84
  }) {
85
85
 
86
86
  // Inherit.
87
87
  super();
88
- this._init_derived({
88
+ this._init({
89
89
  derived: StepsElement,
90
90
  });
91
91
 
@@ -97,7 +97,7 @@ export class StepsElement extends VStackElement {
97
97
  if (Array.isArray(content[i]) || isVElement(content[i])) {
98
98
  content[i] = {
99
99
  content: content[i],
100
- } as ContentObject;
100
+ } as StepContentOptions;
101
101
  }
102
102
  }
103
103
 
@@ -110,6 +110,7 @@ export class StepsElement extends VStackElement {
110
110
  this._div_bg = StepsElement.default_style["--steps-div-bg"];
111
111
 
112
112
  // Build.
113
+ const spacing = "1.25em";
113
114
  this.append(ForEach(content, (item, index, is_last) => {
114
115
 
115
116
  // Build divider.
@@ -125,7 +126,7 @@ export class StepsElement extends VStackElement {
125
126
  // Build content.
126
127
  const content = (item.hstack ? HStack() : VStack())
127
128
  .z_index(1)
128
- // .width(100%)
129
+ // .width("100%")
129
130
  .stretch(true)
130
131
  .overflow("hidden"); // required otherwise when inside Tabs will mess up.
131
132
  if (typeof item.title === "string") {
@@ -170,7 +171,7 @@ export class StepsElement extends VStackElement {
170
171
  .font_size("0.7em")
171
172
  .flex_shrink(0)
172
173
  .frame("1.8em", "1.8em")
173
- .margin("0.2em", "1em", null, null)
174
+ .margin("0.2em", this._step_margin_right, null, null)
174
175
  // .border_radius(this._step_border_radius)
175
176
  .border_radius(5)
176
177
  .border(1, this._step_border)
@@ -181,7 +182,7 @@ export class StepsElement extends VStackElement {
181
182
  divider,
182
183
  content,
183
184
  )
184
- .fixed_width(100%)
185
+ .fixed_width("100%")
185
186
  .margin_top(index > 0 ? spacing : 0)
186
187
  .position("relative")
187
188
  .exec(e => this._step_nodes.append(e))
@@ -311,6 +312,21 @@ export class StepsElement extends VStackElement {
311
312
  return this;
312
313
  }
313
314
 
315
+ /* @docs:
316
+ @title: Set step number border radius
317
+ @description: Set or get the step number border radius.
318
+ */
319
+ step_number_margin_right(): string;
320
+ step_number_margin_right(value: string): this;
321
+ step_number_margin_right(value?: string): this | string {
322
+ if (value == null) { return this._step_margin_right; }
323
+ this._step_margin_right = value;
324
+ this._step_nr_nodes.iterate(node => {
325
+ node.margin_right(value);
326
+ })
327
+ return this;
328
+ }
329
+
314
330
  /* @docs:
315
331
  @title: Iterate step number nodes
316
332
  @description: Iterate the step number nodes. When the callback returns any non null value the iteration will be stopped.
@@ -4,12 +4,15 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VHTMLElement } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VHTMLElement } from "../elements/module.js"
8
8
 
9
9
  // Span.
10
- @Elements.register
11
- export class StyleElement extends VHTMLElement {
12
- static element_tag = "section";
10
+ @Elements.create({
11
+ name: "StyleElement",
12
+ tag: "section",
13
+ })
14
+ export class StyleElement extends (VHTMLElement as any as VElementBaseSignature) {
15
+
13
16
  constructor(style?: CSSStyleDeclaration) {
14
17
 
15
18
  // Initialize base class.
@@ -4,18 +4,21 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement } from "../elements/module.js"
8
8
  import { VStack, VStackElement } from "./stack"
9
9
 
10
- // Switch button.
11
- @Elements.register
12
- export class SwitchElement extends VStackElement {
10
+ export namespace SwitchElement {
11
+ export type OnChangeCallback<This> = (element: This, enabled: boolean) => void;
12
+ }
13
13
 
14
- // Macros.
15
- #macro OnChangeCallback ((element: SwitchElement, enabled: boolean) => void)
14
+ // Switch button.
15
+ @Elements.create({
16
+ name: "SwitchElement",
17
+ })
18
+ export class SwitchElement extends (VStackElement as any as VElementBaseSignature) {
16
19
 
17
20
  // Attributes.
18
- public on_change_handler: OnChangeCallback;
21
+ public on_change_handler: SwitchElement.OnChangeCallback<this>;
19
22
  public _enabled: boolean;
20
23
  public _enabled_color: string;
21
24
  public _disabled_color: string
@@ -29,7 +32,9 @@ export class SwitchElement extends VStackElement {
29
32
 
30
33
  // Initialize base class.
31
34
  super();
32
- this._init_derived({ derived: SwitchElement, });
35
+ this._init({
36
+ derived: SwitchElement,
37
+ });
33
38
 
34
39
  // The slider background.
35
40
  this.slider = VStack()
@@ -269,11 +274,11 @@ export class SwitchElement extends VStackElement {
269
274
 
270
275
  // Set the on change handler.
271
276
  // @ts-expect-error
272
- on_change() : OnChangeCallback;
277
+ on_change(): SwitchElement.OnChangeCallback<this>;
273
278
  // @ts-expect-error
274
- on_change(handler: OnChangeCallback) : this;
279
+ on_change(handler: SwitchElement.OnChangeCallback<this>) : this;
275
280
  // @ts-expect-error
276
- on_change(handler?: OnChangeCallback) : OnChangeCallback | this {
281
+ on_change(handler?: SwitchElement.OnChangeCallback<this>): SwitchElement.OnChangeCallback<this> | this {
277
282
  if (handler == null) {
278
283
  return this.on_change_handler;
279
284
  }
@@ -4,16 +4,17 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap, VDivElement } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap, VDivElement } from "../elements/module.js"
8
8
  import { Scheme } from "../modules/scheme"
9
9
 
10
10
  // Table head element.
11
- @Elements.register
12
- export class TableHeadElement extends VElementTagMap.thead {
13
-
14
- static default_style = {
11
+ @Elements.create({
12
+ name: "TableHeadElement",
13
+ default_style: {
15
14
  "padding": "0px",
16
- };
15
+ },
16
+ })
17
+ export class TableHeadElement extends VElementTagMap.thead {
17
18
 
18
19
  // Constructor.
19
20
  constructor(...content: any[]) {
@@ -32,13 +33,14 @@ export const NullTableHead = Elements.create_null(TableHeadElement);
32
33
  declare module './any_element.d.ts' { interface AnyElementMap { TableHeadElement: TableHeadElement }}
33
34
 
34
35
  // Table header element.
35
- @Elements.register
36
- export class TableHeaderElement extends VElementTagMap.th {
37
-
38
- static default_style = {
36
+ @Elements.create({
37
+ name: "TableHeaderElement",
38
+ default_style: {
39
39
  "text-align": "left",
40
40
  "padding": "0px 10px",
41
- };
41
+ },
42
+ })
43
+ export class TableHeaderElement extends VElementTagMap.th {
42
44
 
43
45
  // Constructor.
44
46
  constructor(...content: any[]) {
@@ -57,12 +59,13 @@ export const NullTableHeader = Elements.create_null(TableHeaderElement);
57
59
  declare module './any_element.d.ts' { interface AnyElementMap { TableHeaderElement: TableHeaderElement }}
58
60
 
59
61
  // Table body element.
60
- @Elements.register
61
- export class TableBodyElement extends VElementTagMap.tbody {
62
-
63
- static default_style = {
62
+ @Elements.create({
63
+ name: "TableBodyElement",
64
+ default_style: {
64
65
  "padding": "0px",
65
- };
66
+ },
67
+ })
68
+ export class TableBodyElement extends VElementTagMap.tbody {
66
69
 
67
70
  // Constructor.
68
71
  constructor(...content: any[]) {
@@ -82,9 +85,11 @@ declare module './any_element.d.ts' { interface AnyElementMap { TableBodyElement
82
85
 
83
86
 
84
87
  // Table row element.
85
- @Elements.register
88
+ @Elements.create({
89
+ name: "TableRowElement",
90
+ })
86
91
  export class TableRowElement extends VElementTagMap.tr {
87
-
92
+
88
93
  // Constructor.
89
94
  constructor(...content: any[]) {
90
95
 
@@ -102,13 +107,14 @@ export const NullTableRow = Elements.create_null(TableRowElement);
102
107
  declare module './any_element.d.ts' { interface AnyElementMap { TableRowElement: TableRowElement }}
103
108
 
104
109
  // Table data element.
105
- @Elements.register
106
- export class TableDataElement extends VElementTagMap.td {
107
-
108
- static default_style = {
110
+ @Elements.create({
111
+ name: "TableDataElement",
112
+ default_style: {
109
113
  "text-align": "left",
110
114
  "padding": "0px 10px",
111
- };
115
+ },
116
+ })
117
+ export class TableDataElement extends VElementTagMap.td {
112
118
 
113
119
  // Constructor.
114
120
  constructor(...content: any[]) {
@@ -129,15 +135,16 @@ declare module './any_element.d.ts' { interface AnyElementMap { TableDataElement
129
135
  // Inner Table element.
130
136
  // Use a container for the Table element so a border color + border radius can be set.
131
137
  // Since border-collapse collapse prevents a border radius but is required for different background for the table head.
132
- @Elements.register
133
- export class InnerTableElement extends VElementTagMap.table {
134
-
135
- static default_style = {
138
+ @Elements.create({
139
+ name: "InnerTableElement",
140
+ default_style: {
136
141
  "border-collapse": "collapse", /* Ensures there is no spacing between table cells */
137
142
  "padding": "0",
138
143
  "margin": 0,
139
144
  "border-spacing": 0, /* Removes any default spacing between cells */
140
- };
145
+ },
146
+ })
147
+ export class InnerTableElement extends VElementTagMap.table {
141
148
 
142
149
  // Constructor.
143
150
  constructor(...content: any[]) {
@@ -156,12 +163,13 @@ export const NullInnerTable = Elements.create_null(InnerTableElement);
156
163
  declare module './any_element.d.ts' { interface AnyElementMap { InnerTableElement: InnerTableElement }}
157
164
 
158
165
  // Table data element.
159
- @Elements.register
160
- export class TableElement extends VElementTagMap.div {
161
-
162
- static default_style = {
166
+ @Elements.create({
167
+ name: "TableElement",
168
+ default_style: {
163
169
  "color": "black",
164
- };
170
+ },
171
+ })
172
+ export class TableElement extends VElementTagMap.div {
165
173
 
166
174
  // Attributes.
167
175
  public table_rows: TableRowElement[];
@@ -268,7 +276,7 @@ export class TableElement extends VElementTagMap.div {
268
276
  )
269
277
  .parent(this),
270
278
  )
271
- .width(100%)
279
+ .width("100%")
272
280
  )
273
281
  }
274
282
 
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement } from "../elements/module.js"
8
8
  import { Scheme } from "../modules/scheme"
9
9
  import { VStack, VStackElement, HStack, HStackElement, ZStack } from "./stack"
10
10
  import { ForEach } from "./for_each"
@@ -60,20 +60,21 @@ type OnTabHeader = ((name: string, header: HStackElement, tab: TabsElement) => a
60
60
  A callback that can be set to edit the tab's header title node.
61
61
  The callback takes the arguments local header node and parent tabs node as `(header_node, tabs_node)`.
62
62
  */
63
- @Elements.register
64
- export class TabsElement extends VStackElement {
65
-
66
- static default_style = {
67
- ...VStackElement.default_style,
68
- "font-size": "16px",
69
- "font-weight": "500",
70
- "overflow-x": "hidden",
71
- "width": "100%",
72
- "--tabs-tint": "blue",
73
- "--tabs-tab-opac": 0.8,
74
- "--tabs-div-bg": "gray",
75
- "--tabs-div-opac": 0.5,
76
- };
63
+ @Elements.create({
64
+ name: "TabsElement",
65
+ default_style: {
66
+ ...VStackElement.default_style,
67
+ "font-size": "16px",
68
+ "font-weight": "500",
69
+ "overflow-x": "hidden",
70
+ "width": "100%",
71
+ "--tabs-tint": "blue",
72
+ "--tabs-tab-opac": 0.8,
73
+ "--tabs-div-bg": "gray",
74
+ "--tabs-div-opac": 0.5,
75
+ },
76
+ })
77
+ export class TabsElement extends (VStackElement as any as VElementBaseSignature) {
77
78
 
78
79
  // Attributes.
79
80
  public _tint: string;
@@ -101,7 +102,7 @@ export class TabsElement extends VStackElement {
101
102
 
102
103
  // Inherit.
103
104
  super();
104
- this._init_derived({
105
+ this._init({
105
106
  derived: TabsElement,
106
107
  })
107
108
 
@@ -293,10 +294,10 @@ export class TabsElement extends VStackElement {
293
294
  return item;
294
295
  }),
295
296
  )
296
- .width(100%),
297
+ .width("100%"),
297
298
 
298
299
  this._div = Divider()
299
- .frame(100%, 1)
300
+ .frame("100%", 1)
300
301
  .background(this._div_bg)
301
302
  .margin(1, 0, 25, 0),
302
303
 
@@ -316,7 +317,7 @@ export class TabsElement extends VStackElement {
316
317
  if (content_stack.overflow_x() === "visible") {
317
318
  content_stack.overflow_x("hidden");
318
319
  }
319
- content_stack.width(100%);
320
+ content_stack.width("100%");
320
321
  content_stack.transition(`opacity ${this._duration}ms ease-in-out`)
321
322
  zstack.append(content_stack);
322
323
  ++index;
@@ -4,20 +4,21 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap } from "../elements/module.js"
8
8
 
9
9
  // Text.
10
- @Elements.register
10
+ @Elements.create({
11
+ name: "TextElement",
12
+ default_style: {
13
+ "margin": "0px 0px 0px 0px",
14
+ "padding": "0", // 2.5px
15
+ "font-size": "20px",
16
+ "color": "inherit",
17
+ "text-align": "inherit",
18
+ "white-space": "wrap",
19
+ }
20
+ })
11
21
  export class TextElement extends VElementTagMap.p {
12
-
13
- static default_style = {
14
- "margin": "0px 0px 0px 0px",
15
- "padding": "0", // 2.5px
16
- "font-size": "20px",
17
- "color": "inherit",
18
- "text-align": "inherit",
19
- "white-space": "wrap",
20
- };
21
22
 
22
23
  // Constructor.
23
24
  constructor(text?: string) {
@@ -4,19 +4,20 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap } from "../elements/module.js"
8
8
 
9
9
  // Title.
10
- @Elements.register
10
+ @Elements.create({
11
+ name: "TitleElement",
12
+ default_style: {
13
+ "margin": "0px 0px 0px 0px",
14
+ "color": "inherit",
15
+ "white-space": "wrap",
16
+ "text-align": "inherit",
17
+ "font-weight": "700", // for safari since it inherits HTMLElement only.
18
+ }
19
+ })
11
20
  export class TitleElement extends VElementTagMap.h1 {
12
-
13
- static default_style = {
14
- "margin": "0px 0px 0px 0px",
15
- "color": "inherit",
16
- "white-space": "wrap",
17
- "text-align": "inherit",
18
- "font-weight": "700", // for safari since it inherits HTMLElement only.
19
- }
20
21
 
21
22
  // Constructor.
22
23
  constructor(text: string = "") {
@@ -35,17 +36,18 @@ export const NullTitle = Elements.create_null(TitleElement);
35
36
  declare module './any_element.d.ts' { interface AnyElementMap { TitleElement: TitleElement }}
36
37
 
37
38
  // Subtitle.
38
- @Elements.register
39
+ @Elements.create({
40
+ name: "SubtitleElement",
41
+ tag: "h2",
42
+ default_style: {
43
+ "margin": "0px 0px 0px 0px",
44
+ "color": "inherit",
45
+ "white-space": "wrap",
46
+ "text-align": "inherit",
47
+ "font-weight": "700", // for safari since it inherits HTMLElement only.
48
+ },
49
+ })
39
50
  export class SubtitleElement extends VElementTagMap.h1 {
40
-
41
- static element_tag = "h2";
42
- static default_style = {
43
- "margin": "0px 0px 0px 0px",
44
- "color": "inherit",
45
- "white-space": "wrap",
46
- "text-align": "inherit",
47
- "font-weight": "700", // for safari since it inherits HTMLElement only.
48
- };
49
51
 
50
52
  // Constructor.
51
53
  constructor(text: string = "") {
@@ -8,7 +8,6 @@ export * from "./border_button.js"
8
8
  export * from "./canvas.js"
9
9
  export * from "./checkbox.js"
10
10
  export * from "./code.js"
11
- export * from "./color.js"
12
11
  export * from "./context_menu.js"
13
12
  export * from "./css.js"
14
13
  export * from "./divider.js"
@@ -34,7 +33,6 @@ export * from "./switch.js"
34
33
  export * from "./table.js"
35
34
  export * from "./tabs.js"
36
35
  export * from "./text.js"
37
- export * from "./theme.js"
38
36
  export * from "./title.js"
39
37
  export * from "./view.js"
40
38
  export type { AnyElement } from "./any_element.d.ts"
@@ -4,30 +4,31 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap, AppendType } from "../elements/module.js"
8
8
 
9
9
  // Scroller.
10
- @Elements.register
10
+ @Elements.create({
11
+ name: "ViewElement",
12
+ default_style: {
13
+ "position": "absolute",
14
+ "top": "0",
15
+ "right": "0",
16
+ "bottom": "0",
17
+ "left": "0",
18
+ "padding": "0px",
19
+ "overflow": "hidden",
20
+ "overflow-y": "none",
21
+ "background": "none",
22
+ "display": "flex", // to support vertical spacers.
23
+ // "text-align": "start",
24
+ "align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
25
+ "flex-direction": "column",
26
+ },
27
+ })
11
28
  export class ViewElement extends VElementTagMap.div {
12
-
13
- static default_style = {
14
- "position": "absolute",
15
- "top": "0",
16
- "right": "0",
17
- "bottom": "0",
18
- "left": "0",
19
- "padding": "0px",
20
- "overflow": "hidden",
21
- "overflow-y": "none",
22
- "background": "none",
23
- "display": "flex", // to support vertical spacers.
24
- // "text-align": "start",
25
- "align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
26
- "flex-direction": "column",
27
- };
28
29
 
29
30
  // Constructor.
30
- constructor(...children: any[]) {
31
+ constructor(...children: AppendType[]) {
31
32
 
32
33
  // Initialize base class.
33
34
  super({
@@ -9,7 +9,8 @@ export * from "./modules/string.js" // @noexport
9
9
  export * from "./modules/array.js" // @noexport
10
10
  export * from "./modules/object.js" // @noexport
11
11
  export * from "./modules/auth.js"
12
- export * from "./modules/colors.js"
12
+ export * from "./modules/color.js"
13
+ // export * from "./modules/colors.js"
13
14
  export * from "./modules/compression.js"
14
15
  export * from "./modules/cookies.js"
15
16
  export * from "./modules/date.js" // @todo
@@ -23,6 +24,7 @@ export * from "./modules/support.js"
23
24
  export * from "./modules/themes.js"
24
25
  export * from "./modules/user.js"
25
26
  export * from "./modules/utils.js"
27
+ export * from "./modules/theme.js"
26
28
 
27
29
  // Elements.
28
30
  export * from "./elements/module.js"
@@ -8,8 +8,8 @@ import * as vhighlight from "/Users/administrator/persistance/private/dev/vinc/v
8
8
  // -------------------------------------------------------------------------------------------------------------------------
9
9
  // Compile Test.
10
10
 
11
- import * as Preprocessing from "../backend/dist/esm/plugins/ts/preprocessing.js";
12
- import * as TypeScript from "../backend/dist/esm/plugins/ts/compiler.js";
11
+ import * as Preprocessing from "../../backend/dist/esm/plugins/ts/preprocessing.js";
12
+ import * as TypeScript from "../../backend/dist/esm/plugins/ts/compiler.js";
13
13
 
14
14
  import * as ts from "typescript";
15
15
  import * as fs from "fs";