@spectratools/graphic-designer-cli 0.9.0 → 0.11.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, at 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 DrawBadge, s as DrawBezier, t as DrawCircle, b as DrawCommand, u as DrawFontFamily, v as DrawGradientRect, au as DrawGrid, w as DrawLine, x as DrawPath, y as DrawPoint, z as DrawRect, E as DrawShadow, F as DrawText, G as DrawTextRow, H as DrawTextRowSegment, I as Element, J as FlowNodeElement, av as FlowNodeShadow, K as Gradient, L as GradientOverlayDecorator, aw as GradientStop, O as GridLayoutConfig, P as ImageElement, Q as LayoutConfig, ax as LinearGradient, U as ManualLayoutConfig, ay as RadialGradient, V as RainbowRuleDecorator, X as ShapeElement, Y as StackLayoutConfig, Z as TerminalElement, _ as TextElement, c as Theme, $ as ThemeInput, a0 as VignetteDecorator, a2 as builtInThemeBackgrounds, a3 as builtInThemes, a5 as connectionElementSchema, a6 as defaultAutoLayout, a7 as defaultCanvas, a8 as defaultConstraints, a9 as defaultGridLayout, aa as defaultLayout, ab as defaultStackLayout, ac as defaultTheme, ad as deriveSafeFrame, ae as designSpecSchema, af as diagramElementSchema, ag as diagramLayoutSchema, ah as diagramSpecSchema, al as flowNodeElementSchema, am as inferLayout, ao as parseDesignSpec, ap as parseDiagramSpec, ar as resolveTheme } from './spec.schema-B_Z-KNqt.js';
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-CYlOLxmK.js';
3
3
  import '@napi-rs/canvas';
@@ -339,6 +339,21 @@ var drawLineSchema = z2.object({
339
339
  opacity: z2.number().min(0).max(1).default(1),
340
340
  shadow: drawShadowSchema.optional()
341
341
  }).strict();
342
+ var drawArcSchema = z2.object({
343
+ type: z2.literal("arc"),
344
+ center: z2.object({
345
+ x: z2.number(),
346
+ y: z2.number()
347
+ }).strict(),
348
+ radius: z2.number().positive(),
349
+ startAngle: z2.number(),
350
+ endAngle: z2.number(),
351
+ color: colorHexSchema2.default("#FFFFFF"),
352
+ width: z2.number().min(0.5).max(32).default(2),
353
+ dash: z2.array(z2.number()).max(6).optional(),
354
+ opacity: z2.number().min(0).max(1).default(1),
355
+ shadow: drawShadowSchema.optional()
356
+ }).strict();
342
357
  var drawPointSchema = z2.object({
343
358
  x: z2.number(),
344
359
  y: z2.number()
@@ -423,6 +438,7 @@ var drawCommandSchema = z2.discriminatedUnion("type", [
423
438
  drawCircleSchema,
424
439
  drawTextSchema,
425
440
  drawLineSchema,
441
+ drawArcSchema,
426
442
  drawBezierSchema,
427
443
  drawPathSchema,
428
444
  drawBadgeSchema,
@@ -554,17 +570,21 @@ var connectionElementSchema = z2.object({
554
570
  from: z2.string().min(1).max(120),
555
571
  to: z2.string().min(1).max(120),
556
572
  style: z2.enum(["solid", "dashed", "dotted"]).default("solid"),
557
- strokeStyle: z2.enum(["solid", "dashed", "dotted"]).default("solid"),
573
+ /** @deprecated Use `style` instead. */
574
+ strokeStyle: z2.enum(["solid", "dashed", "dotted"]).optional(),
558
575
  arrow: z2.enum(["end", "start", "both", "none"]).default("end"),
559
576
  label: z2.string().min(1).max(200).optional(),
560
577
  labelPosition: z2.enum(["start", "middle", "end"]).default("middle"),
561
578
  color: colorHexSchema2.optional(),
579
+ fromColor: colorHexSchema2.optional(),
580
+ toColor: colorHexSchema2.optional(),
562
581
  width: z2.number().min(0.5).max(10).optional(),
563
582
  strokeWidth: z2.number().min(0.5).max(10).default(2),
564
583
  arrowSize: z2.number().min(4).max(32).optional(),
565
584
  arrowPlacement: z2.enum(["endpoint", "boundary"]).default("endpoint"),
566
585
  opacity: z2.number().min(0).max(1).default(1),
567
- routing: z2.enum(["auto", "orthogonal", "curve", "arc"]).default("auto"),
586
+ routing: z2.enum(["auto", "orthogonal", "curve", "arc", "straight"]).default("auto"),
587
+ curveMode: z2.enum(["normal", "ellipse"]).default("normal"),
568
588
  tension: z2.number().min(0.1).max(0.8).default(0.35),
569
589
  fromAnchor: anchorHintSchema.optional(),
570
590
  toAnchor: anchorHintSchema.optional()
@@ -657,7 +677,11 @@ var autoLayoutConfigSchema = z2.object({
657
677
  /** Sort strategy for radial layout node ordering. Only relevant when algorithm is 'radial'. */
658
678
  radialSortBy: z2.enum(["id", "connections"]).optional(),
659
679
  /** Explicit center used by curve/arc connection routing. */
660
- diagramCenter: diagramCenterSchema.optional()
680
+ diagramCenter: diagramCenterSchema.optional(),
681
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
682
+ ellipseRx: z2.number().positive().optional(),
683
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
684
+ ellipseRy: z2.number().positive().optional()
661
685
  }).strict();
662
686
  var gridLayoutConfigSchema = z2.object({
663
687
  mode: z2.literal("grid"),
@@ -667,7 +691,11 @@ var gridLayoutConfigSchema = z2.object({
667
691
  cardMaxHeight: z2.number().int().min(32).max(4096).optional(),
668
692
  equalHeight: z2.boolean().default(false),
669
693
  /** Explicit center used by curve/arc connection routing. */
670
- diagramCenter: diagramCenterSchema.optional()
694
+ diagramCenter: diagramCenterSchema.optional(),
695
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
696
+ ellipseRx: z2.number().positive().optional(),
697
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
698
+ ellipseRy: z2.number().positive().optional()
671
699
  }).strict();
672
700
  var stackLayoutConfigSchema = z2.object({
673
701
  mode: z2.literal("stack"),
@@ -675,7 +703,11 @@ var stackLayoutConfigSchema = z2.object({
675
703
  gap: z2.number().int().min(0).max(256).default(24),
676
704
  alignment: z2.enum(["start", "center", "end", "stretch"]).default("stretch"),
677
705
  /** Explicit center used by curve/arc connection routing. */
678
- diagramCenter: diagramCenterSchema.optional()
706
+ diagramCenter: diagramCenterSchema.optional(),
707
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
708
+ ellipseRx: z2.number().positive().optional(),
709
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
710
+ ellipseRy: z2.number().positive().optional()
679
711
  }).strict();
680
712
  var manualPositionSchema = z2.object({
681
713
  x: z2.number().int(),
@@ -687,7 +719,11 @@ var manualLayoutConfigSchema = z2.object({
687
719
  mode: z2.literal("manual"),
688
720
  positions: z2.record(z2.string().min(1), manualPositionSchema).default({}),
689
721
  /** Explicit center used by curve/arc connection routing. */
690
- diagramCenter: diagramCenterSchema.optional()
722
+ diagramCenter: diagramCenterSchema.optional(),
723
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
724
+ ellipseRx: z2.number().positive().optional(),
725
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
726
+ ellipseRy: z2.number().positive().optional()
691
727
  }).strict();
692
728
  var layoutConfigSchema = z2.discriminatedUnion("mode", [
693
729
  autoLayoutConfigSchema,
@@ -752,7 +788,11 @@ var diagramElementSchema = z2.discriminatedUnion("type", [
752
788
  var diagramLayoutSchema = z2.object({
753
789
  mode: z2.enum(["manual", "auto"]).default("manual"),
754
790
  positions: z2.record(z2.string(), diagramPositionSchema).optional(),
755
- diagramCenter: diagramCenterSchema.optional()
791
+ diagramCenter: diagramCenterSchema.optional(),
792
+ /** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
793
+ ellipseRx: z2.number().positive().optional(),
794
+ /** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
795
+ ellipseRy: z2.number().positive().optional()
756
796
  }).strict();
757
797
  var diagramSpecSchema = z2.object({
758
798
  version: z2.literal(1),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectratools/graphic-designer-cli",
3
- "version": "0.9.0",
3
+ "version": "0.11.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",