@slidev/cli 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,21 @@
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 }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
+ var _chunkKKGXM3XLjs = require('./chunk-KKGXM3XL.js');
3
4
 
4
5
 
5
6
 
6
7
 
7
8
 
8
9
 
10
+ var _chunk6ZL4B4HQjs = require('./chunk-6ZL4B4HQ.js');
9
11
 
10
- var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
12
+
13
+
14
+
15
+ var _chunkMJQETB73js = require('./chunk-MJQETB73.js');
11
16
 
12
17
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
13
- var require_fast_deep_equal = _chunkGE7W2DBEjs.__commonJS.call(void 0, {
18
+ var require_fast_deep_equal = _chunkMJQETB73js.__commonJS.call(void 0, {
14
19
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
15
20
  "use strict";
16
21
  module.exports = function equal2(a, b) {
@@ -84,8 +89,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
84
89
  body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
85
90
  if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
86
91
  head += `
87
- <link rel="stylesheet" href="${_chunkGE7W2DBEjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
88
- main = main.replace("__ENTRY__", _chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
92
+ <link rel="stylesheet" href="${_chunk6ZL4B4HQjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
93
+ main = main.replace("__ENTRY__", _chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
89
94
  return main;
90
95
  }
91
96
  async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
@@ -108,93 +113,6 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
108
113
  return _vite.mergeConfig.call(void 0, viteConfig, config);
109
114
  }
110
115
 
111
- // node/plugins/setupNode.ts
112
-
113
- var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
114
-
115
- var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
116
- function deepMerge(a, b, rootPath = "") {
117
- a = { ...a };
118
- Object.keys(b).forEach((key) => {
119
- if (_utils.isObject.call(void 0, a[key]))
120
- a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
121
- else if (Array.isArray(a[key]))
122
- a[key] = [...a[key], ...b[key]];
123
- else
124
- a[key] = b[key];
125
- });
126
- return a;
127
- }
128
- async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
129
- let returns = initial;
130
- for (const root of roots) {
131
- const path = _path.resolve.call(void 0, root, "setup", name);
132
- if (await _fsextra.pathExists.call(void 0, path)) {
133
- const { default: setup } = _jiti2.default.call(void 0, __filename)(path);
134
- const result = await setup(arg);
135
- if (result !== null) {
136
- returns = merge ? deepMerge(returns, result) : accumulate ? accumulate(returns, result) : result;
137
- }
138
- }
139
- }
140
- return returns;
141
- }
142
-
143
- // node/plugins/windicss.ts
144
-
145
-
146
-
147
-
148
- async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRoot, roots, data }, { windicss: windiOptions }) {
149
- const { default: WindiCSS } = await Promise.resolve().then(() => require("vite-plugin-windicss"));
150
- const { defaultConfigureFiles } = await Promise.resolve().then(() => require("@windicss/config"));
151
- const configFiles = _utils.uniq.call(void 0, [
152
- ...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
153
- ...themeRoots.map((i) => `${i}/windi.config.ts`),
154
- ...addonRoots.map((i) => `${i}/windi.config.ts`),
155
- _path.resolve.call(void 0, clientRoot, "windi.config.ts")
156
- ]);
157
- const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
158
- let config = _jiti2.default.call(void 0, __filename)(configFile);
159
- if (config.default)
160
- config = config.default;
161
- config = await loadSetups(roots, "windicss.ts", {}, config, true);
162
- return WindiCSS(
163
- {
164
- configFiles: [configFile],
165
- config,
166
- onConfigResolved(config2) {
167
- if (!config2.theme)
168
- config2.theme = {};
169
- if (!config2.theme.extend)
170
- config2.theme.extend = {};
171
- if (!config2.theme.extend.fontFamily)
172
- config2.theme.extend.fontFamily = {};
173
- const fontFamily = config2.theme.extend.fontFamily;
174
- fontFamily.sans || (fontFamily.sans = data.config.fonts.sans.join(","));
175
- fontFamily.mono || (fontFamily.mono = data.config.fonts.mono.join(","));
176
- fontFamily.serif || (fontFamily.serif = data.config.fonts.serif.join(","));
177
- return config2;
178
- },
179
- onOptionsResolved(config2) {
180
- themeRoots.forEach((i) => {
181
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
182
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
183
- });
184
- addonRoots.forEach((i) => {
185
- config2.scanOptions.include.push(`${i}/components/**/*.{vue,ts}`);
186
- config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
187
- });
188
- config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
189
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
190
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "katex/package.json", true)));
191
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
192
- },
193
- ...windiOptions
194
- }
195
- );
196
- }
197
-
198
116
  // node/plugins/preset.ts
199
117
 
200
118
 
@@ -203,15 +121,12 @@ var _pluginvuejsx = require('@vitejs/plugin-vue-jsx'); var _pluginvuejsx2 = _int
203
121
  var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
204
122
  var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
205
123
  var _vite5 = require('unplugin-vue-components/vite'); var _vite6 = _interopRequireDefault(_vite5);
206
- var _vitepluginremoteassets = require('vite-plugin-remote-assets'); var _vitepluginremoteassets2 = _interopRequireDefault(_vitepluginremoteassets);
207
124
  var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepluginvueserverref2 = _interopRequireDefault(_vitepluginvueserverref);
208
125
 
209
- var _viteplugininspect = require('vite-plugin-inspect'); var _viteplugininspect2 = _interopRequireDefault(_viteplugininspect);
210
- var _vitepluginstaticcopy = require('vite-plugin-static-copy');
211
126
 
212
127
  // node/drawings.ts
213
128
 
214
-
129
+ var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
215
130
  var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
216
131
  function resolveDrawingsDir(options) {
217
132
  return options.data.config.drawings.persist ? _path.resolve.call(void 0,
@@ -271,11 +186,11 @@ var dependencies = {
271
186
  "@antfu/utils": "^0.7.2",
272
187
  "@slidev/parser": "workspace:*",
273
188
  "@slidev/types": "workspace:*",
274
- "@unocss/reset": "^0.51.13",
189
+ "@unocss/reset": "^0.52.4",
275
190
  "@vueuse/core": "^10.1.2",
276
191
  "@vueuse/head": "^1.1.26",
277
192
  "@vueuse/math": "^10.1.2",
278
- "@vueuse/motion": "^2.0.0-beta.27",
193
+ "@vueuse/motion": "^2.0.0",
279
194
  codemirror: "^5.65.5",
280
195
  defu: "^6.1.2",
281
196
  drauu: "^0.3.2",
@@ -284,16 +199,16 @@ var dependencies = {
284
199
  "js-base64": "^3.7.5",
285
200
  "js-yaml": "^4.1.0",
286
201
  katex: "^0.16.7",
287
- mermaid: "^10.1.0",
202
+ mermaid: "^10.2.0",
288
203
  "monaco-editor": "^0.37.1",
289
204
  nanoid: "^4.0.2",
290
205
  prettier: "^2.8.8",
291
206
  recordrtc: "^5.6.2",
292
207
  resolve: "^1.22.2",
293
- unocss: "^0.51.13",
208
+ unocss: "^0.52.4",
294
209
  "vite-plugin-windicss": "^1.9.0",
295
- vue: "^3.3.2",
296
- "vue-router": "^4.2.0",
210
+ vue: "^3.3.4",
211
+ "vue-router": "^4.2.1",
297
212
  "vue-starport": "^0.3.0",
298
213
  windicss: "^3.5.6"
299
214
  };
@@ -371,7 +286,7 @@ function createConfigPlugin(options) {
371
286
  define: getDefine(options),
372
287
  resolve: {
373
288
  alias: {
374
- "@slidev/client/": `${_chunkGE7W2DBEjs.toAtFS.call(void 0, options.clientRoot)}/`
289
+ "@slidev/client/": `${_chunk6ZL4B4HQjs.toAtFS.call(void 0, options.clientRoot)}/`
375
290
  },
376
291
  dedupe: ["vue"]
377
292
  },
@@ -406,7 +321,7 @@ function createConfigPlugin(options) {
406
321
  allow: _utils.uniq.call(void 0, [
407
322
  searchForWorkspaceRoot(options.userRoot),
408
323
  searchForWorkspaceRoot(options.cliRoot),
409
- ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
324
+ ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk6ZL4B4HQjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
410
325
  ])
411
326
  }
412
327
  },
@@ -415,7 +330,7 @@ function createConfigPlugin(options) {
415
330
  if (_isinstalledglobally2.default) {
416
331
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
417
332
  injection.root = options.cliRoot;
418
- injection.resolve.alias.vue = `${_chunkGE7W2DBEjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
333
+ injection.resolve.alias.vue = `${_chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
419
334
  }
420
335
  return _vite.mergeConfig.call(void 0, injection, config);
421
336
  },
@@ -437,7 +352,7 @@ function createConfigPlugin(options) {
437
352
  function getDefine(options) {
438
353
  return {
439
354
  __DEV__: options.mode === "dev" ? "true" : "false",
440
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkGE7W2DBEjs.toAtFS.call(void 0, options.clientRoot)),
355
+ __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk6ZL4B4HQjs.toAtFS.call(void 0, options.clientRoot)),
441
356
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
442
357
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
443
358
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
@@ -448,7 +363,7 @@ function getDefine(options) {
448
363
  }
449
364
 
450
365
  // node/plugins/loaders.ts
451
- var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, require_fast_deep_equal());
366
+ var import_fast_deep_equal = _chunkMJQETB73js.__toESM.call(void 0, require_fast_deep_equal());
452
367
 
453
368
 
454
369
 
@@ -459,13 +374,13 @@ var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_f
459
374
  var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
460
375
  var regexIdQuery = /(\d+?)\.(md|json)$/;
461
376
  function getBodyJson(req) {
462
- return new Promise((resolve6, reject) => {
377
+ return new Promise((resolve3, reject) => {
463
378
  let body = "";
464
379
  req.on("data", (chunk) => body += chunk);
465
380
  req.on("error", reject);
466
381
  req.on("end", () => {
467
382
  try {
468
- resolve6(JSON.parse(body) || {});
383
+ resolve3(JSON.parse(body) || {});
469
384
  } catch (e) {
470
385
  reject(e);
471
386
  }
@@ -717,7 +632,7 @@ ${title}
717
632
  delete frontmatter.title;
718
633
  const imports = [
719
634
  'import { inject as vueInject } from "vue"',
720
- `import InjectedLayout from "${_chunkGE7W2DBEjs.toAtFS.call(void 0, layouts[layoutName])}"`,
635
+ `import InjectedLayout from "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, layouts[layoutName])}"`,
721
636
  'import { injectionSlidevContext } from "@slidev/client/constants.ts"',
722
637
  `const frontmatter = ${JSON.stringify(frontmatter)}`,
723
638
  "const $slidev = vueInject(injectionSlidevContext)"
@@ -822,10 +737,10 @@ defineProps<{ no: number | string }>()`);
822
737
  }
823
738
  async function generateUserStyles() {
824
739
  const imports = [
825
- `import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
826
- `import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
827
- `import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`,
828
- `import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/transitions.css"))}"`
740
+ `import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
741
+ `import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
742
+ `import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`,
743
+ `import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/transitions.css"))}"`
829
744
  ];
830
745
  const roots2 = _utils.uniq.call(void 0, [
831
746
  ...themeRoots,
@@ -842,13 +757,13 @@ defineProps<{ no: number | string }>()`);
842
757
  ];
843
758
  for (const style of styles) {
844
759
  if (_fsextra.existsSync.call(void 0, style)) {
845
- imports.push(`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, style)}"`);
760
+ imports.push(`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, style)}"`);
846
761
  continue;
847
762
  }
848
763
  }
849
764
  }
850
765
  if (data.features.katex)
851
- imports.push(`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
766
+ imports.push(`import "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, _chunk6ZL4B4HQjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
852
767
  if (data.config.css === "unocss") {
853
768
  imports.unshift(
854
769
  'import "@unocss/reset/tailwind.css"',
@@ -876,7 +791,7 @@ defineProps<{ no: number | string }>()`);
876
791
  const layouts = _utils.objectMap.call(void 0,
877
792
  await getLayouts(),
878
793
  (k, v) => {
879
- imports.push(`import __layout_${k} from "${_chunkGE7W2DBEjs.toAtFS.call(void 0, v)}"`);
794
+ imports.push(`import __layout_${k} from "${_chunk6ZL4B4HQjs.toAtFS.call(void 0, v)}"`);
880
795
  return [k, `__layout_${k}`];
881
796
  }
882
797
  );
@@ -913,8 +828,7 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
913
828
  const redirect = ((_c = i.frontmatter) == null ? void 0 : _c.routeAlias) ? `{ path: '${(_d = i.frontmatter) == null ? void 0 : _d.routeAlias}', redirect: { path: '${no}' } }` : null;
914
829
  no += 1;
915
830
  return [route, redirect];
916
- }).flat().filter(_utils.notNullish),
917
- `{ path: "${no}", component: __layout__end, meta: { layout: "end" } }`
831
+ }).flat().filter(_utils.notNullish)
918
832
  ];
919
833
  const routesStr = `export default [
920
834
  ${routes.join(",\n")}
@@ -925,7 +839,7 @@ ${routes.join(",\n")}
925
839
  const config = { ...data.config, remote };
926
840
  if (_utils.isString.call(void 0, config.title)) {
927
841
  const tokens = md.parseInline(config.title, {});
928
- config.title = _chunkGE7W2DBEjs.stringifyMarkdownTokens.call(void 0, tokens);
842
+ config.title = _chunk6ZL4B4HQjs.stringifyMarkdownTokens.call(void 0, tokens);
929
843
  }
930
844
  if (_utils.isString.call(void 0, config.info))
931
845
  config.info = md.render(config.info);
@@ -946,7 +860,7 @@ ${routes.join(",\n")}
946
860
  ];
947
861
  }
948
862
  }).filter((i) => _fsextra2.default.existsSync(i));
949
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, i)}'`).join("\n");
863
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, i)}'`).join("\n");
950
864
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
951
865
  return `
952
866
  ${imports}
@@ -965,7 +879,7 @@ export default {
965
879
  _path.join.call(void 0, root, "CustomNavControls.vue")
966
880
  ];
967
881
  }).filter((i) => _fsextra2.default.existsSync(i));
968
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, i)}'`).join("\n");
882
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, i)}'`).join("\n");
969
883
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
970
884
  return `
971
885
  ${imports}
@@ -1045,7 +959,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
1045
959
  setups.forEach((path, idx) => {
1046
960
  if (!_fs.existsSync.call(void 0, path))
1047
961
  return;
1048
- imports.push(`import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, path)}'`);
962
+ imports.push(`import __n${idx} from '${_chunk6ZL4B4HQjs.toAtFS.call(void 0, path)}'`);
1049
963
  let fn = `:AWAIT:__n${idx}`;
1050
964
  if (/\binjection_return\b/g.test(code))
1051
965
  fn = `injection_return = ${fn}`;
@@ -1255,7 +1169,7 @@ function loadPrismLang(lang) {
1255
1169
  }
1256
1170
  function loadPrismPlugin(name) {
1257
1171
  try {
1258
- _chunkGE7W2DBEjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1172
+ _chunkMJQETB73js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1259
1173
  } catch (e) {
1260
1174
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1261
1175
  }
@@ -1361,14 +1275,14 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1361
1275
  const entryPath = _utils.slash.call(void 0, entry);
1362
1276
  if (config.highlighter === "shiki") {
1363
1277
  const { getHighlighter } = await Promise.resolve().then(() => require("shiki"));
1364
- const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1278
+ const shikiOptions = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1365
1279
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1366
1280
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
1367
1281
  setups.push((md2) => md2.use(markdown_it_shiki_default, shikiOptions));
1368
1282
  } else {
1369
1283
  setups.push((md2) => md2.use(markdownItPrism));
1370
1284
  }
1371
- const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1285
+ const KatexOptions = await _chunkKKGXM3XLjs.loadSetups.call(void 0, roots, "katex.ts", {}, { strict: false }, false);
1372
1286
  return _vitepluginvuemarkdown2.default.call(void 0, {
1373
1287
  wrapperClasses: "",
1374
1288
  headEnabled: false,
@@ -1542,40 +1456,6 @@ function createFixPlugins(options) {
1542
1456
  ];
1543
1457
  }
1544
1458
 
1545
- // node/plugins/unocss.ts
1546
-
1547
-
1548
-
1549
-
1550
- async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, userRoot, data }, { unocss: unoOptions }) {
1551
- var _a, _b, _c, _d;
1552
- const UnoCSS = await Promise.resolve().then(() => require("unocss/vite")).then((r) => r.default);
1553
- const configFiles = _utils.uniq.call(void 0, [
1554
- _path.resolve.call(void 0, userRoot, "uno.config.ts"),
1555
- _path.resolve.call(void 0, userRoot, "unocss.config.ts"),
1556
- ...themeRoots.map((i) => `${i}/uno.config.ts`),
1557
- ...themeRoots.map((i) => `${i}/unocss.config.ts`),
1558
- ...addonRoots.map((i) => `${i}/uno.config.ts`),
1559
- ...addonRoots.map((i) => `${i}/unocss.config.ts`),
1560
- _path.resolve.call(void 0, clientRoot, "uno.config.ts"),
1561
- _path.resolve.call(void 0, clientRoot, "unocss.config.ts")
1562
- ]);
1563
- const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
1564
- let config = _jiti2.default.call(void 0, __filename)(configFile);
1565
- if ("default" in config)
1566
- config = config.default;
1567
- config = await loadSetups(roots, "unocss.ts", {}, config, true);
1568
- config.theme || (config.theme = {});
1569
- (_a = config.theme).fontFamily || (_a.fontFamily = {});
1570
- (_b = config.theme.fontFamily).sans || (_b.sans = data.config.fonts.sans.join(","));
1571
- (_c = config.theme.fontFamily).mono || (_c.mono = data.config.fonts.mono.join(","));
1572
- (_d = config.theme.fontFamily).serif || (_d.serif = data.config.fonts.serif.join(","));
1573
- return UnoCSS({
1574
- configFile: false,
1575
- ..._utils.deepMerge.call(void 0, config, unoOptions || {})
1576
- });
1577
- }
1578
-
1579
1459
  // node/plugins/preset.ts
1580
1460
  var customElements = /* @__PURE__ */ new Set([
1581
1461
  // katex
@@ -1640,7 +1520,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1640
1520
  const MarkdownPlugin = await createMarkdownPlugin(options, pluginOptions);
1641
1521
  const drawingData = await loadDrawings(options);
1642
1522
  const publicRoots = themeRoots.map((i) => _path.join.call(void 0, i, "public")).filter(_fs.existsSync);
1643
- return [
1523
+ const plugins = [
1644
1524
  MarkdownPlugin,
1645
1525
  VueJsxPlugin,
1646
1526
  VuePlugin,
@@ -1671,9 +1551,9 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1671
1551
  autoInstall: true,
1672
1552
  ...iconsOptions
1673
1553
  }),
1674
- config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, {
1554
+ config.remoteAssets === true || config.remoteAssets === mode ? Promise.resolve().then(() => require("vite-plugin-remote-assets")).then((r) => r.default({
1675
1555
  rules: [
1676
- ..._vitepluginremoteassets.DefaultRules,
1556
+ ...r.DefaultRules,
1677
1557
  {
1678
1558
  match: /\b(https?:\/\/image.unsplash\.com.*?)(?=[`'")\]])/ig,
1679
1559
  ext: ".png"
@@ -1682,7 +1562,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1682
1562
  resolveMode: (id) => id.endsWith("index.html") ? "relative" : "@fs",
1683
1563
  awaitDownload: mode === "build",
1684
1564
  ...remoteAssetsOptions
1685
- }) : null,
1565
+ })) : null,
1686
1566
  _vitepluginvueserverref2.default.call(void 0, {
1687
1567
  debug: process.env.NODE_ENV === "development",
1688
1568
  state: {
@@ -1702,23 +1582,24 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1702
1582
  writeDrawings(options, _nullishCoalesce(patch, () => ( data)));
1703
1583
  }
1704
1584
  }),
1705
- publicRoots.length ? _vitepluginstaticcopy.viteStaticCopy.call(void 0, {
1706
- silent: true,
1707
- targets: publicRoots.map((r) => ({
1708
- src: `${r}/*`,
1709
- dest: "theme"
1710
- }))
1711
- }) : null,
1712
1585
  createConfigPlugin(options),
1713
1586
  createClientSetupPlugin(options),
1714
1587
  createMonacoTypesLoader(),
1715
1588
  createFixPlugins(options),
1716
- options.inspect ? _viteplugininspect2.default.call(void 0, {
1589
+ publicRoots.length ? Promise.resolve().then(() => require("vite-plugin-static-copy")).then((r) => r.viteStaticCopy({
1590
+ silent: true,
1591
+ targets: publicRoots.map((r2) => ({
1592
+ src: `${r2}/*`,
1593
+ dest: "theme"
1594
+ }))
1595
+ })) : null,
1596
+ options.inspect ? Promise.resolve().then(() => require("vite-plugin-inspect")).then((r) => r.default({
1717
1597
  dev: true,
1718
1598
  build: true
1719
- }) : null,
1720
- config.css === "none" ? null : config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
1721
- ].flat().filter(_utils.notNullish);
1599
+ })) : null,
1600
+ config.css === "none" ? null : config.css === "windicss" ? Promise.resolve().then(() => require("./windicss-YNIIPANV.js")).then((r) => r.createWindiCSSPlugin(options, pluginOptions)) : Promise.resolve().then(() => require("./unocss-2CJUFE63.js")).then((r) => r.createUnocssPlugin(options, pluginOptions))
1601
+ ];
1602
+ return (await Promise.all(plugins)).flat().filter(_utils.notNullish);
1722
1603
  }
1723
1604
 
1724
1605
 
@@ -1726,6 +1607,4 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1726
1607
 
1727
1608
 
1728
1609
 
1729
-
1730
-
1731
- exports.getIndexHtml = getIndexHtml; exports.mergeViteConfigs = mergeViteConfigs; exports.require_fast_deep_equal = require_fast_deep_equal; exports.loadSetups = loadSetups; exports.createWindiCSSPlugin = createWindiCSSPlugin; exports.ViteSlidevPlugin = ViteSlidevPlugin;
1610
+ exports.getIndexHtml = getIndexHtml; exports.mergeViteConfigs = mergeViteConfigs; exports.require_fast_deep_equal = require_fast_deep_equal; exports.ViteSlidevPlugin = ViteSlidevPlugin;
@@ -0,0 +1,35 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// node/plugins/setupNode.ts
2
+ var _path = require('path');
3
+ var _fsextra = require('fs-extra');
4
+ var _utils = require('@antfu/utils');
5
+ var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
6
+ function deepMerge(a, b, rootPath = "") {
7
+ a = { ...a };
8
+ Object.keys(b).forEach((key) => {
9
+ if (_utils.isObject.call(void 0, a[key]))
10
+ a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
11
+ else if (Array.isArray(a[key]))
12
+ a[key] = [...a[key], ...b[key]];
13
+ else
14
+ a[key] = b[key];
15
+ });
16
+ return a;
17
+ }
18
+ async function loadSetups(roots, name, arg, initial, merge = true, accumulate) {
19
+ let returns = initial;
20
+ for (const root of roots) {
21
+ const path = _path.resolve.call(void 0, root, "setup", name);
22
+ if (await _fsextra.pathExists.call(void 0, path)) {
23
+ const { default: setup } = _jiti2.default.call(void 0, __filename)(path);
24
+ const result = await setup(arg);
25
+ if (result !== null) {
26
+ returns = merge ? deepMerge(returns, result) : accumulate ? accumulate(returns, result) : result;
27
+ }
28
+ }
29
+ }
30
+ return returns;
31
+ }
32
+
33
+
34
+
35
+ exports.loadSetups = loadSetups;
@@ -57,70 +57,6 @@ var __privateWrapper = (obj, member, setter, getter) => ({
57
57
  }
58
58
  });
59
59
 
60
- // node/utils.ts
61
- import { join } from "path";
62
- import { ensurePrefix, slash } from "@antfu/utils";
63
- import isInstalledGlobally from "is-installed-globally";
64
- import { sync as resolve } from "resolve";
65
- import globalDirs from "global-dirs";
66
- function toAtFS(path) {
67
- return `/@fs${ensurePrefix("/", slash(path))}`;
68
- }
69
- function resolveImportPath(importName, ensure = false) {
70
- try {
71
- return resolve(importName, {
72
- preserveSymlinks: false
73
- });
74
- } catch {
75
- }
76
- if (isInstalledGlobally) {
77
- try {
78
- return __require.resolve(join(globalDirs.yarn.packages, importName));
79
- } catch {
80
- }
81
- try {
82
- return __require.resolve(join(globalDirs.npm.packages, importName));
83
- } catch {
84
- }
85
- }
86
- if (ensure)
87
- throw new Error(`Failed to resolve package "${importName}"`);
88
- return void 0;
89
- }
90
- function resolveGlobalImportPath(importName) {
91
- try {
92
- return resolve(importName, { preserveSymlinks: false, basedir: __dirname });
93
- } catch {
94
- }
95
- try {
96
- return __require.resolve(join(globalDirs.yarn.packages, importName));
97
- } catch {
98
- }
99
- try {
100
- return __require.resolve(join(globalDirs.npm.packages, importName));
101
- } catch {
102
- }
103
- throw new Error(`Failed to resolve global package "${importName}"`);
104
- }
105
- function stringifyMarkdownTokens(tokens) {
106
- return tokens.map(
107
- (token) => {
108
- var _a;
109
- return (_a = token.children) == null ? void 0 : _a.filter((t) => ["text", "code_inline"].includes(t.type) && !t.content.match(/^\s*$/)).map((t) => t.content.trim()).join(" ");
110
- }
111
- ).filter(Boolean).join(" ");
112
- }
113
- function generateGoogleFontsUrl(options) {
114
- const weights = options.weights.flatMap((i) => options.italic ? [`0,${i}`, `1,${i}`] : [`${i}`]).sort().join(";");
115
- const fonts = options.webfonts.map((i) => `family=${i.replace(/^(['"])(.*)\1$/, "$1").replace(/\s+/g, "+")}:${options.italic ? "ital," : ""}wght@${weights}`).join("&");
116
- return `https://fonts.googleapis.com/css2?${fonts}&display=swap`;
117
- }
118
- function packageExists(name) {
119
- if (resolveImportPath(`${name}/package.json`))
120
- return true;
121
- return false;
122
- }
123
-
124
60
  export {
125
61
  __require,
126
62
  __commonJS,
@@ -128,11 +64,5 @@ export {
128
64
  __privateGet,
129
65
  __privateAdd,
130
66
  __privateSet,
131
- __privateWrapper,
132
- toAtFS,
133
- resolveImportPath,
134
- resolveGlobalImportPath,
135
- stringifyMarkdownTokens,
136
- generateGoogleFontsUrl,
137
- packageExists
67
+ __privateWrapper
138
68
  };
@@ -0,0 +1,68 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});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 __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined")
11
+ return require.apply(this, arguments);
12
+ throw new Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __commonJS = (cb, mod) => function __require2() {
15
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
33
+ var __accessCheck = (obj, member, msg) => {
34
+ if (!member.has(obj))
35
+ throw TypeError("Cannot " + msg);
36
+ };
37
+ var __privateGet = (obj, member, getter) => {
38
+ __accessCheck(obj, member, "read from private field");
39
+ return getter ? getter.call(obj) : member.get(obj);
40
+ };
41
+ var __privateAdd = (obj, member, value) => {
42
+ if (member.has(obj))
43
+ throw TypeError("Cannot add the same private member more than once");
44
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
45
+ };
46
+ var __privateSet = (obj, member, value, setter) => {
47
+ __accessCheck(obj, member, "write to private field");
48
+ setter ? setter.call(obj, value) : member.set(obj, value);
49
+ return value;
50
+ };
51
+ var __privateWrapper = (obj, member, setter, getter) => ({
52
+ set _(value) {
53
+ __privateSet(obj, member, value, setter);
54
+ },
55
+ get _() {
56
+ return __privateGet(obj, member, getter);
57
+ }
58
+ });
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+ exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateWrapper = __privateWrapper;