themekit-js 1.47.3018 → 1.47.3110

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,6 @@
1
1
  <script setup lang="ts">
2
- import Image from './Image.vue'
2
+
3
+ import { withBase } from 'themekit-js'
3
4
  import Button from './Button.vue'
4
5
 
5
6
  const _blank:string="_blank"
@@ -18,7 +19,7 @@ function CoverStyles(children:any){
18
19
 
19
20
 
20
21
 
21
- function ItemStyles(child:any,name:string ){
22
+ function ItemStyles(child:any){//,name:string ){
22
23
  const styles:any=[]
23
24
 
24
25
  if(child["src"]!=null ){
@@ -29,21 +30,21 @@ function CoverStyles(children:any){
29
30
  while ((match = pattern.exec(src)) !== null) {
30
31
  params[match[1]]=match[2]
31
32
  }
32
- if(params["class"]==name){
33
- styles.push({"display":"block"})
33
+ // if(params["class"]==name){
34
+
34
35
  if(params["background"]){
35
36
  styles.push({"background":decodeURIComponent(params["background"])})
36
37
  }
37
38
  if(params["height"]){
38
39
  styles.push({"height":params["height"]})
39
40
  }
40
- }
41
+ // }
41
42
  }
42
43
 
43
44
  return styles
44
45
  }
45
46
 
46
-
47
+ /**
47
48
  function hasImageParam(child:any,name:string ){
48
49
 
49
50
  if(child["src"]!=null ){
@@ -59,32 +60,27 @@ function hasImageParam(child:any,name:string ){
59
60
  }
60
61
  }
61
62
  return false;
62
- }
63
+ }*/
63
64
  </script>
64
65
 
65
66
  <template>
66
67
  <div class="VPFeature" >
67
68
  <article class="box">
68
- <template v-for="(item) in block.children" >
69
- <template v-for="(subitem) in item.children">
70
- <template v-if="hasImageParam(subitem,'masker')" >
71
- <div class="block-feature-masker" :style="ItemStyles(subitem,'masker')">
72
- <template v-if="subitem.src.substring(0,5)!='blank'">
73
- <img v-if="subitem.block_type=='img' " :src="subitem.src" />
74
- <i class="box-marker"></i>
75
- </template>
76
- </div>
77
- </template>
69
+ <template v-for="(item) in block.children" >
70
+ <template v-for="(subitem) in item.children">
71
+ <div v-if="subitem.block_type=='img'&&subitem.alt=='masker'" class="block-feature-masker" >
72
+ <img alt="Image" :src="withBase(subitem.src)" />
73
+ <i class="box-marker"></i>
74
+ </div>
75
+ <div v-if="subitem.block_type=='img'&&subitem.alt=='background'" :style="ItemStyles(subitem)" class="block-feature-masker" ></div>
78
76
  </template>
79
77
  </template>
80
78
  <div class="box-inner">
81
79
  <template v-for="(item) in block.children" >
82
80
  <template v-for="(subitem) in item.children">
83
- <template v-if="hasImageParam(subitem,'icon')" >
84
- <div class="block-feature-icon" :style="ItemStyles(subitem,'icon')">
85
- <img v-if="subitem.block_type=='img' " :src="subitem.src" />
86
- </div>
87
- </template>
81
+ <div v-if="subitem.block_type=='img'&&subitem.alt=='icon'" class="block-feature-icon" >
82
+ <img alt="Image" :src="withBase(subitem.src)" />
83
+ </div>
88
84
  </template>
89
85
  </template>
90
86
  <div class="box-main" >
@@ -101,8 +97,8 @@ function hasImageParam(child:any,name:string ){
101
97
  <p v-if="item.block_type=='p'" class="details" >
102
98
  <template v-for="(subitem) in item.children">
103
99
  <template v-if="subitem.block_type=='text'">{{subitem.content}} </template>
104
- <Image v-if="subitem.block_type=='img'&&!hasImageParam(subitem,'masker')&&!hasImageParam(subitem,'icon')"
105
- :block="subitem" />
100
+ <img v-if="subitem.block_type=='img'&&subitem.alt!='icon'&&subitem.alt!='masker'"
101
+ :src="subitem.src" />
106
102
  <Button v-if="subitem.block_type=='a'"
107
103
  tag="a"
108
104
  size="medium"
@@ -141,9 +137,7 @@ function hasImageParam(child:any,name:string ){
141
137
  background-color: #eee;
142
138
  }
143
139
 
144
- .dark .VPFeature .box-marker {
145
- background-color: #222;
146
- }
140
+
147
141
  .block-feature-icon{
148
142
  margin-right:16px;
149
143
  }
@@ -158,6 +152,7 @@ function hasImageParam(child:any,name:string ){
158
152
  overflow:hidden;
159
153
 
160
154
  }
155
+ .dark .block-feature-masker{ background-color: #222 !important ; }
161
156
  .block-feature-masker img{ width: 100%;}
162
157
 
163
158
 
@@ -173,6 +168,8 @@ function hasImageParam(child:any,name:string ){
173
168
  height: 100%;
174
169
  position: relative;
175
170
  }
171
+
172
+
176
173
  .box-inner{ padding: 24px; z-index: 1; display: flex; }
177
174
  .box-main{ flex-grow: 1;}
178
175
  .box > :deep(.VPImage) {
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-C1giFHyt.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-DmUU-lBi.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-C1giFHyt.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-C1giFHyt.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DmUU-lBi.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-DmUU-lBi.js';
5
5
  import path from 'path';
6
6
  import 'crypto';
7
7
  import 'module';
@@ -38286,7 +38286,8 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
38286
38286
  for (let i2 = start2; i2 < tokens.length; i2++) {
38287
38287
  const token = tokens[i2];
38288
38288
  if (token.type == "image") {
38289
- parent["children"].push({ "block_type": "img", "content": token.attrGet("content"), "src": token.attrGet("src") });
38289
+ const alt = token.children != null && token.children.length > 0 ? token.children[0]["content"] : "";
38290
+ parent["children"].push({ "block_type": "img", "content": token.attrGet("content"), "alt": alt, "src": token.attrGet("src") });
38290
38291
  continue;
38291
38292
  }
38292
38293
  if (token.tag == "code") {
@@ -46738,7 +46739,7 @@ function escapeHtml(string) {
46738
46739
 
46739
46740
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
46740
46741
 
46741
- var version = "1.47.3018";
46742
+ var version = "1.47.3110";
46742
46743
 
46743
46744
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
46744
46745
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themekit-js",
3
- "version": "1.47.3018",
3
+ "version": "1.47.3110",
4
4
  "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@8.15.6",