@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.
- package/backend/dist/cjs/database.d.ts +41 -68
- package/backend/dist/cjs/database.js +136 -78
- package/backend/dist/cjs/endpoint.d.ts +23 -9
- package/backend/dist/cjs/endpoint.js +98 -21
- package/backend/dist/cjs/file_watcher.js +2 -2
- package/backend/dist/cjs/frontend.d.ts +0 -2
- package/backend/dist/cjs/frontend.js +9 -9
- package/backend/dist/cjs/image_endpoint.d.ts +3 -1
- package/backend/dist/cjs/image_endpoint.js +2 -1
- package/backend/dist/cjs/payments/paddle.js +10 -2
- package/backend/dist/cjs/plugins/css.d.ts +6 -5
- package/backend/dist/cjs/plugins/css.js +32 -7
- package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
- package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/cjs/server.d.ts +7 -13
- package/backend/dist/cjs/server.js +184 -303
- package/backend/dist/cjs/status.d.ts +1 -0
- package/backend/dist/cjs/status.js +2 -1
- package/backend/dist/cjs/stream.d.ts +5 -3
- package/backend/dist/cjs/stream.js +13 -4
- package/backend/dist/cjs/users.d.ts +1 -1
- package/backend/dist/cjs/users.js +87 -72
- package/backend/dist/cjs/utils.d.ts +17 -9
- package/backend/dist/cjs/utils.js +22 -64
- package/backend/dist/cjs/view.d.ts +2 -2
- package/backend/dist/cjs/view.js +38 -40
- package/backend/dist/cjs/volt.d.ts +3 -2
- package/backend/dist/cjs/volt.js +2 -2
- package/backend/dist/css/volt.css +5 -0
- package/backend/dist/esm/database.d.ts +41 -68
- package/backend/dist/esm/database.js +137 -79
- package/backend/dist/esm/endpoint.d.ts +23 -9
- package/backend/dist/esm/endpoint.js +99 -22
- package/backend/dist/esm/file_watcher.js +2 -2
- package/backend/dist/esm/frontend.d.ts +0 -2
- package/backend/dist/esm/frontend.js +9 -9
- package/backend/dist/esm/image_endpoint.d.ts +3 -1
- package/backend/dist/esm/image_endpoint.js +2 -1
- package/backend/dist/esm/payments/paddle.js +11 -3
- package/backend/dist/esm/plugins/css.d.ts +6 -5
- package/backend/dist/esm/plugins/css.js +32 -6
- package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm/plugins/ts/compiler.js +26 -2
- package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/esm/server.d.ts +7 -13
- package/backend/dist/esm/server.js +182 -301
- package/backend/dist/esm/status.d.ts +1 -0
- package/backend/dist/esm/status.js +1 -0
- package/backend/dist/esm/stream.d.ts +5 -3
- package/backend/dist/esm/stream.js +13 -4
- package/backend/dist/esm/users.d.ts +1 -1
- package/backend/dist/esm/users.js +87 -72
- package/backend/dist/esm/utils.d.ts +17 -9
- package/backend/dist/esm/utils.js +21 -62
- package/backend/dist/esm/view.d.ts +2 -2
- package/backend/dist/esm/view.js +38 -40
- package/backend/dist/esm/volt.d.ts +3 -2
- package/backend/dist/esm/volt.js +2 -1
- package/backend/dist/esm-dev/blacklist.js +1 -1
- package/backend/dist/esm-dev/cli.js +2 -2
- package/backend/dist/esm-dev/database.d.ts +41 -68
- package/backend/dist/esm-dev/database.js +138 -80
- package/backend/dist/esm-dev/endpoint.d.ts +23 -9
- package/backend/dist/esm-dev/endpoint.js +100 -23
- package/backend/dist/esm-dev/file_watcher.js +3 -3
- package/backend/dist/esm-dev/frontend.d.ts +0 -2
- package/backend/dist/esm-dev/frontend.js +9 -9
- package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
- package/backend/dist/esm-dev/image_endpoint.js +2 -1
- package/backend/dist/esm-dev/logger.js +1 -1
- package/backend/dist/esm-dev/payments/paddle.js +12 -4
- package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
- package/backend/dist/esm-dev/plugins/css.js +33 -7
- package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
- package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
- package/backend/dist/esm-dev/rate_limit.js +1 -1
- package/backend/dist/esm-dev/server.d.ts +7 -13
- package/backend/dist/esm-dev/server.js +184 -303
- package/backend/dist/esm-dev/status.d.ts +1 -0
- package/backend/dist/esm-dev/status.js +1 -0
- package/backend/dist/esm-dev/stream.d.ts +5 -3
- package/backend/dist/esm-dev/stream.js +13 -4
- package/backend/dist/esm-dev/users.d.ts +1 -1
- package/backend/dist/esm-dev/users.js +88 -73
- package/backend/dist/esm-dev/utils.d.ts +17 -9
- package/backend/dist/esm-dev/utils.js +22 -63
- package/backend/dist/esm-dev/view.d.ts +2 -2
- package/backend/dist/esm-dev/view.js +39 -41
- package/backend/dist/esm-dev/volt.d.ts +3 -2
- package/backend/dist/esm-dev/volt.js +2 -1
- package/backend/src/database.ts +173 -155
- package/backend/src/endpoint.ts +123 -31
- package/backend/src/file_watcher.ts +2 -2
- package/backend/src/frontend.ts +9 -8
- package/backend/src/image_endpoint.ts +4 -0
- package/backend/src/payments/paddle.ts +11 -3
- package/backend/src/plugins/css.ts +36 -8
- package/backend/src/plugins/ts/compiler.ts +37 -1
- package/backend/src/plugins/ts/preprocessing.ts +5 -3
- package/backend/src/server.ts +167 -306
- package/backend/src/status.ts +1 -0
- package/backend/src/stream.ts +28 -8
- package/backend/src/users.ts +87 -72
- package/backend/src/utils.ts +58 -25
- package/backend/src/view.ts +30 -28
- package/backend/src/{volt.js → volt.ts} +2 -1
- package/backend/tsconfig.cjs.json +3 -3
- package/backend/tsconfig.esm.json +3 -3
- package/frontend/dist/elements/base.d.ts +414 -432
- package/frontend/dist/elements/base.js +566 -329
- package/frontend/dist/elements/module.d.ts +26 -12
- package/frontend/dist/elements/module.js +69 -32
- package/frontend/dist/elements/register_element.d.ts +3 -0
- package/frontend/dist/elements/register_element.js +22 -0
- package/frontend/dist/modules/auth.d.ts +1 -0
- package/frontend/dist/modules/auth.js +6 -5
- package/frontend/dist/modules/color.d.ts +159 -0
- package/frontend/dist/modules/color.js +315 -0
- package/frontend/dist/modules/colors.d.ts +1 -26
- package/frontend/dist/modules/colors.js +417 -340
- package/frontend/dist/modules/cookies.d.ts +1 -0
- package/frontend/dist/modules/cookies.js +1 -0
- package/frontend/dist/modules/events.d.ts +1 -0
- package/frontend/dist/modules/events.js +1 -0
- package/frontend/dist/modules/google.d.ts +1 -0
- package/frontend/dist/modules/google.js +1 -0
- package/frontend/dist/modules/meta.d.ts +1 -0
- package/frontend/dist/modules/meta.js +1 -0
- package/frontend/dist/modules/mutex.d.ts +1 -2
- package/frontend/dist/modules/mutex.js +3 -4
- package/frontend/dist/modules/paddle.d.ts +1 -0
- package/frontend/dist/modules/paddle.js +14 -13
- package/frontend/dist/modules/scheme.d.ts +1 -0
- package/frontend/dist/modules/scheme.js +5 -3
- package/frontend/dist/modules/statics.d.ts +1 -0
- package/frontend/dist/modules/statics.js +1 -0
- package/frontend/dist/modules/support.d.ts +1 -0
- package/frontend/dist/modules/support.js +3 -2
- package/frontend/dist/modules/theme.d.ts +56 -0
- package/frontend/dist/{ui → modules}/theme.js +186 -75
- package/frontend/dist/modules/themes.d.ts +1 -1
- package/frontend/dist/modules/themes.js +1 -0
- package/frontend/dist/modules/user.d.ts +1 -0
- package/frontend/dist/modules/user.js +11 -10
- package/frontend/dist/modules/utils.d.ts +23 -2
- package/frontend/dist/modules/utils.js +93 -1
- package/frontend/dist/types/gradient.js +4 -0
- package/frontend/dist/ui/border_button.d.ts +0 -25
- package/frontend/dist/ui/border_button.js +50 -51
- package/frontend/dist/ui/button.d.ts +0 -21
- package/frontend/dist/ui/button.js +41 -46
- package/frontend/dist/ui/canvas.js +15 -15
- package/frontend/dist/ui/checkbox.d.ts +3 -17
- package/frontend/dist/ui/checkbox.js +36 -30
- package/frontend/dist/ui/code.d.ts +15 -82
- package/frontend/dist/ui/code.js +150 -125
- package/frontend/dist/ui/color.d.ts +0 -1
- package/frontend/dist/ui/color.js +1 -1
- package/frontend/dist/ui/context_menu.d.ts +4 -2
- package/frontend/dist/ui/context_menu.js +16 -17
- package/frontend/dist/ui/css.js +2 -0
- package/frontend/dist/ui/divider.d.ts +0 -7
- package/frontend/dist/ui/divider.js +21 -25
- package/frontend/dist/ui/dropdown.d.ts +13 -7
- package/frontend/dist/ui/dropdown.js +65 -30
- package/frontend/dist/ui/for_each.d.ts +0 -5
- package/frontend/dist/ui/for_each.js +17 -22
- package/frontend/dist/ui/form.d.ts +17 -12
- package/frontend/dist/ui/form.js +21 -18
- package/frontend/dist/ui/frame_modes.d.ts +9 -12
- package/frontend/dist/ui/frame_modes.js +8 -10
- package/frontend/dist/ui/google_map.d.ts +0 -11
- package/frontend/dist/ui/google_map.js +23 -28
- package/frontend/dist/ui/gradient.d.ts +0 -5
- package/frontend/dist/ui/gradient.js +17 -22
- package/frontend/dist/ui/image.d.ts +27 -58
- package/frontend/dist/ui/image.js +99 -93
- package/frontend/dist/ui/input.d.ts +20 -97
- package/frontend/dist/ui/input.js +192 -170
- package/frontend/dist/ui/link.d.ts +0 -18
- package/frontend/dist/ui/link.js +42 -48
- package/frontend/dist/ui/list.js +36 -37
- package/frontend/dist/ui/loader_button.d.ts +4 -19
- package/frontend/dist/ui/loader_button.js +35 -37
- package/frontend/dist/ui/loaders.d.ts +0 -8
- package/frontend/dist/ui/loaders.js +20 -25
- package/frontend/dist/ui/popup.d.ts +11 -8
- package/frontend/dist/ui/popup.js +183 -24
- package/frontend/dist/ui/pseudo.d.ts +3 -3
- package/frontend/dist/ui/pseudo.js +14 -17
- package/frontend/dist/ui/scroller.d.ts +10 -48
- package/frontend/dist/ui/scroller.js +306 -300
- package/frontend/dist/ui/slider.d.ts +9 -3
- package/frontend/dist/ui/slider.js +31 -17
- package/frontend/dist/ui/spacer.d.ts +0 -9
- package/frontend/dist/ui/spacer.js +21 -26
- package/frontend/dist/ui/span.js +13 -15
- package/frontend/dist/ui/stack.d.ts +14 -75
- package/frontend/dist/ui/stack.js +166 -169
- package/frontend/dist/ui/steps.d.ts +10 -23
- package/frontend/dist/ui/steps.js +47 -34
- package/frontend/dist/ui/style.d.ts +4 -3
- package/frontend/dist/ui/style.js +13 -18
- package/frontend/dist/ui/switch.d.ts +10 -4
- package/frontend/dist/ui/switch.js +24 -16
- package/frontend/dist/ui/table.d.ts +0 -23
- package/frontend/dist/ui/table.js +113 -119
- package/frontend/dist/ui/tabs.d.ts +3 -19
- package/frontend/dist/ui/tabs.js +35 -29
- package/frontend/dist/ui/text.d.ts +0 -8
- package/frontend/dist/ui/text.js +20 -25
- package/frontend/dist/ui/title.d.ts +0 -15
- package/frontend/dist/ui/title.js +39 -45
- package/frontend/dist/ui/ui.d.ts +0 -2
- package/frontend/dist/ui/ui.js +0 -2
- package/frontend/dist/ui/view.d.ts +3 -17
- package/frontend/dist/ui/view.js +27 -32
- package/frontend/dist/volt.d.ts +2 -1
- package/frontend/dist/volt.js +3 -1
- package/frontend/examples/dashboard/dashboard.ts +774 -0
- package/frontend/examples/theme/theme.ts +58 -0
- package/frontend/src/css/volt.css +5 -0
- package/frontend/src/elements/base.ts +767 -545
- package/frontend/src/elements/module.ts +90 -29
- package/frontend/src/elements/register_element.ts +24 -0
- package/frontend/src/modules/auth.ts +7 -6
- package/frontend/src/modules/color.ts +348 -0
- package/frontend/src/modules/colors.ts +468 -449
- package/frontend/src/modules/cookies.ts +1 -0
- package/frontend/src/modules/events.ts +1 -0
- package/frontend/src/modules/google.ts +1 -0
- package/frontend/src/modules/meta.ts +2 -1
- package/frontend/src/modules/mutex.ts +2 -4
- package/frontend/src/modules/paddle.ts +21 -20
- package/frontend/src/modules/scheme.ts +5 -4
- package/frontend/src/modules/statics.ts +2 -1
- package/frontend/src/modules/support.ts +3 -2
- package/frontend/src/modules/theme.ts +413 -0
- package/frontend/src/modules/themes.ts +2 -1
- package/frontend/src/modules/user.ts +12 -11
- package/frontend/src/modules/utils.ts +125 -2
- package/frontend/src/ui/border_button.ts +41 -37
- package/frontend/src/ui/button.ts +33 -32
- package/frontend/src/ui/canvas.ts +5 -2
- package/frontend/src/ui/checkbox.ts +21 -22
- package/frontend/src/ui/code.ts +92 -86
- package/frontend/src/ui/context_menu.ts +7 -5
- package/frontend/src/ui/css.ts +1 -1
- package/frontend/src/ui/divider.ts +15 -10
- package/frontend/src/ui/dropdown.ts +38 -21
- package/frontend/src/ui/for_each.ts +9 -8
- package/frontend/src/ui/form.ts +26 -21
- package/frontend/src/ui/frame_modes.ts +13 -17
- package/frontend/src/ui/google_map.ts +15 -13
- package/frontend/src/ui/gradient.ts +9 -8
- package/frontend/src/ui/image.ts +108 -86
- package/frontend/src/ui/input.ts +145 -144
- package/frontend/src/ui/link.ts +25 -23
- package/frontend/src/ui/list.ts +12 -6
- package/frontend/src/ui/loader_button.ts +26 -25
- package/frontend/src/ui/loaders.ts +12 -11
- package/frontend/src/ui/popup.ts +168 -14
- package/frontend/src/ui/pseudo.ts +5 -3
- package/frontend/src/ui/scroller.ts +303 -294
- package/frontend/src/ui/slider.ts +15 -10
- package/frontend/src/ui/spacer.ts +14 -11
- package/frontend/src/ui/span.ts +6 -2
- package/frontend/src/ui/stack.ts +196 -183
- package/frontend/src/ui/steps.ts +38 -22
- package/frontend/src/ui/style.ts +7 -4
- package/frontend/src/ui/switch.ts +16 -11
- package/frontend/src/ui/table.ts +42 -34
- package/frontend/src/ui/tabs.ts +20 -19
- package/frontend/src/ui/text.ts +12 -11
- package/frontend/src/ui/title.ts +22 -20
- package/frontend/src/ui/ui.ts +0 -2
- package/frontend/src/ui/view.ts +20 -19
- package/frontend/src/volt.ts +3 -1
- package/frontend/{compile.js → tools/compile.old.js} +2 -2
- package/frontend/tools/embed_scripts.js +69 -0
- package/frontend/tsconfig.json +26 -0
- package/package.json +7 -6
- package/frontend/dist/ui/theme.d.ts +0 -25
- package/frontend/exports.json +0 -1340
- package/frontend/src/modules/date.js +0 -535
- package/frontend/src/ui/color.ts +0 -117
- package/frontend/src/ui/theme.ts +0 -279
- /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright: © 2022 - 2024 Daan van den Bergh.
|
|
4
4
|
*/
|
|
5
5
|
// Imports.
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { Color } from "./color.js";
|
|
7
|
+
import { Themes as ThemesModule } from "./themes.js";
|
|
8
|
+
const ThemeIdList = ["dark", "light"];
|
|
9
9
|
// Themes class.
|
|
10
10
|
/* @docs:
|
|
11
11
|
@nav: Frontend
|
|
@@ -29,12 +29,17 @@ import { Themes as ThemesModule } from "../modules/themes";
|
|
|
29
29
|
When theme attributes are retrieved, by default they will be the active theme's attribute as a css variable. So this can be passed to an element.
|
|
30
30
|
However, some element functions do not accept css variables, in this case the `value()` function can be used to retrieve the raw value. Do not forget to apply an `on_theme_update()` callback on the elements where you use this.
|
|
31
31
|
*/
|
|
32
|
-
export class
|
|
33
|
-
|
|
32
|
+
export class Theme {
|
|
33
|
+
// helper: union of all keys across all themes
|
|
34
|
+
// Attributes.
|
|
35
|
+
active_id;
|
|
36
|
+
active;
|
|
37
|
+
_attrs;
|
|
38
|
+
_css_vars;
|
|
39
|
+
_id;
|
|
40
|
+
_on_activate_callback;
|
|
41
|
+
constructor(id, themes) {
|
|
34
42
|
// Attributes.
|
|
35
|
-
this.active_id = undefined;
|
|
36
|
-
this.active = undefined;
|
|
37
|
-
this._theme_ids = [];
|
|
38
43
|
this._attrs = [];
|
|
39
44
|
this._css_vars = {};
|
|
40
45
|
this._id = id;
|
|
@@ -42,7 +47,6 @@ export class ThemeClass {
|
|
|
42
47
|
Object.keys(themes).iterate((theme) => {
|
|
43
48
|
// Initialize.
|
|
44
49
|
const theme_style = themes[theme];
|
|
45
|
-
this._theme_ids.append(theme);
|
|
46
50
|
this[theme] = theme_style;
|
|
47
51
|
// Activate first theme.
|
|
48
52
|
if (this.active_id === undefined) {
|
|
@@ -57,7 +61,68 @@ export class ThemeClass {
|
|
|
57
61
|
this._add_attr(id, theme);
|
|
58
62
|
});
|
|
59
63
|
});
|
|
64
|
+
// Ensure type.
|
|
65
|
+
if (this.active_id == null || this.active == null) {
|
|
66
|
+
throw new Error("No themes were specified in parameter \"themes\".");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Initialize a specific theme.
|
|
71
|
+
* @note This function should be called after the constructor to ensure the most recent theme is activated, argument "id" can be left undefined.
|
|
72
|
+
*/
|
|
73
|
+
initialize(id) {
|
|
74
|
+
if (id == null) {
|
|
75
|
+
id = (localStorage.getItem(this._id) ?? undefined);
|
|
76
|
+
}
|
|
77
|
+
if (id != null && ThemeIdList.includes(id)) {
|
|
78
|
+
this.activate(id);
|
|
79
|
+
}
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
// ---------------------------------------------------------------------
|
|
83
|
+
// Theme selection methods.
|
|
84
|
+
/** Get full active theme id. */
|
|
85
|
+
get id() {
|
|
86
|
+
return `${this._id}.${String(this.active_id)}`;
|
|
87
|
+
}
|
|
88
|
+
// Get cached active subtheme id.
|
|
89
|
+
get_active_id_cached() {
|
|
90
|
+
return localStorage.getItem(this._id) ?? "";
|
|
91
|
+
}
|
|
92
|
+
// Activate a theme.
|
|
93
|
+
activate(id, apply_theme_update = true) {
|
|
94
|
+
if (ThemeIdList.includes(id) === false || this[id] === undefined) {
|
|
95
|
+
throw Error(`Theme "${id}" does not exist.`);
|
|
96
|
+
}
|
|
97
|
+
this.active_id = id;
|
|
98
|
+
this.active = this[id];
|
|
99
|
+
Object.keys(this.active).iterate((id) => {
|
|
100
|
+
document.documentElement.style.setProperty(`--${this._id}_${id}`, this.active[id] ?? "");
|
|
101
|
+
});
|
|
102
|
+
if (this._on_activate_callback != null) {
|
|
103
|
+
this._on_activate_callback(this, this.active_id);
|
|
104
|
+
}
|
|
105
|
+
if (apply_theme_update) {
|
|
106
|
+
ThemesModule.apply_theme_update();
|
|
107
|
+
}
|
|
108
|
+
localStorage.setItem(this._id, String(this.active_id));
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
on_activate(callback) {
|
|
112
|
+
if (callback == null) {
|
|
113
|
+
return this._on_activate_callback;
|
|
114
|
+
}
|
|
115
|
+
this._on_activate_callback = callback;
|
|
116
|
+
return this;
|
|
60
117
|
}
|
|
118
|
+
// Toggle themes.
|
|
119
|
+
toggle(apply_theme_update = true) {
|
|
120
|
+
const other = this.active_id === "dark" ? "light" : "dark";
|
|
121
|
+
this.activate(other, apply_theme_update);
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
124
|
+
// ---------------------------------------------------------------------
|
|
125
|
+
// Adding values.
|
|
61
126
|
// Add a new attribute.
|
|
62
127
|
_add_attr(id, theme) {
|
|
63
128
|
if (theme == null) {
|
|
@@ -112,18 +177,8 @@ export class ThemeClass {
|
|
|
112
177
|
// Response.
|
|
113
178
|
return this;
|
|
114
179
|
}
|
|
115
|
-
get
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
// Initialize by cached.
|
|
119
|
-
initialize(id) {
|
|
120
|
-
if (id == null) {
|
|
121
|
-
id = localStorage.getItem(this._id) ?? undefined;
|
|
122
|
-
}
|
|
123
|
-
if (id != null && this._theme_ids.includes(id)) {
|
|
124
|
-
this.activate(id);
|
|
125
|
-
}
|
|
126
|
-
return this;
|
|
180
|
+
get raw() {
|
|
181
|
+
return this.active;
|
|
127
182
|
}
|
|
128
183
|
// Get raw value.
|
|
129
184
|
value(id) {
|
|
@@ -132,16 +187,65 @@ export class ThemeClass {
|
|
|
132
187
|
}
|
|
133
188
|
return this.active[id];
|
|
134
189
|
}
|
|
190
|
+
// ---------------------------------------------------------------------
|
|
191
|
+
// Color manipulation methods.
|
|
192
|
+
// Create a new color for each theme.
|
|
193
|
+
create(id, create_theme_value) {
|
|
194
|
+
// Already created.
|
|
195
|
+
if (this._css_vars[id]) {
|
|
196
|
+
throw new Error(`Color "${id}" already exists.`);
|
|
197
|
+
}
|
|
198
|
+
// Iterate.
|
|
199
|
+
let index = 0;
|
|
200
|
+
for (const theme_id of ThemeIdList) {
|
|
201
|
+
const theme = this[theme_id];
|
|
202
|
+
const value = create_theme_value(theme_id, theme);
|
|
203
|
+
theme[id] = value;
|
|
204
|
+
// Add attribute to document on first call.
|
|
205
|
+
if (index === 0) {
|
|
206
|
+
this._add_attr(id);
|
|
207
|
+
}
|
|
208
|
+
// Set property.
|
|
209
|
+
if (this.active_id === theme_id) {
|
|
210
|
+
document.documentElement.style.setProperty(`--${this._id}_${id}`, theme[id]);
|
|
211
|
+
}
|
|
212
|
+
// Incr index
|
|
213
|
+
++index;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Auto darken lighten a color from the theme
|
|
218
|
+
* Safe to call multiple times, caching is implemented.
|
|
219
|
+
*
|
|
220
|
+
* @warning The input color must be a hex / rgb(a) string.
|
|
221
|
+
* @param theme_attr The name of the original theme color.
|
|
222
|
+
* @param percent Percentage between 0. and 1.0.
|
|
223
|
+
*/
|
|
224
|
+
auto_darken_lighten(theme_attr, percent = 0.5, reversed = false) {
|
|
225
|
+
let full_id = `${String(theme_attr)}_adl_${percent}`;
|
|
226
|
+
full_id = full_id.replaceAll(".", "_");
|
|
227
|
+
if (this._css_vars[full_id]) {
|
|
228
|
+
return this._css_vars[full_id];
|
|
229
|
+
}
|
|
230
|
+
const process = reversed === true ? (x => x < 0.5) : (x => x > 0.5);
|
|
231
|
+
this.create(full_id, (theme_id, theme) => {
|
|
232
|
+
if (!theme[theme_attr]) {
|
|
233
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" does not exist.`);
|
|
234
|
+
}
|
|
235
|
+
return new Color(theme[theme_attr]).auto_darken_lighten(percent, process).str();
|
|
236
|
+
});
|
|
237
|
+
return this._css_vars[full_id];
|
|
238
|
+
}
|
|
135
239
|
// Opacity.
|
|
136
240
|
// Opacity must be a number `0.0` till `1.0`, and may also be an object with opacity pet theme `{dark: 0.2, light: 0.35}`.
|
|
137
|
-
opacity(
|
|
241
|
+
opacity(theme_attr, opacity = 1.0) {
|
|
138
242
|
// Create full id.
|
|
139
243
|
let full_id;
|
|
140
244
|
if (typeof opacity === "number") {
|
|
141
|
-
full_id = `${
|
|
245
|
+
full_id = `${String(theme_attr)}_opac_${opacity}`;
|
|
142
246
|
}
|
|
143
247
|
else {
|
|
144
|
-
full_id = `${
|
|
248
|
+
full_id = `${String(theme_attr)}_opac_${Object.values(opacity).join("_")}`;
|
|
145
249
|
}
|
|
146
250
|
full_id = full_id.replaceAll(".", "_");
|
|
147
251
|
// Already created.
|
|
@@ -150,26 +254,26 @@ export class ThemeClass {
|
|
|
150
254
|
}
|
|
151
255
|
// Iterate.
|
|
152
256
|
let index = 0;
|
|
153
|
-
for (const theme_id of
|
|
257
|
+
for (const theme_id of ThemeIdList) {
|
|
154
258
|
const theme = this[theme_id];
|
|
155
259
|
// Checks.
|
|
156
|
-
if (theme[
|
|
157
|
-
console.error(new Error(`Theme attribute "${
|
|
260
|
+
if (theme[theme_attr] == null) {
|
|
261
|
+
console.error(new Error(`Theme attribute "${String(theme_attr)}" does not exist.`));
|
|
158
262
|
return "";
|
|
159
263
|
}
|
|
160
|
-
if (theme[
|
|
161
|
-
console.error(new Error(`Unable to set the opacity on gradient color "${
|
|
264
|
+
if (theme[theme_attr]._is_gradient) {
|
|
265
|
+
console.error(new Error(`Unable to set the opacity on gradient color "${String(theme_attr)}".`));
|
|
162
266
|
return "";
|
|
163
267
|
}
|
|
164
268
|
// Create new color.
|
|
165
269
|
let theme_opac = opacity;
|
|
166
270
|
if (typeof theme_opac === "object") {
|
|
167
|
-
theme_opac = theme_opac[
|
|
271
|
+
theme_opac = theme_opac[theme_attr];
|
|
168
272
|
if (theme_opac === undefined) {
|
|
169
|
-
console.error(new Error(`Unable to find the opacity on for theme id "${
|
|
273
|
+
console.error(new Error(`Unable to find the opacity on for theme id "${theme_attr}".`));
|
|
170
274
|
}
|
|
171
275
|
}
|
|
172
|
-
theme[full_id] =
|
|
276
|
+
theme[full_id] = new Color(theme[theme_attr]).opacity(theme_opac).rgb();
|
|
173
277
|
// Add css var.
|
|
174
278
|
if (index === 0) {
|
|
175
279
|
this._add_attr(full_id);
|
|
@@ -183,55 +287,62 @@ export class ThemeClass {
|
|
|
183
287
|
}
|
|
184
288
|
return this._css_vars[full_id];
|
|
185
289
|
}
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
290
|
+
// ---------------------------------------------------------------------
|
|
291
|
+
// Font size manipulation methods.
|
|
292
|
+
/**
|
|
293
|
+
* Create a new value by multiplying a numeric attribute.
|
|
294
|
+
* @warning argument `id` should be the name of a numeric theme attribute.
|
|
295
|
+
* @param theme_attr The name of a numeric attribute
|
|
296
|
+
* @param x The number by which to multiply the attribute, `attribute * x`.
|
|
297
|
+
*/
|
|
298
|
+
multiply(theme_attr, x = 1.0) {
|
|
299
|
+
let full_id = `${String(theme_attr)}_fsr_${x}`;
|
|
300
|
+
full_id = full_id.replaceAll(".", "_");
|
|
301
|
+
if (this._css_vars[full_id]) {
|
|
302
|
+
return this._css_vars[full_id];
|
|
190
303
|
}
|
|
191
|
-
|
|
192
|
-
this.
|
|
193
|
-
|
|
194
|
-
|
|
304
|
+
const process = (x => x < 0.5);
|
|
305
|
+
this.create(full_id, (_, theme) => {
|
|
306
|
+
if (!theme[theme_attr]) {
|
|
307
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" does not exist.`);
|
|
308
|
+
}
|
|
309
|
+
if (typeof theme[theme_attr] !== "number") {
|
|
310
|
+
throw new Error(`Theme attribute "${String(theme_attr)}" is not a number.`);
|
|
311
|
+
}
|
|
312
|
+
return theme[theme_attr] * x;
|
|
195
313
|
});
|
|
196
|
-
|
|
197
|
-
this._on_activate_callback(this, this.active_id);
|
|
198
|
-
}
|
|
199
|
-
if (apply_theme_update) {
|
|
200
|
-
ThemesModule.apply_theme_update();
|
|
201
|
-
}
|
|
202
|
-
localStorage.setItem(this._id, this.active_id);
|
|
203
|
-
return this;
|
|
314
|
+
return this._css_vars[full_id];
|
|
204
315
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
316
|
+
// ---------------------------------------------------------------------
|
|
317
|
+
// Animation methods.
|
|
318
|
+
/** Function to disable all transition attributes on all elements. */
|
|
319
|
+
disable_transitions() {
|
|
320
|
+
// const style = document.createElement('style');
|
|
321
|
+
// style.id = '__libris_thme_disable_transitions__';
|
|
322
|
+
// style.innerHTML = `
|
|
323
|
+
// * { transition: none !important; }
|
|
324
|
+
// *::after { transition: none !important; }
|
|
325
|
+
// *::before { transition: none !important; }
|
|
326
|
+
// `.dedent();
|
|
327
|
+
// document.head.appendChild(style);
|
|
328
|
+
document.body.classList.add("notransition");
|
|
329
|
+
// Force a reflow to apply the new styles immediately
|
|
330
|
+
// document.head.getBoundingClientRect();
|
|
331
|
+
void document.body.offsetHeight;
|
|
210
332
|
return this;
|
|
211
333
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
toggle(apply_theme_update = true) {
|
|
218
|
-
if (this._theme_ids.length > 1) {
|
|
219
|
-
let active_index = -1;
|
|
220
|
-
for (let i = 0; i < this._theme_ids.length; i++) {
|
|
221
|
-
if (this._theme_ids[i] === this.active_id) {
|
|
222
|
-
active_index = i;
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
if (active_index !== -1 && active_index + 1 < this._theme_ids.length) {
|
|
227
|
-
this.activate(this._theme_ids[active_index + 1], apply_theme_update);
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
this.activate(this._theme_ids[0], apply_theme_update);
|
|
231
|
-
}
|
|
334
|
+
/** Function to re-enable all transition attributes on all elements. */
|
|
335
|
+
enable_transitions(delay = 0) {
|
|
336
|
+
if (delay > 0) {
|
|
337
|
+
setTimeout(() => this.enable_transitions(0), delay);
|
|
338
|
+
return this;
|
|
232
339
|
}
|
|
340
|
+
document.body.classList.remove("notransition");
|
|
341
|
+
// const style = document.getElementById('__libris_thme_disable_transitions__');
|
|
342
|
+
// if (style) {
|
|
343
|
+
// style.remove();
|
|
344
|
+
// }
|
|
345
|
+
document.head.getBoundingClientRect();
|
|
233
346
|
return this;
|
|
234
347
|
}
|
|
235
348
|
}
|
|
236
|
-
export const Theme = Elements.wrapper(ThemeClass);
|
|
237
|
-
export const NullTheme = Elements.create_null(ThemeClass); //@todo duplicate name from Themes
|
|
@@ -110,7 +110,7 @@ export var User;
|
|
|
110
110
|
* @type: boolean
|
|
111
111
|
*/
|
|
112
112
|
async function get() {
|
|
113
|
-
return Utils.
|
|
113
|
+
return Utils.request_v1({
|
|
114
114
|
method: "GET",
|
|
115
115
|
url: "/volt/user/",
|
|
116
116
|
data: {
|
|
@@ -128,7 +128,7 @@ export var User;
|
|
|
128
128
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
129
129
|
*/
|
|
130
130
|
async function set(user) {
|
|
131
|
-
return Utils.
|
|
131
|
+
return Utils.request_v1({
|
|
132
132
|
method: "POST",
|
|
133
133
|
url: "/volt/user/",
|
|
134
134
|
data: user,
|
|
@@ -144,7 +144,7 @@ export var User;
|
|
|
144
144
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
145
145
|
*/
|
|
146
146
|
async function activate(code = "") {
|
|
147
|
-
return Utils.
|
|
147
|
+
return Utils.request_v1({
|
|
148
148
|
method: "POST",
|
|
149
149
|
url: "/volt/auth/activate",
|
|
150
150
|
data: {
|
|
@@ -162,7 +162,7 @@ export var User;
|
|
|
162
162
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
163
163
|
*/
|
|
164
164
|
async function change_password({ current_password = "", password = "", verify_password = "", }) {
|
|
165
|
-
return Utils.
|
|
165
|
+
return Utils.request_v1({
|
|
166
166
|
method: "POST",
|
|
167
167
|
url: "/volt/user/change_password",
|
|
168
168
|
data: {
|
|
@@ -182,7 +182,7 @@ export var User;
|
|
|
182
182
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
183
183
|
*/
|
|
184
184
|
async function delete_account() {
|
|
185
|
-
return Utils.
|
|
185
|
+
return Utils.request_v1({
|
|
186
186
|
method: "DELETE",
|
|
187
187
|
url: "/volt/user",
|
|
188
188
|
});
|
|
@@ -197,7 +197,7 @@ export var User;
|
|
|
197
197
|
* @return: Returns a promise with a successful update response with the newly generated API key as an attribute or a request error on a failed request.
|
|
198
198
|
*/
|
|
199
199
|
async function generate_api_key() {
|
|
200
|
-
return Utils.
|
|
200
|
+
return Utils.request_v1({
|
|
201
201
|
method: "POST",
|
|
202
202
|
url: "/volt/user/api_key",
|
|
203
203
|
});
|
|
@@ -212,7 +212,7 @@ export var User;
|
|
|
212
212
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
213
213
|
*/
|
|
214
214
|
async function revoke_api_key() {
|
|
215
|
-
return Utils.
|
|
215
|
+
return Utils.request_v1({
|
|
216
216
|
method: "DELETE",
|
|
217
217
|
url: "/volt/user/api_key",
|
|
218
218
|
});
|
|
@@ -227,7 +227,7 @@ export var User;
|
|
|
227
227
|
* @return: Returns a promise with the loaded user's data or a request error on a failed request.
|
|
228
228
|
*/
|
|
229
229
|
async function load(path, def = "") {
|
|
230
|
-
return Utils.
|
|
230
|
+
return Utils.request_v1({
|
|
231
231
|
method: "GET",
|
|
232
232
|
url: "/volt/user/data",
|
|
233
233
|
data: {
|
|
@@ -246,7 +246,7 @@ export var User;
|
|
|
246
246
|
* @return: Returns a promise with a successful update response or a request error on a failed request.
|
|
247
247
|
*/
|
|
248
248
|
async function save(path = "", data = {}) {
|
|
249
|
-
return Utils.
|
|
249
|
+
return Utils.request_v1({
|
|
250
250
|
method: "POST",
|
|
251
251
|
url: "/volt/user/data",
|
|
252
252
|
data: {
|
|
@@ -265,7 +265,7 @@ export var User;
|
|
|
265
265
|
* @return: Returns a promise with the loaded user's data or a request error on a failed request.
|
|
266
266
|
*/
|
|
267
267
|
async function load_protected(path, def = "") {
|
|
268
|
-
return Utils.
|
|
268
|
+
return Utils.request_v1({
|
|
269
269
|
method: "GET",
|
|
270
270
|
url: "/volt/user/data/protected",
|
|
271
271
|
data: {
|
|
@@ -277,3 +277,4 @@ export var User;
|
|
|
277
277
|
User.load_protected = load_protected;
|
|
278
278
|
})(User || (User = {}));
|
|
279
279
|
;
|
|
280
|
+
export { User as user }; // also export as lowercase for compatibility.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnyElement } from "../ui/any_element";
|
|
1
2
|
declare const Utils: {
|
|
2
3
|
is_apple: boolean;
|
|
3
4
|
is_safari: boolean;
|
|
@@ -30,7 +31,26 @@ declare const Utils: {
|
|
|
30
31
|
a: number;
|
|
31
32
|
};
|
|
32
33
|
deep_copy(obj: any): any;
|
|
33
|
-
request
|
|
34
|
+
/** New request method. */
|
|
35
|
+
request<Data = any>(options: {
|
|
36
|
+
method?: string;
|
|
37
|
+
url?: string | null;
|
|
38
|
+
data?: any;
|
|
39
|
+
json?: boolean;
|
|
40
|
+
credentials?: RequestCredentials;
|
|
41
|
+
headers?: Record<string, string>;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
error?: {
|
|
44
|
+
message: string;
|
|
45
|
+
type?: string;
|
|
46
|
+
invalid_fields?: {
|
|
47
|
+
[name: string]: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
status: number;
|
|
51
|
+
data?: Data;
|
|
52
|
+
}>;
|
|
53
|
+
request_v1(options: {
|
|
34
54
|
method?: string;
|
|
35
55
|
url?: string | null;
|
|
36
56
|
data?: any;
|
|
@@ -38,7 +58,7 @@ declare const Utils: {
|
|
|
38
58
|
credentials?: "include" | "same-origin" | "omit";
|
|
39
59
|
headers?: Record<string, string>;
|
|
40
60
|
}): Promise<any>;
|
|
41
|
-
on_load(func: () => HTMLElement | Promise<HTMLElement> | null): Promise<void>;
|
|
61
|
+
on_load(func: () => HTMLElement | AnyElement | Promise<HTMLElement | AnyElement> | null | undefined): Promise<void>;
|
|
42
62
|
unix_to_date(unix: number, mseconds?: boolean | null): string;
|
|
43
63
|
fuzzy_search({ query, targets, limit, case_match, allow_exceeding_chars, get_matches, key, nested_key, }: {
|
|
44
64
|
query: string;
|
|
@@ -56,3 +76,4 @@ declare const Utils: {
|
|
|
56
76
|
on_resize_observer: ResizeObserver;
|
|
57
77
|
};
|
|
58
78
|
export { Utils };
|
|
79
|
+
export { Utils as utils };
|
|
@@ -524,6 +524,97 @@ const Utils = {
|
|
|
524
524
|
return obj;
|
|
525
525
|
}
|
|
526
526
|
},
|
|
527
|
+
/** New request method. */
|
|
528
|
+
async request(options) {
|
|
529
|
+
const { method = 'GET', url = null, data = null, json = true, credentials = "same-origin", headers = {}, } = options;
|
|
530
|
+
// — prepare headers —
|
|
531
|
+
if (json && data != null && !headers['Content-Type']) {
|
|
532
|
+
headers['Content-Type'] = 'application/json';
|
|
533
|
+
}
|
|
534
|
+
// — build URL + body —
|
|
535
|
+
let finalUrl = url;
|
|
536
|
+
let body;
|
|
537
|
+
if (data != null && typeof data === 'object') {
|
|
538
|
+
if (method.toUpperCase() === 'GET') {
|
|
539
|
+
finalUrl = `${url}?${new URLSearchParams(data).toString()}`;
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
body = JSON.stringify(data);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
else if (data != null) {
|
|
546
|
+
body = String(data);
|
|
547
|
+
}
|
|
548
|
+
const init = { method, credentials, headers };
|
|
549
|
+
if (body !== undefined)
|
|
550
|
+
init.body = body;
|
|
551
|
+
try {
|
|
552
|
+
const response = await fetch(finalUrl, init);
|
|
553
|
+
const status = response.status;
|
|
554
|
+
// — parse payload once —
|
|
555
|
+
let payload;
|
|
556
|
+
const clone = response.clone(); // @dev.
|
|
557
|
+
if (json) {
|
|
558
|
+
try {
|
|
559
|
+
payload = await response.json();
|
|
560
|
+
}
|
|
561
|
+
catch (e) {
|
|
562
|
+
// malformed JSON still counts as a “success” fetch
|
|
563
|
+
console.log("[debug] Unable to parse a json from response:", await clone.text(), "- Error: ", JSON.stringify(e, null, 4));
|
|
564
|
+
console.log("rsponse:", response);
|
|
565
|
+
return {
|
|
566
|
+
status,
|
|
567
|
+
error: { message: `Failed to parse JSON response: ${e.message}` },
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
try {
|
|
573
|
+
payload = await response.text();
|
|
574
|
+
}
|
|
575
|
+
catch (e) {
|
|
576
|
+
return {
|
|
577
|
+
status,
|
|
578
|
+
error: { message: `Failed to parse text response: ${e.message}` },
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
console.log("Payload", json, payload);
|
|
583
|
+
// — handle HTTP errors (4xx/5xx) by resolving with an error object —
|
|
584
|
+
if (!response.ok) {
|
|
585
|
+
// if server wrapped its error in { error: { message, type?, invalid_fields? }, … }
|
|
586
|
+
if (payload &&
|
|
587
|
+
typeof payload === 'object' &&
|
|
588
|
+
typeof payload.error === 'object' &&
|
|
589
|
+
typeof payload.error.message === 'string') {
|
|
590
|
+
return {
|
|
591
|
+
status,
|
|
592
|
+
error: {
|
|
593
|
+
message: payload.error.message,
|
|
594
|
+
type: payload.error.type,
|
|
595
|
+
invalid_fields: payload.error.invalid_fields,
|
|
596
|
+
},
|
|
597
|
+
data: payload.data,
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
// otherwise fall back to a generic single‐message error
|
|
601
|
+
const msg = typeof payload === 'string'
|
|
602
|
+
? payload
|
|
603
|
+
: payload?.error?.toString() ?? JSON.stringify(payload);
|
|
604
|
+
return {
|
|
605
|
+
status,
|
|
606
|
+
error: { message: msg },
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
// — 2xx: success —
|
|
610
|
+
return { status, data: payload };
|
|
611
|
+
}
|
|
612
|
+
catch (networkErr) {
|
|
613
|
+
// genuine network / system failure
|
|
614
|
+
throw networkErr;
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
// @deprecated.
|
|
527
618
|
/* @docs:
|
|
528
619
|
@nav: Frontend
|
|
529
620
|
@chapter: Utils
|
|
@@ -544,7 +635,7 @@ const Utils = {
|
|
|
544
635
|
@desc: A Promise that resolves with the response data.
|
|
545
636
|
@type: Promise<any>
|
|
546
637
|
*/
|
|
547
|
-
|
|
638
|
+
request_v1(options) {
|
|
548
639
|
const { method = "GET", url = null, data = null, json = true, credentials = "same-origin", headers = {}, } = options;
|
|
549
640
|
// Set headers.
|
|
550
641
|
// Host and User-Agent headers are restricted and set by the browser itself.
|
|
@@ -1157,3 +1248,4 @@ const Utils = {
|
|
|
1157
1248
|
};
|
|
1158
1249
|
// Export.
|
|
1159
1250
|
export { Utils };
|
|
1251
|
+
export { Utils as utils }; // also export as lowercase for compatibility.
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
* Or the arguments can be as `new GradientType("linear", "black", "0%", "white", "100%")`.
|
|
21
21
|
*/
|
|
22
22
|
export class GradientType {
|
|
23
|
+
gradient;
|
|
24
|
+
type;
|
|
25
|
+
degree;
|
|
26
|
+
colors;
|
|
23
27
|
constructor(...args) {
|
|
24
28
|
if (args.length === 1) {
|
|
25
29
|
this.gradient = args[0];
|
|
@@ -4,31 +4,6 @@ import { VDivElement, VElementTagMap } from "../elements/module.js";
|
|
|
4
4
|
* Warning: this class is still experimental and may be subject to future change.
|
|
5
5
|
*/
|
|
6
6
|
export declare class BorderButtonElement extends VElementTagMap.a {
|
|
7
|
-
static default_style: {
|
|
8
|
-
margin: string;
|
|
9
|
-
display: string;
|
|
10
|
-
color: string;
|
|
11
|
-
"text-align": string;
|
|
12
|
-
cursor: string;
|
|
13
|
-
position: string;
|
|
14
|
-
"z-index": string;
|
|
15
|
-
background: string;
|
|
16
|
-
"user-select": string;
|
|
17
|
-
outline: string;
|
|
18
|
-
border: string;
|
|
19
|
-
"text-decoration": string;
|
|
20
|
-
"--child-color": string;
|
|
21
|
-
"--child-background": string;
|
|
22
|
-
"--child-border-width": string;
|
|
23
|
-
"--child-border-radius": string;
|
|
24
|
-
"--child-padding": string;
|
|
25
|
-
};
|
|
26
|
-
static default_events: {
|
|
27
|
-
onmousedown: (this: any) => void;
|
|
28
|
-
onmouseover: (this: any) => void;
|
|
29
|
-
onmouseup: (this: any) => void;
|
|
30
|
-
onmouseout: (this: any) => void;
|
|
31
|
-
};
|
|
32
7
|
nodes: {
|
|
33
8
|
border: VDivElement;
|
|
34
9
|
text: VDivElement;
|