@slidev/cli 0.49.12 → 0.49.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/{build-U63KCQIF.mjs → build-J45HACJD.mjs} +3 -5
- package/dist/{chunk-RG2EEPCO.mjs → chunk-27Q2X57X.mjs} +28 -0
- package/dist/{chunk-KNG6PIQ7.mjs → chunk-VAXCTWQX.mjs} +187 -135
- package/dist/{chunk-Z7QBEIOP.mjs → chunk-X5LWKCT6.mjs} +1 -1
- package/dist/cli.mjs +8 -11
- package/dist/{export-IRR3JZOI.mjs → export-ZRMOIVNM.mjs} +2 -3
- package/dist/index.mjs +3 -5
- package/package.json +16 -16
- package/dist/chunk-BXO7ZPPU.mjs +0 -30
- package/dist/chunk-LOUKLO2C.mjs +0 -24
- package/dist/unocss-JEKY4MJK.mjs +0 -46
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexHtml,
|
|
3
3
|
resolveViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-RG2EEPCO.mjs";
|
|
7
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
4
|
+
} from "./chunk-VAXCTWQX.mjs";
|
|
5
|
+
import "./chunk-27Q2X57X.mjs";
|
|
8
6
|
|
|
9
7
|
// node/commands/build.ts
|
|
10
8
|
import { resolve } from "node:path";
|
|
@@ -53,7 +51,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
53
51
|
await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
54
52
|
`, "utf-8");
|
|
55
53
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
56
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
54
|
+
const { exportSlides, getExportOptions } = await import("./export-ZRMOIVNM.mjs");
|
|
57
55
|
const port = 12445;
|
|
58
56
|
const app = connect();
|
|
59
57
|
const server = http.createServer(app);
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
1
27
|
// node/resolver.ts
|
|
2
28
|
import { dirname, join, relative, resolve } from "node:path";
|
|
3
29
|
import * as fs from "node:fs";
|
|
@@ -180,6 +206,8 @@ async function getRoots(entry) {
|
|
|
180
206
|
}
|
|
181
207
|
|
|
182
208
|
export {
|
|
209
|
+
__commonJS,
|
|
210
|
+
__toESM,
|
|
183
211
|
isInstalledGlobally,
|
|
184
212
|
resolveImportUrl,
|
|
185
213
|
toAtFS,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__toESM,
|
|
5
4
|
createResolver,
|
|
6
5
|
getRoots,
|
|
7
6
|
isInstalledGlobally,
|
|
@@ -9,11 +8,7 @@ import {
|
|
|
9
8
|
resolveImportPath,
|
|
10
9
|
resolveImportUrl,
|
|
11
10
|
toAtFS
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
__commonJS,
|
|
15
|
-
__toESM
|
|
16
|
-
} from "./chunk-BXO7ZPPU.mjs";
|
|
11
|
+
} from "./chunk-27Q2X57X.mjs";
|
|
17
12
|
|
|
18
13
|
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/identity.js
|
|
19
14
|
var require_identity = __commonJS({
|
|
@@ -4144,19 +4139,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4144
4139
|
onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`);
|
|
4145
4140
|
if (props.comment) {
|
|
4146
4141
|
let prevItemComment = "";
|
|
4147
|
-
loop:
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
break loop;
|
|
4158
|
-
}
|
|
4142
|
+
loop: for (const st of start) {
|
|
4143
|
+
switch (st.type) {
|
|
4144
|
+
case "comma":
|
|
4145
|
+
case "space":
|
|
4146
|
+
break;
|
|
4147
|
+
case "comment":
|
|
4148
|
+
prevItemComment = st.source.substring(1);
|
|
4149
|
+
break loop;
|
|
4150
|
+
default:
|
|
4151
|
+
break loop;
|
|
4159
4152
|
}
|
|
4153
|
+
}
|
|
4160
4154
|
if (prevItemComment) {
|
|
4161
4155
|
let prev = coll.items[coll.items.length - 1];
|
|
4162
4156
|
if (identity.isPair(prev))
|
|
@@ -5950,27 +5944,26 @@ var require_lexer = __commonJS({
|
|
|
5950
5944
|
let nl = this.pos - 1;
|
|
5951
5945
|
let indent = 0;
|
|
5952
5946
|
let ch;
|
|
5953
|
-
loop:
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5947
|
+
loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {
|
|
5948
|
+
switch (ch) {
|
|
5949
|
+
case " ":
|
|
5950
|
+
indent += 1;
|
|
5951
|
+
break;
|
|
5952
|
+
case "\n":
|
|
5953
|
+
nl = i2;
|
|
5954
|
+
indent = 0;
|
|
5955
|
+
break;
|
|
5956
|
+
case "\r": {
|
|
5957
|
+
const next = this.buffer[i2 + 1];
|
|
5958
|
+
if (!next && !this.atEnd)
|
|
5959
|
+
return this.setNext("block-scalar");
|
|
5960
|
+
if (next === "\n")
|
|
5962
5961
|
break;
|
|
5963
|
-
case "\r": {
|
|
5964
|
-
const next = this.buffer[i2 + 1];
|
|
5965
|
-
if (!next && !this.atEnd)
|
|
5966
|
-
return this.setNext("block-scalar");
|
|
5967
|
-
if (next === "\n")
|
|
5968
|
-
break;
|
|
5969
|
-
}
|
|
5970
|
-
default:
|
|
5971
|
-
break loop;
|
|
5972
5962
|
}
|
|
5963
|
+
default:
|
|
5964
|
+
break loop;
|
|
5973
5965
|
}
|
|
5966
|
+
}
|
|
5974
5967
|
if (!ch && !this.atEnd)
|
|
5975
5968
|
return this.setNext("block-scalar");
|
|
5976
5969
|
if (indent >= this.indentNext) {
|
|
@@ -6240,17 +6233,16 @@ var require_parser = __commonJS({
|
|
|
6240
6233
|
if (prev.length === 0)
|
|
6241
6234
|
return [];
|
|
6242
6235
|
let i = prev.length;
|
|
6243
|
-
loop:
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
break loop;
|
|
6252
|
-
}
|
|
6236
|
+
loop: while (--i >= 0) {
|
|
6237
|
+
switch (prev[i].type) {
|
|
6238
|
+
case "doc-start":
|
|
6239
|
+
case "explicit-key-ind":
|
|
6240
|
+
case "map-value-ind":
|
|
6241
|
+
case "seq-item-ind":
|
|
6242
|
+
case "newline":
|
|
6243
|
+
break loop;
|
|
6253
6244
|
}
|
|
6245
|
+
}
|
|
6254
6246
|
while (prev[++i]?.type === "space") {
|
|
6255
6247
|
}
|
|
6256
6248
|
return prev.splice(i, prev.length);
|
|
@@ -6748,14 +6740,14 @@ var require_parser = __commonJS({
|
|
|
6748
6740
|
case "scalar":
|
|
6749
6741
|
case "single-quoted-scalar":
|
|
6750
6742
|
case "double-quoted-scalar": {
|
|
6751
|
-
const
|
|
6743
|
+
const fs10 = this.flowScalar(this.type);
|
|
6752
6744
|
if (atNextItem || it.value) {
|
|
6753
|
-
map.items.push({ start, key:
|
|
6745
|
+
map.items.push({ start, key: fs10, sep: [] });
|
|
6754
6746
|
this.onKeyLine = true;
|
|
6755
6747
|
} else if (it.sep) {
|
|
6756
|
-
this.stack.push(
|
|
6748
|
+
this.stack.push(fs10);
|
|
6757
6749
|
} else {
|
|
6758
|
-
Object.assign(it, { key:
|
|
6750
|
+
Object.assign(it, { key: fs10, sep: [] });
|
|
6759
6751
|
this.onKeyLine = true;
|
|
6760
6752
|
}
|
|
6761
6753
|
return;
|
|
@@ -6873,13 +6865,13 @@ var require_parser = __commonJS({
|
|
|
6873
6865
|
case "scalar":
|
|
6874
6866
|
case "single-quoted-scalar":
|
|
6875
6867
|
case "double-quoted-scalar": {
|
|
6876
|
-
const
|
|
6868
|
+
const fs10 = this.flowScalar(this.type);
|
|
6877
6869
|
if (!it || it.value)
|
|
6878
|
-
fc.items.push({ start: [], key:
|
|
6870
|
+
fc.items.push({ start: [], key: fs10, sep: [] });
|
|
6879
6871
|
else if (it.sep)
|
|
6880
|
-
this.stack.push(
|
|
6872
|
+
this.stack.push(fs10);
|
|
6881
6873
|
else
|
|
6882
|
-
Object.assign(it, { key:
|
|
6874
|
+
Object.assign(it, { key: fs10, sep: [] });
|
|
6883
6875
|
return;
|
|
6884
6876
|
}
|
|
6885
6877
|
case "flow-map-end":
|
|
@@ -7184,10 +7176,10 @@ var require_dist = __commonJS({
|
|
|
7184
7176
|
});
|
|
7185
7177
|
|
|
7186
7178
|
// package.json
|
|
7187
|
-
var version = "0.49.
|
|
7179
|
+
var version = "0.49.15";
|
|
7188
7180
|
|
|
7189
7181
|
// node/commands/shared.ts
|
|
7190
|
-
import { existsSync as
|
|
7182
|
+
import { existsSync as existsSync7, promises as fs9 } from "node:fs";
|
|
7191
7183
|
import { join as join10 } from "node:path";
|
|
7192
7184
|
import { loadConfigFromFile, mergeConfig as mergeConfig2 } from "vite";
|
|
7193
7185
|
import MarkdownIt from "markdown-it";
|
|
@@ -7263,9 +7255,9 @@ function updateFrontmatterPatch(slide, frontmatter) {
|
|
|
7263
7255
|
|
|
7264
7256
|
// node/vite/index.ts
|
|
7265
7257
|
import { join as join9 } from "node:path";
|
|
7266
|
-
import { existsSync as
|
|
7258
|
+
import { existsSync as existsSync6 } from "node:fs";
|
|
7267
7259
|
import process2 from "node:process";
|
|
7268
|
-
import { fileURLToPath as
|
|
7260
|
+
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
7269
7261
|
import Icons from "unplugin-icons/vite";
|
|
7270
7262
|
import IconsResolver from "unplugin-icons/resolver";
|
|
7271
7263
|
import Components from "unplugin-vue-components/vite";
|
|
@@ -7419,13 +7411,13 @@ function createConfigPlugin(options) {
|
|
|
7419
7411
|
exclude: EXCLUDE_LOCAL,
|
|
7420
7412
|
include: INCLUDE_LOCAL
|
|
7421
7413
|
},
|
|
7422
|
-
css:
|
|
7414
|
+
css: {
|
|
7423
7415
|
postcss: {
|
|
7424
7416
|
plugins: [
|
|
7425
7417
|
await import("postcss-nested").then((r) => (r.default || r)())
|
|
7426
7418
|
]
|
|
7427
7419
|
}
|
|
7428
|
-
}
|
|
7420
|
+
},
|
|
7429
7421
|
server: {
|
|
7430
7422
|
fs: {
|
|
7431
7423
|
strict: true,
|
|
@@ -7729,7 +7721,30 @@ var setupModules = ["shiki", "code-runners", "monaco", "mermaid", "main", "root"
|
|
|
7729
7721
|
var templateSetups = setupModules.map(createSetupTemplate);
|
|
7730
7722
|
|
|
7731
7723
|
// node/setups/shiki.ts
|
|
7732
|
-
import
|
|
7724
|
+
import fs3 from "node:fs/promises";
|
|
7725
|
+
|
|
7726
|
+
// node/setups/load.ts
|
|
7727
|
+
import { resolve as resolve4 } from "node:path";
|
|
7728
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7729
|
+
import fs2 from "fs-extra";
|
|
7730
|
+
import { deepMergeWithArray } from "@antfu/utils";
|
|
7731
|
+
import jiti from "jiti";
|
|
7732
|
+
async function loadSetups(clientRoot, roots, name, arg, initial, merge = true) {
|
|
7733
|
+
let returns = initial;
|
|
7734
|
+
for (const root of [clientRoot, ...roots].reverse()) {
|
|
7735
|
+
const path4 = resolve4(root, "setup", name);
|
|
7736
|
+
if (fs2.existsSync(path4)) {
|
|
7737
|
+
const { default: setup } = jiti(fileURLToPath2(import.meta.url))(path4);
|
|
7738
|
+
const result = await setup(arg);
|
|
7739
|
+
if (result !== null) {
|
|
7740
|
+
returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMergeWithArray(returns, result) : result;
|
|
7741
|
+
}
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7744
|
+
return returns;
|
|
7745
|
+
}
|
|
7746
|
+
|
|
7747
|
+
// node/setups/shiki.ts
|
|
7733
7748
|
async function loadShikiSetups(clientRoot, roots) {
|
|
7734
7749
|
const result = await loadSetups(
|
|
7735
7750
|
clientRoot,
|
|
@@ -7739,7 +7754,7 @@ async function loadShikiSetups(clientRoot, roots) {
|
|
|
7739
7754
|
/** @deprecated */
|
|
7740
7755
|
async loadTheme(path4) {
|
|
7741
7756
|
console.warn("[slidev] `loadTheme` in `setup/shiki.ts` is deprecated. Pass directly the theme name it's supported by Shiki. For custom themes, load it manually via `JSON.parse(fs.readFileSync(path, 'utf-8'))` and pass the raw JSON object instead.");
|
|
7742
|
-
return JSON.parse(await
|
|
7757
|
+
return JSON.parse(await fs3.readFile(path4, "utf-8"));
|
|
7743
7758
|
}
|
|
7744
7759
|
},
|
|
7745
7760
|
{},
|
|
@@ -7900,18 +7915,17 @@ var templateStyle = {
|
|
|
7900
7915
|
if (data.config.highlighter === "shiki") {
|
|
7901
7916
|
imports.push(
|
|
7902
7917
|
`import "${await resolveImportUrl("@shikijs/vitepress-twoslash/style.css")}"`,
|
|
7903
|
-
`import "${resolveUrlOfClient("styles/shiki-twoslash.css")}"
|
|
7918
|
+
`import "${resolveUrlOfClient("styles/shiki-twoslash.css")}"`,
|
|
7919
|
+
`import "${await resolveImportUrl("shiki-magic-move/style.css")}"`
|
|
7904
7920
|
);
|
|
7905
7921
|
}
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
imports.push('import "uno.css"');
|
|
7914
|
-
}
|
|
7922
|
+
imports.unshift(
|
|
7923
|
+
`import "${await resolveImportUrl("@unocss/reset/tailwind.css")}"`,
|
|
7924
|
+
'import "uno:preflights.css"',
|
|
7925
|
+
'import "uno:typography.css"',
|
|
7926
|
+
'import "uno:shortcuts.css"'
|
|
7927
|
+
);
|
|
7928
|
+
imports.push('import "uno.css"');
|
|
7915
7929
|
return imports.join("\n");
|
|
7916
7930
|
}
|
|
7917
7931
|
};
|
|
@@ -7973,7 +7987,7 @@ import * as parser from "@slidev/parser/fs";
|
|
|
7973
7987
|
|
|
7974
7988
|
// node/integrations/themes.ts
|
|
7975
7989
|
import { join as join8 } from "node:path";
|
|
7976
|
-
import
|
|
7990
|
+
import fs4 from "fs-extra";
|
|
7977
7991
|
import { satisfies } from "semver";
|
|
7978
7992
|
var officialThemes = {
|
|
7979
7993
|
"none": "",
|
|
@@ -7986,17 +8000,17 @@ var officialThemes = {
|
|
|
7986
8000
|
var resolveTheme = createResolver("theme", officialThemes);
|
|
7987
8001
|
async function getThemeMeta(name, root) {
|
|
7988
8002
|
const path4 = join8(root, "package.json");
|
|
7989
|
-
if (!
|
|
8003
|
+
if (!fs4.existsSync(path4))
|
|
7990
8004
|
return {};
|
|
7991
|
-
const { slidev = {}, engines = {} } = await
|
|
8005
|
+
const { slidev = {}, engines = {} } = await fs4.readJSON(path4);
|
|
7992
8006
|
if (engines.slidev && !satisfies(version, engines.slidev, { includePrerelease: true }))
|
|
7993
8007
|
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7994
8008
|
return slidev;
|
|
7995
8009
|
}
|
|
7996
8010
|
|
|
7997
8011
|
// node/integrations/addons.ts
|
|
7998
|
-
import { resolve as
|
|
7999
|
-
import
|
|
8012
|
+
import { resolve as resolve5 } from "node:path";
|
|
8013
|
+
import fs5 from "fs-extra";
|
|
8000
8014
|
import { satisfies as satisfies2 } from "semver";
|
|
8001
8015
|
async function resolveAddons(addonsInConfig) {
|
|
8002
8016
|
const { userRoot, userPkgJson } = await getRoots();
|
|
@@ -8007,7 +8021,7 @@ async function resolveAddons(addonsInConfig) {
|
|
|
8007
8021
|
if (!pkgRoot)
|
|
8008
8022
|
return;
|
|
8009
8023
|
resolved.push(pkgRoot);
|
|
8010
|
-
const { slidev = {}, engines = {} } = await
|
|
8024
|
+
const { slidev = {}, engines = {} } = await fs5.readJSON(resolve5(pkgRoot, "package.json"));
|
|
8011
8025
|
if (engines.slidev && !satisfies2(version, engines.slidev, { includePrerelease: true }))
|
|
8012
8026
|
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
8013
8027
|
if (Array.isArray(slidev.addons))
|
|
@@ -8077,20 +8091,16 @@ function createDataUtils(data) {
|
|
|
8077
8091
|
var regexId = /^\/@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
|
|
8078
8092
|
var regexIdQuery = /(\d+)\.(md|json|frontmatter)$/;
|
|
8079
8093
|
var templateInjectionMarker = "/* @slidev-injection */";
|
|
8080
|
-
var templateImportContextUtils = `import {
|
|
8081
|
-
|
|
8082
|
-
provideFrontmatter as _provideFrontmatter,
|
|
8083
|
-
frontmatterToProps as _frontmatterToProps,
|
|
8084
|
-
} from "@slidev/client/context.ts"`.replace(/\n\s*/g, " ");
|
|
8085
|
-
var templateInitContext = `const { $slidev, $nav, $clicksContext, $clicks, $page, $renderContext, $frontmatter } = useSlideContext()`;
|
|
8094
|
+
var templateImportContextUtils = `import { useSlideContext as _useSlideContext, frontmatterToProps as _frontmatterToProps } from "@slidev/client/context.ts"`;
|
|
8095
|
+
var templateInitContext = `const { $slidev, $nav, $clicksContext, $clicks, $page, $renderContext, $frontmatter } = _useSlideContext()`;
|
|
8086
8096
|
function getBodyJson(req) {
|
|
8087
|
-
return new Promise((
|
|
8097
|
+
return new Promise((resolve8, reject) => {
|
|
8088
8098
|
let body = "";
|
|
8089
8099
|
req.on("data", (chunk) => body += chunk);
|
|
8090
8100
|
req.on("error", reject);
|
|
8091
8101
|
req.on("end", () => {
|
|
8092
8102
|
try {
|
|
8093
|
-
|
|
8103
|
+
resolve8(JSON.parse(body) || {});
|
|
8094
8104
|
} catch (e) {
|
|
8095
8105
|
reject(e);
|
|
8096
8106
|
}
|
|
@@ -8310,37 +8320,42 @@ function createSlidesLoader(options, pluginOptions, serverOptions) {
|
|
|
8310
8320
|
return {
|
|
8311
8321
|
code: [
|
|
8312
8322
|
"// @unocss-include",
|
|
8313
|
-
'import { reactive,
|
|
8314
|
-
`export const
|
|
8315
|
-
`export const meta = reactive({
|
|
8316
|
-
layout: computed(() => frontmatter.layout),
|
|
8317
|
-
transition: computed(() => frontmatter.transition),
|
|
8318
|
-
class: computed(() => frontmatter.class),
|
|
8319
|
-
clicks: computed(() => frontmatter.clicks),
|
|
8320
|
-
name: computed(() => frontmatter.name),
|
|
8321
|
-
preload: computed(() => frontmatter.preload),
|
|
8322
|
-
slide: {
|
|
8323
|
-
...(${JSON.stringify(slideBase)}),
|
|
8324
|
-
frontmatter,
|
|
8325
|
-
filepath: ${JSON.stringify(mode === "dev" ? slide.source.filepath : "")},
|
|
8326
|
-
start: ${JSON.stringify(slide.source.start)},
|
|
8327
|
-
id: ${pageNo},
|
|
8328
|
-
no: ${no},
|
|
8329
|
-
},
|
|
8330
|
-
__clicksContext: null,
|
|
8331
|
-
__preloaded: false,
|
|
8332
|
-
})`,
|
|
8333
|
-
"export default frontmatter",
|
|
8323
|
+
'import { computed, reactive, shallowReactive } from "vue"',
|
|
8324
|
+
`export const frontmatterData = ${JSON.stringify(fontmatter)}`,
|
|
8334
8325
|
// handle HMR, update frontmatter with update
|
|
8335
8326
|
"if (import.meta.hot) {",
|
|
8336
|
-
" import.meta.hot.
|
|
8337
|
-
"
|
|
8327
|
+
" const firstLoad = !import.meta.hot.data.frontmatter",
|
|
8328
|
+
" import.meta.hot.data.frontmatter ??= reactive(frontmatterData)",
|
|
8329
|
+
" import.meta.hot.accept(({ frontmatterData: update }) => {",
|
|
8330
|
+
" if (firstLoad) return",
|
|
8331
|
+
" const frontmatter = import.meta.hot.data.frontmatter",
|
|
8338
8332
|
" Object.keys(frontmatter).forEach(key => {",
|
|
8339
8333
|
" if (!(key in update)) delete frontmatter[key]",
|
|
8340
8334
|
" })",
|
|
8341
8335
|
" Object.assign(frontmatter, update)",
|
|
8342
8336
|
" })",
|
|
8343
|
-
"}"
|
|
8337
|
+
"}",
|
|
8338
|
+
"export const frontmatter = import.meta.hot ? import.meta.hot.data.frontmatter : reactive(frontmatterData)",
|
|
8339
|
+
"export default frontmatter",
|
|
8340
|
+
"export const meta = shallowReactive({",
|
|
8341
|
+
" get layout(){ return frontmatter.layout },",
|
|
8342
|
+
" get transition(){ return frontmatter.transition },",
|
|
8343
|
+
" get class(){ return frontmatter.class },",
|
|
8344
|
+
" get clicks(){ return frontmatter.clicks },",
|
|
8345
|
+
" get name(){ return frontmatter.name },",
|
|
8346
|
+
" get preload(){ return frontmatter.preload },",
|
|
8347
|
+
// No need to be reactive, as it's only used once after reload
|
|
8348
|
+
" slide: {",
|
|
8349
|
+
` ...(${JSON.stringify(slideBase)}),`,
|
|
8350
|
+
` frontmatter,`,
|
|
8351
|
+
` filepath: ${JSON.stringify(mode === "dev" ? slide.source.filepath : "")},`,
|
|
8352
|
+
` start: ${JSON.stringify(slide.source.start)},`,
|
|
8353
|
+
` id: ${pageNo},`,
|
|
8354
|
+
` no: ${no},`,
|
|
8355
|
+
" },",
|
|
8356
|
+
" __clicksContext: null,",
|
|
8357
|
+
" __preloaded: false,",
|
|
8358
|
+
"})"
|
|
8344
8359
|
].join("\n"),
|
|
8345
8360
|
map: { mappings: "" }
|
|
8346
8361
|
};
|
|
@@ -8414,9 +8429,7 @@ Unknown layout "${bold(layoutName)}".${yellow(" Available layouts are:")}`) + Ob
|
|
|
8414
8429
|
delete frontmatter.title;
|
|
8415
8430
|
const imports = [
|
|
8416
8431
|
`import InjectedLayout from "${toAtFS(layouts[layoutName])}"`,
|
|
8417
|
-
`import frontmatter from "${toAtFS(`${VIRTUAL_SLIDE_PREFIX + (index + 1)}.frontmatter`)}"`,
|
|
8418
8432
|
templateImportContextUtils,
|
|
8419
|
-
"_provideFrontmatter(frontmatter)",
|
|
8420
8433
|
templateInitContext,
|
|
8421
8434
|
templateInjectionMarker
|
|
8422
8435
|
];
|
|
@@ -8429,7 +8442,7 @@ ${imports.join("\n")}
|
|
|
8429
8442
|
if (body.startsWith("<div>") && body.endsWith("</div>"))
|
|
8430
8443
|
body = body.slice(5, -6);
|
|
8431
8444
|
code = `${code.slice(0, injectA)}
|
|
8432
|
-
<InjectedLayout v-bind="_frontmatterToProps(frontmatter,${index})">
|
|
8445
|
+
<InjectedLayout v-bind="_frontmatterToProps($frontmatter,${index})">
|
|
8433
8446
|
${body}
|
|
8434
8447
|
</InjectedLayout>
|
|
8435
8448
|
${code.slice(injectB)}`;
|
|
@@ -8488,6 +8501,45 @@ ${code}`;
|
|
|
8488
8501
|
}
|
|
8489
8502
|
}
|
|
8490
8503
|
|
|
8504
|
+
// node/vite/unocss.ts
|
|
8505
|
+
import { resolve as resolve6 } from "node:path";
|
|
8506
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
8507
|
+
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
8508
|
+
import { uniq as uniq5 } from "@antfu/utils";
|
|
8509
|
+
import { mergeConfigs } from "unocss";
|
|
8510
|
+
import jiti2 from "jiti";
|
|
8511
|
+
import UnoCSS from "unocss/vite";
|
|
8512
|
+
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data, userRoot }, { unocss: unoOptions = {} }) {
|
|
8513
|
+
const configFiles = uniq5([
|
|
8514
|
+
resolve6(userRoot, "uno.config.ts"),
|
|
8515
|
+
resolve6(userRoot, "unocss.config.ts"),
|
|
8516
|
+
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
8517
|
+
...themeRoots.map((i) => `${i}/unocss.config.ts`),
|
|
8518
|
+
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
8519
|
+
...addonRoots.map((i) => `${i}/unocss.config.ts`),
|
|
8520
|
+
resolve6(clientRoot, "uno.config.ts"),
|
|
8521
|
+
resolve6(clientRoot, "unocss.config.ts")
|
|
8522
|
+
]).filter((i) => existsSync5(i));
|
|
8523
|
+
const configs = configFiles.map((i) => {
|
|
8524
|
+
const loaded = jiti2(fileURLToPath3(import.meta.url))(i);
|
|
8525
|
+
const config2 = "default" in loaded ? loaded.default : loaded;
|
|
8526
|
+
return config2;
|
|
8527
|
+
}).filter(Boolean);
|
|
8528
|
+
configs.reverse();
|
|
8529
|
+
let config = mergeConfigs([...configs, unoOptions]);
|
|
8530
|
+
config = await loadSetups(clientRoot, roots, "unocss.ts", {}, config, (a, b) => mergeConfigs([a, b]));
|
|
8531
|
+
config.theme ||= {};
|
|
8532
|
+
config.theme.fontFamily ||= {};
|
|
8533
|
+
config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
|
|
8534
|
+
config.theme.fontFamily.mono ||= data.config.fonts.mono.join(",");
|
|
8535
|
+
config.theme.fontFamily.serif ||= data.config.fonts.serif.join(",");
|
|
8536
|
+
return UnoCSS({
|
|
8537
|
+
configFile: false,
|
|
8538
|
+
configDeps: configFiles,
|
|
8539
|
+
...config
|
|
8540
|
+
});
|
|
8541
|
+
}
|
|
8542
|
+
|
|
8491
8543
|
// node/vite/markdown.ts
|
|
8492
8544
|
import Markdown from "unplugin-vue-markdown/vite";
|
|
8493
8545
|
import { isTruthy, slash as slash3 } from "@antfu/utils";
|
|
@@ -8655,8 +8707,7 @@ function math_inline(state, silent) {
|
|
|
8655
8707
|
match = start;
|
|
8656
8708
|
while ((match = state.src.indexOf("$", match)) !== -1) {
|
|
8657
8709
|
pos = match - 1;
|
|
8658
|
-
while (state.src[pos] === "\\")
|
|
8659
|
-
pos -= 1;
|
|
8710
|
+
while (state.src[pos] === "\\") pos -= 1;
|
|
8660
8711
|
if ((match - pos) % 2 === 1)
|
|
8661
8712
|
break;
|
|
8662
8713
|
match += 1;
|
|
@@ -9027,11 +9078,11 @@ function transformPlantUml(ctx) {
|
|
|
9027
9078
|
// node/syntax/transform/snippet.ts
|
|
9028
9079
|
import path3 from "node:path";
|
|
9029
9080
|
import lz3 from "lz-string";
|
|
9030
|
-
import
|
|
9081
|
+
import fs7 from "fs-extra";
|
|
9031
9082
|
import { slash as slash2 } from "@antfu/utils";
|
|
9032
9083
|
|
|
9033
9084
|
// node/vite/monacoWrite.ts
|
|
9034
|
-
import
|
|
9085
|
+
import fs6 from "node:fs/promises";
|
|
9035
9086
|
import path2 from "node:path";
|
|
9036
9087
|
var monacoWriterWhitelist = /* @__PURE__ */ new Set();
|
|
9037
9088
|
function createMonacoWriter({ userRoot }) {
|
|
@@ -9055,7 +9106,7 @@ function createMonacoWriter({ userRoot }) {
|
|
|
9055
9106
|
}
|
|
9056
9107
|
const filepath = path2.join(userRoot, file);
|
|
9057
9108
|
console.log("[Slidev] Writing file:", filepath);
|
|
9058
|
-
await
|
|
9109
|
+
await fs6.writeFile(filepath, content, "utf-8");
|
|
9059
9110
|
}
|
|
9060
9111
|
});
|
|
9061
9112
|
});
|
|
@@ -9131,11 +9182,11 @@ function transformSnippet(ctx) {
|
|
|
9131
9182
|
/^@\//.test(filepath) ? path3.resolve(options.userRoot, filepath.slice(2)) : path3.resolve(dir, filepath)
|
|
9132
9183
|
);
|
|
9133
9184
|
data.watchFiles.push(src);
|
|
9134
|
-
const isAFile =
|
|
9135
|
-
if (!
|
|
9185
|
+
const isAFile = fs7.statSync(src).isFile();
|
|
9186
|
+
if (!fs7.existsSync(src) || !isAFile) {
|
|
9136
9187
|
throw new Error(isAFile ? `Code snippet path not found: ${src}` : `Invalid code snippet option`);
|
|
9137
9188
|
}
|
|
9138
|
-
let content =
|
|
9189
|
+
let content = fs7.readFileSync(src, "utf8");
|
|
9139
9190
|
slideInfo.snippetsUsed ??= {};
|
|
9140
9191
|
slideInfo.snippetsUsed[src] = content;
|
|
9141
9192
|
if (regionName) {
|
|
@@ -9428,8 +9479,8 @@ function createVueCompilerFlagsPlugin(options) {
|
|
|
9428
9479
|
}
|
|
9429
9480
|
|
|
9430
9481
|
// node/vite/monacoTypes.ts
|
|
9431
|
-
import
|
|
9432
|
-
import { dirname as dirname2, resolve as
|
|
9482
|
+
import fs8 from "node:fs/promises";
|
|
9483
|
+
import { dirname as dirname2, resolve as resolve7 } from "node:path";
|
|
9433
9484
|
import { slash as slash4 } from "@antfu/utils";
|
|
9434
9485
|
import fg4 from "fast-glob";
|
|
9435
9486
|
import { findDepPkgJsonPath } from "vitefu";
|
|
@@ -9453,7 +9504,7 @@ function createMonacoTypesLoader({ userRoot, utils }) {
|
|
|
9453
9504
|
if (!pkgJsonPath)
|
|
9454
9505
|
throw new Error(`Package "${pkg}" not found in "${importer}"`);
|
|
9455
9506
|
const root = slash4(dirname2(pkgJsonPath));
|
|
9456
|
-
const pkgJson = JSON.parse(await
|
|
9507
|
+
const pkgJson = JSON.parse(await fs8.readFile(pkgJsonPath, "utf-8"));
|
|
9457
9508
|
let deps = Object.keys(pkgJson.dependencies ?? {});
|
|
9458
9509
|
deps = deps.filter((pkg2) => !utils.isMonacoTypesIgnored(pkg2));
|
|
9459
9510
|
return [
|
|
@@ -9482,7 +9533,7 @@ function createMonacoTypesLoader({ userRoot, utils }) {
|
|
|
9482
9533
|
return "/** No files found **/";
|
|
9483
9534
|
return [
|
|
9484
9535
|
'import { addFile } from "@slidev/client/setup/monaco.ts"',
|
|
9485
|
-
...files.map((file) => `addFile(() => import(${JSON.stringify(`${toAtFS(
|
|
9536
|
+
...files.map((file) => `addFile(() => import(${JSON.stringify(`${toAtFS(resolve7(root, file))}?monaco-types&raw`)}), ${JSON.stringify(`node_modules/${name}/${file}`)})`)
|
|
9486
9537
|
].join("\n");
|
|
9487
9538
|
}
|
|
9488
9539
|
}
|
|
@@ -9563,7 +9614,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9563
9614
|
data: { config }
|
|
9564
9615
|
} = options;
|
|
9565
9616
|
const drawingData = await loadDrawings(options);
|
|
9566
|
-
const publicRoots = [...themeRoots, ...addonRoots].map((i) => join9(i, "public")).filter(
|
|
9617
|
+
const publicRoots = [...themeRoots, ...addonRoots].map((i) => join9(i, "public")).filter(existsSync6);
|
|
9567
9618
|
const plugins = [
|
|
9568
9619
|
createMarkdownPlugin(options, pluginOptions),
|
|
9569
9620
|
createVuePlugin(options, pluginOptions),
|
|
@@ -9591,7 +9642,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9591
9642
|
}),
|
|
9592
9643
|
Icons({
|
|
9593
9644
|
defaultClass: "slidev-icon",
|
|
9594
|
-
collectionsNodeResolvePath:
|
|
9645
|
+
collectionsNodeResolvePath: fileURLToPath4(import.meta.url),
|
|
9595
9646
|
...iconsOptions
|
|
9596
9647
|
}),
|
|
9597
9648
|
config.remoteAssets === true || config.remoteAssets === mode ? import("vite-plugin-remote-assets").then((r) => r.VitePluginRemoteAssets({
|
|
@@ -9629,6 +9680,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9629
9680
|
createConfigPlugin(options),
|
|
9630
9681
|
createMonacoTypesLoader(options),
|
|
9631
9682
|
createVueCompilerFlagsPlugin(options),
|
|
9683
|
+
createUnocssPlugin(options, pluginOptions),
|
|
9632
9684
|
publicRoots.length ? import("vite-plugin-static-copy").then((r) => r.viteStaticCopy({
|
|
9633
9685
|
silent: true,
|
|
9634
9686
|
targets: publicRoots.map((r2) => ({
|
|
@@ -9639,8 +9691,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9639
9691
|
options.inspect ? import("vite-plugin-inspect").then((r) => (r.default || r)({
|
|
9640
9692
|
dev: true,
|
|
9641
9693
|
build: true
|
|
9642
|
-
})) : null
|
|
9643
|
-
config.css === "none" ? null : import("./unocss-JEKY4MJK.mjs").then((r) => r.createUnocssPlugin(options, pluginOptions))
|
|
9694
|
+
})) : null
|
|
9644
9695
|
];
|
|
9645
9696
|
return (await Promise.all(plugins)).flat().filter(notNullish2);
|
|
9646
9697
|
}
|
|
@@ -9660,7 +9711,7 @@ function escapeHtml(unsafe) {
|
|
|
9660
9711
|
);
|
|
9661
9712
|
}
|
|
9662
9713
|
async function getIndexHtml({ mode, entry, clientRoot, roots, data }) {
|
|
9663
|
-
let main = await
|
|
9714
|
+
let main = await fs9.readFile(join10(clientRoot, "index.html"), "utf-8");
|
|
9664
9715
|
let head = "";
|
|
9665
9716
|
let body = "";
|
|
9666
9717
|
const { info, author, keywords } = data.headmatter;
|
|
@@ -9675,9 +9726,9 @@ async function getIndexHtml({ mode, entry, clientRoot, roots, data }) {
|
|
|
9675
9726
|
].filter(Boolean).join("\n");
|
|
9676
9727
|
for (const root of roots) {
|
|
9677
9728
|
const path4 = join10(root, "index.html");
|
|
9678
|
-
if (!
|
|
9729
|
+
if (!existsSync7(path4))
|
|
9679
9730
|
continue;
|
|
9680
|
-
const index = await
|
|
9731
|
+
const index = await fs9.readFile(path4, "utf-8");
|
|
9681
9732
|
head += `
|
|
9682
9733
|
${(index.match(/<head>([\s\S]*?)<\/head>/i)?.[1] || "").trim()}`;
|
|
9683
9734
|
body += `
|
|
@@ -9698,7 +9749,7 @@ async function resolveViteConfigs(options, baseConfig, overrideConfigs, command,
|
|
|
9698
9749
|
};
|
|
9699
9750
|
const files = options.roots.map((i) => join10(i, "vite.config.ts"));
|
|
9700
9751
|
for (const file of files) {
|
|
9701
|
-
if (!
|
|
9752
|
+
if (!existsSync7(file))
|
|
9702
9753
|
continue;
|
|
9703
9754
|
const viteConfig = await loadConfigFromFile(configEnv, file);
|
|
9704
9755
|
if (!viteConfig?.config)
|
|
@@ -9724,6 +9775,7 @@ export {
|
|
|
9724
9775
|
version,
|
|
9725
9776
|
getIndexHtml,
|
|
9726
9777
|
resolveViteConfigs,
|
|
9778
|
+
loadSetups,
|
|
9727
9779
|
parser,
|
|
9728
9780
|
resolveTheme,
|
|
9729
9781
|
getThemeMeta,
|
package/dist/cli.mjs
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X5LWKCT6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
getThemeMeta,
|
|
6
|
+
loadSetups,
|
|
6
7
|
parser,
|
|
7
8
|
resolveAddons,
|
|
8
9
|
resolveOptions,
|
|
9
10
|
resolveTheme,
|
|
10
11
|
version
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
loadSetups
|
|
14
|
-
} from "./chunk-LOUKLO2C.mjs";
|
|
12
|
+
} from "./chunk-VAXCTWQX.mjs";
|
|
15
13
|
import {
|
|
16
14
|
getRoots,
|
|
17
15
|
isInstalledGlobally,
|
|
18
16
|
resolveEntry
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
17
|
+
} from "./chunk-27Q2X57X.mjs";
|
|
21
18
|
|
|
22
19
|
// node/cli.ts
|
|
23
20
|
import path from "node:path";
|
|
@@ -328,7 +325,7 @@ cli.command(
|
|
|
328
325
|
}).strict().help(),
|
|
329
326
|
async (args) => {
|
|
330
327
|
const { entry, theme, base, download, out, inspect } = args;
|
|
331
|
-
const { build } = await import("./build-
|
|
328
|
+
const { build } = await import("./build-J45HACJD.mjs");
|
|
332
329
|
for (const entryFile of entry) {
|
|
333
330
|
const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
|
|
334
331
|
if (download && !options.data.config.download)
|
|
@@ -408,7 +405,7 @@ cli.command(
|
|
|
408
405
|
(args) => exportOptions(commonOptions(args)).strict().help(),
|
|
409
406
|
async (args) => {
|
|
410
407
|
const { entry, theme } = args;
|
|
411
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
408
|
+
const { exportSlides, getExportOptions } = await import("./export-ZRMOIVNM.mjs");
|
|
412
409
|
const port = await getPort(12445);
|
|
413
410
|
for (const entryFile of entry) {
|
|
414
411
|
const options = await resolveOptions({ entry: entryFile, theme }, "export");
|
|
@@ -457,7 +454,7 @@ cli.command(
|
|
|
457
454
|
timeout,
|
|
458
455
|
wait
|
|
459
456
|
}) => {
|
|
460
|
-
const { exportNotes } = await import("./export-
|
|
457
|
+
const { exportNotes } = await import("./export-ZRMOIVNM.mjs");
|
|
461
458
|
const port = await getPort(12445);
|
|
462
459
|
for (const entryFile of entry) {
|
|
463
460
|
const options = await resolveOptions({ entry: entryFile }, "export");
|
|
@@ -545,7 +542,7 @@ function printInfo(options, port, remote, tunnelUrl, publicIp) {
|
|
|
545
542
|
console.log();
|
|
546
543
|
verifyConfig(options.data.config, options.data.themeMeta, (v) => console.warn(yellow(` ! ${v}`)));
|
|
547
544
|
console.log(dim(" theme ") + (options.theme ? green(options.theme) : gray("none")));
|
|
548
|
-
console.log(dim(" css engine ") +
|
|
545
|
+
console.log(dim(" css engine ") + blue("unocss"));
|
|
549
546
|
console.log(dim(" entry ") + dim(path.dirname(options.entry) + path.sep) + path.basename(options.entry));
|
|
550
547
|
if (port) {
|
|
551
548
|
const query = remote ? `?password=${remote}` : "";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRoots
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
3
|
+
} from "./chunk-27Q2X57X.mjs";
|
|
5
4
|
|
|
6
5
|
// node/commands/export.ts
|
|
7
6
|
import path from "node:path";
|
|
@@ -479,7 +478,7 @@ function getExportOptions(args, options, outDir, outFilename) {
|
|
|
479
478
|
format: format || "pdf",
|
|
480
479
|
timeout: timeout ?? 3e4,
|
|
481
480
|
wait: wait ?? 0,
|
|
482
|
-
waitUntil: waitUntil === "none" ? void 0 : waitUntil,
|
|
481
|
+
waitUntil: waitUntil === "none" ? void 0 : waitUntil ?? "networkidle",
|
|
483
482
|
dark: dark || options.data.config.colorSchema === "dark",
|
|
484
483
|
routerMode: options.data.config.routerMode,
|
|
485
484
|
width: options.data.config.canvasWidth,
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X5LWKCT6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ViteSlidevPlugin,
|
|
6
6
|
createDataUtils,
|
|
7
7
|
parser,
|
|
8
8
|
resolveOptions
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-RG2EEPCO.mjs";
|
|
12
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
9
|
+
} from "./chunk-VAXCTWQX.mjs";
|
|
10
|
+
import "./chunk-27Q2X57X.mjs";
|
|
13
11
|
export {
|
|
14
12
|
ViteSlidevPlugin,
|
|
15
13
|
createDataUtils,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slidev/cli",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.15",
|
|
4
4
|
"description": "Presentation slides for developers",
|
|
5
5
|
"author": "antfu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@antfu/ni": "^0.21.12",
|
|
46
|
-
"@antfu/utils": "^0.7.
|
|
46
|
+
"@antfu/utils": "^0.7.10",
|
|
47
47
|
"@iconify-json/carbon": "^1.1.36",
|
|
48
48
|
"@iconify-json/ph": "^1.1.13",
|
|
49
49
|
"@iconify-json/svg-spinners": "^1.1.2",
|
|
50
50
|
"@lillallol/outline-pdf": "^4.0.0",
|
|
51
|
-
"@shikijs/markdown-it": "^1.
|
|
52
|
-
"@shikijs/twoslash": "^1.
|
|
53
|
-
"@shikijs/vitepress-twoslash": "^1.
|
|
54
|
-
"@unocss/extractor-mdc": "^0.61.
|
|
55
|
-
"@unocss/reset": "^0.61.
|
|
51
|
+
"@shikijs/markdown-it": "^1.10.0",
|
|
52
|
+
"@shikijs/twoslash": "^1.10.0",
|
|
53
|
+
"@shikijs/vitepress-twoslash": "^1.10.0",
|
|
54
|
+
"@unocss/extractor-mdc": "^0.61.2",
|
|
55
|
+
"@unocss/reset": "^0.61.2",
|
|
56
56
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
57
57
|
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
58
58
|
"chokidar": "^3.6.0",
|
|
@@ -90,32 +90,32 @@
|
|
|
90
90
|
"resolve-from": "^5.0.0",
|
|
91
91
|
"resolve-global": "^2.0.0",
|
|
92
92
|
"semver": "^7.6.2",
|
|
93
|
-
"shiki": "^1.
|
|
93
|
+
"shiki": "^1.10.0",
|
|
94
94
|
"shiki-magic-move": "^0.4.2",
|
|
95
95
|
"sirv": "^2.0.4",
|
|
96
96
|
"source-map-js": "^1.2.0",
|
|
97
97
|
"typescript": "^5.5.2",
|
|
98
|
-
"unocss": "^0.61.
|
|
98
|
+
"unocss": "^0.61.2",
|
|
99
99
|
"unplugin-icons": "^0.19.0",
|
|
100
|
-
"unplugin-vue-components": "^0.27.
|
|
100
|
+
"unplugin-vue-components": "^0.27.2",
|
|
101
101
|
"unplugin-vue-markdown": "^0.26.2",
|
|
102
102
|
"untun": "^0.1.3",
|
|
103
103
|
"uqr": "^0.1.2",
|
|
104
|
-
"vite": "^5.3.
|
|
104
|
+
"vite": "^5.3.2",
|
|
105
105
|
"vite-plugin-inspect": "^0.8.4",
|
|
106
106
|
"vite-plugin-remote-assets": "^0.4.1",
|
|
107
107
|
"vite-plugin-static-copy": "^1.0.5",
|
|
108
108
|
"vite-plugin-vue-server-ref": "^0.4.2",
|
|
109
109
|
"vitefu": "^0.2.5",
|
|
110
|
-
"vue": "^3.4.
|
|
110
|
+
"vue": "^3.4.31",
|
|
111
111
|
"yargs": "^17.7.2",
|
|
112
|
-
"@slidev/client": "0.49.
|
|
113
|
-
"@slidev/
|
|
114
|
-
"@slidev/
|
|
112
|
+
"@slidev/client": "0.49.15",
|
|
113
|
+
"@slidev/types": "0.49.15",
|
|
114
|
+
"@slidev/parser": "0.49.15"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@hedgedoc/markdown-it-plugins": "^2.1.4",
|
|
118
|
-
"@types/micromatch": "^4.0.
|
|
118
|
+
"@types/micromatch": "^4.0.9",
|
|
119
119
|
"@types/plantuml-encoder": "^1.4.2"
|
|
120
120
|
},
|
|
121
121
|
"scripts": {
|
package/dist/chunk-BXO7ZPPU.mjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
__commonJS,
|
|
29
|
-
__toESM
|
|
30
|
-
};
|
package/dist/chunk-LOUKLO2C.mjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// node/setups/load.ts
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import fs from "fs-extra";
|
|
5
|
-
import { deepMergeWithArray } from "@antfu/utils";
|
|
6
|
-
import jiti from "jiti";
|
|
7
|
-
async function loadSetups(clientRoot, roots, name, arg, initial, merge = true) {
|
|
8
|
-
let returns = initial;
|
|
9
|
-
for (const root of [clientRoot, ...roots].reverse()) {
|
|
10
|
-
const path = resolve(root, "setup", name);
|
|
11
|
-
if (fs.existsSync(path)) {
|
|
12
|
-
const { default: setup } = jiti(fileURLToPath(import.meta.url))(path);
|
|
13
|
-
const result = await setup(arg);
|
|
14
|
-
if (result !== null) {
|
|
15
|
-
returns = typeof merge === "function" ? merge(returns, result) : merge ? deepMergeWithArray(returns, result) : result;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return returns;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
loadSetups
|
|
24
|
-
};
|
package/dist/unocss-JEKY4MJK.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadSetups
|
|
3
|
-
} from "./chunk-LOUKLO2C.mjs";
|
|
4
|
-
import "./chunk-BXO7ZPPU.mjs";
|
|
5
|
-
|
|
6
|
-
// node/vite/unocss.ts
|
|
7
|
-
import { resolve } from "node:path";
|
|
8
|
-
import { existsSync } from "node:fs";
|
|
9
|
-
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { uniq } from "@antfu/utils";
|
|
11
|
-
import { mergeConfigs } from "unocss";
|
|
12
|
-
import jiti from "jiti";
|
|
13
|
-
import UnoCSS from "unocss/vite";
|
|
14
|
-
async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data, userRoot }, { unocss: unoOptions = {} }) {
|
|
15
|
-
const configFiles = uniq([
|
|
16
|
-
resolve(userRoot, "uno.config.ts"),
|
|
17
|
-
resolve(userRoot, "unocss.config.ts"),
|
|
18
|
-
...themeRoots.map((i) => `${i}/uno.config.ts`),
|
|
19
|
-
...themeRoots.map((i) => `${i}/unocss.config.ts`),
|
|
20
|
-
...addonRoots.map((i) => `${i}/uno.config.ts`),
|
|
21
|
-
...addonRoots.map((i) => `${i}/unocss.config.ts`),
|
|
22
|
-
resolve(clientRoot, "uno.config.ts"),
|
|
23
|
-
resolve(clientRoot, "unocss.config.ts")
|
|
24
|
-
]).filter((i) => existsSync(i));
|
|
25
|
-
const configs = configFiles.map((i) => {
|
|
26
|
-
const loaded = jiti(fileURLToPath(import.meta.url))(i);
|
|
27
|
-
const config2 = "default" in loaded ? loaded.default : loaded;
|
|
28
|
-
return config2;
|
|
29
|
-
}).filter(Boolean);
|
|
30
|
-
configs.reverse();
|
|
31
|
-
let config = mergeConfigs([...configs, unoOptions]);
|
|
32
|
-
config = await loadSetups(clientRoot, roots, "unocss.ts", {}, config, (a, b) => mergeConfigs([a, b]));
|
|
33
|
-
config.theme ||= {};
|
|
34
|
-
config.theme.fontFamily ||= {};
|
|
35
|
-
config.theme.fontFamily.sans ||= data.config.fonts.sans.join(",");
|
|
36
|
-
config.theme.fontFamily.mono ||= data.config.fonts.mono.join(",");
|
|
37
|
-
config.theme.fontFamily.serif ||= data.config.fonts.serif.join(",");
|
|
38
|
-
return UnoCSS({
|
|
39
|
-
configFile: false,
|
|
40
|
-
configDeps: configFiles,
|
|
41
|
-
...config
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
createUnocssPlugin
|
|
46
|
-
};
|