@cloudron/pankow 4.4.3 → 4.4.5
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/components/SettingsItem.vue +49 -0
- package/components/Switch.vue +8 -0
- package/components/VersionCheckBanner.vue +37 -56
- package/index.js +2 -0
- package/package.json +3 -3
- package/types/index.d.ts +2 -1
- package/vite-plugin.js +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<template>
|
|
5
|
+
<div class="pankow-settings-item">
|
|
6
|
+
<div class="pankow-settings-item-body">
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="pankow-settings-item-bottom" v-if="$slots.bottom">
|
|
10
|
+
<slot name="bottom"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
|
|
17
|
+
.pankow-settings-item {
|
|
18
|
+
border-radius: var(--pankow-border-radius);
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin-bottom: 20px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pankow-settings-item-body {
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 20px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pankow-settings-item-body > :first-child {
|
|
31
|
+
max-width: 720px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (max-width: 576px) {
|
|
35
|
+
.pankow-settings-item[wrap] .pankow-settings-item-body {
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pankow-settings-item label {
|
|
41
|
+
margin-top: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pankow-settings-item-bottom {
|
|
45
|
+
width: 100%;
|
|
46
|
+
margin-top: 10px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
</style>
|
package/components/Switch.vue
CHANGED
|
@@ -69,6 +69,10 @@ function onChange(event) {
|
|
|
69
69
|
transition: all 250ms;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
.pankow-switch.pankow-switch-disabled span::before {
|
|
73
|
+
background-color: color-mix(in srgb, var(--pankow-text-color), transparent 60%);
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
.pankow-switch-input-label {
|
|
73
77
|
margin-left: 8px;
|
|
74
78
|
cursor: pointer;
|
|
@@ -87,6 +91,10 @@ input:checked + span::before {
|
|
|
87
91
|
background-color: white;
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
.pankow-switch.pankow-switch-disabled > input:checked + span::before {
|
|
95
|
+
background-color: color-mix(in srgb, white, transparent 60%);
|
|
96
|
+
}
|
|
97
|
+
|
|
90
98
|
.pankow-switch input {
|
|
91
99
|
display: none;
|
|
92
100
|
}
|
|
@@ -1,99 +1,80 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<Transition name="pankow-version-banner">
|
|
3
|
+
<div v-if="mismatch" class="pankow-version-banner">
|
|
4
|
+
<span>A new version is available.</span>
|
|
5
|
+
<Button plain @click="reload">Reload</Button>
|
|
6
|
+
<Button plain tool @click="dismiss" aria-label="Dismiss">✕</Button>
|
|
7
|
+
</div>
|
|
8
|
+
</Transition>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup>
|
|
12
12
|
import { ref, onMounted, onUnmounted } from 'vue';
|
|
13
|
+
import Button from './Button.vue';
|
|
13
14
|
|
|
14
15
|
const mismatch = ref(false);
|
|
15
16
|
|
|
16
17
|
function setMismatch() {
|
|
17
|
-
|
|
18
|
+
mismatch.value = true;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
function reload() {
|
|
21
|
-
|
|
22
|
+
window.location.reload(true);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
function dismiss() {
|
|
25
|
-
|
|
26
|
+
mismatch.value = false;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
function checkFlag() {
|
|
29
|
-
|
|
30
|
+
if (window.__pankow_version_mismatch) setMismatch();
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
onMounted(() => {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
if (window.__pankow_version_mismatch) setMismatch();
|
|
35
|
+
window.addEventListener('pankow:version-mismatch', checkFlag);
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
onUnmounted(() => {
|
|
38
|
-
|
|
39
|
+
window.removeEventListener('pankow:version-mismatch', checkFlag);
|
|
39
40
|
});
|
|
40
41
|
</script>
|
|
41
42
|
|
|
42
43
|
<style>
|
|
43
44
|
.pankow-version-banner {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
position: fixed;
|
|
46
|
+
top: 0;
|
|
47
|
+
left: 0;
|
|
48
|
+
right: 0;
|
|
49
|
+
z-index: 30002;
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 16px;
|
|
54
|
+
padding: 10px 24px;
|
|
55
|
+
background: var(--pankow-color-primary);
|
|
56
|
+
color: white;
|
|
57
|
+
font-family: var(--pankow-font-family, Inter, sans-serif);
|
|
58
|
+
font-size: 13px;
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
.pankow-version-banner-
|
|
63
|
-
|
|
64
|
-
border: 1px solid rgba(255, 255, 255, 0.4);
|
|
65
|
-
color: white;
|
|
66
|
-
padding: 4px 12px;
|
|
67
|
-
border-radius: var(--pankow-border-radius, 4px);
|
|
68
|
-
cursor: pointer;
|
|
69
|
-
font: inherit;
|
|
63
|
+
.pankow-version-banner .pankow-button[plain] {
|
|
64
|
+
color: white;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
.pankow-version-banner-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.pankow-version-banner-close {
|
|
77
|
-
background: none;
|
|
78
|
-
border: none;
|
|
79
|
-
color: rgba(255, 255, 255, 0.7);
|
|
80
|
-
cursor: pointer;
|
|
81
|
-
font-size: 14px;
|
|
82
|
-
padding: 0 4px;
|
|
83
|
-
line-height: 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.pankow-version-banner-close:hover {
|
|
87
|
-
color: white;
|
|
67
|
+
.pankow-version-banner .pankow-button[plain]:hover {
|
|
68
|
+
color: white;
|
|
88
69
|
}
|
|
89
70
|
|
|
90
71
|
.pankow-version-banner-enter-active,
|
|
91
72
|
.pankow-version-banner-leave-active {
|
|
92
|
-
|
|
73
|
+
transition: transform 0.3s ease;
|
|
93
74
|
}
|
|
94
75
|
|
|
95
76
|
.pankow-version-banner-enter-from,
|
|
96
77
|
.pankow-version-banner-leave-to {
|
|
97
|
-
|
|
78
|
+
transform: translateY(-100%);
|
|
98
79
|
}
|
|
99
80
|
</style>
|
package/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import ProgressBar from './components/ProgressBar.vue';
|
|
|
40
40
|
import RadioButton from './components/RadioButton.vue';
|
|
41
41
|
import SaveIndicator from './components/SaveIndicator.vue';
|
|
42
42
|
import SectionItem from './components/SectionItem.vue';
|
|
43
|
+
import SettingsItem from './components/SettingsItem.vue';
|
|
43
44
|
import SideBar from './components/SideBar.vue';
|
|
44
45
|
import SplitLayout from './components/SplitLayout.vue';
|
|
45
46
|
import Spinner from './components/Spinner.vue';
|
|
@@ -95,6 +96,7 @@ export {
|
|
|
95
96
|
RadioButton,
|
|
96
97
|
SaveIndicator,
|
|
97
98
|
SectionItem,
|
|
99
|
+
SettingsItem,
|
|
98
100
|
SideBar,
|
|
99
101
|
SplitLayout,
|
|
100
102
|
Spinner,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudron/pankow",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.4.
|
|
4
|
+
"version": "4.4.5",
|
|
5
5
|
"description": "Vue 3 UI component library for Cloudron apps",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@highlightjs/vue-plugin": "^2.1.0",
|
|
51
|
-
"@unhead/vue": "^3.
|
|
51
|
+
"@unhead/vue": "^3.3.0",
|
|
52
52
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
53
53
|
"highlight.js": "^11.11.1",
|
|
54
54
|
"typescript": "^7.0.2",
|
|
55
|
-
"vite": "^8.
|
|
55
|
+
"vite": "^8.2.0",
|
|
56
56
|
"vite-ssg": "^28.3.0",
|
|
57
57
|
"vue": "^3.5.40",
|
|
58
58
|
"vue-router": "^5.2.0"
|
package/types/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import ProgressBar from './components/ProgressBar.vue';
|
|
|
35
35
|
import RadioButton from './components/RadioButton.vue';
|
|
36
36
|
import SaveIndicator from './components/SaveIndicator.vue';
|
|
37
37
|
import SectionItem from './components/SectionItem.vue';
|
|
38
|
+
import SettingsItem from './components/SettingsItem.vue';
|
|
38
39
|
import SideBar from './components/SideBar.vue';
|
|
39
40
|
import SplitLayout from './components/SplitLayout.vue';
|
|
40
41
|
import Spinner from './components/Spinner.vue';
|
|
@@ -54,7 +55,7 @@ import utils from './utils.js';
|
|
|
54
55
|
import tooltip from './tooltip.js';
|
|
55
56
|
import fallbackImage from './fallbackImage.js';
|
|
56
57
|
import textOverflow from './text-overflow.js';
|
|
57
|
-
export { BottomBar, BreadCrumb, Button, ButtonGroup, ClipboardAction, ClipboardButton, CheckBox, DateTimeInput, Dialog, DirectoryView, EmailInput, FileUploader, FormGroup, InputGroup, Icon, ListItem, InputDialog, LoginView, MainLayout, MaskedInput, Menu, MenuItem, SingleSelect, MultiSelect, Notification, NumberInput, OfflineBanner, PasswordInput, Popover, ProgressBar, RadioButton, SaveIndicator, SectionItem, SideBar, SplitLayout, Spinner, Switch, TableView, TableViewActionBar, TabView, TagInput, TextInput, TextInputRaw, TopBar, TreeView, fetcher, gestures, tooltip, fallbackImage, textOverflow, utils, };
|
|
58
|
+
export { BottomBar, BreadCrumb, Button, ButtonGroup, ClipboardAction, ClipboardButton, CheckBox, DateTimeInput, Dialog, DirectoryView, EmailInput, FileUploader, FormGroup, InputGroup, Icon, ListItem, InputDialog, LoginView, MainLayout, MaskedInput, Menu, MenuItem, SingleSelect, MultiSelect, Notification, NumberInput, OfflineBanner, PasswordInput, Popover, ProgressBar, RadioButton, SaveIndicator, SectionItem, SettingsItem, SideBar, SplitLayout, Spinner, Switch, TableView, TableViewActionBar, TabView, TagInput, TextInput, TextInputRaw, TopBar, TreeView, fetcher, gestures, tooltip, fallbackImage, textOverflow, utils, };
|
|
58
59
|
export { CheckBox as Checkbox };
|
|
59
60
|
export { RadioButton as Radiobutton };
|
|
60
61
|
export { BreadCrumb as Breadcrumb };
|
package/vite-plugin.js
CHANGED
|
@@ -73,7 +73,7 @@ export default function pankowPlugin({ versionCheck = false } = {}) {
|
|
|
73
73
|
},
|
|
74
74
|
transformIndexHtml(html) {
|
|
75
75
|
if (!versionCheck) return html;
|
|
76
|
-
buildId = Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 8);
|
|
76
|
+
if (!buildId) buildId = Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 8);
|
|
77
77
|
return html.replace('</head>', `<meta name="build-id" content="${buildId}">\n${versionCheckScript}\n</head>`);
|
|
78
78
|
},
|
|
79
79
|
closeBundle() {
|