vizmatic 0.1.16 → 0.1.17

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/PROMPT.md CHANGED
@@ -119,7 +119,7 @@ Or set it in the frame:
119
119
  </Scene>
120
120
  ```
121
121
 
122
- If a direct CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows omitted axes when overflow is detected. Explicit dimensions stay strict and should be used when exact output size matters.
122
+ If a direct CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows to fit content when overflow is detected. Generated wrappers that export the default `960x540` size get the same fit-to-content behavior. Add `autoSize = false` when exact dimensions should stay strict and fail on clipping.
123
123
 
124
124
  For direct CLI frames, skip imports, `defineIllustration`, and `c` props by default. The CLI injects Vizmatic primitives and theme colors. Reference `c` only when you need explicit theme tokens such as `background={c.bg}`. `Scene` title/subtitle are optional; omit both for visual-only figures, badges, inline blog diagrams, or frames where surrounding copy already supplies the title. Use the full module form when you need custom dependencies, direct renderer APIs, advanced reusable JSX helpers, or animation exports.
125
125
 
@@ -418,13 +418,13 @@ height = 560;
418
418
 
419
419
  - Use semantic tones, not hard-coded colors: `blue`, `purple`, `green`, `warm`, `cyan`, `pink`, `critical`, `ocean`, `neutral`.
420
420
  - Keep canvas sizes explicit. Good defaults: `1040x560` for article figures, `1280x720` for slide frames, `900x520` for compact diagrams.
421
- - For exploratory direct CLI frames, dimensions may be omitted; Vizmatic auto-grows omitted axes if content overflows.
421
+ - For exploratory direct CLI frames, dimensions may be omitted; Vizmatic starts at `960x540` and grows to fit content if overflow is detected.
422
422
  - Prefer alpha-transparent PNG/SVG backgrounds for blog embeds and docs cards. Use theme backgrounds only when the host surface is unknown or needs full-frame fill.
423
423
  - Use `width`, `minWidth`, `height`, `minHeight`, `gap`, and `padding` props to stabilize layout.
424
424
  - Keep text short. Use `TextLabel`, `Panel`, `StepCard`, `MetricCard`, `DataTable`, and `Grid` for wrapping-safe labels.
425
425
  - Render both dark and light when shipping reusable assets: `--theme dark,light`.
426
426
  - Use GIF only when motion explains state change. Keep scenes short, export `createScenes(theme)`, and keep a static `create(theme)` fallback.
427
- - If render fails with `Canvas overflow detected`, increase canvas dimensions or reduce content density. Do not ignore the error.
427
+ - If render fails with `Canvas overflow detected`, the frame has strict dimensions. Increase canvas dimensions, reduce content density, or remove strict sizing for CLI auto-fit. Do not ignore the error.
428
428
  - Verify generated PNGs/GIFs exist and are non-empty. Open at least one rendered image before finalizing.
429
429
 
430
430
  ## Common recipes
package/README.md CHANGED
@@ -50,7 +50,7 @@ PNG and SVG renders use an alpha-transparent canvas by default. Add `--backgroun
50
50
  vizmatic ./frame.tsx --out ./dist/frames --theme dark,light --background theme
51
51
  ```
52
52
 
53
- If a CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows omitted axes when overflow is detected. Explicit dimensions stay strict and fail on clipping.
53
+ If a CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows to fit content when overflow is detected. Generated wrappers that export the default `960x540` size get the same fit-to-content behavior. Add `autoSize = false` when exact dimensions should stay strict and fail on clipping.
54
54
 
55
55
  Bare CLI frames auto-import Vizmatic primitives and inject theme colors. Use normal imports when a frame needs helpers, data loading, custom dependencies, or direct renderer APIs.
56
56
 
package/dist/cli.js CHANGED
@@ -5901,17 +5901,20 @@ function normalizeAutoSize(value, defaults) {
5901
5901
  }
5902
5902
  function normalizeFrameModule(mod) {
5903
5903
  const defaultObject = typeof mod.default === "object" && mod.default && "create" in mod.default ? mod.default : void 0;
5904
+ const hasAutoSizeSetting = mod.autoSize != null || mod.__vizmaticAutoSize != null;
5904
5905
  const hasWidth = mod.width != null || defaultObject?.width != null;
5905
5906
  const hasHeight = mod.height != null || defaultObject?.height != null;
5907
+ const width = mod.width ?? defaultObject?.width ?? DEFAULT_FRAME_WIDTH;
5908
+ const height = mod.height ?? defaultObject?.height ?? DEFAULT_FRAME_HEIGHT;
5906
5909
  const autoSize = normalizeAutoSize(mod.autoSize ?? mod.__vizmaticAutoSize, {
5907
- width: !hasWidth,
5908
- height: !hasHeight
5910
+ width: !hasWidth || !hasAutoSizeSetting && width === DEFAULT_FRAME_WIDTH,
5911
+ height: !hasHeight || !hasAutoSizeSetting && height === DEFAULT_FRAME_HEIGHT
5909
5912
  });
5910
5913
  return {
5911
5914
  ...mod,
5912
5915
  ...defaultObject ?? {},
5913
- width: mod.width ?? defaultObject?.width ?? DEFAULT_FRAME_WIDTH,
5914
- height: mod.height ?? defaultObject?.height ?? DEFAULT_FRAME_HEIGHT,
5916
+ width,
5917
+ height,
5915
5918
  autoSize
5916
5919
  };
5917
5920
  }
package/docs/PROMPT.md CHANGED
@@ -119,7 +119,7 @@ Or set it in the frame:
119
119
  </Scene>
120
120
  ```
121
121
 
122
- If a direct CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows omitted axes when overflow is detected. Explicit dimensions stay strict and should be used when exact output size matters.
122
+ If a direct CLI frame omits `width` or `height`, Vizmatic starts at `960x540` and grows to fit content when overflow is detected. Generated wrappers that export the default `960x540` size get the same fit-to-content behavior. Add `autoSize = false` when exact dimensions should stay strict and fail on clipping.
123
123
 
124
124
  For direct CLI frames, skip imports, `defineIllustration`, and `c` props by default. The CLI injects Vizmatic primitives and theme colors. Reference `c` only when you need explicit theme tokens such as `background={c.bg}`. `Scene` title/subtitle are optional; omit both for visual-only figures, badges, inline blog diagrams, or frames where surrounding copy already supplies the title. Use the full module form when you need custom dependencies, direct renderer APIs, advanced reusable JSX helpers, or animation exports.
125
125
 
@@ -418,13 +418,13 @@ height = 560;
418
418
 
419
419
  - Use semantic tones, not hard-coded colors: `blue`, `purple`, `green`, `warm`, `cyan`, `pink`, `critical`, `ocean`, `neutral`.
420
420
  - Keep canvas sizes explicit. Good defaults: `1040x560` for article figures, `1280x720` for slide frames, `900x520` for compact diagrams.
421
- - For exploratory direct CLI frames, dimensions may be omitted; Vizmatic auto-grows omitted axes if content overflows.
421
+ - For exploratory direct CLI frames, dimensions may be omitted; Vizmatic starts at `960x540` and grows to fit content if overflow is detected.
422
422
  - Prefer alpha-transparent PNG/SVG backgrounds for blog embeds and docs cards. Use theme backgrounds only when the host surface is unknown or needs full-frame fill.
423
423
  - Use `width`, `minWidth`, `height`, `minHeight`, `gap`, and `padding` props to stabilize layout.
424
424
  - Keep text short. Use `TextLabel`, `Panel`, `StepCard`, `MetricCard`, `DataTable`, and `Grid` for wrapping-safe labels.
425
425
  - Render both dark and light when shipping reusable assets: `--theme dark,light`.
426
426
  - Use GIF only when motion explains state change. Keep scenes short, export `createScenes(theme)`, and keep a static `create(theme)` fallback.
427
- - If render fails with `Canvas overflow detected`, increase canvas dimensions or reduce content density. Do not ignore the error.
427
+ - If render fails with `Canvas overflow detected`, the frame has strict dimensions. Increase canvas dimensions, reduce content density, or remove strict sizing for CLI auto-fit. Do not ignore the error.
428
428
  - Verify generated PNGs/GIFs exist and are non-empty. Open at least one rendered image before finalizing.
429
429
 
430
430
  ## Common recipes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vizmatic",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Theme-aware visual primitives and render pipeline for AI-generated diagrams, figures, and presentation frames.",
5
5
  "type": "module",
6
6
  "license": "MIT",