@open-slide/core 1.0.1 → 1.0.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.
@@ -1,5 +1,5 @@
1
- import "./design-BUML7uvZ.js";
2
- import { createViteConfig } from "./config-Cuw0mC5h.js";
1
+ import "./design-C13iz9_4.js";
2
+ import { createViteConfig } from "./config-CN7J0RDO.js";
3
3
  import path from "node:path";
4
4
  import { build as build$1, mergeConfig } from "vite";
5
5
 
package/dist/cli/bin.js CHANGED
@@ -57,15 +57,15 @@ async function run(argv) {
57
57
  program.name("open-slide").description("Author slides — we handle the Vite/React stack.").version(version, "-v, --version", "print version").helpOption("-h, --help", "show help").showHelpAfterError(chalk.dim("(run `open-slide --help` for usage)"));
58
58
  program.command("dev").description("Start the dev server").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").option("--no-skills-check", "skip the built-in skills drift check").action(async (flags) => {
59
59
  if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
60
- const { dev } = await import("../dev-BuWsdYvn.js");
60
+ const { dev } = await import("../dev-jWxtWHAG.js");
61
61
  await dev(flags);
62
62
  });
63
63
  program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
64
- const { build } = await import("../build-DC3FTpWO.js");
64
+ const { build } = await import("../build-DqfKmw9h.js");
65
65
  await build(flags);
66
66
  });
67
67
  program.command("preview").description("Preview the production build").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").action(async (flags) => {
68
- const { preview } = await import("../preview-CIcG-lP3.js");
68
+ const { preview } = await import("../preview-CSA05Gfm.js");
69
69
  await preview(flags);
70
70
  });
71
71
  program.command("sync:skills").description("Sync built-in skills from @open-slide/core into this workspace").option("--dry-run", "show what would change without writing").action(async (flags) => {
@@ -1,4 +1,4 @@
1
- import { defaultDesign } from "./design-BUML7uvZ.js";
1
+ import { defaultDesign } from "./design-C13iz9_4.js";
2
2
  import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -8,7 +8,7 @@ function designToCssVars(d) {
8
8
  "--osd-font-body": d.fonts.body,
9
9
  "--osd-size-hero": `${d.typeScale.hero}px`,
10
10
  "--osd-size-body": `${d.typeScale.body}px`,
11
- "--osd-radius-md": `${d.radius.md}px`
11
+ "--osd-radius": `${d.radius}px`
12
12
  };
13
13
  }
14
14
  function cssVarsToString(vars) {
@@ -28,7 +28,7 @@ const defaultDesign = {
28
28
  hero: 168,
29
29
  body: 36
30
30
  },
31
- radius: { md: 12 }
31
+ radius: 12
32
32
  };
33
33
 
34
34
  //#endregion
@@ -1,5 +1,5 @@
1
- import "./design-BUML7uvZ.js";
2
- import { createViteConfig } from "./config-Cuw0mC5h.js";
1
+ import "./design-C13iz9_4.js";
2
+ import { createViteConfig } from "./config-CN7J0RDO.js";
3
3
  import { createServer, mergeConfig } from "vite";
4
4
 
5
5
  //#region src/cli/dev.ts
package/dist/index.d.ts CHANGED
@@ -34,14 +34,11 @@ type DesignTypeScale = {
34
34
  hero: number;
35
35
  body: number;
36
36
  };
37
- type DesignRadius = {
38
- md: number;
39
- };
40
37
  type DesignSystem = {
41
38
  palette: DesignPalette;
42
39
  fonts: DesignFonts;
43
40
  typeScale: DesignTypeScale;
44
- radius: DesignRadius;
41
+ radius: number;
45
42
  };
46
43
  declare function designToCssVars(d: DesignSystem): Record<string, string>;
47
44
  declare function cssVarsToString(vars: Record<string, string>): string;
@@ -63,4 +60,4 @@ declare const CANVAS_WIDTH = 1920;
63
60
  declare const CANVAS_HEIGHT = 1080;
64
61
 
65
62
  //#endregion
66
- export { CANVAS_HEIGHT, CANVAS_WIDTH, DesignFonts, DesignPalette, DesignRadius, DesignSystem, DesignTypeScale, ImagePlaceholder, ImagePlaceholderProps, OpenSlideConfig, Page, SlideMeta, SlideModule, cssVarsToString, defaultDesign, designToCssVars };
63
+ export { CANVAS_HEIGHT, CANVAS_WIDTH, DesignFonts, DesignPalette, DesignSystem, DesignTypeScale, ImagePlaceholder, ImagePlaceholderProps, OpenSlideConfig, Page, SlideMeta, SlideModule, cssVarsToString, defaultDesign, designToCssVars };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cssVarsToString, defaultDesign, designToCssVars } from "./design-BUML7uvZ.js";
1
+ import { cssVarsToString, defaultDesign, designToCssVars } from "./design-C13iz9_4.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/app/components/image-placeholder.tsx
@@ -1,5 +1,5 @@
1
- import "./design-BUML7uvZ.js";
2
- import { createViteConfig } from "./config-Cuw0mC5h.js";
1
+ import "./design-C13iz9_4.js";
2
+ import { createViteConfig } from "./config-CN7J0RDO.js";
3
3
  import { mergeConfig, preview as preview$1 } from "vite";
4
4
 
5
5
  //#region src/cli/preview.ts
@@ -1,4 +1,4 @@
1
- import "../design-BUML7uvZ.js";
2
- import { createViteConfig } from "../config-Cuw0mC5h.js";
1
+ import "../design-C13iz9_4.js";
2
+ import { createViteConfig } from "../config-CN7J0RDO.js";
3
3
 
4
4
  export { createViteConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-slide/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Runtime and CLI for open-slide — write slides in slides/, we handle the rest.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -125,7 +125,7 @@ export const design: DesignSystem = {
125
125
  body: '-apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif',
126
126
  },
127
127
  typeScale: { hero: 168, body: 36 },
128
- radius: { md: 12 },
128
+ radius: 12,
129
129
  };
130
130
  ```
131
131
 
@@ -137,9 +137,9 @@ There are **two consumption surfaces**, and you should mix them inside the same
137
137
 
138
138
  - **`var(--osd-X)` for visual properties (color, font, font-size, radius)** — these get instant updates while the user drags a slider in the Design panel, before any file write.
139
139
  ```tsx
140
- <div style={{ background: 'var(--osd-bg)', color: 'var(--osd-text)', borderRadius: 'var(--osd-radius-md)', fontFamily: 'var(--osd-font-body)', fontSize: 'var(--osd-size-body)' }}>
140
+ <div style={{ background: 'var(--osd-bg)', color: 'var(--osd-text)', borderRadius: 'var(--osd-radius)', fontFamily: 'var(--osd-font-body)', fontSize: 'var(--osd-size-body)' }}>
141
141
  ```
142
- Available vars: `--osd-bg`, `--osd-text`, `--osd-accent`, `--osd-font-display`, `--osd-font-body`, `--osd-size-hero`, `--osd-size-body`, `--osd-radius-md`.
142
+ Available vars: `--osd-bg`, `--osd-text`, `--osd-accent`, `--osd-font-display`, `--osd-font-body`, `--osd-size-hero`, `--osd-size-body`, `--osd-radius`.
143
143
 
144
144
  - **Direct `design.X` reads** — when you need a JS number for arithmetic or to label something in the UI. These update via HMR after the panel commits the file, not while dragging.
145
145
  ```tsx
@@ -167,6 +167,7 @@ export const design: DesignSystem = {
167
167
  body: 'system-ui, -apple-system, sans-serif',
168
168
  },
169
169
  typeScale: { hero: 180, body: 40 },
170
+ radius: 12,
170
171
  };
171
172
 
172
173
  // Extra colors / sizes outside the DesignSystem shape stay as plain consts.
@@ -158,15 +158,15 @@ export function DesignPanel({ open, onClose }: DesignPanelProps) {
158
158
  <Section title="Shape">
159
159
  <SliderField
160
160
  label="Radius"
161
- value={draft.radius.md}
161
+ value={draft.radius}
162
162
  min={0}
163
163
  max={80}
164
164
  step={1}
165
165
  suffix="px"
166
166
  onChange={(n) =>
167
167
  update((d) => {
168
- d.radius.md = n;
169
- }, 'design:radius.md')
168
+ d.radius = n;
169
+ }, 'design:radius')
170
170
  }
171
171
  />
172
172
  </Section>
@@ -14,15 +14,11 @@ export type DesignTypeScale = {
14
14
  body: number;
15
15
  };
16
16
 
17
- export type DesignRadius = {
18
- md: number;
19
- };
20
-
21
17
  export type DesignSystem = {
22
18
  palette: DesignPalette;
23
19
  fonts: DesignFonts;
24
20
  typeScale: DesignTypeScale;
25
- radius: DesignRadius;
21
+ radius: number;
26
22
  };
27
23
 
28
24
  export function designToCssVars(d: DesignSystem): Record<string, string> {
@@ -34,7 +30,7 @@ export function designToCssVars(d: DesignSystem): Record<string, string> {
34
30
  '--osd-font-body': d.fonts.body,
35
31
  '--osd-size-hero': `${d.typeScale.hero}px`,
36
32
  '--osd-size-body': `${d.typeScale.body}px`,
37
- '--osd-radius-md': `${d.radius.md}px`,
33
+ '--osd-radius': `${d.radius}px`,
38
34
  };
39
35
  }
40
36
 
@@ -58,7 +54,5 @@ export const defaultDesign: DesignSystem = {
58
54
  hero: 168,
59
55
  body: 36,
60
56
  },
61
- radius: {
62
- md: 12,
63
- },
57
+ radius: 12,
64
58
  };