themekit-js 1.1.32 → 1.1.36

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.
@@ -9,18 +9,31 @@ const { base } = useData()
9
9
  const styles= computed(() => {
10
10
 
11
11
  let styles:any=[ ];
12
+ if(block['background']){
13
+ styles.push({ 'background':block['background']})
14
+ }
12
15
  if(block['background-color']){
13
16
  styles.push({ 'background-color':block['background-color']})
14
17
  }
15
18
  if(block['background-image']){
16
- styles.push({ 'background-image':'url('+base.value+block['background-image']+")"})
17
-
19
+ const src=block['background-image']
20
+ if(src.substring(0,1)=="/"){
21
+ styles.push({"background-image":"url("+ base.value+src.substring(1,src.length) +")"})
22
+ }else{
23
+ styles.push({"background-image":"url("+ src +")"})
24
+ }
25
+ }
26
+ if(block['width']){
27
+ styles.push({ 'width':block['width']})
18
28
  }
29
+ if(block['height']){
30
+ styles.push({ 'height':block['height']})
31
+ }
32
+ if(block['color']){
33
+ styles.push({ 'color':block['color']})
34
+ }
19
35
  return styles
20
- })
21
-
22
-
23
-
36
+ })
24
37
  </script>
25
38
  <template>
26
39
 
@@ -30,7 +43,7 @@ const styles= computed(() => {
30
43
  </template>
31
44
 
32
45
  <style>
33
- .doc{ background-size: cover;background-position: center;}
46
+ .doc{ background-size: cover;background-position: center; margin: 0 auto;}
34
47
  </style>
35
48
  <style scoped>
36
49
 
@@ -13,27 +13,42 @@ defineProps<{
13
13
 
14
14
 
15
15
 
16
+
17
+ function hasMasker(children:any){
18
+ return hasParam(children,"masker" );
19
+ }
16
20
  function hasCover(children:any){
17
-
18
- const styles:any=[]
21
+ return hasParam(children,"cover" );
22
+ }
23
+ function hasParam(children:any,name:string ){
24
+ const styles:any=[]
19
25
  for(let i=0;i< children.length;i++){
20
26
  const child=children[i]
21
27
  if(child["src"]!=null ){
22
- const pattern = /[?&]([^=#]+)=([^&#]*)/g;
28
+ const src=child["src"]
29
+ const pattern = /[?&]([^=#]+)=([^&#]*)/g;
30
+ const params:any={}
23
31
  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
- const src=child["src"]
32
+ while ((match = pattern.exec(src)) !== null) {
33
+ params[match[1]]=match[2]
34
+ }
35
+ if(params["class"]==name){
36
+ styles.push({"display":"block"})
29
37
  if(src.substring(0,1)=="/"){
30
38
  styles.push({"background-image":"url("+ base.value+src.substring(1,src.length) +")"})
31
39
  }else{
32
40
  styles.push({"background-image":"url("+ src +")"})
33
41
  }
34
- break
35
- }
36
- }
42
+ if(params["color"]){
43
+ styles.push({"color":params["color"]})
44
+ }
45
+ if(params["background"]){
46
+ styles.push({"background":params["background"]})
47
+ }
48
+ if(params["height"]){
49
+ styles.push({"height":params["height"]})
50
+ }
51
+ }
37
52
  }
38
53
  }
39
54
  return styles
@@ -43,14 +58,12 @@ function hasCover(children:any){
43
58
  <template>
44
59
  <div class="VPFeature" >
45
60
  <article class="box">
46
- <template v-for="(item) in block.children" >
47
-
48
-
49
- <i class="box-cover" :style="hasCover(item.children)" >
50
- <i class="box-marker" ></i>
51
- </i>
52
-
53
-
61
+ <template v-for="(item) in block.children" >
62
+ <div class="box-cover" :style="hasCover(item.children)" ></div>
63
+ <i class="box-cover-fixed" :style="hasCover(item.children)" ></i>
64
+ <div class="box-cover" :style="hasMasker(item.children)" >
65
+ <i class="box-marker" ></i>
66
+ </div>
54
67
  <h1 class="title" v-if="item.block_type=='h1'">
55
68
  <span v-for="(h1) in item.children" class="clip">{{h1.content}}</span>
56
69
  </h1>
@@ -118,7 +131,11 @@ function hasCover(children:any){
118
131
  background-size: cover;
119
132
  background-position: center;
120
133
  }
121
-
134
+ .VPFeature .box-cover-fixed{
135
+ display: none;
136
+ opacity: 0;
137
+ margin:-24px;
138
+ }
122
139
  .VPFeature.link:hover {
123
140
  border-color: var(--vp-c-brand-1);
124
141
  }
@@ -85,7 +85,8 @@ html:not(.dark) .VPImage.dark {
85
85
  .dark .VPImage.light {
86
86
  display: none;
87
87
  }
88
- .VPImage.cover{
88
+ .VPImage.cover,
89
+ .VPImage.masker{
89
90
  display: none;
90
91
  }
91
92
 
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-DnyzZFIh.js';
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-DokX1-DL.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'path';
4
4
  import 'shiki';
@@ -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-DnyzZFIh.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-DnyzZFIh.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DokX1-DL.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-DokX1-DL.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.32";
46736
+ var version = "1.1.36";
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.32",
3
+ "version": "1.1.36",
4
4
  "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@8.15.6",