@vuepress/plugin-redirect 2.0.0-rc.23 → 2.0.0-rc.25
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { usePreferredLanguages, useScrollLock, useSessionStorage, } from '@vueuse/core';
|
|
2
|
-
import { computed, defineComponent, h,
|
|
2
|
+
import { computed, defineComponent, h, onBeforeUnmount, onMounted, ref, TransitionGroup, watch, } from 'vue';
|
|
3
3
|
import { useRoute, useRouteLocale, useRouter } from 'vuepress/client';
|
|
4
4
|
import { redirectLocaleConfig, redirectLocaleEntries } from '../define.js';
|
|
5
5
|
import '../styles/language-switch.css';
|
|
@@ -67,20 +67,20 @@ export default defineComponent({
|
|
|
67
67
|
watch(showModal, (value) => {
|
|
68
68
|
isLocked.value = value;
|
|
69
69
|
}, { immediate: true });
|
|
70
|
-
|
|
70
|
+
onBeforeUnmount(() => {
|
|
71
71
|
isLocked.value = false;
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
return () => showModal.value
|
|
75
|
-
? h(TransitionGroup, { name: '
|
|
76
|
-
? h('div', { key: 'mask', class: '
|
|
75
|
+
? h(TransitionGroup, { name: 'redirect-modal-fade' }, () => showModal.value
|
|
76
|
+
? h('div', { key: 'mask', class: 'redirect-modal-mask' }, h('div', {
|
|
77
77
|
key: 'popup',
|
|
78
|
-
class: '
|
|
78
|
+
class: 'redirect-modal-wrapper',
|
|
79
79
|
}, [
|
|
80
|
-
h('div', { class: '
|
|
80
|
+
h('div', { class: 'redirect-modal-content' }, locale.value?.hint.map((text) => h('p', text))),
|
|
81
81
|
h('button', {
|
|
82
82
|
type: 'button',
|
|
83
|
-
class: '
|
|
83
|
+
class: 'redirect-modal-action primary',
|
|
84
84
|
onClick: () => {
|
|
85
85
|
updateStatus();
|
|
86
86
|
router.replace(targetRoute.value);
|
|
@@ -88,7 +88,7 @@ export default defineComponent({
|
|
|
88
88
|
}, locale.value?.switch),
|
|
89
89
|
h('button', {
|
|
90
90
|
type: 'button',
|
|
91
|
-
class: '
|
|
91
|
+
class: 'redirect-modal-action',
|
|
92
92
|
onClick: () => updateStatus(),
|
|
93
93
|
}, locale.value?.cancel),
|
|
94
94
|
]))
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
.
|
|
2
|
-
.
|
|
1
|
+
.redirect-modal-fade-enter-active,
|
|
2
|
+
.redirect-modal-fade-leave-active {
|
|
3
3
|
transition: opacity 0.5s;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
.
|
|
6
|
+
.redirect-modal-fade-enter,
|
|
7
|
+
.redirect-modal-fade-leave-to {
|
|
8
8
|
opacity: 0;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
11
|
+
.redirect-modal-mask {
|
|
12
12
|
position: fixed;
|
|
13
13
|
inset: 0;
|
|
14
14
|
z-index: var(--redirect-z-index);
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
backdrop-filter: blur(10px);
|
|
19
19
|
}
|
|
20
20
|
@media print {
|
|
21
|
-
.
|
|
21
|
+
.redirect-modal-mask {
|
|
22
22
|
display: none;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.redirect-modal-wrapper {
|
|
27
27
|
position: relative;
|
|
28
28
|
z-index: 1500;
|
|
29
29
|
overflow: hidden;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
box-shadow: 0 2px 6px 0 var(--card-shadow);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.
|
|
37
|
+
.redirect-modal-action {
|
|
38
38
|
display: block;
|
|
39
39
|
width: 100%;
|
|
40
40
|
margin: 1rem 0;
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
color: inherit;
|
|
46
46
|
cursor: pointer;
|
|
47
47
|
}
|
|
48
|
-
.
|
|
48
|
+
.redirect-modal-action:hover {
|
|
49
49
|
background-color: var(--redirect-bg-color-light);
|
|
50
50
|
}
|
|
51
|
-
.
|
|
51
|
+
.redirect-modal-action.primary {
|
|
52
52
|
background-color: var(--redirect-primary-color);
|
|
53
53
|
color: var(--redirect-primary-text-color);
|
|
54
54
|
}
|
|
55
|
-
.
|
|
55
|
+
.redirect-modal-action.primary:hover {
|
|
56
56
|
background-color: var(--redirect-primary-hover-color);
|
|
57
57
|
}
|
|
@@ -6,8 +6,6 @@ export const getRedirectLocaleConfig = (app, options) => {
|
|
|
6
6
|
const { locales } = app.options;
|
|
7
7
|
const localeConfig = deepAssign(fromEntries(entries(locales)
|
|
8
8
|
.filter(([key, { lang }]) => {
|
|
9
|
-
if (key === '/')
|
|
10
|
-
return false;
|
|
11
9
|
if (!lang) {
|
|
12
10
|
logger.error(`Missing ${colors.magenta('lang')} option for locale "${key}", this locale will be ignored!`);
|
|
13
11
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/plugin-redirect",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.25",
|
|
4
4
|
"description": "VuePress plugin - redirect",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-plugin",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"style": "sass src:lib --no-source-map"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vuepress/helper": "~2.0.0-rc.
|
|
45
|
+
"@vuepress/helper": "~2.0.0-rc.24",
|
|
46
46
|
"@vueuse/core": "^10.9.0",
|
|
47
47
|
"cac": "^6.7.14",
|
|
48
48
|
"vue": "^3.4.21"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "6fc0c991838123f38dd60462ad16d7e48463b699"
|
|
57
57
|
}
|