themekit-js 1.1.22 → 1.1.31
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/dist/client/theme-default/components/blocks/Button.vue +18 -2
- package/dist/client/theme-default/components/blocks/Feature.vue +66 -9
- package/dist/client/theme-default/components/blocks/Image.vue +3 -10
- package/dist/node/cli.js +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/{serve-B2ZqpcxS.js → serve-DIhz1XaQ.js} +1 -1
- package/package.json +2 -2
|
@@ -33,14 +33,30 @@ const params = computed(() => {
|
|
|
33
33
|
// return [params["theme"]==null?props.theme:params["theme"],params["size"]==null?props.size:params["size"],props.baseClass]
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
const classes = computed(() => {
|
|
38
|
+
const _:any=[props.baseClass]
|
|
39
|
+
if(params.value['theme']!=null){
|
|
40
|
+
_.push(params.value['theme'])
|
|
41
|
+
}
|
|
42
|
+
if(params.value['size']!=null){
|
|
43
|
+
_.push(params.value['size'])
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if(params.value['class']!=null){
|
|
47
|
+
_.push(params.value['class'])
|
|
48
|
+
}
|
|
49
|
+
return _
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
//[params['theme']==null?props.theme:params['theme'],params['size']==null?props.size:params['size'],props.baseClass]
|
|
37
53
|
</script>
|
|
38
54
|
|
|
39
55
|
<template >
|
|
40
56
|
<component
|
|
41
57
|
:is="component"
|
|
42
58
|
class="btn"
|
|
43
|
-
:class="
|
|
59
|
+
:class="classes"
|
|
44
60
|
:href="href ? href : undefined"
|
|
45
61
|
:target="props.target"
|
|
46
62
|
>
|
|
@@ -2,17 +2,50 @@
|
|
|
2
2
|
import Image from './Image.vue'
|
|
3
3
|
import Button from './Button.vue'
|
|
4
4
|
|
|
5
|
+
import { useData } from '../../composables/data'
|
|
6
|
+
|
|
7
|
+
const { base } = useData()
|
|
5
8
|
const _blank:string="_blank"
|
|
6
9
|
|
|
7
10
|
defineProps<{
|
|
8
11
|
block?: any
|
|
9
12
|
}>()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
function hasCover(children:any){
|
|
17
|
+
|
|
18
|
+
const styles:any=[]
|
|
19
|
+
for(let i=0;i< children.length;i++){
|
|
20
|
+
const child=children[i]
|
|
21
|
+
if(child["src"]!=null ){
|
|
22
|
+
const pattern = /[?&]([^=#]+)=([^&#]*)/g;
|
|
23
|
+
let match;
|
|
24
|
+
while ((match = pattern.exec(child["src"])) !== null) {
|
|
25
|
+
|
|
26
|
+
if(match.length>2&&match[1]=="class"&&match[2]=="cover"){
|
|
27
|
+
styles.push({"display":"block"})
|
|
28
|
+
styles.push({"background-image":"url("+ base.value+ child["src"] +")"})
|
|
29
|
+
break
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return styles
|
|
35
|
+
}
|
|
10
36
|
</script>
|
|
11
37
|
|
|
12
38
|
<template>
|
|
13
39
|
<div class="VPFeature" >
|
|
14
40
|
<article class="box">
|
|
15
41
|
<template v-for="(item) in block.children" >
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<i class="box-cover" :style="hasCover(item.children)" >
|
|
45
|
+
<i class="box-marker" ></i>
|
|
46
|
+
</i>
|
|
47
|
+
|
|
48
|
+
|
|
16
49
|
<h1 class="title" v-if="item.block_type=='h1'">
|
|
17
50
|
<span v-for="(h1) in item.children" class="clip">{{h1.content}}</span>
|
|
18
51
|
</h1>
|
|
@@ -26,16 +59,13 @@ defineProps<{
|
|
|
26
59
|
<template v-for="(subitem) in item.children">
|
|
27
60
|
<template v-if="subitem.block_type=='text'">{{subitem.content}} </template>
|
|
28
61
|
<Image v-if="subitem.block_type=='img'"
|
|
29
|
-
:block="subitem"
|
|
30
|
-
/>
|
|
62
|
+
:block="subitem" />
|
|
31
63
|
<Button v-if="subitem.block_type=='a'"
|
|
32
|
-
|
|
33
|
-
|
|
64
|
+
tag="a"
|
|
65
|
+
size="medium"
|
|
34
66
|
:block="subitem"
|
|
35
67
|
:href="subitem.href"
|
|
36
|
-
:target="_blank"
|
|
37
|
-
></Button>
|
|
38
|
-
|
|
68
|
+
:target="_blank" ></Button>
|
|
39
69
|
</template>
|
|
40
70
|
</p>
|
|
41
71
|
|
|
@@ -46,8 +76,7 @@ defineProps<{
|
|
|
46
76
|
|
|
47
77
|
<style scoped>
|
|
48
78
|
.VPFeature {
|
|
49
|
-
display: block;
|
|
50
|
-
border: 1px solid var(--vp-c-bg-soft);
|
|
79
|
+
display: block;
|
|
51
80
|
border-radius: 12px;
|
|
52
81
|
height: 100%;
|
|
53
82
|
background-color: var(--vp-c-bg-soft);
|
|
@@ -56,6 +85,34 @@ defineProps<{
|
|
|
56
85
|
overflow: hidden;
|
|
57
86
|
}
|
|
58
87
|
|
|
88
|
+
.VPFeature .box-marker {
|
|
89
|
+
display: block;
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 0;
|
|
92
|
+
left: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
bottom: 0;
|
|
95
|
+
z-index: 0;
|
|
96
|
+
opacity: 0.75;
|
|
97
|
+
background-color: #fff;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.dark .VPFeature .box-marker {
|
|
101
|
+
background-color: #222;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.VPFeature .box-cover {
|
|
105
|
+
display: none;
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 0;
|
|
108
|
+
left: 0;
|
|
109
|
+
right: 0;
|
|
110
|
+
bottom: 0;
|
|
111
|
+
z-index: 0;
|
|
112
|
+
border-radius: 12px;
|
|
113
|
+
background-size: cover;
|
|
114
|
+
background-position: center;
|
|
115
|
+
}
|
|
59
116
|
|
|
60
117
|
.VPFeature.link:hover {
|
|
61
118
|
border-color: var(--vp-c-brand-1);
|
|
@@ -85,15 +85,8 @@ html:not(.dark) .VPImage.dark {
|
|
|
85
85
|
.dark .VPImage.light {
|
|
86
86
|
display: none;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.cover{
|
|
91
|
-
position: absolute;
|
|
92
|
-
top: 0;
|
|
93
|
-
left: 0;
|
|
94
|
-
right: 0;
|
|
95
|
-
bottom: 0;
|
|
96
|
-
z-index: -1;
|
|
97
|
-
border-radius: 12px;
|
|
88
|
+
.VPImage.cover{
|
|
89
|
+
display: none;
|
|
98
90
|
}
|
|
91
|
+
|
|
99
92
|
</style>
|
package/dist/node/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-
|
|
1
|
+
import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-DIhz1XaQ.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'shiki';
|
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizePath } from 'vite';
|
|
2
2
|
export { loadEnv } from 'vite';
|
|
3
|
-
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-
|
|
4
|
-
export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-
|
|
3
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DIhz1XaQ.js';
|
|
4
|
+
export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-DIhz1XaQ.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -46733,7 +46733,7 @@ function escapeHtml(string) {
|
|
|
46733
46733
|
|
|
46734
46734
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46735
46735
|
|
|
46736
|
-
var version = "1.1.
|
|
46736
|
+
var version = "1.1.31";
|
|
46737
46737
|
|
|
46738
46738
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46739
46739
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "themekit-js",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.31",
|
|
4
4
|
"description": "基于VitePress开发的Markdown静态网站生成器",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@8.15.6",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"./vue-demi": {
|
|
29
29
|
"default": "./lib/vue-demi.mjs"
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
},
|
|
32
32
|
"bin": {
|
|
33
33
|
"themekit": "bin/themekit.js"
|