themekit-js 1.1.13 → 1.1.15
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/Doc.vue +4 -1
- package/dist/client/theme-default/components/blocks/Features.vue +4 -1
- package/dist/client/theme-default/components/blocks/Hero.vue +3 -0
- package/dist/client/theme-default/styles/components/vp-doc.css +5 -3
- package/dist/node/cli.js +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/{serve-CFnipkLI.js → serve-BI5vlbXe.js} +66 -56
- package/package.json +1 -1
|
@@ -10,10 +10,13 @@ const docStyles= computed(() => {
|
|
|
10
10
|
|
|
11
11
|
let styles:any=[ vw ? { '--vp-offset': "calc(50% - "+vw.value/2+"px)"} : {}];
|
|
12
12
|
if(block['background-color']){
|
|
13
|
-
|
|
13
|
+
styles.push({ 'background-color':block['background-color']})
|
|
14
14
|
}
|
|
15
15
|
if(block['background-image']){
|
|
16
16
|
styles.push({ 'background-image':"url("+block['background-image']+")"})
|
|
17
|
+
}
|
|
18
|
+
if(block['color']){
|
|
19
|
+
styles.push({ 'color':block['color']})
|
|
17
20
|
}
|
|
18
21
|
return styles
|
|
19
22
|
})
|
|
@@ -24,7 +24,10 @@ if(props.block['background-color']){
|
|
|
24
24
|
}
|
|
25
25
|
if(props.block['background-image']){
|
|
26
26
|
styles.push({'background-image':"url("+props.block['background-image']+")"})
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
|
+
if(props.block['color']){
|
|
29
|
+
styles.push({ 'color':props.block['color']})
|
|
30
|
+
}
|
|
28
31
|
return styles
|
|
29
32
|
})
|
|
30
33
|
|
|
@@ -63,6 +63,9 @@ const styles= computed(() => {
|
|
|
63
63
|
if(props.block['background-image']){
|
|
64
64
|
styles.push({'background-image':"url("+props.block['background-image']+")"})
|
|
65
65
|
}
|
|
66
|
+
if(props.block['color']){
|
|
67
|
+
styles.push({ 'color':props.block['color']})
|
|
68
|
+
}
|
|
66
69
|
return styles
|
|
67
70
|
})
|
|
68
71
|
</script>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Headings
|
|
3
3
|
* -------------------------------------------------------------------------- */
|
|
4
|
+
.vp-doc{
|
|
4
5
|
|
|
6
|
+
overflow: auto;
|
|
7
|
+
}
|
|
5
8
|
.vp-doc h1,
|
|
6
9
|
.vp-doc h2,
|
|
7
10
|
.vp-doc h3,
|
|
@@ -76,10 +79,9 @@
|
|
|
76
79
|
line-height: 40px;
|
|
77
80
|
font-size: 32px;
|
|
78
81
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
82
|
+
}
|
|
81
83
|
.vp-doc h2 .header-anchor {
|
|
82
|
-
top:
|
|
84
|
+
top:18px;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
/**
|
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-BI5vlbXe.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-BI5vlbXe.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-BI5vlbXe.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -38260,67 +38260,77 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
|
|
|
38260
38260
|
const blocksRegex = /<!--#([\s\S]*?)#-->/g;
|
|
38261
38261
|
let blockRaws = [];
|
|
38262
38262
|
let blockRaw;
|
|
38263
|
-
|
|
38264
|
-
|
|
38265
|
-
|
|
38263
|
+
const regexLayout = /(?<=<!--\$layout).*?(?=-->)/g;
|
|
38264
|
+
let layout;
|
|
38265
|
+
let layoutVal = "doc";
|
|
38266
|
+
while (layout = regexLayout.exec(src)) {
|
|
38267
|
+
const attrStart = layout[0].indexOf(":");
|
|
38268
|
+
layoutVal = layout[0].substring(attrStart + 1).trim();
|
|
38269
|
+
}
|
|
38270
|
+
console.log("Layout:" + layoutVal);
|
|
38266
38271
|
let blocks = [];
|
|
38267
|
-
|
|
38268
|
-
|
|
38269
|
-
|
|
38270
|
-
|
|
38271
|
-
|
|
38272
|
-
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38276
|
-
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38283
|
-
|
|
38284
|
-
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
|
|
38288
|
-
|
|
38289
|
-
|
|
38290
|
-
|
|
38272
|
+
if (layoutVal == "block") {
|
|
38273
|
+
while ((blockRaw = blocksRegex.exec(src)) !== null) {
|
|
38274
|
+
blockRaws.push(blockRaw[0]);
|
|
38275
|
+
}
|
|
38276
|
+
for (let i = 0; i < blockRaws.length; i++) {
|
|
38277
|
+
let Token2JSON2 = function(tokens, parent = {}, closeTag, start2) {
|
|
38278
|
+
for (let i2 = start2; i2 < tokens.length; i2++) {
|
|
38279
|
+
const token = tokens[i2];
|
|
38280
|
+
if (token.type == "image") {
|
|
38281
|
+
parent["children"].push({ "block_type": "img", "content": token.attrGet("content"), "src": token.attrGet("src") });
|
|
38282
|
+
continue;
|
|
38283
|
+
}
|
|
38284
|
+
if (token.tag == "code") {
|
|
38285
|
+
parent["children"].push({ "block_type": "div", "content": "", "html": md.render("```" + token.info + "\n" + token.content + "```", env) });
|
|
38286
|
+
continue;
|
|
38287
|
+
}
|
|
38288
|
+
if (token.type.indexOf("_open") >= 0) {
|
|
38289
|
+
const newBlock = { "block_type": token.tag, "content": token.content, "children": [] };
|
|
38290
|
+
if (token.type == "link_open") {
|
|
38291
|
+
newBlock.href = token.attrGet("href");
|
|
38292
|
+
}
|
|
38293
|
+
parent["children"].push(newBlock);
|
|
38294
|
+
i2 = Token2JSON2(tokens, parent["children"][parent["children"].length - 1], token.tag, i2 + 1);
|
|
38295
|
+
} else if (token.type.indexOf("_close") >= 0 && token.tag == closeTag) {
|
|
38296
|
+
return i2;
|
|
38291
38297
|
} else {
|
|
38292
|
-
|
|
38298
|
+
if (token.children == null) {
|
|
38299
|
+
parent["children"].push(token.content.indexOf("<!--") >= 0 ? { "block_type": "mark", "content": token.content } : { "block_type": token.tag == "" ? "text" : token.tag, "content": token.content });
|
|
38300
|
+
} else {
|
|
38301
|
+
Token2JSON2(token.children, parent, "item", 0);
|
|
38302
|
+
}
|
|
38293
38303
|
}
|
|
38294
38304
|
}
|
|
38305
|
+
return tokens.length;
|
|
38306
|
+
};
|
|
38307
|
+
const block = blockRaws[i];
|
|
38308
|
+
src = src.replace(block, "<!--Block-->");
|
|
38309
|
+
const blockVarsRegex = /(?<=<!--\$).*?(?=-->)/g;
|
|
38310
|
+
let match2;
|
|
38311
|
+
const blockVars = {};
|
|
38312
|
+
while (match2 = blockVarsRegex.exec(block)) {
|
|
38313
|
+
const attrStart = match2[0].indexOf(":");
|
|
38314
|
+
const attrVal = match2[0].substring(attrStart + 1).trim();
|
|
38315
|
+
const attrName = match2[0].substring(0, attrStart);
|
|
38316
|
+
blockVars[attrName] = attrVal;
|
|
38317
|
+
}
|
|
38318
|
+
const blockTypeRegex = /(?<=<!--#).*?(?=-->)/g;
|
|
38319
|
+
const blockType = blockTypeRegex.exec(block);
|
|
38320
|
+
const blockContent = blockType != null && (blockType[0] == "Doc" || blockType[0] == "Github") ? md.render(block, env) : "";
|
|
38321
|
+
const blockItem = Object.assign(
|
|
38322
|
+
blockVars,
|
|
38323
|
+
{ "children": [], "block_type": blockType === null ? "blank" : blockType[0], "content": blockContent }
|
|
38324
|
+
);
|
|
38325
|
+
if (blockType != null && blockType[0] != "Doc" && blockType[0] != "Github") {
|
|
38326
|
+
Token2JSON2(MarkdownIt({
|
|
38327
|
+
html: true,
|
|
38328
|
+
linkify: true,
|
|
38329
|
+
...options
|
|
38330
|
+
}).parse(block, env), blockItem, "body", 0);
|
|
38295
38331
|
}
|
|
38296
|
-
|
|
38297
|
-
};
|
|
38298
|
-
const block = blockRaws[i];
|
|
38299
|
-
src = src.replace(block, "<!--Block-->");
|
|
38300
|
-
const blockVarsRegex = /(?<=<!--\$).*?(?=-->)/g;
|
|
38301
|
-
let match2;
|
|
38302
|
-
const blockVars = {};
|
|
38303
|
-
while (match2 = blockVarsRegex.exec(block)) {
|
|
38304
|
-
const attrStart = match2[0].indexOf(":");
|
|
38305
|
-
const attrVal = match2[0].substring(attrStart + 1).trim();
|
|
38306
|
-
const attrName = match2[0].substring(0, attrStart);
|
|
38307
|
-
blockVars[attrName] = attrVal;
|
|
38308
|
-
}
|
|
38309
|
-
const blockTypeRegex = /(?<=<!--#).*?(?=-->)/g;
|
|
38310
|
-
const blockType = blockTypeRegex.exec(block);
|
|
38311
|
-
const blockContent = blockType != null && (blockType[0] == "Doc" || blockType[0] == "Github") ? md.render(block, env) : "";
|
|
38312
|
-
const blockItem = Object.assign(
|
|
38313
|
-
blockVars,
|
|
38314
|
-
{ "children": [], "block_type": blockType === null ? "blank" : blockType[0], "content": blockContent }
|
|
38315
|
-
);
|
|
38316
|
-
if (blockType != null && blockType[0] != "Doc" && blockType[0] != "Github") {
|
|
38317
|
-
Token2JSON2(MarkdownIt({
|
|
38318
|
-
html: true,
|
|
38319
|
-
linkify: true,
|
|
38320
|
-
...options
|
|
38321
|
-
}).parse(block, env), blockItem, "body", 0);
|
|
38332
|
+
blocks.push(blockItem);
|
|
38322
38333
|
}
|
|
38323
|
-
blocks.push(blockItem);
|
|
38324
38334
|
}
|
|
38325
38335
|
const html = md.render(src, env);
|
|
38326
38336
|
const {
|
|
@@ -46715,7 +46725,7 @@ function escapeHtml(string) {
|
|
|
46715
46725
|
|
|
46716
46726
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46717
46727
|
|
|
46718
|
-
var version = "1.1.
|
|
46728
|
+
var version = "1.1.15";
|
|
46719
46729
|
|
|
46720
46730
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46721
46731
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|