@slidev/cli 0.33.0 → 0.33.1
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-P4Q57V2J.mjs → build-JAORN7ES.mjs} +3 -3
- package/dist/{build-JMQRM5SA.js → build-OWDFSW6Q.js} +13 -13
- package/dist/{chunk-C7GPMAIX.mjs → chunk-DGFMEJWT.mjs} +10 -10
- package/dist/{chunk-FFZLS6QK.js → chunk-IP7ZGKHI.js} +2 -2
- package/dist/{chunk-ZWCVPYOA.mjs → chunk-IWKTUAXD.mjs} +2 -2
- package/dist/{chunk-JQEMHC65.js → chunk-LIMOCTLS.js} +154 -154
- package/dist/{chunk-ORQ3SHUX.mjs → chunk-MVE4F2AE.mjs} +3 -3
- package/dist/{chunk-UNBXPUSG.js → chunk-WGEHDK3K.js} +66 -66
- package/dist/cli.js +24 -24
- package/dist/cli.mjs +5 -5
- package/dist/{export-LOKLMK66.js → export-JHIU6OQI.js} +4 -4
- package/dist/{export-5R6FV775.mjs → export-Z44PM4CT.mjs} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DGFMEJWT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__dirname,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
init_esm_shims,
|
|
17
17
|
packageExists,
|
|
18
18
|
resolveImportPath
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IWKTUAXD.mjs";
|
|
20
20
|
|
|
21
21
|
// ../../node_modules/.pnpm/semver@7.3.7/node_modules/semver/internal/constants.js
|
|
22
22
|
var require_constants = __commonJS({
|
|
@@ -2402,7 +2402,7 @@ init_esm_shims();
|
|
|
2402
2402
|
import * as parser from "@slidev/parser/fs";
|
|
2403
2403
|
|
|
2404
2404
|
// package.json
|
|
2405
|
-
var version = "0.33.
|
|
2405
|
+
var version = "0.33.1";
|
|
2406
2406
|
|
|
2407
2407
|
// node/themes.ts
|
|
2408
2408
|
init_esm_shims();
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkIP7ZGKHIjs = require('./chunk-IP7ZGKHI.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 = _chunkIP7ZGKHIjs.__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
|
+
_chunkIP7ZGKHIjs.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 = _chunkFFZLS6QKjs.__commonJS.call(void 0, {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
// node/common.ts
|
|
62
|
-
|
|
62
|
+
_chunkIP7ZGKHIjs.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');
|
|
@@ -88,8 +88,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
|
|
|
88
88
|
body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
|
|
89
89
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
90
90
|
head += `
|
|
91
|
-
<link rel="stylesheet" href="${
|
|
92
|
-
main = main.replace("__ENTRY__",
|
|
91
|
+
<link rel="stylesheet" href="${_chunkIP7ZGKHIjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
92
|
+
main = main.replace("__ENTRY__", _chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
93
93
|
return main;
|
|
94
94
|
}
|
|
95
95
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -113,7 +113,7 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
// node/plugins/windicss.ts
|
|
116
|
-
|
|
116
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
|
|
@@ -121,13 +121,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
|
|
|
121
121
|
var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
|
|
122
122
|
|
|
123
123
|
// node/plugins/setupNode.ts
|
|
124
|
-
|
|
124
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
125
125
|
|
|
126
126
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
function deepMerge(a, b, rootPath = "") {
|
|
130
|
-
a =
|
|
130
|
+
a = _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, a);
|
|
131
131
|
Object.keys(b).forEach((key) => {
|
|
132
132
|
if (_utils.isObject.call(void 0, a[key]))
|
|
133
133
|
a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
|
|
@@ -166,7 +166,7 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
166
166
|
if (config.default)
|
|
167
167
|
config = config.default;
|
|
168
168
|
config = await loadSetups(roots, "windicss.ts", {}, config, true);
|
|
169
|
-
return _vitepluginwindicss2.default.call(void 0,
|
|
169
|
+
return _vitepluginwindicss2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
170
170
|
configFiles: [configFile],
|
|
171
171
|
config,
|
|
172
172
|
onConfigResolved(config2) {
|
|
@@ -192,15 +192,15 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
192
192
|
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
193
193
|
});
|
|
194
194
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
195
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
196
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
197
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
195
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
196
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
197
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
198
198
|
}
|
|
199
199
|
}, windiOptions));
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
// node/plugins/preset.ts
|
|
203
|
-
|
|
203
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
204
204
|
var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
|
|
205
205
|
var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
|
|
206
206
|
var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
|
|
@@ -210,7 +210,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
|
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
// node/drawings.ts
|
|
213
|
-
|
|
213
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
|
|
@@ -256,7 +256,7 @@ ${value}
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// node/plugins/extendConfig.ts
|
|
259
|
-
|
|
259
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
260
260
|
|
|
261
261
|
|
|
262
262
|
var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
|
|
@@ -267,7 +267,7 @@ var dependencies = {
|
|
|
267
267
|
"@antfu/utils": "^0.5.2",
|
|
268
268
|
"@slidev/parser": "workspace:*",
|
|
269
269
|
"@slidev/types": "workspace:*",
|
|
270
|
-
"@vueuse/core": "^8.
|
|
270
|
+
"@vueuse/core": "^8.7.4",
|
|
271
271
|
"@vueuse/head": "^0.7.6",
|
|
272
272
|
"@vueuse/motion": "^2.0.0-beta.18",
|
|
273
273
|
codemirror: "^5.65.5",
|
|
@@ -276,22 +276,22 @@ var dependencies = {
|
|
|
276
276
|
"file-saver": "^2.0.5",
|
|
277
277
|
"js-base64": "^3.7.2",
|
|
278
278
|
"js-yaml": "^4.1.0",
|
|
279
|
-
katex: "^0.
|
|
280
|
-
mermaid: "^9.1.
|
|
279
|
+
katex: "^0.16.0",
|
|
280
|
+
mermaid: "^9.1.2",
|
|
281
281
|
"monaco-editor": "^0.33.0",
|
|
282
|
-
nanoid: "^
|
|
283
|
-
prettier: "^2.
|
|
282
|
+
nanoid: "^4.0.0",
|
|
283
|
+
prettier: "^2.7.1",
|
|
284
284
|
recordrtc: "^5.6.2",
|
|
285
|
-
resolve: "^1.22.
|
|
285
|
+
resolve: "^1.22.1",
|
|
286
286
|
"vite-plugin-windicss": "^1.8.4",
|
|
287
287
|
vue: "^3.2.36",
|
|
288
|
-
"vue-router": "^4.0.
|
|
289
|
-
"vue-starport": "^0.
|
|
288
|
+
"vue-router": "^4.0.16",
|
|
289
|
+
"vue-starport": "^0.3.0",
|
|
290
290
|
windicss: "^3.5.4"
|
|
291
291
|
};
|
|
292
292
|
|
|
293
293
|
// node/vite/searchRoot.ts
|
|
294
|
-
|
|
294
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
295
295
|
|
|
296
296
|
|
|
297
297
|
var ROOT_FILES = [
|
|
@@ -351,7 +351,7 @@ function createConfigPlugin(options) {
|
|
|
351
351
|
define: getDefine(options),
|
|
352
352
|
resolve: {
|
|
353
353
|
alias: {
|
|
354
|
-
"@slidev/client/": `${
|
|
354
|
+
"@slidev/client/": `${_chunkIP7ZGKHIjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
355
355
|
}
|
|
356
356
|
},
|
|
357
357
|
optimizeDeps: {
|
|
@@ -378,7 +378,7 @@ function createConfigPlugin(options) {
|
|
|
378
378
|
allow: _utils.uniq.call(void 0, [
|
|
379
379
|
searchForWorkspaceRoot(options.userRoot),
|
|
380
380
|
searchForWorkspaceRoot(options.cliRoot),
|
|
381
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
381
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
382
382
|
])
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -387,7 +387,7 @@ function createConfigPlugin(options) {
|
|
|
387
387
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
388
388
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
389
389
|
injection.root = options.cliRoot;
|
|
390
|
-
injection.resolve.alias.vue = `${
|
|
390
|
+
injection.resolve.alias.vue = `${_chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
391
391
|
}
|
|
392
392
|
return _vite.mergeConfig.call(void 0, config, injection);
|
|
393
393
|
},
|
|
@@ -408,7 +408,7 @@ function createConfigPlugin(options) {
|
|
|
408
408
|
}
|
|
409
409
|
function getDefine(options) {
|
|
410
410
|
return {
|
|
411
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
411
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkIP7ZGKHIjs.toAtFS.call(void 0, options.clientRoot)),
|
|
412
412
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
413
413
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
414
414
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -418,8 +418,8 @@ function getDefine(options) {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
// node/plugins/loaders.ts
|
|
421
|
-
|
|
422
|
-
var import_fast_deep_equal =
|
|
421
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
422
|
+
var import_fast_deep_equal = _chunkIP7ZGKHIjs.__toESM.call(void 0, require_fast_deep_equal());
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
|
|
@@ -451,7 +451,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
451
451
|
}
|
|
452
452
|
});
|
|
453
453
|
function prepareSlideInfo(data) {
|
|
454
|
-
return
|
|
454
|
+
return _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, data), {
|
|
455
455
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
456
456
|
});
|
|
457
457
|
}
|
|
@@ -542,7 +542,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
542
542
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
543
543
|
try {
|
|
544
544
|
const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
545
|
-
return await VuePlugin.handleHotUpdate(
|
|
545
|
+
return await VuePlugin.handleHotUpdate(_chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, ctx), {
|
|
546
546
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
547
547
|
file,
|
|
548
548
|
read() {
|
|
@@ -659,14 +659,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
|
|
|
659
659
|
async function transformMarkdown(code, pageNo, data2) {
|
|
660
660
|
var _a, _b;
|
|
661
661
|
const layouts = await getLayouts();
|
|
662
|
-
const frontmatter =
|
|
662
|
+
const frontmatter = _chunkIP7ZGKHIjs.__spreadValues.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
|
|
663
663
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
664
664
|
if (!layouts[layoutName])
|
|
665
665
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
666
666
|
delete frontmatter.title;
|
|
667
667
|
const imports = [
|
|
668
668
|
'import { inject as vueInject } from "vue"',
|
|
669
|
-
`import InjectedLayout from "${
|
|
669
|
+
`import InjectedLayout from "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
670
670
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
671
671
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
672
672
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -770,9 +770,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
770
770
|
}
|
|
771
771
|
async function generateUserStyles() {
|
|
772
772
|
const imports = [
|
|
773
|
-
`import "${
|
|
774
|
-
`import "${
|
|
775
|
-
`import "${
|
|
773
|
+
`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
774
|
+
`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
775
|
+
`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
|
|
776
776
|
];
|
|
777
777
|
const roots2 = _utils.uniq.call(void 0, [
|
|
778
778
|
...themeRoots,
|
|
@@ -789,13 +789,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
789
789
|
];
|
|
790
790
|
for (const style of styles) {
|
|
791
791
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
792
|
-
imports.push(`import "${
|
|
792
|
+
imports.push(`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, style)}"`);
|
|
793
793
|
continue;
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
if (data.features.katex)
|
|
798
|
-
imports.push(`import "${
|
|
798
|
+
imports.push(`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
799
799
|
return imports.join("\n");
|
|
800
800
|
}
|
|
801
801
|
async function generateMonacoTypes() {
|
|
@@ -804,7 +804,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
804
804
|
async function generateLayouts() {
|
|
805
805
|
const imports = [];
|
|
806
806
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
807
|
-
imports.push(`import __layout_${k} from "${
|
|
807
|
+
imports.push(`import __layout_${k} from "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, v)}"`);
|
|
808
808
|
return [k, `__layout_${k}`];
|
|
809
809
|
});
|
|
810
810
|
return [
|
|
@@ -826,7 +826,7 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
826
826
|
return void 0;
|
|
827
827
|
imports.push(`import n${no} from '${slidePrefix}${idx + 1}.md'`);
|
|
828
828
|
const additions = {
|
|
829
|
-
slide:
|
|
829
|
+
slide: _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, prepareSlideInfo(i)), {
|
|
830
830
|
filepath: ((_b = i.source) == null ? void 0 : _b.filepath) || entry,
|
|
831
831
|
id: idx,
|
|
832
832
|
no
|
|
@@ -848,10 +848,10 @@ ${routes.join(",\n")}
|
|
|
848
848
|
return [...imports, routesStr].join("\n");
|
|
849
849
|
}
|
|
850
850
|
function generateConfigs() {
|
|
851
|
-
const config =
|
|
851
|
+
const config = _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, data.config), { remote });
|
|
852
852
|
if (_utils.isString.call(void 0, config.title)) {
|
|
853
853
|
const tokens = md.parseInline(config.title, {});
|
|
854
|
-
config.title =
|
|
854
|
+
config.title = _chunkIP7ZGKHIjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
855
855
|
}
|
|
856
856
|
if (_utils.isString.call(void 0, config.info))
|
|
857
857
|
config.info = md.render(config.info);
|
|
@@ -872,7 +872,7 @@ ${routes.join(",\n")}
|
|
|
872
872
|
];
|
|
873
873
|
}
|
|
874
874
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
875
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
875
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
876
876
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
877
877
|
return `
|
|
878
878
|
${imports}
|
|
@@ -891,7 +891,7 @@ export default {
|
|
|
891
891
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
892
892
|
];
|
|
893
893
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
894
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
894
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
895
895
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
896
896
|
return `
|
|
897
897
|
${imports}
|
|
@@ -906,7 +906,7 @@ export default {
|
|
|
906
906
|
}
|
|
907
907
|
|
|
908
908
|
// node/plugins/monacoTransform.ts
|
|
909
|
-
|
|
909
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
910
910
|
|
|
911
911
|
|
|
912
912
|
|
|
@@ -940,7 +940,7 @@ function createMonacoTypesLoader() {
|
|
|
940
940
|
}
|
|
941
941
|
|
|
942
942
|
// node/plugins/setupClient.ts
|
|
943
|
-
|
|
943
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
944
944
|
|
|
945
945
|
|
|
946
946
|
|
|
@@ -963,7 +963,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
963
963
|
setups.forEach((path, idx) => {
|
|
964
964
|
if (!_fs.existsSync.call(void 0, path))
|
|
965
965
|
return;
|
|
966
|
-
imports.push(`import __n${idx} from '${
|
|
966
|
+
imports.push(`import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, path)}'`);
|
|
967
967
|
let fn = `__n${idx}`;
|
|
968
968
|
let awaitFn = `await __n${idx}`;
|
|
969
969
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -991,8 +991,8 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
991
991
|
}
|
|
992
992
|
|
|
993
993
|
// node/plugins/markdown.ts
|
|
994
|
-
|
|
995
|
-
var
|
|
994
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
995
|
+
var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
|
|
996
996
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
997
997
|
|
|
998
998
|
|
|
@@ -1001,7 +1001,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
1001
1001
|
var _plantumlencoder = require('plantuml-encoder');
|
|
1002
1002
|
|
|
1003
1003
|
// node/plugins/markdown-it-katex.ts
|
|
1004
|
-
|
|
1004
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
1005
1005
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
1006
1006
|
function isValidDelim(state, pos) {
|
|
1007
1007
|
const max = state.posMax;
|
|
@@ -1148,7 +1148,7 @@ function math_plugin(md2, options) {
|
|
|
1148
1148
|
}
|
|
1149
1149
|
|
|
1150
1150
|
// node/plugins/markdown-it-prism.ts
|
|
1151
|
-
|
|
1151
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
1152
1152
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1153
1153
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1154
1154
|
var DEFAULTS = {
|
|
@@ -1171,7 +1171,7 @@ function loadPrismLang(lang) {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
function loadPrismPlugin(name) {
|
|
1173
1173
|
try {
|
|
1174
|
-
|
|
1174
|
+
_chunkIP7ZGKHIjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1175
1175
|
} catch (e) {
|
|
1176
1176
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1177
1177
|
}
|
|
@@ -1211,7 +1211,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
|
|
1213
1213
|
// node/plugins/markdown-it-shiki.ts
|
|
1214
|
-
|
|
1214
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
1215
1215
|
function getThemeName(theme) {
|
|
1216
1216
|
if (typeof theme === "string")
|
|
1217
1217
|
return theme;
|
|
@@ -1233,7 +1233,7 @@ function resolveShikiOptions(options) {
|
|
|
1233
1233
|
themes.push(options.theme);
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
return
|
|
1236
|
+
return _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, options), {
|
|
1237
1237
|
themes,
|
|
1238
1238
|
darkModeThemes: darkModeThemes ? {
|
|
1239
1239
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1271,7 +1271,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1271
1271
|
const setups = [];
|
|
1272
1272
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1273
1273
|
if (config.highlighter === "shiki") {
|
|
1274
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1274
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunkIP7ZGKHIjs.__toESM.call(void 0, _chunkIP7ZGKHIjs.__require.call(void 0, "shiki")));
|
|
1275
1275
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1276
1276
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1277
1277
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1280,11 +1280,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1280
1280
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1281
1281
|
}
|
|
1282
1282
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1283
|
-
return
|
|
1283
|
+
return _vitepluginvuemarkdown2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1284
1284
|
wrapperClasses: "",
|
|
1285
1285
|
headEnabled: false,
|
|
1286
1286
|
frontmatter: false,
|
|
1287
|
-
markdownItOptions:
|
|
1287
|
+
markdownItOptions: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1288
1288
|
quotes: `""''`,
|
|
1289
1289
|
html: true,
|
|
1290
1290
|
xhtmlOut: true,
|
|
@@ -1420,7 +1420,7 @@ function escapeVueInCode(md2) {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
|
|
1422
1422
|
// node/plugins/patchTransform.ts
|
|
1423
|
-
|
|
1423
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
1424
1424
|
|
|
1425
1425
|
function createFixPlugins(options) {
|
|
1426
1426
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1485,10 +1485,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1485
1485
|
clientRoot,
|
|
1486
1486
|
data: { config }
|
|
1487
1487
|
} = options;
|
|
1488
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1488
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1489
1489
|
include: [/\.vue$/, /\.md$/],
|
|
1490
1490
|
exclude: [],
|
|
1491
|
-
template:
|
|
1491
|
+
template: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1492
1492
|
compilerOptions: {
|
|
1493
1493
|
isCustomElement(tag) {
|
|
1494
1494
|
return customElements.has(tag);
|
|
@@ -1503,7 +1503,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1503
1503
|
MarkdownPlugin,
|
|
1504
1504
|
VuePlugin,
|
|
1505
1505
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1506
|
-
_vite6.default.call(void 0,
|
|
1506
|
+
_vite6.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1507
1507
|
extensions: ["vue", "md", "ts"],
|
|
1508
1508
|
dirs: [
|
|
1509
1509
|
`${clientRoot}/builtin`,
|
|
@@ -1522,11 +1522,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1522
1522
|
})
|
|
1523
1523
|
]
|
|
1524
1524
|
}, componentsOptions)),
|
|
1525
|
-
_vite4.default.call(void 0,
|
|
1525
|
+
_vite4.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1526
1526
|
defaultClass: "slidev-icon",
|
|
1527
1527
|
autoInstall: true
|
|
1528
1528
|
}, iconsOptions)),
|
|
1529
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1529
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1530
1530
|
rules: [
|
|
1531
1531
|
..._vitepluginremoteassets.DefaultRules,
|
|
1532
1532
|
{
|
|
@@ -1539,7 +1539,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1539
1539
|
}, remoteAssetsOptions)) : null,
|
|
1540
1540
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1541
1541
|
debug: process.env.NODE_ENV === "development",
|
|
1542
|
-
state:
|
|
1542
|
+
state: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
|
|
1543
1543
|
sync: false,
|
|
1544
1544
|
nav: {
|
|
1545
1545
|
page: 0,
|
package/dist/cli.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkLIMOCTLSjs = require('./chunk-LIMOCTLS.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkWGEHDK3Kjs = require('./chunk-WGEHDK3K.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkIP7ZGKHIjs = require('./chunk-IP7ZGKHI.js');
|
|
18
18
|
|
|
19
19
|
// node/cli.ts
|
|
20
|
-
|
|
21
|
-
var import_fast_deep_equal =
|
|
20
|
+
_chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
|
|
21
|
+
var import_fast_deep_equal = _chunkIP7ZGKHIjs.__toESM.call(void 0, _chunkWGEHDK3Kjs.require_fast_deep_equal.call(void 0, ));
|
|
22
22
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
23
23
|
var _net = require('net'); var _net2 = _interopRequireDefault(_net);
|
|
24
24
|
var _os = require('os'); var _os2 = _interopRequireDefault(_os);
|
|
@@ -36,7 +36,7 @@ var CONFIG_RESTART_FIELDS = [
|
|
|
36
36
|
"routerMode",
|
|
37
37
|
"fonts"
|
|
38
38
|
];
|
|
39
|
-
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(
|
|
39
|
+
var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkLIMOCTLSjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
|
|
40
40
|
cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
|
|
41
41
|
alias: "p",
|
|
42
42
|
type: "number",
|
|
@@ -79,9 +79,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
79
79
|
async function initServer() {
|
|
80
80
|
if (server)
|
|
81
81
|
await server.close();
|
|
82
|
-
const options = await
|
|
82
|
+
const options = await _chunkLIMOCTLSjs.resolveOptions.call(void 0, { entry, remote, theme }, "dev");
|
|
83
83
|
port = userPort || await findFreePort(3030);
|
|
84
|
-
server = await
|
|
84
|
+
server = await _chunkLIMOCTLSjs.createServer.call(void 0, options, {
|
|
85
85
|
server: {
|
|
86
86
|
port,
|
|
87
87
|
strictPort: true,
|
|
@@ -92,7 +92,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
|
|
|
92
92
|
logLevel: log
|
|
93
93
|
}, {
|
|
94
94
|
onDataReload(newData, data) {
|
|
95
|
-
if (!theme &&
|
|
95
|
+
if (!theme && _chunkLIMOCTLSjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkLIMOCTLSjs.resolveThemeName.call(void 0, data.config.theme)) {
|
|
96
96
|
console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
|
|
97
97
|
initServer();
|
|
98
98
|
} else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
|
|
@@ -168,8 +168,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
168
168
|
type: "boolean",
|
|
169
169
|
describe: "allow download as PDF"
|
|
170
170
|
}).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
|
|
171
|
-
const { build } = await Promise.resolve().then(() =>
|
|
172
|
-
const options = await
|
|
171
|
+
const { build } = await Promise.resolve().then(() => _chunkIP7ZGKHIjs.__toESM.call(void 0, _chunkIP7ZGKHIjs.__require.call(void 0, "./build-OWDFSW6Q.js")));
|
|
172
|
+
const options = await _chunkLIMOCTLSjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
173
173
|
if (download && !options.data.config.download)
|
|
174
174
|
options.data.config.download = download;
|
|
175
175
|
printInfo(options);
|
|
@@ -182,26 +182,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
|
|
|
182
182
|
});
|
|
183
183
|
});
|
|
184
184
|
cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
|
|
185
|
-
const data = await
|
|
186
|
-
|
|
187
|
-
await
|
|
185
|
+
const data = await _chunkLIMOCTLSjs.parser.load(entry);
|
|
186
|
+
_chunkLIMOCTLSjs.parser.prettify(data);
|
|
187
|
+
await _chunkLIMOCTLSjs.parser.save(data);
|
|
188
188
|
});
|
|
189
189
|
cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
190
190
|
return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
|
|
191
191
|
type: "string",
|
|
192
192
|
default: "theme"
|
|
193
193
|
}), async ({ entry, dir, theme: themeInput }) => {
|
|
194
|
-
const data = await
|
|
195
|
-
const theme =
|
|
194
|
+
const data = await _chunkLIMOCTLSjs.parser.load(entry);
|
|
195
|
+
const theme = _chunkLIMOCTLSjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
|
|
196
196
|
if (theme === "none") {
|
|
197
197
|
console.error('Can not eject theme "none"');
|
|
198
198
|
process.exit(1);
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
200
|
+
if (_chunkLIMOCTLSjs.isPath.call(void 0, theme)) {
|
|
201
201
|
console.error("Theme is already ejected");
|
|
202
202
|
process.exit(1);
|
|
203
203
|
}
|
|
204
|
-
const roots =
|
|
204
|
+
const roots = _chunkLIMOCTLSjs.getThemeRoots.call(void 0, theme, entry);
|
|
205
205
|
if (!roots.length) {
|
|
206
206
|
console.error(`Does not found theme "${theme}"`);
|
|
207
207
|
process.exit(1);
|
|
@@ -213,7 +213,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
|
|
|
213
213
|
const dirPath = `./${dir}`;
|
|
214
214
|
data.slides[0].frontmatter.theme = dirPath;
|
|
215
215
|
data.slides[0].raw = null;
|
|
216
|
-
await
|
|
216
|
+
await _chunkLIMOCTLSjs.parser.save(data);
|
|
217
217
|
console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
|
|
218
218
|
});
|
|
219
219
|
}, () => {
|
|
@@ -255,17 +255,17 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
|
|
|
255
255
|
"with-clicks": withClicks
|
|
256
256
|
}) => {
|
|
257
257
|
process.env.NODE_ENV = "production";
|
|
258
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
258
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkIP7ZGKHIjs.__toESM.call(void 0, _chunkIP7ZGKHIjs.__require.call(void 0, "./export-JHIU6OQI.js")));
|
|
259
259
|
const port = await findFreePort(12445);
|
|
260
|
-
const options = await
|
|
260
|
+
const options = await _chunkLIMOCTLSjs.resolveOptions.call(void 0, { entry, theme }, "build");
|
|
261
261
|
output = output || options.data.config.exportFilename || `${_path2.default.basename(entry, ".md")}-export`;
|
|
262
|
-
const server = await
|
|
262
|
+
const server = await _chunkLIMOCTLSjs.createServer.call(void 0, options, {
|
|
263
263
|
server: { port },
|
|
264
264
|
clearScreen: false
|
|
265
265
|
});
|
|
266
266
|
await server.listen(port);
|
|
267
267
|
printInfo(options);
|
|
268
|
-
|
|
268
|
+
_chunkLIMOCTLSjs.parser.filterDisabled(options.data);
|
|
269
269
|
const width = options.data.config.canvasWidth;
|
|
270
270
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
271
271
|
output = await exportSlides({
|
|
@@ -303,7 +303,7 @@ function printInfo(options, port, remote) {
|
|
|
303
303
|
console.log();
|
|
304
304
|
console.log();
|
|
305
305
|
console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
|
|
306
|
-
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${
|
|
306
|
+
console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkLIMOCTLSjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
|
|
307
307
|
console.log();
|
|
308
308
|
console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
|
|
309
309
|
console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));
|