@slidev/cli 0.31.4 → 0.32.3
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-5QYEFLVL.js → build-M2QTEV63.js} +11 -11
- package/dist/{build-QLCAUS73.mjs → build-YVXTTUTD.mjs} +3 -3
- package/dist/{chunk-RQ7QDWD6.js → chunk-IW3TSLZF.js} +74 -64
- package/dist/{chunk-OYCSUJS7.js → chunk-JWGORJY6.js} +7 -1
- package/dist/{chunk-7HNXF4RI.mjs → chunk-M2TT7ZMD.mjs} +107 -36
- package/dist/{chunk-VNV7XQUU.js → chunk-N7XL66RP.js} +244 -173
- package/dist/{chunk-25USV2L5.mjs → chunk-NOFZO6W4.mjs} +7 -1
- package/dist/{chunk-NKDK3BW7.mjs → chunk-WZ6OPJJF.mjs} +19 -9
- package/dist/cli.js +25 -27
- package/dist/cli.mjs +7 -9
- package/dist/{export-RFA6N32W.mjs → export-GIPHUNUX.mjs} +3 -5
- package/dist/{export-W52T2VBO.js → export-M6HJUIFY.js} +4 -6
- package/dist/index.d.ts +5 -2
- package/dist/index.js +9 -7
- package/dist/index.mjs +8 -6
- package/package.json +12 -12
- package/dist/chunk-6FP4S4BJ.js +0 -31
- package/dist/chunk-A6EFYWHQ.mjs +0 -31
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIW3TSLZFjs = require('./chunk-IW3TSLZF.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
|
|
11
11
|
|
|
12
12
|
// node/build.ts
|
|
13
|
-
|
|
13
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
14
14
|
var _path = require('path');
|
|
15
15
|
var _http = require('http'); var _http2 = _interopRequireDefault(_http);
|
|
16
16
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
@@ -18,12 +18,12 @@ var _vite = require('vite');
|
|
|
18
18
|
var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
|
|
19
19
|
|
|
20
20
|
// ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
|
|
21
|
-
|
|
21
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
22
22
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
// ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
|
|
26
|
-
|
|
26
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
function totalist(dir, callback, pre = "") {
|
|
@@ -38,7 +38,7 @@ function totalist(dir, callback, pre = "") {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// ../../node_modules/.pnpm/@polka+url@1.0.0-next.21/node_modules/@polka/url/build.mjs
|
|
41
|
-
|
|
41
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
42
42
|
var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
|
|
43
43
|
function parse2(req) {
|
|
44
44
|
let raw = req.url;
|
|
@@ -62,7 +62,7 @@ function parse2(req) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// ../../node_modules/.pnpm/mrmime@1.0.0/node_modules/mrmime/index.mjs
|
|
65
|
-
|
|
65
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
66
66
|
var mimes = {
|
|
67
67
|
"ez": "application/andrew-inset",
|
|
68
68
|
"aw": "application/applixware",
|
|
@@ -527,7 +527,7 @@ function is404(req, res) {
|
|
|
527
527
|
}
|
|
528
528
|
function send(req, res, file, stats, headers) {
|
|
529
529
|
let code = 200, tmp, opts = {};
|
|
530
|
-
headers =
|
|
530
|
+
headers = _chunkJWGORJY6js.__spreadValues.call(void 0, {}, headers);
|
|
531
531
|
for (let key in headers) {
|
|
532
532
|
tmp = res.getHeader(key);
|
|
533
533
|
if (tmp)
|
|
@@ -655,13 +655,13 @@ async function build(options, viteConfig = {}) {
|
|
|
655
655
|
let originalIndexHTML;
|
|
656
656
|
if (_fsextra2.default.existsSync(indexPath))
|
|
657
657
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
658
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
658
|
+
await _fsextra2.default.writeFile(indexPath, await _chunkIW3TSLZFjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
659
659
|
let config = void 0;
|
|
660
660
|
try {
|
|
661
661
|
const inlineConfig = _vite.mergeConfig.call(void 0, viteConfig, {
|
|
662
662
|
root: options.userRoot,
|
|
663
663
|
plugins: [
|
|
664
|
-
await
|
|
664
|
+
await _chunkIW3TSLZFjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
665
665
|
{
|
|
666
666
|
name: "resolve-config",
|
|
667
667
|
configResolved(_config) {
|
|
@@ -713,7 +713,7 @@ async function build(options, viteConfig = {}) {
|
|
|
713
713
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
714
714
|
`, "utf-8");
|
|
715
715
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
716
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
716
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "./export-M6HJUIFY.js")));
|
|
717
717
|
const port = 12445;
|
|
718
718
|
const app = _connect2.default.call(void 0, );
|
|
719
719
|
const server = _http2.default.createServer(app);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WZ6OPJJF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__require,
|
|
7
7
|
__spreadValues,
|
|
8
8
|
__toESM,
|
|
9
9
|
init_esm_shims
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NOFZO6W4.mjs";
|
|
11
11
|
|
|
12
12
|
// node/build.ts
|
|
13
13
|
init_esm_shims();
|
|
@@ -713,7 +713,7 @@ async function build(options, viteConfig = {}) {
|
|
|
713
713
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
714
714
|
`, "utf-8");
|
|
715
715
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
716
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
716
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-GIPHUNUX.mjs")));
|
|
717
717
|
const port = 12445;
|
|
718
718
|
const app = connect();
|
|
719
719
|
const server = http.createServer(app);
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkJWGORJY6js = require('./chunk-JWGORJY6.js');
|
|
14
14
|
|
|
15
15
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
16
|
-
var require_fast_deep_equal =
|
|
16
|
+
var require_fast_deep_equal = _chunkJWGORJY6js.__commonJS.call(void 0, {
|
|
17
17
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
18
18
|
"use strict";
|
|
19
|
-
|
|
19
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
20
20
|
module.exports = function equal2(a, b) {
|
|
21
21
|
if (a === b)
|
|
22
22
|
return true;
|
|
@@ -59,7 +59,7 @@ var require_fast_deep_equal = _chunkOYCSUJS7js.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
63
63
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
64
64
|
var _path = require('path');
|
|
65
65
|
var _utils = require('@antfu/utils');
|
|
@@ -87,13 +87,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
87
87
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
88
88
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
89
89
|
head += `
|
|
90
|
-
<link rel="stylesheet" href="${
|
|
91
|
-
main = main.replace("__ENTRY__",
|
|
90
|
+
<link rel="stylesheet" href="${_chunkJWGORJY6js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
91
|
+
main = main.replace("__ENTRY__", _chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
92
92
|
return main;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
// node/plugins/windicss.ts
|
|
96
|
-
|
|
96
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
@@ -101,13 +101,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
|
|
|
101
101
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
102
102
|
|
|
103
103
|
// node/plugins/setupNode.ts
|
|
104
|
-
|
|
104
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
105
105
|
|
|
106
106
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
function deepMerge(a, b, rootPath = "") {
|
|
110
|
-
a =
|
|
110
|
+
a = _chunkJWGORJY6js.__spreadValues.call(void 0, {}, a);
|
|
111
111
|
Object.keys(b).forEach((key) => {
|
|
112
112
|
if (_utils.isObject.call(void 0, a[key]))
|
|
113
113
|
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
@@ -134,10 +134,11 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
// node/plugins/windicss.ts
|
|
137
|
-
async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
137
|
+
async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
|
|
138
138
|
const configFiles = _utils.uniq.call(void 0, [
|
|
139
139
|
..._vitepluginwindicss.defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
|
|
140
140
|
...themeRoots.map((i) => `${i}/windi.config.ts`),
|
|
141
|
+
...addonRoots.map((i) => `${i}/windi.config.ts`),
|
|
141
142
|
_path.resolve.call(void 0, clientRoot, "windi.config.ts")
|
|
142
143
|
]);
|
|
143
144
|
const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
|
|
@@ -145,7 +146,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
145
146
|
if (config.default)
|
|
146
147
|
config = config.default;
|
|
147
148
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
148
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
149
|
+
return _vitepluginwindicss2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
149
150
|
configFiles: [configFile],
|
|
150
151
|
config,
|
|
151
152
|
onConfigResolved(config2) {
|
|
@@ -166,16 +167,20 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
|
|
|
166
167
|
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
167
168
|
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
168
169
|
});
|
|
170
|
+
addonRoots.forEach((i) => {
|
|
171
|
+
config2.scanOptions.include.push(`${i}/components/*.{vue,ts}`);
|
|
172
|
+
config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
|
|
173
|
+
});
|
|
169
174
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
170
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
171
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
172
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
175
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
176
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
177
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
173
178
|
}
|
|
174
179
|
}, windiOptions));
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
// node/plugins/preset.ts
|
|
178
|
-
|
|
183
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
179
184
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
180
185
|
var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
|
|
181
186
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -185,7 +190,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
185
190
|
|
|
186
191
|
|
|
187
192
|
// node/drawings.ts
|
|
188
|
-
|
|
193
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
189
194
|
|
|
190
195
|
|
|
191
196
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -231,7 +236,7 @@ ${value}
|
|
|
231
236
|
}
|
|
232
237
|
|
|
233
238
|
// node/plugins/extendConfig.ts
|
|
234
|
-
|
|
239
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
235
240
|
|
|
236
241
|
var _vite5 = require('vite');
|
|
237
242
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -242,16 +247,16 @@ var dependencies = {
|
|
|
242
247
|
"@antfu/utils": "^0.5.2",
|
|
243
248
|
"@slidev/parser": "workspace:*",
|
|
244
249
|
"@slidev/types": "workspace:*",
|
|
245
|
-
"@vueuse/core": "^8.
|
|
250
|
+
"@vueuse/core": "^8.5.0",
|
|
246
251
|
"@vueuse/head": "^0.7.6",
|
|
247
252
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
248
|
-
codemirror: "^5.65.
|
|
253
|
+
codemirror: "^5.65.4",
|
|
249
254
|
defu: "^6.0.0",
|
|
250
255
|
drauu: "^0.3.0",
|
|
251
256
|
"file-saver": "^2.0.5",
|
|
252
257
|
"js-base64": "^3.7.2",
|
|
253
258
|
"js-yaml": "^4.1.0",
|
|
254
|
-
katex: "^0.15.
|
|
259
|
+
katex: "^0.15.6",
|
|
255
260
|
mermaid: "^9.1.1",
|
|
256
261
|
"monaco-editor": "^0.33.0",
|
|
257
262
|
nanoid: "^3.3.4",
|
|
@@ -259,14 +264,14 @@ var dependencies = {
|
|
|
259
264
|
recordrtc: "^5.6.2",
|
|
260
265
|
resolve: "^1.22.0",
|
|
261
266
|
"vite-plugin-windicss": "^1.8.4",
|
|
262
|
-
vue: "^3.2.
|
|
267
|
+
vue: "^3.2.35",
|
|
263
268
|
"vue-router": "^4.0.15",
|
|
264
269
|
"vue-starport": "^0.2.10",
|
|
265
|
-
windicss: "^3.5.
|
|
270
|
+
windicss: "^3.5.4"
|
|
266
271
|
};
|
|
267
272
|
|
|
268
273
|
// node/vite/searchRoot.ts
|
|
269
|
-
|
|
274
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
270
275
|
|
|
271
276
|
|
|
272
277
|
var ROOT_FILES = [
|
|
@@ -326,7 +331,7 @@ function createConfigPlugin(options) {
|
|
|
326
331
|
define: getDefine(options),
|
|
327
332
|
resolve: {
|
|
328
333
|
alias: {
|
|
329
|
-
"@slidev/client/": `${
|
|
334
|
+
"@slidev/client/": `${_chunkJWGORJY6js.toAtFS.call(void 0, options.clientRoot)}/`
|
|
330
335
|
}
|
|
331
336
|
},
|
|
332
337
|
optimizeDeps: {
|
|
@@ -353,7 +358,7 @@ function createConfigPlugin(options) {
|
|
|
353
358
|
allow: _utils.uniq.call(void 0, [
|
|
354
359
|
searchForWorkspaceRoot(options.userRoot),
|
|
355
360
|
searchForWorkspaceRoot(options.cliRoot),
|
|
356
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
361
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkJWGORJY6js.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkJWGORJY6js.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
357
362
|
])
|
|
358
363
|
}
|
|
359
364
|
}
|
|
@@ -362,7 +367,7 @@ function createConfigPlugin(options) {
|
|
|
362
367
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
363
368
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
364
369
|
injection.root = options.cliRoot;
|
|
365
|
-
injection.resolve.alias.vue = `${
|
|
370
|
+
injection.resolve.alias.vue = `${_chunkJWGORJY6js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
366
371
|
}
|
|
367
372
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
368
373
|
},
|
|
@@ -383,7 +388,7 @@ function createConfigPlugin(options) {
|
|
|
383
388
|
}
|
|
384
389
|
function getDefine(options) {
|
|
385
390
|
return {
|
|
386
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
391
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkJWGORJY6js.toAtFS.call(void 0, options.clientRoot)),
|
|
387
392
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
388
393
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
389
394
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -393,8 +398,8 @@ function getDefine(options) {
|
|
|
393
398
|
}
|
|
394
399
|
|
|
395
400
|
// node/plugins/loaders.ts
|
|
396
|
-
|
|
397
|
-
var import_fast_deep_equal =
|
|
401
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
402
|
+
var import_fast_deep_equal = _chunkJWGORJY6js.__toESM.call(void 0, require_fast_deep_equal());
|
|
398
403
|
|
|
399
404
|
|
|
400
405
|
|
|
@@ -426,11 +431,11 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
426
431
|
}
|
|
427
432
|
});
|
|
428
433
|
function prepareSlideInfo(data) {
|
|
429
|
-
return
|
|
434
|
+
return _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, data), {
|
|
430
435
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
431
436
|
});
|
|
432
437
|
}
|
|
433
|
-
function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
438
|
+
function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
|
|
434
439
|
const slidePrefix = "/@slidev/slides/";
|
|
435
440
|
const hmrPages = /* @__PURE__ */ new Set();
|
|
436
441
|
let server;
|
|
@@ -517,7 +522,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
517
522
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
518
523
|
try {
|
|
519
524
|
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
520
|
-
return await VuePlugin.handleHotUpdate(
|
|
525
|
+
return await VuePlugin.handleHotUpdate(_chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, ctx), {
|
|
521
526
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
522
527
|
file,
|
|
523
528
|
read() {
|
|
@@ -634,14 +639,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
634
639
|
async function transformMarkdown(code, pageNo, data2) {
|
|
635
640
|
var _a, _b;
|
|
636
641
|
const layouts = await getLayouts();
|
|
637
|
-
const frontmatter =
|
|
642
|
+
const frontmatter = _chunkJWGORJY6js.__spreadValues.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
638
643
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
639
644
|
if (!layouts[layoutName])
|
|
640
645
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
641
646
|
delete frontmatter.title;
|
|
642
647
|
const imports = [
|
|
643
648
|
'import { inject as vueInject } from "vue"',
|
|
644
|
-
`import InjectedLayout from "${
|
|
649
|
+
`import InjectedLayout from "${_chunkJWGORJY6js.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
645
650
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
646
651
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
647
652
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -724,6 +729,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
724
729
|
const roots2 = _utils.uniq.call(void 0, [
|
|
725
730
|
userRoot,
|
|
726
731
|
...themeRoots,
|
|
732
|
+
...addonRoots,
|
|
727
733
|
clientRoot
|
|
728
734
|
]);
|
|
729
735
|
for (const root of roots2) {
|
|
@@ -744,12 +750,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
744
750
|
}
|
|
745
751
|
async function generateUserStyles() {
|
|
746
752
|
const imports = [
|
|
747
|
-
`import "${
|
|
748
|
-
`import "${
|
|
749
|
-
`import "${
|
|
753
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
754
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
755
|
+
`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
750
756
|
];
|
|
751
757
|
const roots2 = _utils.uniq.call(void 0, [
|
|
752
758
|
...themeRoots,
|
|
759
|
+
...addonRoots,
|
|
753
760
|
userRoot
|
|
754
761
|
]);
|
|
755
762
|
for (const root of roots2) {
|
|
@@ -762,13 +769,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
762
769
|
];
|
|
763
770
|
for (const style of styles) {
|
|
764
771
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
765
|
-
imports.push(`import "${
|
|
772
|
+
imports.push(`import "${_chunkJWGORJY6js.toAtFS.call(void 0, style)}"`);
|
|
766
773
|
continue;
|
|
767
774
|
}
|
|
768
775
|
}
|
|
769
776
|
}
|
|
770
777
|
if (data.features.katex)
|
|
771
|
-
imports.push(`import "${
|
|
778
|
+
imports.push(`import "${_chunkJWGORJY6js.toAtFS.call(void 0, _chunkJWGORJY6js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
772
779
|
return imports.join("\n");
|
|
773
780
|
}
|
|
774
781
|
async function generateMonacoTypes() {
|
|
@@ -777,7 +784,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
777
784
|
async function generateLayouts() {
|
|
778
785
|
const imports = [];
|
|
779
786
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
780
|
-
imports.push(`import __layout_${k} from "${
|
|
787
|
+
imports.push(`import __layout_${k} from "${_chunkJWGORJY6js.toAtFS.call(void 0, v)}"`);
|
|
781
788
|
return [k, `__layout_${k}`];
|
|
782
789
|
});
|
|
783
790
|
return [
|
|
@@ -826,10 +833,10 @@ ${routes.join(",\n")}
|
|
|
826
833
|
return [...imports, routesStr].join("\n");
|
|
827
834
|
}
|
|
828
835
|
function generateConfigs() {
|
|
829
|
-
const config =
|
|
836
|
+
const config = _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, data.config), { remote });
|
|
830
837
|
if (_utils.isString.call(void 0, config.title)) {
|
|
831
838
|
const tokens = md.parseInline(config.title, {});
|
|
832
|
-
config.title =
|
|
839
|
+
config.title = _chunkJWGORJY6js.stringifyMarkdownTokens.call(void 0, tokens);
|
|
833
840
|
}
|
|
834
841
|
if (_utils.isString.call(void 0, config.info))
|
|
835
842
|
config.info = md.render(config.info);
|
|
@@ -850,7 +857,7 @@ ${routes.join(",\n")}
|
|
|
850
857
|
];
|
|
851
858
|
}
|
|
852
859
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
853
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
860
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
854
861
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
855
862
|
return `
|
|
856
863
|
${imports}
|
|
@@ -869,7 +876,7 @@ export default {
|
|
|
869
876
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
870
877
|
];
|
|
871
878
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
872
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
879
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, i)}'`).join("\n");
|
|
873
880
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
874
881
|
return `
|
|
875
882
|
${imports}
|
|
@@ -884,7 +891,7 @@ export default {
|
|
|
884
891
|
}
|
|
885
892
|
|
|
886
893
|
// node/plugins/monacoTransform.ts
|
|
887
|
-
|
|
894
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
888
895
|
|
|
889
896
|
|
|
890
897
|
|
|
@@ -918,11 +925,11 @@ function createMonacoTypesLoader() {
|
|
|
918
925
|
}
|
|
919
926
|
|
|
920
927
|
// node/plugins/setupClient.ts
|
|
921
|
-
|
|
928
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
922
929
|
|
|
923
930
|
|
|
924
931
|
|
|
925
|
-
function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
932
|
+
function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot }) {
|
|
926
933
|
const setupEntry = _utils.slash.call(void 0, _path.resolve.call(void 0, clientRoot, "setup"));
|
|
927
934
|
return {
|
|
928
935
|
name: "slidev:setup",
|
|
@@ -935,12 +942,13 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
935
942
|
const asyncInjections = [];
|
|
936
943
|
const setups = _utils.uniq.call(void 0, [
|
|
937
944
|
...themeRoots,
|
|
945
|
+
...addonRoots,
|
|
938
946
|
userRoot
|
|
939
947
|
]).map((i) => _path.join.call(void 0, i, "setup", name));
|
|
940
948
|
setups.forEach((path, idx) => {
|
|
941
949
|
if (!_fs.existsSync.call(void 0, path))
|
|
942
950
|
return;
|
|
943
|
-
imports.push(`import __n${idx} from '${
|
|
951
|
+
imports.push(`import __n${idx} from '${_chunkJWGORJY6js.toAtFS.call(void 0, path)}'`);
|
|
944
952
|
let fn = `__n${idx}`;
|
|
945
953
|
let awaitFn = `await __n${idx}`;
|
|
946
954
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -968,7 +976,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
968
976
|
}
|
|
969
977
|
|
|
970
978
|
// node/plugins/markdown.ts
|
|
971
|
-
|
|
979
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
972
980
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
973
981
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
974
982
|
|
|
@@ -978,7 +986,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
978
986
|
var _plantumlencoder = require('plantuml-encoder');
|
|
979
987
|
|
|
980
988
|
// node/plugins/markdown-it-katex.ts
|
|
981
|
-
|
|
989
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
982
990
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
983
991
|
function isValidDelim(state, pos) {
|
|
984
992
|
const max = state.posMax;
|
|
@@ -1125,7 +1133,7 @@ function math_plugin(md2, options) {
|
|
|
1125
1133
|
}
|
|
1126
1134
|
|
|
1127
1135
|
// node/plugins/markdown-it-prism.ts
|
|
1128
|
-
|
|
1136
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1129
1137
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1130
1138
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1131
1139
|
var DEFAULTS = {
|
|
@@ -1148,7 +1156,7 @@ function loadPrismLang(lang) {
|
|
|
1148
1156
|
}
|
|
1149
1157
|
function loadPrismPlugin(name) {
|
|
1150
1158
|
try {
|
|
1151
|
-
|
|
1159
|
+
_chunkJWGORJY6js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1152
1160
|
} catch (e) {
|
|
1153
1161
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1154
1162
|
}
|
|
@@ -1188,7 +1196,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1188
1196
|
}
|
|
1189
1197
|
|
|
1190
1198
|
// node/plugins/markdown-it-shiki.ts
|
|
1191
|
-
|
|
1199
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1192
1200
|
function getThemeName(theme) {
|
|
1193
1201
|
if (typeof theme === "string")
|
|
1194
1202
|
return theme;
|
|
@@ -1210,7 +1218,7 @@ function resolveShikiOptions(options) {
|
|
|
1210
1218
|
themes.push(options.theme);
|
|
1211
1219
|
}
|
|
1212
1220
|
}
|
|
1213
|
-
return
|
|
1221
|
+
return _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {}, options), {
|
|
1214
1222
|
themes,
|
|
1215
1223
|
darkModeThemes: darkModeThemes ? {
|
|
1216
1224
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1248,7 +1256,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1248
1256
|
const setups = [];
|
|
1249
1257
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1250
1258
|
if (config.highlighter === "shiki") {
|
|
1251
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1259
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkJWGORJY6js.__toESM.call(void 0, _chunkJWGORJY6js.__require.call(void 0, "shiki")));
|
|
1252
1260
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1253
1261
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1254
1262
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1257,11 +1265,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1257
1265
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1258
1266
|
}
|
|
1259
1267
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1260
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1268
|
+
return _vitepluginmd2.default.call(void 0, _chunkJWGORJY6js.__spreadProps.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1261
1269
|
wrapperClasses: "",
|
|
1262
1270
|
headEnabled: false,
|
|
1263
1271
|
frontmatter: false,
|
|
1264
|
-
markdownItOptions:
|
|
1272
|
+
markdownItOptions: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1265
1273
|
quotes: `""''`,
|
|
1266
1274
|
html: true,
|
|
1267
1275
|
xhtmlOut: true,
|
|
@@ -1397,7 +1405,7 @@ function escapeVueInCode(md2) {
|
|
|
1397
1405
|
}
|
|
1398
1406
|
|
|
1399
1407
|
// node/plugins/patchTransform.ts
|
|
1400
|
-
|
|
1408
|
+
_chunkJWGORJY6js.init_cjs_shims.call(void 0, );
|
|
1401
1409
|
|
|
1402
1410
|
function createFixPlugins(options) {
|
|
1403
1411
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1458,13 +1466,14 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1458
1466
|
const {
|
|
1459
1467
|
mode,
|
|
1460
1468
|
themeRoots,
|
|
1469
|
+
addonRoots,
|
|
1461
1470
|
clientRoot,
|
|
1462
1471
|
data: { config }
|
|
1463
1472
|
} = options;
|
|
1464
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1473
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1465
1474
|
include: [/\.vue$/, /\.md$/],
|
|
1466
1475
|
exclude: [],
|
|
1467
|
-
template:
|
|
1476
|
+
template: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1468
1477
|
compilerOptions: {
|
|
1469
1478
|
isCustomElement(tag) {
|
|
1470
1479
|
return customElements.has(tag);
|
|
@@ -1479,12 +1488,13 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1479
1488
|
MarkdownPlugin,
|
|
1480
1489
|
VuePlugin,
|
|
1481
1490
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1482
|
-
_vite4.default.call(void 0,
|
|
1491
|
+
_vite4.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1483
1492
|
extensions: ["vue", "md", "ts"],
|
|
1484
1493
|
dirs: [
|
|
1485
1494
|
`${clientRoot}/builtin`,
|
|
1486
1495
|
`${clientRoot}/components`,
|
|
1487
1496
|
...themeRoots.map((i) => `${i}/components`),
|
|
1497
|
+
...addonRoots.map((i) => `${i}/components`),
|
|
1488
1498
|
"src/components",
|
|
1489
1499
|
"components"
|
|
1490
1500
|
],
|
|
@@ -1497,11 +1507,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1497
1507
|
})
|
|
1498
1508
|
]
|
|
1499
1509
|
}, componentsOptions)),
|
|
1500
|
-
_vite2.default.call(void 0,
|
|
1510
|
+
_vite2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1501
1511
|
defaultClass: "slidev-icon",
|
|
1502
1512
|
autoInstall: true
|
|
1503
1513
|
}, iconsOptions)),
|
|
1504
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1514
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1505
1515
|
rules: [
|
|
1506
1516
|
..._vitepluginremoteassets.DefaultRules,
|
|
1507
1517
|
{
|
|
@@ -1514,7 +1524,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1514
1524
|
}, remoteAssetsOptions)) : null,
|
|
1515
1525
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1516
1526
|
debug: process.env.NODE_ENV === "development",
|
|
1517
|
-
state:
|
|
1527
|
+
state: _chunkJWGORJY6js.__spreadValues.call(void 0, {
|
|
1518
1528
|
sync: false,
|
|
1519
1529
|
nav: {
|
|
1520
1530
|
page: 0,
|
|
@@ -147,6 +147,12 @@ function generateGoogleFontsUrl(options) {
|
|
|
147
147
|
const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
|
|
148
148
|
return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
|
|
149
149
|
}
|
|
150
|
+
function packageExists(name) {
|
|
151
|
+
if (resolveImportPath(`${name}/package.json`))
|
|
152
|
+
return true;
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
|
|
150
156
|
|
|
151
157
|
|
|
152
158
|
|
|
@@ -165,4 +171,4 @@ function generateGoogleFontsUrl(options) {
|
|
|
165
171
|
|
|
166
172
|
|
|
167
173
|
|
|
168
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl;
|
|
174
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__require = __require; exports.__objRest = __objRest; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper; exports.init_cjs_shims = init_cjs_shims; exports.toAtFS = toAtFS; exports.resolveImportPath = resolveImportPath; exports.resolveGlobalImportPath = resolveGlobalImportPath; exports.stringifyMarkdownTokens = stringifyMarkdownTokens; exports.generateGoogleFontsUrl = generateGoogleFontsUrl; exports.packageExists = packageExists;
|