@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.
- package/README.md +42 -1
- package/dist/cli.js +262 -124
- package/dist/index.d.ts +44 -4
- package/dist/index.js +266 -74
- package/dist/qa.d.ts +1 -1
- package/dist/qa.js +50 -7
- package/dist/renderer.d.ts +1 -1
- package/dist/renderer.js +262 -124
- package/dist/{spec.schema-B6sXTTou.d.ts → spec.schema-BkbcnVcm.d.ts} +1790 -1267
- package/dist/spec.schema.d.ts +1 -1
- package/dist/spec.schema.js +50 -7
- package/package.json +1 -1
package/dist/qa.js
CHANGED
|
@@ -509,6 +509,10 @@ var drawShadowSchema = z2.object({
|
|
|
509
509
|
offsetY: z2.number().default(4)
|
|
510
510
|
}).strict();
|
|
511
511
|
var drawFontFamilySchema = z2.enum(["heading", "body", "mono"]);
|
|
512
|
+
var strokeGradientSchema = z2.object({
|
|
513
|
+
from: colorHexSchema2,
|
|
514
|
+
to: colorHexSchema2
|
|
515
|
+
}).strict();
|
|
512
516
|
var drawRectSchema = z2.object({
|
|
513
517
|
type: z2.literal("rect"),
|
|
514
518
|
x: z2.number(),
|
|
@@ -556,6 +560,7 @@ var drawLineSchema = z2.object({
|
|
|
556
560
|
x2: z2.number(),
|
|
557
561
|
y2: z2.number(),
|
|
558
562
|
color: colorHexSchema2.default("#FFFFFF"),
|
|
563
|
+
strokeGradient: strokeGradientSchema.optional(),
|
|
559
564
|
width: z2.number().min(0.5).max(32).default(2),
|
|
560
565
|
dash: z2.array(z2.number()).max(6).optional(),
|
|
561
566
|
arrow: z2.enum(["none", "end", "start", "both"]).default("none"),
|
|
@@ -586,6 +591,7 @@ var drawBezierSchema = z2.object({
|
|
|
586
591
|
type: z2.literal("bezier"),
|
|
587
592
|
points: z2.array(drawPointSchema).min(2).max(20),
|
|
588
593
|
color: colorHexSchema2.default("#FFFFFF"),
|
|
594
|
+
strokeGradient: strokeGradientSchema.optional(),
|
|
589
595
|
width: z2.number().min(0.5).max(32).default(2),
|
|
590
596
|
dash: z2.array(z2.number()).max(6).optional(),
|
|
591
597
|
arrow: z2.enum(["none", "end", "start", "both"]).default("none"),
|
|
@@ -793,7 +799,8 @@ var connectionElementSchema = z2.object({
|
|
|
793
799
|
from: z2.string().min(1).max(120),
|
|
794
800
|
to: z2.string().min(1).max(120),
|
|
795
801
|
style: z2.enum(["solid", "dashed", "dotted"]).default("solid"),
|
|
796
|
-
|
|
802
|
+
/** @deprecated Use `style` instead. */
|
|
803
|
+
strokeStyle: z2.enum(["solid", "dashed", "dotted"]).optional(),
|
|
797
804
|
arrow: z2.enum(["end", "start", "both", "none"]).default("end"),
|
|
798
805
|
label: z2.string().min(1).max(200).optional(),
|
|
799
806
|
labelPosition: z2.enum(["start", "middle", "end"]).default("middle"),
|
|
@@ -805,7 +812,8 @@ var connectionElementSchema = z2.object({
|
|
|
805
812
|
arrowSize: z2.number().min(4).max(32).optional(),
|
|
806
813
|
arrowPlacement: z2.enum(["endpoint", "boundary"]).default("endpoint"),
|
|
807
814
|
opacity: z2.number().min(0).max(1).default(1),
|
|
808
|
-
routing: z2.enum(["auto", "orthogonal", "curve", "arc"]).default("auto"),
|
|
815
|
+
routing: z2.enum(["auto", "orthogonal", "curve", "arc", "straight"]).default("auto"),
|
|
816
|
+
curveMode: z2.enum(["normal", "ellipse"]).default("normal"),
|
|
809
817
|
tension: z2.number().min(0.1).max(0.8).default(0.35),
|
|
810
818
|
fromAnchor: anchorHintSchema.optional(),
|
|
811
819
|
toAnchor: anchorHintSchema.optional()
|
|
@@ -898,7 +906,11 @@ var autoLayoutConfigSchema = z2.object({
|
|
|
898
906
|
/** Sort strategy for radial layout node ordering. Only relevant when algorithm is 'radial'. */
|
|
899
907
|
radialSortBy: z2.enum(["id", "connections"]).optional(),
|
|
900
908
|
/** Explicit center used by curve/arc connection routing. */
|
|
901
|
-
diagramCenter: diagramCenterSchema.optional()
|
|
909
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
910
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
911
|
+
ellipseRx: z2.number().positive().optional(),
|
|
912
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
913
|
+
ellipseRy: z2.number().positive().optional()
|
|
902
914
|
}).strict();
|
|
903
915
|
var gridLayoutConfigSchema = z2.object({
|
|
904
916
|
mode: z2.literal("grid"),
|
|
@@ -908,7 +920,11 @@ var gridLayoutConfigSchema = z2.object({
|
|
|
908
920
|
cardMaxHeight: z2.number().int().min(32).max(4096).optional(),
|
|
909
921
|
equalHeight: z2.boolean().default(false),
|
|
910
922
|
/** Explicit center used by curve/arc connection routing. */
|
|
911
|
-
diagramCenter: diagramCenterSchema.optional()
|
|
923
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
924
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
925
|
+
ellipseRx: z2.number().positive().optional(),
|
|
926
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
927
|
+
ellipseRy: z2.number().positive().optional()
|
|
912
928
|
}).strict();
|
|
913
929
|
var stackLayoutConfigSchema = z2.object({
|
|
914
930
|
mode: z2.literal("stack"),
|
|
@@ -916,7 +932,25 @@ var stackLayoutConfigSchema = z2.object({
|
|
|
916
932
|
gap: z2.number().int().min(0).max(256).default(24),
|
|
917
933
|
alignment: z2.enum(["start", "center", "end", "stretch"]).default("stretch"),
|
|
918
934
|
/** Explicit center used by curve/arc connection routing. */
|
|
919
|
-
diagramCenter: diagramCenterSchema.optional()
|
|
935
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
936
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
937
|
+
ellipseRx: z2.number().positive().optional(),
|
|
938
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
939
|
+
ellipseRy: z2.number().positive().optional()
|
|
940
|
+
}).strict();
|
|
941
|
+
var ellipseLayoutConfigSchema = z2.object({
|
|
942
|
+
mode: z2.literal("ellipse"),
|
|
943
|
+
cx: z2.number().optional(),
|
|
944
|
+
cy: z2.number().optional(),
|
|
945
|
+
rx: z2.number().positive(),
|
|
946
|
+
ry: z2.number().positive(),
|
|
947
|
+
startAngle: z2.number().default(-90),
|
|
948
|
+
/** Explicit center used by curve/arc connection routing. */
|
|
949
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
950
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
951
|
+
ellipseRx: z2.number().positive().optional(),
|
|
952
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
953
|
+
ellipseRy: z2.number().positive().optional()
|
|
920
954
|
}).strict();
|
|
921
955
|
var manualPositionSchema = z2.object({
|
|
922
956
|
x: z2.number().int(),
|
|
@@ -928,12 +962,17 @@ var manualLayoutConfigSchema = z2.object({
|
|
|
928
962
|
mode: z2.literal("manual"),
|
|
929
963
|
positions: z2.record(z2.string().min(1), manualPositionSchema).default({}),
|
|
930
964
|
/** Explicit center used by curve/arc connection routing. */
|
|
931
|
-
diagramCenter: diagramCenterSchema.optional()
|
|
965
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
966
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
967
|
+
ellipseRx: z2.number().positive().optional(),
|
|
968
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
969
|
+
ellipseRy: z2.number().positive().optional()
|
|
932
970
|
}).strict();
|
|
933
971
|
var layoutConfigSchema = z2.discriminatedUnion("mode", [
|
|
934
972
|
autoLayoutConfigSchema,
|
|
935
973
|
gridLayoutConfigSchema,
|
|
936
974
|
stackLayoutConfigSchema,
|
|
975
|
+
ellipseLayoutConfigSchema,
|
|
937
976
|
manualLayoutConfigSchema
|
|
938
977
|
]);
|
|
939
978
|
var constraintsSchema = z2.object({
|
|
@@ -993,7 +1032,11 @@ var diagramElementSchema = z2.discriminatedUnion("type", [
|
|
|
993
1032
|
var diagramLayoutSchema = z2.object({
|
|
994
1033
|
mode: z2.enum(["manual", "auto"]).default("manual"),
|
|
995
1034
|
positions: z2.record(z2.string(), diagramPositionSchema).optional(),
|
|
996
|
-
diagramCenter: diagramCenterSchema.optional()
|
|
1035
|
+
diagramCenter: diagramCenterSchema.optional(),
|
|
1036
|
+
/** Horizontal radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
1037
|
+
ellipseRx: z2.number().positive().optional(),
|
|
1038
|
+
/** Vertical radius for shared ellipse used by curveMode: 'ellipse'. */
|
|
1039
|
+
ellipseRy: z2.number().positive().optional()
|
|
997
1040
|
}).strict();
|
|
998
1041
|
var diagramSpecSchema = z2.object({
|
|
999
1042
|
version: z2.literal(1),
|
package/dist/renderer.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { i as DEFAULT_GENERATOR_VERSION,
|
|
1
|
+
export { i as DEFAULT_GENERATOR_VERSION, U as IterationMeta, W as LayoutSnapshot, a as Rect, Z as RenderDesignOptions, R as RenderMetadata, _ as RenderResult, d as RenderedElement, a5 as WrittenArtifacts, a8 as computeSpecHash, ar as inferSidecarPath, au as renderDesign, aw as writeRenderArtifacts } from './spec.schema-BkbcnVcm.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@napi-rs/canvas';
|