@spectratools/graphic-designer-cli 0.10.0 → 0.12.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,3 +1,3 @@
1
1
  import 'zod';
2
- export { A as AnchorHint, e as AutoLayoutConfig, B as BuiltInTheme, f as CardElement, g as CodeBlockElement, aw as CodeBlockStyle, C as ConnectionElement, h as ConstraintSpec, k as Decorator, l as DesignCardSpec, m as DesignSafeFrame, D as DesignSpec, n as DesignTheme, o as DiagramElement, p as DiagramLayout, q as DiagramSpec, r as DrawArc, s as DrawBadge, t as DrawBezier, u as DrawCircle, b as DrawCommand, v as DrawFontFamily, w as DrawGradientRect, ax as DrawGrid, x as DrawLine, y as DrawPath, z as DrawPoint, E as DrawRect, F as DrawShadow, G as DrawText, H as DrawTextRow, I as DrawTextRowSegment, J as Element, K as FlowNodeElement, ay as FlowNodeShadow, L as Gradient, M as GradientOverlayDecorator, az as GradientStop, P as GridLayoutConfig, Q as ImageElement, U as LayoutConfig, aA as LinearGradient, W as ManualLayoutConfig, aB as RadialGradient, X as RainbowRuleDecorator, _ as ShapeElement, $ as StackLayoutConfig, a0 as TerminalElement, a1 as TextElement, c as Theme, a2 as ThemeInput, a3 as VignetteDecorator, a5 as builtInThemeBackgrounds, a6 as builtInThemes, a8 as connectionElementSchema, a9 as defaultAutoLayout, aa as defaultCanvas, ab as defaultConstraints, ac as defaultGridLayout, ad as defaultLayout, ae as defaultStackLayout, af as defaultTheme, ag as deriveSafeFrame, ah as designSpecSchema, ai as diagramElementSchema, aj as diagramLayoutSchema, ak as diagramSpecSchema, ao as flowNodeElementSchema, ap as inferLayout, ar as parseDesignSpec, as as parseDiagramSpec, au as resolveTheme } from './spec.schema-B6sXTTou.js';
2
+ export { A as AnchorHint, e as AutoLayoutConfig, B as BuiltInTheme, f as CardElement, g as CodeBlockElement, ax as CodeBlockStyle, C as ConnectionElement, h as ConstraintSpec, k as Decorator, l as DesignCardSpec, m as DesignSafeFrame, D as DesignSpec, n as DesignTheme, o as DiagramElement, p as DiagramLayout, q as DiagramSpec, r as DrawArc, s as DrawBadge, t as DrawBezier, u as DrawCircle, b as DrawCommand, v as DrawFontFamily, w as DrawGradientRect, ay as DrawGrid, x as DrawLine, y as DrawPath, z as DrawPoint, E as DrawRect, F as DrawShadow, az as DrawStrokeGradient, G as DrawText, H as DrawTextRow, I as DrawTextRowSegment, J as Element, K as EllipseLayoutConfig, L as FlowNodeElement, aA as FlowNodeShadow, M as Gradient, N as GradientOverlayDecorator, aB as GradientStop, Q as GridLayoutConfig, S as ImageElement, V as LayoutConfig, aC as LinearGradient, X as ManualLayoutConfig, aD as RadialGradient, Y as RainbowRuleDecorator, $ as ShapeElement, a0 as StackLayoutConfig, a1 as TerminalElement, a2 as TextElement, c as Theme, a3 as ThemeInput, a4 as VignetteDecorator, a6 as builtInThemeBackgrounds, a7 as builtInThemes, a9 as connectionElementSchema, aa as defaultAutoLayout, ab as defaultCanvas, ac as defaultConstraints, ad as defaultGridLayout, ae as defaultLayout, af as defaultStackLayout, ag as defaultTheme, ah as deriveSafeFrame, ai as designSpecSchema, aj as diagramElementSchema, ak as diagramLayoutSchema, al as diagramSpecSchema, ap as flowNodeElementSchema, aq as inferLayout, as as parseDesignSpec, at as parseDiagramSpec, av as resolveTheme } from './spec.schema-BkbcnVcm.js';
3
3
  import '@napi-rs/canvas';
@@ -285,6 +285,10 @@ var drawShadowSchema = z2.object({
285
285
  offsetY: z2.number().default(4)
286
286
  }).strict();
287
287
  var drawFontFamilySchema = z2.enum(["heading", "body", "mono"]);
288
+ var strokeGradientSchema = z2.object({
289
+ from: colorHexSchema2,
290
+ to: colorHexSchema2
291
+ }).strict();
288
292
  var drawRectSchema = z2.object({
289
293
  type: z2.literal("rect"),
290
294
  x: z2.number(),
@@ -332,6 +336,7 @@ var drawLineSchema = z2.object({
332
336
  x2: z2.number(),
333
337
  y2: z2.number(),
334
338
  color: colorHexSchema2.default("#FFFFFF"),
339
+ strokeGradient: strokeGradientSchema.optional(),
335
340
  width: z2.number().min(0.5).max(32).default(2),
336
341
  dash: z2.array(z2.number()).max(6).optional(),
337
342
  arrow: z2.enum(["none", "end", "start", "both"]).default("none"),
@@ -362,6 +367,7 @@ var drawBezierSchema = z2.object({
362
367
  type: z2.literal("bezier"),
363
368
  points: z2.array(drawPointSchema).min(2).max(20),
364
369
  color: colorHexSchema2.default("#FFFFFF"),
370
+ strokeGradient: strokeGradientSchema.optional(),
365
371
  width: z2.number().min(0.5).max(32).default(2),
366
372
  dash: z2.array(z2.number()).max(6).optional(),
367
373
  arrow: z2.enum(["none", "end", "start", "both"]).default("none"),
@@ -570,7 +576,8 @@ var connectionElementSchema = z2.object({
570
576
  from: z2.string().min(1).max(120),
571
577
  to: z2.string().min(1).max(120),
572
578
  style: z2.enum(["solid", "dashed", "dotted"]).default("solid"),
573
- strokeStyle: z2.enum(["solid", "dashed", "dotted"]).default("solid"),
579
+ /** @deprecated Use `style` instead. */
580
+ strokeStyle: z2.enum(["solid", "dashed", "dotted"]).optional(),
574
581
  arrow: z2.enum(["end", "start", "both", "none"]).default("end"),
575
582
  label: z2.string().min(1).max(200).optional(),
576
583
  labelPosition: z2.enum(["start", "middle", "end"]).default("middle"),
@@ -582,7 +589,8 @@ var connectionElementSchema = z2.object({
582
589
  arrowSize: z2.number().min(4).max(32).optional(),
583
590
  arrowPlacement: z2.enum(["endpoint", "boundary"]).default("endpoint"),
584
591
  opacity: z2.number().min(0).max(1).default(1),
585
- routing: z2.enum(["auto", "orthogonal", "curve", "arc"]).default("auto"),
592
+ routing: z2.enum(["auto", "orthogonal", "curve", "arc", "straight"]).default("auto"),
593
+ curveMode: z2.enum(["normal", "ellipse"]).default("normal"),
586
594
  tension: z2.number().min(0.1).max(0.8).default(0.35),
587
595
  fromAnchor: anchorHintSchema.optional(),
588
596
  toAnchor: anchorHintSchema.optional()
@@ -675,7 +683,11 @@ var autoLayoutConfigSchema = z2.object({
675
683
  /** Sort strategy for radial layout node ordering. Only relevant when algorithm is 'radial'. */
676
684
  radialSortBy: z2.enum(["id", "connections"]).optional(),
677
685
  /** Explicit center used by curve/arc connection routing. */
678
- diagramCenter: diagramCenterSchema.optional()
686
+ diagramCenter: diagramCenterSchema.optional(),
687
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
688
+ ellipseRx: z2.number().positive().optional(),
689
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
690
+ ellipseRy: z2.number().positive().optional()
679
691
  }).strict();
680
692
  var gridLayoutConfigSchema = z2.object({
681
693
  mode: z2.literal("grid"),
@@ -685,7 +697,11 @@ var gridLayoutConfigSchema = z2.object({
685
697
  cardMaxHeight: z2.number().int().min(32).max(4096).optional(),
686
698
  equalHeight: z2.boolean().default(false),
687
699
  /** Explicit center used by curve/arc connection routing. */
688
- diagramCenter: diagramCenterSchema.optional()
700
+ diagramCenter: diagramCenterSchema.optional(),
701
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
702
+ ellipseRx: z2.number().positive().optional(),
703
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
704
+ ellipseRy: z2.number().positive().optional()
689
705
  }).strict();
690
706
  var stackLayoutConfigSchema = z2.object({
691
707
  mode: z2.literal("stack"),
@@ -693,7 +709,25 @@ var stackLayoutConfigSchema = z2.object({
693
709
  gap: z2.number().int().min(0).max(256).default(24),
694
710
  alignment: z2.enum(["start", "center", "end", "stretch"]).default("stretch"),
695
711
  /** Explicit center used by curve/arc connection routing. */
696
- diagramCenter: diagramCenterSchema.optional()
712
+ diagramCenter: diagramCenterSchema.optional(),
713
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
714
+ ellipseRx: z2.number().positive().optional(),
715
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
716
+ ellipseRy: z2.number().positive().optional()
717
+ }).strict();
718
+ var ellipseLayoutConfigSchema = z2.object({
719
+ mode: z2.literal("ellipse"),
720
+ cx: z2.number().optional(),
721
+ cy: z2.number().optional(),
722
+ rx: z2.number().positive(),
723
+ ry: z2.number().positive(),
724
+ startAngle: z2.number().default(-90),
725
+ /** Explicit center used by curve/arc connection routing. */
726
+ diagramCenter: diagramCenterSchema.optional(),
727
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
728
+ ellipseRx: z2.number().positive().optional(),
729
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
730
+ ellipseRy: z2.number().positive().optional()
697
731
  }).strict();
698
732
  var manualPositionSchema = z2.object({
699
733
  x: z2.number().int(),
@@ -705,12 +739,17 @@ var manualLayoutConfigSchema = z2.object({
705
739
  mode: z2.literal("manual"),
706
740
  positions: z2.record(z2.string().min(1), manualPositionSchema).default({}),
707
741
  /** Explicit center used by curve/arc connection routing. */
708
- diagramCenter: diagramCenterSchema.optional()
742
+ diagramCenter: diagramCenterSchema.optional(),
743
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
744
+ ellipseRx: z2.number().positive().optional(),
745
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
746
+ ellipseRy: z2.number().positive().optional()
709
747
  }).strict();
710
748
  var layoutConfigSchema = z2.discriminatedUnion("mode", [
711
749
  autoLayoutConfigSchema,
712
750
  gridLayoutConfigSchema,
713
751
  stackLayoutConfigSchema,
752
+ ellipseLayoutConfigSchema,
714
753
  manualLayoutConfigSchema
715
754
  ]);
716
755
  var constraintsSchema = z2.object({
@@ -770,7 +809,11 @@ var diagramElementSchema = z2.discriminatedUnion("type", [
770
809
  var diagramLayoutSchema = z2.object({
771
810
  mode: z2.enum(["manual", "auto"]).default("manual"),
772
811
  positions: z2.record(z2.string(), diagramPositionSchema).optional(),
773
- diagramCenter: diagramCenterSchema.optional()
812
+ diagramCenter: diagramCenterSchema.optional(),
813
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
814
+ ellipseRx: z2.number().positive().optional(),
815
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
816
+ ellipseRy: z2.number().positive().optional()
774
817
  }).strict();
775
818
  var diagramSpecSchema = z2.object({
776
819
  version: z2.literal(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectratools/graphic-designer-cli",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Deterministic visual content generator — code screenshots, terminal shots, flowcharts, and infographics. No browser dependency.",
5
5
  "type": "module",
6
6
  "license": "MIT",