supadeck 0.0.7 → 0.0.9

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.
Files changed (38) hide show
  1. package/dist/cli/export.js +35 -0
  2. package/dist/cli/index.js +89 -30533
  3. package/dist/cli/serve.js +12 -0
  4. package/dist/cli/templates.js +69 -0
  5. package/dist/cli/workspace.js +26 -0
  6. package/dist/content/parse-deck.js +136 -0
  7. package/dist/content/rehype-shiki-code-blocks.js +139 -0
  8. package/dist/content/remark-unwrap-jsx-paragraphs.js +63 -0
  9. package/dist/export/pdf.js +40 -0
  10. package/dist/index.js +11 -2808
  11. package/dist/runtime/App.js +45 -0
  12. package/dist/runtime/components/Callout.js +13 -0
  13. package/dist/runtime/components/Center.js +4 -0
  14. package/dist/runtime/components/Columns.js +4 -0
  15. package/dist/runtime/components/Disclosure.js +5 -0
  16. package/dist/runtime/components/Frame.js +4 -0
  17. package/dist/runtime/components/index.js +4 -0
  18. package/dist/runtime/default-components.js +59 -0
  19. package/dist/runtime/hooks/slides.js +45 -0
  20. package/dist/runtime/layout/DeckSlide.js +6 -0
  21. package/dist/runtime/layout/SlideFrame.js +6 -0
  22. package/dist/runtime/main.js +21 -2868
  23. package/dist/runtime/primitives/DeckChrome.js +6 -0
  24. package/dist/runtime/primitives/DeckNavigation.js +4 -0
  25. package/dist/runtime/primitives/DeckProgress.js +5 -0
  26. package/dist/runtime/primitives/DeckTitle.js +4 -0
  27. package/dist/runtime/tailwind-hmr.js +67 -0
  28. package/dist/runtime/tailwind-sources.js +42 -0
  29. package/dist/runtime/theme-resolution.js +62 -0
  30. package/dist/runtime/theme-types.js +1 -0
  31. package/dist/runtime/themes/base/DefaultDeck.js +10 -0
  32. package/dist/runtime/themes/default/DefaultThemeDeck.js +22 -0
  33. package/dist/runtime/themes/default/components.js +100 -0
  34. package/dist/runtime/themes/default/index.js +15 -312
  35. package/dist/runtime/themes/sunset/index.js +10 -2737
  36. package/dist/runtime/utils/use-current-slide.js +19 -0
  37. package/dist/runtime/vite-config.js +201 -30209
  38. package/package.json +11 -16
@@ -0,0 +1,35 @@
1
+ import { build, preview } from "vite";
2
+ import { exportDeckToPdf } from "../export/pdf.js";
3
+ import { createSupadeckViteConfig } from "../runtime/vite-config.js";
4
+ export async function runExport({ deckPath, outputPath, themeOverride, }) {
5
+ const config = createSupadeckViteConfig({
6
+ deckPath,
7
+ themeOverride,
8
+ outputDirName: ".supadeck-dist",
9
+ });
10
+ await build(config);
11
+ const previewServer = await preview({
12
+ ...config,
13
+ preview: {
14
+ host: "127.0.0.1",
15
+ port: 4173,
16
+ strictPort: false,
17
+ },
18
+ });
19
+ const urls = previewServer.resolvedUrls?.local ?? [];
20
+ const baseUrl = urls[0];
21
+ if (!baseUrl) {
22
+ await previewServer.httpServer?.close();
23
+ throw new Error("Unable to determine preview URL for PDF export.");
24
+ }
25
+ try {
26
+ await exportDeckToPdf({
27
+ url: `${baseUrl}?print=1`,
28
+ outputPath,
29
+ });
30
+ }
31
+ finally {
32
+ await previewServer.httpServer?.close();
33
+ }
34
+ console.log(`[supadeck] PDF exported to ${outputPath}`);
35
+ }