@slidev/cli 0.49.23 → 0.49.25

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/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-N256MP4I.js";
3
+ } from "./chunk-A5KTDQ7I.js";
4
4
  import {
5
5
  getThemeMeta,
6
6
  loadSetups,
@@ -9,7 +9,7 @@ import {
9
9
  resolveOptions,
10
10
  resolveTheme,
11
11
  version
12
- } from "./chunk-XYLYAM2E.js";
12
+ } from "./chunk-UL5AC2R7.js";
13
13
  import "./chunk-6DS3IPOB.js";
14
14
  import {
15
15
  getRoots,
@@ -335,7 +335,7 @@ cli.command(
335
335
  }).strict().help(),
336
336
  async (args) => {
337
337
  const { entry, theme, base, download, out, inspect } = args;
338
- const { build } = await import("./build-ZPFNOFW5.js");
338
+ const { build } = await import("./build-PW7D5MRO.js");
339
339
  for (const entryFile of entry) {
340
340
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
341
341
  if (download && !options.data.config.download)
@@ -415,7 +415,7 @@ cli.command(
415
415
  (args) => exportOptions(commonOptions(args)).strict().help(),
416
416
  async (args) => {
417
417
  const { entry, theme } = args;
418
- const { exportSlides, getExportOptions } = await import("./export-F3V7NX5E.js");
418
+ const { exportSlides, getExportOptions } = await import("./export-SZDV4AEI.js");
419
419
  const port = await getPort(12445);
420
420
  for (const entryFile of entry) {
421
421
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -464,7 +464,7 @@ cli.command(
464
464
  timeout,
465
465
  wait
466
466
  }) => {
467
- const { exportNotes } = await import("./export-F3V7NX5E.js");
467
+ const { exportNotes } = await import("./export-SZDV4AEI.js");
468
468
  const port = await getPort(12445);
469
469
  for (const entryFile of entry) {
470
470
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -542,6 +542,9 @@ function exportOptions(args) {
542
542
  }).option("scale", {
543
543
  type: "number",
544
544
  describe: "scale factor for image export"
545
+ }).option("omit-background", {
546
+ type: "boolean",
547
+ describe: "export png pages without the default browser background"
545
548
  });
546
549
  }
547
550
  function printInfo(options, port, remote, tunnelUrl, publicIp) {
@@ -129,7 +129,8 @@ async function exportSlides({
129
129
  withToc = false,
130
130
  perSlide = false,
131
131
  scale = 1,
132
- waitUntil
132
+ waitUntil,
133
+ omitBackground = false
133
134
  }) {
134
135
  const pages = parseRangeString(total, range);
135
136
  const { chromium } = await importPlaywright();
@@ -312,7 +313,9 @@ async function exportSlides({
312
313
  progress.update(i + 1);
313
314
  const id = await slideContainers.nth(i).getAttribute("id") || "";
314
315
  const slideNo = +id.split("-")[0];
315
- const buffer = await slideContainers.nth(i).screenshot();
316
+ const buffer = await slideContainers.nth(i).screenshot({
317
+ omitBackground
318
+ });
316
319
  result.push({ slideIndex: slideNo - 1, buffer });
317
320
  if (writeToDisk)
318
321
  await fs.writeFile(path.join(output, `${withClicks ? id : slideNo}.png`), buffer);
@@ -323,7 +326,9 @@ async function exportSlides({
323
326
  const result = [];
324
327
  const genScreenshot = async (no, clicks) => {
325
328
  await go(no, clicks);
326
- const buffer = await page.screenshot();
329
+ const buffer = await page.screenshot({
330
+ omitBackground
331
+ });
327
332
  result.push({ slideIndex: no - 1, buffer });
328
333
  if (writeToDisk) {
329
334
  await fs.writeFile(
@@ -450,7 +455,8 @@ function getExportOptions(args, options, outDir, outFilename) {
450
455
  withClicks: args["with-clicks"],
451
456
  executablePath: args["executable-path"],
452
457
  withToc: args["with-toc"],
453
- perSlide: args["per-slide"]
458
+ perSlide: args["per-slide"],
459
+ omitBackground: args["omit-background"]
454
460
  })
455
461
  };
456
462
  const {
@@ -466,7 +472,8 @@ function getExportOptions(args, options, outDir, outFilename) {
466
472
  executablePath,
467
473
  withToc,
468
474
  perSlide,
469
- scale
475
+ scale,
476
+ omitBackground
470
477
  } = config;
471
478
  outFilename = output || options.data.config.exportFilename || outFilename || `${path.basename(entry, ".md")}-export`;
472
479
  if (outDir)
@@ -488,7 +495,8 @@ function getExportOptions(args, options, outDir, outFilename) {
488
495
  executablePath,
489
496
  withToc: withToc || false,
490
497
  perSlide: perSlide || false,
491
- scale: scale || 2
498
+ scale: scale || 2,
499
+ omitBackground: omitBackground ?? false
492
500
  };
493
501
  }
494
502
  async function importPlaywright() {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ResolvedSlidevOptions, SlidevPluginOptions, SlidevServerOptions, SlidevEntryOptions, SlidevData, ResolvedSlidevUtils } from '@slidev/types';
1
+ import { ResolvedSlidevOptions, SlidevPluginOptions, SlidevServerOptions, SlidevEntryOptions, ResolvedSlidevUtils } from '@slidev/types';
2
2
  import * as vite from 'vite';
3
3
  import { PluginOption, InlineConfig } from 'vite';
4
4
  import * as fs from '@slidev/parser/fs';
@@ -9,6 +9,6 @@ declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions?
9
9
  declare function createServer(options: ResolvedSlidevOptions, viteConfig?: InlineConfig, serverOptions?: SlidevServerOptions): Promise<vite.ViteDevServer>;
10
10
 
11
11
  declare function resolveOptions(entryOptions: SlidevEntryOptions, mode: ResolvedSlidevOptions['mode']): Promise<ResolvedSlidevOptions>;
12
- declare function createDataUtils(data: SlidevData, clientRoot: string, roots: string[]): Promise<ResolvedSlidevUtils>;
12
+ declare function createDataUtils(resolved: Omit<ResolvedSlidevOptions, 'utils'>): Promise<ResolvedSlidevUtils>;
13
13
 
14
14
  export { ViteSlidevPlugin, createDataUtils, createServer, resolveOptions };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-N256MP4I.js";
3
+ } from "./chunk-A5KTDQ7I.js";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-XYLYAM2E.js";
9
+ } from "./chunk-UL5AC2R7.js";
10
10
  import "./chunk-6DS3IPOB.js";
11
11
  import "./chunk-HOVIRHCR.js";
12
12
  import "./chunk-JSBRDJBE.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
3
  "type": "module",
4
- "version": "0.49.23",
4
+ "version": "0.49.25",
5
5
  "description": "Presentation slides for developers",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -42,23 +42,23 @@
42
42
  }
43
43
  },
44
44
  "dependencies": {
45
- "@antfu/ni": "^0.22.0",
45
+ "@antfu/ni": "^0.22.4",
46
46
  "@antfu/utils": "^0.7.10",
47
- "@iconify-json/carbon": "^1.1.36",
48
- "@iconify-json/ph": "^1.1.13",
49
- "@iconify-json/svg-spinners": "^1.1.2",
47
+ "@iconify-json/carbon": "^1.1.37",
48
+ "@iconify-json/ph": "^1.1.14",
49
+ "@iconify-json/svg-spinners": "^1.1.3",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^1.11.1",
52
- "@shikijs/twoslash": "^1.11.0",
53
- "@shikijs/vitepress-twoslash": "^1.11.1",
54
- "@unocss/extractor-mdc": "^0.61.5",
55
- "@unocss/reset": "^0.61.5",
56
- "@vitejs/plugin-vue": "^5.0.5",
57
- "@vitejs/plugin-vue-jsx": "^4.0.0",
51
+ "@shikijs/markdown-it": "^1.13.0",
52
+ "@shikijs/twoslash": "^1.13.0",
53
+ "@shikijs/vitepress-twoslash": "^1.13.0",
54
+ "@unocss/extractor-mdc": "^0.62.2",
55
+ "@unocss/reset": "^0.62.2",
56
+ "@vitejs/plugin-vue": "^5.1.2",
57
+ "@vitejs/plugin-vue-jsx": "^4.0.1",
58
58
  "chokidar": "^3.6.0",
59
59
  "cli-progress": "^3.12.0",
60
60
  "connect": "^3.7.0",
61
- "debug": "^4.3.5",
61
+ "debug": "^4.3.6",
62
62
  "fast-deep-equal": "^3.1.3",
63
63
  "fast-glob": "^3.3.2",
64
64
  "fs-extra": "^11.2.0",
@@ -71,7 +71,7 @@
71
71
  "kolorist": "^1.8.0",
72
72
  "local-pkg": "^0.5.0",
73
73
  "lz-string": "^1.5.0",
74
- "magic-string": "^0.30.10",
74
+ "magic-string": "^0.30.11",
75
75
  "magic-string-stack": "^0.1.1",
76
76
  "markdown-it": "^14.1.0",
77
77
  "markdown-it-footnote": "^4.0.0",
@@ -86,32 +86,32 @@
86
86
  "pptxgenjs": "^3.12.0",
87
87
  "prismjs": "^1.29.0",
88
88
  "prompts": "^2.4.2",
89
- "public-ip": "^6.0.2",
89
+ "public-ip": "^7.0.1",
90
90
  "resolve-from": "^5.0.0",
91
91
  "resolve-global": "^2.0.0",
92
92
  "semver": "^7.6.3",
93
- "shiki": "^1.11.1",
93
+ "shiki": "^1.13.0",
94
94
  "shiki-magic-move": "^0.4.3",
95
95
  "sirv": "^2.0.4",
96
96
  "source-map-js": "^1.2.0",
97
97
  "typescript": "^5.5.4",
98
- "unocss": "^0.61.5",
99
- "unplugin-icons": "^0.19.0",
100
- "unplugin-vue-components": "^0.27.3",
98
+ "unocss": "^0.62.2",
99
+ "unplugin-icons": "^0.19.2",
100
+ "unplugin-vue-components": "^0.27.4",
101
101
  "unplugin-vue-markdown": "^0.26.2",
102
102
  "untun": "^0.1.3",
103
103
  "uqr": "^0.1.2",
104
- "vite": "^5.3.4",
104
+ "vite": "^5.4.1",
105
105
  "vite-plugin-inspect": "^0.8.5",
106
106
  "vite-plugin-remote-assets": "^0.5.0",
107
107
  "vite-plugin-static-copy": "^1.0.6",
108
108
  "vite-plugin-vue-server-ref": "^0.4.2",
109
109
  "vitefu": "^0.2.5",
110
- "vue": "^3.4.33",
110
+ "vue": "^3.4.38",
111
111
  "yargs": "^17.7.2",
112
- "@slidev/client": "0.49.23",
113
- "@slidev/types": "0.49.23",
114
- "@slidev/parser": "0.49.23"
112
+ "@slidev/types": "0.49.25",
113
+ "@slidev/parser": "0.49.25",
114
+ "@slidev/client": "0.49.25"
115
115
  },
116
116
  "devDependencies": {
117
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",