@appscode/design-system 1.0.43-alpha.6 → 1.0.43-alpha.63
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/base/utilities/_default.scss +136 -20
- package/base/utilities/_derived-variables.scss +2 -15
- package/base/utilities/_initial-variables.scss +99 -64
- package/base/utilities/_mixin.scss +90 -10
- package/base/utilities/_typography.scss +20 -7
- package/base/utilities/dark-theme.scss +25 -0
- package/components/_ac-accordion.scss +1 -0
- package/components/_ac-alert-box.scss +45 -10
- package/components/_ac-card.scss +54 -19
- package/components/_ac-code-highlight.scss +6 -0
- package/components/_ac-content-layout.scss +4 -4
- package/components/_ac-drag.scss +6 -6
- package/components/_ac-input.scss +72 -38
- package/components/_ac-modal.scss +5 -4
- package/components/_ac-multi-select.scss +220 -18
- package/components/_ac-options.scss +18 -8
- package/components/_ac-select-box.scss +5 -5
- package/components/_ac-table.scss +40 -33
- package/components/_ac-tabs.scss +64 -23
- package/components/_ac-tags.scss +2 -2
- package/components/_ac-terminal.scss +248 -0
- package/components/_app-drawer.scss +6 -6
- package/components/_breadcumb.scss +7 -2
- package/components/_buttons.scss +78 -32
- package/components/_card-body-wrapper.scss +3 -3
- package/components/_dashboard-header.scss +3 -3
- package/components/_direct-deploy.scss +69 -0
- package/components/_go-to-top.scss +1 -1
- package/components/_image-upload.scss +6 -4
- package/components/_left-sidebar-menu.scss +196 -46
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +103 -26
- package/components/_overview-info.scss +4 -4
- package/components/_overview-page.scss +1 -2
- package/components/_pagination.scss +45 -7
- package/components/_payment-card.scss +28 -12
- package/components/_preview-modal.scss +8 -8
- package/components/_pricing-table.scss +1 -1
- package/components/_progress-bar.scss +5 -5
- package/components/_subscription-card.scss +15 -8
- package/components/_table-of-content.scss +1 -1
- package/components/_tfa.scss +69 -0
- package/components/_widget-menu.scss +9 -9
- package/components/_wizard.scss +32 -20
- package/components/ac-toaster/_ac-toasted.scss +40 -8
- package/components/bbum/_card-team.scss +17 -9
- package/components/bbum/_information-center.scss +19 -5
- package/components/bbum/_mobile-desktop.scss +6 -6
- package/components/bbum/_post.scss +5 -4
- package/components/bbum/_sign-up-notification.scss +6 -6
- package/components/bbum/_single-post-preview.scss +9 -9
- package/components/bbum/_user-profile.scss +98 -90
- package/components/ui-builder/_ui-builder.scss +19 -8
- package/layouts/_404.scss +2 -1
- package/layouts/_code-preview.scss +14 -7
- package/main.scss +2 -0
- package/package.json +1 -1
- package/plugins/theme.js +142 -0
- package/plugins/vue-toaster.js +6 -6
- package/vue-components/v2/card/PaymentCards.vue +11 -2
- package/vue-components/v2/editor/Editor.vue +31 -17
- package/vue-components/v2/navbar/Appdrawer.vue +10 -9
- package/vue-components/v2/navbar/ThemeMode.vue +124 -0
- package/vue-components/v2/preloader/Preloader.vue +5 -5
- package/vue-components/v2/table/table-cell/CellValue.vue +10 -1
- package/vue-components/v3/dropdown/DropdownMenu.vue +1 -1
- package/vue-components/v3/editor/Editor.vue +33 -19
- package/vue-components/v3/navbar/Appdrawer.vue +12 -7
- package/vue-components/v3/navbar/ThemeMode.vue +118 -0
- package/vue-components/v3/table/table-cell/CellValue.vue +9 -0
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
.ac-html-preview {
|
|
19
19
|
width: 100%;
|
|
20
20
|
|
|
21
|
+
i.is-block {
|
|
22
|
+
color: $ac-color-value;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
.ac-navbar-area {
|
|
22
26
|
position: inherit;
|
|
23
27
|
}
|
|
@@ -29,7 +33,7 @@
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
&.ac-bg-dark {
|
|
32
|
-
background-color: $ac-
|
|
36
|
+
background-color: $ac-color-heading;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
.ac-html-preview {
|
|
@@ -54,13 +58,13 @@
|
|
|
54
58
|
|
|
55
59
|
/* Handle */
|
|
56
60
|
&::-webkit-scrollbar-thumb {
|
|
57
|
-
background:
|
|
61
|
+
background-color: $ac-gray-light;
|
|
58
62
|
border-radius: 10px;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
/* Handle on hover */
|
|
62
66
|
&::-webkit-scrollbar-thumb:hover {
|
|
63
|
-
background:
|
|
67
|
+
background-color: $ac-gray-light;
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
.number {
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
.ac-code-preview-wrapper {
|
|
94
|
-
border: 1px solid
|
|
98
|
+
border: 1px solid $ac-white-light;
|
|
95
99
|
border-radius: 4px;
|
|
96
100
|
|
|
97
101
|
.ac-code-header {
|
|
@@ -113,7 +117,7 @@
|
|
|
113
117
|
.component-header {
|
|
114
118
|
display: flex;
|
|
115
119
|
justify-content: space-between;
|
|
116
|
-
border-bottom: 1px solid
|
|
120
|
+
border-bottom: 1px solid $ac-white-light;
|
|
117
121
|
background-color: $ac-white;
|
|
118
122
|
|
|
119
123
|
h3 {
|
|
@@ -121,7 +125,7 @@
|
|
|
121
125
|
font-size: 16px;
|
|
122
126
|
font-weight: 500;
|
|
123
127
|
font-family: $ac-family-paragraph;
|
|
124
|
-
color:
|
|
128
|
+
color: $ac-color-value;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
.component-switch {
|
|
@@ -145,18 +149,21 @@
|
|
|
145
149
|
z-index: 1;
|
|
146
150
|
max-height: 500px;
|
|
147
151
|
overflow-y: auto;
|
|
152
|
+
|
|
148
153
|
.copy-button {
|
|
149
154
|
position: absolute;
|
|
150
155
|
right: 5px;
|
|
151
156
|
top: 5px;
|
|
157
|
+
|
|
152
158
|
&:hover {
|
|
153
159
|
box-shadow: none;
|
|
154
160
|
}
|
|
155
161
|
}
|
|
162
|
+
|
|
156
163
|
pre {
|
|
157
164
|
margin: 0;
|
|
158
165
|
border-radius: 4px;
|
|
159
|
-
font-size:
|
|
166
|
+
font-size: 14px;
|
|
160
167
|
|
|
161
168
|
.token {
|
|
162
169
|
&.tag {
|
package/main.scss
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
// BASE
|
|
9
9
|
@import "~assets/design-system/base/utilities/initial-variables";
|
|
10
|
+
@import "~assets/design-system/base/utilities/dark-theme";
|
|
10
11
|
@import "~assets/design-system/base/utilities/derived-variables";
|
|
11
12
|
@import "~assets/design-system/base/utilities/typography";
|
|
12
13
|
@import "~assets/design-system/base/utilities/default";
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
@import "~assets/design-system/components/overview-info";
|
|
49
50
|
@import "~assets/design-system/components/pricing-table";
|
|
50
51
|
@import "~assets/design-system/components/table-of-content";
|
|
52
|
+
@import "~assets/design-system/components/direct-deploy";
|
|
51
53
|
@import "~assets/design-system/components/preview-modal";
|
|
52
54
|
@import "~assets/design-system/components/wizard";
|
|
53
55
|
@import "~assets/design-system/components/preloader";
|
package/package.json
CHANGED
package/plugins/theme.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
export function HSLToHex(h, s, l) {
|
|
2
|
+
s /= 100;
|
|
3
|
+
l /= 100;
|
|
4
|
+
|
|
5
|
+
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
6
|
+
x = c * (1 - Math.abs(((h / 60) % 2) - 1)),
|
|
7
|
+
m = l - c / 2;
|
|
8
|
+
|
|
9
|
+
let r = 0,
|
|
10
|
+
g = 0,
|
|
11
|
+
b = 0;
|
|
12
|
+
|
|
13
|
+
if (0 <= h && h < 60) {
|
|
14
|
+
r = c;
|
|
15
|
+
g = x;
|
|
16
|
+
b = 0;
|
|
17
|
+
} else if (60 <= h && h < 120) {
|
|
18
|
+
r = x;
|
|
19
|
+
g = c;
|
|
20
|
+
b = 0;
|
|
21
|
+
} else if (120 <= h && h < 180) {
|
|
22
|
+
r = 0;
|
|
23
|
+
g = c;
|
|
24
|
+
b = x;
|
|
25
|
+
} else if (180 <= h && h < 240) {
|
|
26
|
+
r = 0;
|
|
27
|
+
g = x;
|
|
28
|
+
b = c;
|
|
29
|
+
} else if (240 <= h && h < 300) {
|
|
30
|
+
r = x;
|
|
31
|
+
g = 0;
|
|
32
|
+
b = c;
|
|
33
|
+
} else if (300 <= h && h < 360) {
|
|
34
|
+
r = c;
|
|
35
|
+
g = 0;
|
|
36
|
+
b = x;
|
|
37
|
+
}
|
|
38
|
+
// Having obtained RGB, convert channels to hex
|
|
39
|
+
r = Math.round((r + m) * 255).toString(16);
|
|
40
|
+
g = Math.round((g + m) * 255).toString(16);
|
|
41
|
+
b = Math.round((b + m) * 255).toString(16);
|
|
42
|
+
|
|
43
|
+
// Prepend 0s, if necessary
|
|
44
|
+
if (r.length == 1) r = "0" + r;
|
|
45
|
+
if (g.length == 1) g = "0" + g;
|
|
46
|
+
if (b.length == 1) b = "0" + b;
|
|
47
|
+
|
|
48
|
+
return "#" + r + g + b;
|
|
49
|
+
}
|
|
50
|
+
export function HexToHSL(H) {
|
|
51
|
+
// Convert hex to RGB first
|
|
52
|
+
let r = 0,
|
|
53
|
+
g = 0,
|
|
54
|
+
b = 0;
|
|
55
|
+
if (H.length == 4) {
|
|
56
|
+
r = parseInt("0x" + H[1] + H[1]);
|
|
57
|
+
g = parseInt("0x" + H[2] + H[2]);
|
|
58
|
+
b = parseInt("0x" + H[3] + H[3]);
|
|
59
|
+
} else if (H.length == 7) {
|
|
60
|
+
r = parseInt("0x" + H[1] + H[2]);
|
|
61
|
+
g = parseInt("0x" + H[3] + H[4]);
|
|
62
|
+
b = parseInt("0x" + H[5] + H[6]);
|
|
63
|
+
}
|
|
64
|
+
// Then to HSL
|
|
65
|
+
r /= 255;
|
|
66
|
+
g /= 255;
|
|
67
|
+
b /= 255;
|
|
68
|
+
const cmin = Math.min(r, g, b),
|
|
69
|
+
cmax = Math.max(r, g, b),
|
|
70
|
+
delta = cmax - cmin;
|
|
71
|
+
let h = 0,
|
|
72
|
+
s = 0,
|
|
73
|
+
l = 0;
|
|
74
|
+
|
|
75
|
+
if (delta == 0) h = 0;
|
|
76
|
+
else if (cmax == r) h = ((g - b) / delta) % 6;
|
|
77
|
+
else if (cmax == g) h = (b - r) / delta + 2;
|
|
78
|
+
else h = (r - g) / delta + 4;
|
|
79
|
+
|
|
80
|
+
h = Math.round(h * 60);
|
|
81
|
+
|
|
82
|
+
if (h < 0) h += 360;
|
|
83
|
+
|
|
84
|
+
l = (cmax + cmin) / 2;
|
|
85
|
+
s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));
|
|
86
|
+
s = +(s * 100).toFixed(1);
|
|
87
|
+
l = +(l * 100).toFixed(1);
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
hue: `${h}`,
|
|
91
|
+
saturation: `${s}%`,
|
|
92
|
+
lightness: `${l}%`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export function getThemeHSL() {
|
|
96
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
97
|
+
"--hsl-hue"
|
|
98
|
+
);
|
|
99
|
+
const saturation = getComputedStyle(
|
|
100
|
+
document.documentElement
|
|
101
|
+
).getPropertyValue("--hsl-saturation");
|
|
102
|
+
const lightness = getComputedStyle(
|
|
103
|
+
document.documentElement
|
|
104
|
+
).getPropertyValue("--hsl-lightness");
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
hue,
|
|
108
|
+
saturation,
|
|
109
|
+
lightness,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export function setThemeHSL(h, s, l) {
|
|
113
|
+
document.documentElement.style.setProperty("--hsl-hue", h);
|
|
114
|
+
document.documentElement.style.setProperty("--hsl-saturation", s);
|
|
115
|
+
document.documentElement.style.setProperty("--hsl-lightness", l);
|
|
116
|
+
}
|
|
117
|
+
export function setFontHSL(h, s, l) {
|
|
118
|
+
document.documentElement.style.setProperty("--font-hsl-hue", h);
|
|
119
|
+
document.documentElement.style.setProperty("--font-hsl-saturation", s);
|
|
120
|
+
document.documentElement.style.setProperty("--font-hsl-lightness", l);
|
|
121
|
+
}
|
|
122
|
+
export function getFontHSL() {
|
|
123
|
+
const hue = getComputedStyle(document.documentElement).getPropertyValue(
|
|
124
|
+
"--font-hsl-hue"
|
|
125
|
+
);
|
|
126
|
+
const saturation = getComputedStyle(
|
|
127
|
+
document.documentElement
|
|
128
|
+
).getPropertyValue("--font-hsl-saturation");
|
|
129
|
+
const lightness = getComputedStyle(
|
|
130
|
+
document.documentElement
|
|
131
|
+
).getPropertyValue("--font-hsl-lightness");
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
hue,
|
|
135
|
+
saturation,
|
|
136
|
+
lightness,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export const loaderLightThemePrimaryColor = "#f5f7f9";
|
|
140
|
+
export const loaderDarkThemePrimaryColor = "#2e323c";
|
|
141
|
+
export const loaderLightThemeSecondaryColor = "#ecebeb";
|
|
142
|
+
export const loaderDarkThemeSecondaryColor = "#21272e";
|
package/plugins/vue-toaster.js
CHANGED
|
@@ -2,9 +2,9 @@ module.exports = {
|
|
|
2
2
|
position: "top-center",
|
|
3
3
|
theme: "toasted-primary",
|
|
4
4
|
iconPack: "fontawesome",
|
|
5
|
-
className: "ac-
|
|
5
|
+
className: "ac-toast",
|
|
6
6
|
action: {
|
|
7
|
-
|
|
7
|
+
icon: "close",
|
|
8
8
|
class: "ac-toast-action",
|
|
9
9
|
onClick: (e, toastObject) => {
|
|
10
10
|
toastObject.goAway(0);
|
|
@@ -26,7 +26,7 @@ module.exports = {
|
|
|
26
26
|
icon: "fa-check",
|
|
27
27
|
duration: 2500,
|
|
28
28
|
type: "success",
|
|
29
|
-
className: "ac-
|
|
29
|
+
className: "ac-toast is-success",
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
{
|
|
@@ -42,7 +42,7 @@ module.exports = {
|
|
|
42
42
|
options: {
|
|
43
43
|
icon: "fa-warning",
|
|
44
44
|
type: "error",
|
|
45
|
-
className: "ac-
|
|
45
|
+
className: "ac-toast is-error",
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
{
|
|
@@ -57,7 +57,7 @@ module.exports = {
|
|
|
57
57
|
options: {
|
|
58
58
|
icon: "fa-info",
|
|
59
59
|
type: "info",
|
|
60
|
-
className: "ac-
|
|
60
|
+
className: "ac-toast is-info",
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -74,7 +74,7 @@ module.exports = {
|
|
|
74
74
|
options: {
|
|
75
75
|
icon: "fa-warning",
|
|
76
76
|
type: "error",
|
|
77
|
-
className: "ac-
|
|
77
|
+
className: "ac-toast is-warning",
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
],
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<content-loader
|
|
6
6
|
:height="235"
|
|
7
7
|
:speed="2"
|
|
8
|
-
:
|
|
9
|
-
:
|
|
8
|
+
:primaryColor="primaryColor"
|
|
9
|
+
:secondaryColor="secondaryColor"
|
|
10
10
|
/>
|
|
11
11
|
</div>
|
|
12
12
|
<!-- loader end -->
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
<script>
|
|
22
22
|
import { ContentLoader } from "vue-content-loader";
|
|
23
|
+
import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
|
|
23
24
|
|
|
24
25
|
export default {
|
|
25
26
|
components: {
|
|
@@ -31,5 +32,13 @@ export default {
|
|
|
31
32
|
default: false,
|
|
32
33
|
},
|
|
33
34
|
},
|
|
35
|
+
computed: {
|
|
36
|
+
primaryColor() {
|
|
37
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemePrimaryColor : loaderLightThemePrimaryColor;
|
|
38
|
+
},
|
|
39
|
+
secondaryColor() {
|
|
40
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemeSecondaryColor : loaderLightThemeSecondaryColor;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
34
43
|
};
|
|
35
44
|
</script>
|
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
:language="language"
|
|
16
16
|
:options="{
|
|
17
17
|
minimap: {
|
|
18
|
-
enabled: calcShowMinimap
|
|
18
|
+
enabled: calcShowMinimap
|
|
19
19
|
},
|
|
20
|
+
theme: theme,
|
|
20
21
|
readOnly: readOnly,
|
|
21
|
-
scrollBeyondLastLine: false
|
|
22
|
+
scrollBeyondLastLine: false
|
|
22
23
|
}"
|
|
23
24
|
/>
|
|
24
25
|
<monaco-editor
|
|
@@ -29,10 +30,11 @@
|
|
|
29
30
|
:language="language"
|
|
30
31
|
:options="{
|
|
31
32
|
minimap: {
|
|
32
|
-
enabled: calcShowMinimap
|
|
33
|
+
enabled: calcShowMinimap
|
|
33
34
|
},
|
|
35
|
+
theme: theme,
|
|
34
36
|
readOnly: true,
|
|
35
|
-
scrollBeyondLastLine: false
|
|
37
|
+
scrollBeyondLastLine: false
|
|
36
38
|
}"
|
|
37
39
|
:original="originalEditorContent"
|
|
38
40
|
:diff-editor="true"
|
|
@@ -45,39 +47,43 @@ export default {
|
|
|
45
47
|
props: {
|
|
46
48
|
value: {
|
|
47
49
|
type: String,
|
|
48
|
-
default: ""
|
|
50
|
+
default: ""
|
|
49
51
|
},
|
|
50
52
|
originalValue: {
|
|
51
53
|
type: String,
|
|
52
|
-
default: ""
|
|
54
|
+
default: ""
|
|
53
55
|
},
|
|
54
56
|
readOnly: {
|
|
55
57
|
type: Boolean,
|
|
56
|
-
default: false
|
|
58
|
+
default: false
|
|
57
59
|
},
|
|
58
60
|
language: {
|
|
59
61
|
type: String,
|
|
60
|
-
default: "yaml"
|
|
62
|
+
default: "yaml"
|
|
61
63
|
},
|
|
62
64
|
showMinimap: {
|
|
63
65
|
type: Boolean,
|
|
64
|
-
default: true
|
|
66
|
+
default: true
|
|
65
67
|
},
|
|
66
68
|
editorHeight: {
|
|
67
69
|
type: Number,
|
|
68
|
-
default: 40
|
|
70
|
+
default: 40
|
|
69
71
|
},
|
|
72
|
+
editorTheme: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ""
|
|
75
|
+
}
|
|
70
76
|
},
|
|
71
77
|
components: {
|
|
72
78
|
EditorTabs: () => import("../tabs/EditorTabs.vue"),
|
|
73
|
-
MonacoEditor: () => import("vue-monaco")
|
|
79
|
+
MonacoEditor: () => import("vue-monaco")
|
|
74
80
|
},
|
|
75
81
|
|
|
76
82
|
data() {
|
|
77
83
|
return {
|
|
78
84
|
activeTab: "edit",
|
|
79
85
|
editorContent: "",
|
|
80
|
-
originalEditorContent: ""
|
|
86
|
+
originalEditorContent: ""
|
|
81
87
|
};
|
|
82
88
|
},
|
|
83
89
|
|
|
@@ -86,6 +92,14 @@ export default {
|
|
|
86
92
|
const noOfLines = this.editorContent.split("\n").length;
|
|
87
93
|
return this.showMinimap && noOfLines * 2 > this.editorHeight;
|
|
88
94
|
},
|
|
95
|
+
theme() {
|
|
96
|
+
return (
|
|
97
|
+
this.editorTheme ||
|
|
98
|
+
(document.documentElement.classList.contains("is-dark-theme")
|
|
99
|
+
? "vs-dark"
|
|
100
|
+
: "vs")
|
|
101
|
+
);
|
|
102
|
+
}
|
|
89
103
|
},
|
|
90
104
|
|
|
91
105
|
watch: {
|
|
@@ -95,7 +109,7 @@ export default {
|
|
|
95
109
|
if (this.editorContent !== n) {
|
|
96
110
|
this.editorContent = n;
|
|
97
111
|
}
|
|
98
|
-
}
|
|
112
|
+
}
|
|
99
113
|
},
|
|
100
114
|
originalValue: {
|
|
101
115
|
immediate: true,
|
|
@@ -103,8 +117,8 @@ export default {
|
|
|
103
117
|
if (this.originalEditorContent !== n) {
|
|
104
118
|
this.originalEditorContent = n;
|
|
105
119
|
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
108
122
|
},
|
|
109
123
|
|
|
110
124
|
methods: {
|
|
@@ -114,7 +128,7 @@ export default {
|
|
|
114
128
|
editor.onDidBlurEditorText(() => {
|
|
115
129
|
this.$emit("input", this.editorContent);
|
|
116
130
|
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
119
133
|
};
|
|
120
134
|
</script>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="app-drawer-wrapper
|
|
3
|
-
<div
|
|
2
|
+
<div class="app-drawer-wrapper is-flex">
|
|
3
|
+
<div
|
|
4
|
+
class="drawer-icon is-flex is-justify-content-center is-align-items-center"
|
|
5
|
+
>
|
|
4
6
|
<svg
|
|
5
7
|
class="gb_We"
|
|
6
8
|
focusable="false"
|
|
7
9
|
viewBox="0 0 24 24"
|
|
10
|
+
style="width: 22px;margin-top: 2px;"
|
|
8
11
|
:style="{ fill: 'white' }"
|
|
9
12
|
>
|
|
10
13
|
<path
|
|
@@ -20,16 +23,14 @@
|
|
|
20
23
|
<article class="media">
|
|
21
24
|
<figure class="media-left">
|
|
22
25
|
<p class="image">
|
|
23
|
-
<img
|
|
24
|
-
:src="app.icon_url"
|
|
25
|
-
/>
|
|
26
|
+
<img :src="app.icon_url" />
|
|
26
27
|
</p>
|
|
27
28
|
</figure>
|
|
28
29
|
<div class="media-content">
|
|
29
30
|
<div class="content">
|
|
30
31
|
<p>
|
|
31
|
-
<strong>{{app.title}}</strong>
|
|
32
|
-
<span>{{app.sub_title}}</span>
|
|
32
|
+
<strong>{{ app.title }}</strong>
|
|
33
|
+
<span>{{ app.sub_title }}</span>
|
|
33
34
|
</p>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
@@ -50,7 +51,7 @@ export default {
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
components: {
|
|
53
|
-
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
54
|
-
}
|
|
54
|
+
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
55
|
+
}
|
|
55
56
|
};
|
|
56
57
|
</script>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
v-if="themeMode"
|
|
5
|
+
class="button ac-nav-button"
|
|
6
|
+
style="color: #ffffff; font-size: 15px;"
|
|
7
|
+
@click="toggleTheme"
|
|
8
|
+
:title="themeModeIconTooltip"
|
|
9
|
+
>
|
|
10
|
+
<i :class="`fa ${themeModeIconClass}`" />
|
|
11
|
+
</button>
|
|
12
|
+
<div class="ac-menu-content theme-choice">
|
|
13
|
+
<ul class="is-flex is-flex-direction-row is-justify-content-space-around">
|
|
14
|
+
<li class="is-active"><i class="fa fa-moon-o"></i></li>
|
|
15
|
+
<li><i class="fa fa-desktop"></i></li>
|
|
16
|
+
<li><i class="fa fa-sun-o"></i></li>
|
|
17
|
+
</ul>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
themeMode: ""
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
computed: {
|
|
30
|
+
// to set icon class for theme mode
|
|
31
|
+
themeModeIconClass() {
|
|
32
|
+
if (this.themeMode === "system") {
|
|
33
|
+
return "fa-desktop";
|
|
34
|
+
} else if (this.themeMode === "light") {
|
|
35
|
+
return "fa-sun-o";
|
|
36
|
+
} else if (this.themeMode === "dark") {
|
|
37
|
+
return "fa-moon-o";
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
// to set icon tooltip for theme mode
|
|
42
|
+
themeModeIconTooltip() {
|
|
43
|
+
if (this.themeMode === "system") {
|
|
44
|
+
return "System theme";
|
|
45
|
+
} else if (this.themeMode === "light") {
|
|
46
|
+
return "Light theme";
|
|
47
|
+
} else if (this.themeMode === "dark") {
|
|
48
|
+
return "Dark theme";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
mounted() {
|
|
54
|
+
// get theme mode from localStorage or set default one
|
|
55
|
+
this.themeMode = localStorage.getItem("themeMode") || "light";
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
destroyed() {
|
|
59
|
+
this.removeColorSchemeEventListener();
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
watch: {
|
|
63
|
+
themeMode: {
|
|
64
|
+
handler(n) {
|
|
65
|
+
this.onThemeModeChange(n);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
methods: {
|
|
71
|
+
// handle theme mode button click
|
|
72
|
+
toggleTheme() {
|
|
73
|
+
if (this.themeMode === "light") this.themeMode = "dark";
|
|
74
|
+
else if (this.themeMode === "dark") this.themeMode = "system";
|
|
75
|
+
else if (this.themeMode === "system") this.themeMode = "light";
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
// triggered when theme mode is updated
|
|
79
|
+
onThemeModeChange(n) {
|
|
80
|
+
localStorage.setItem("themeMode", n);
|
|
81
|
+
|
|
82
|
+
let theme = n;
|
|
83
|
+
if (n === "system") {
|
|
84
|
+
const isDarkMode =
|
|
85
|
+
window.matchMedia &&
|
|
86
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
87
|
+
this.addColorSchemeEventListener();
|
|
88
|
+
theme = isDarkMode ? "dark" : "light";
|
|
89
|
+
} else {
|
|
90
|
+
this.removeColorSchemeEventListener();
|
|
91
|
+
}
|
|
92
|
+
this.$emit("set:theme", theme);
|
|
93
|
+
this.handleDarkThemeClass(theme);
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// add proper css class to update the ui theme
|
|
97
|
+
handleDarkThemeClass(currentTheme) {
|
|
98
|
+
if (currentTheme === "light") {
|
|
99
|
+
document.documentElement.classList.remove("is-dark-theme");
|
|
100
|
+
} else {
|
|
101
|
+
document.documentElement.classList.add("is-dark-theme");
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// add system theme listener event
|
|
106
|
+
addColorSchemeEventListener() {
|
|
107
|
+
window
|
|
108
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
109
|
+
.addEventListener("change", this.handleSystemThemeChange);
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
// remove system theme listener event
|
|
113
|
+
removeColorSchemeEventListener() {
|
|
114
|
+
window
|
|
115
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
116
|
+
.removeEventListener("change", this.handleSystemThemeChange);
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
handleSystemThemeChange() {
|
|
120
|
+
this.onThemeModeChange(this.themeMode);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column"
|
|
3
|
+
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column ac-preloader"
|
|
4
4
|
style="height: calc(100vh - 200px);"
|
|
5
5
|
>
|
|
6
6
|
<span v-if="showSpinner" class="spinner"></span>
|
|
@@ -15,12 +15,12 @@ export default {
|
|
|
15
15
|
props: {
|
|
16
16
|
showSpinner: {
|
|
17
17
|
type: Boolean,
|
|
18
|
-
default: true
|
|
18
|
+
default: true
|
|
19
19
|
},
|
|
20
20
|
message: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: "Fetching! Please wait for sometime..."
|
|
23
|
-
}
|
|
24
|
-
}
|
|
22
|
+
default: "Fetching! Please wait for sometime..."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
};
|
|
26
26
|
</script>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isLoaderActive" ref="cellLoaderDiv" :style="{ maxWidth: '300px' }">
|
|
3
|
-
<content-loader :height="10" :width="computedCellWidth || 300"
|
|
3
|
+
<content-loader :height="10" :width="computedCellWidth || 300" :primaryColor="primaryColor"
|
|
4
|
+
:secondaryColor="secondaryColor" />
|
|
4
5
|
</div>
|
|
5
6
|
<div v-else class="haha" ref="cellDiv">
|
|
6
7
|
<object-cell
|
|
@@ -24,6 +25,8 @@
|
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script>
|
|
28
|
+
import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
|
|
29
|
+
|
|
27
30
|
export default {
|
|
28
31
|
props: {
|
|
29
32
|
isLoaderActive: {
|
|
@@ -56,6 +59,12 @@ export default {
|
|
|
56
59
|
maxCharacterLength() {
|
|
57
60
|
return Math.ceil(this.computedCellWidth / 8);
|
|
58
61
|
},
|
|
62
|
+
primaryColor() {
|
|
63
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemePrimaryColor : loaderLightThemePrimaryColor;
|
|
64
|
+
},
|
|
65
|
+
secondaryColor() {
|
|
66
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemeSecondaryColor : loaderLightThemeSecondaryColor;
|
|
67
|
+
}
|
|
59
68
|
},
|
|
60
69
|
|
|
61
70
|
data() {
|
|
@@ -57,9 +57,9 @@ export default defineComponent({
|
|
|
57
57
|
|
|
58
58
|
// attach click event listener on window, and close the dropdown
|
|
59
59
|
function deactivateDropdown(e: Event) {
|
|
60
|
-
e.preventDefault();
|
|
61
60
|
const { target } = e;
|
|
62
61
|
if (
|
|
62
|
+
isDropdownActive.value &&
|
|
63
63
|
dropdown.value &&
|
|
64
64
|
dropdown.value !== target &&
|
|
65
65
|
!dropdown.value.contains(target as Node)
|