@retikz/core 0.1.0-alpha.5 → 0.1.0-beta.1
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/dist/es/compile/compile.d.ts +17 -0
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +40 -15
- package/dist/es/compile/index.d.ts +1 -1
- package/dist/es/compile/index.d.ts.map +1 -1
- package/dist/es/compile/node.d.ts +3 -3
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +1 -1
- package/dist/es/compile/path/anchor.d.ts +19 -0
- package/dist/es/compile/path/anchor.d.ts.map +1 -0
- package/dist/es/compile/path/anchor.js +54 -0
- package/dist/es/compile/{path.d.ts → path/index.d.ts} +18 -7
- package/dist/es/compile/path/index.d.ts.map +1 -0
- package/dist/es/compile/path/index.js +308 -0
- package/dist/es/compile/path/label.d.ts +18 -0
- package/dist/es/compile/path/label.d.ts.map +1 -0
- package/dist/es/compile/path/label.js +102 -0
- package/dist/es/compile/path/relative.d.ts +8 -0
- package/dist/es/compile/path/relative.d.ts.map +1 -0
- package/dist/es/compile/path/relative.js +48 -0
- package/dist/es/compile/path/shrink.d.ts +24 -0
- package/dist/es/compile/path/shrink.d.ts.map +1 -0
- package/dist/es/compile/path/shrink.js +136 -0
- package/dist/es/compile/path/split.d.ts +15 -0
- package/dist/es/compile/path/split.d.ts.map +1 -0
- package/dist/es/compile/path/split.js +46 -0
- package/dist/es/compile/text-metrics.d.ts +4 -1
- package/dist/es/compile/text-metrics.d.ts.map +1 -1
- package/dist/es/compile/text-metrics.js +11 -5
- package/dist/es/geometry/_transform.d.ts +21 -0
- package/dist/es/geometry/_transform.d.ts.map +1 -0
- package/dist/es/geometry/_transform.js +27 -0
- package/dist/es/geometry/bend.d.ts +1 -1
- package/dist/es/geometry/bend.js +1 -1
- package/dist/es/geometry/circle.d.ts +2 -3
- package/dist/es/geometry/circle.d.ts.map +1 -1
- package/dist/es/geometry/circle.js +1 -16
- package/dist/es/geometry/diamond.d.ts +2 -3
- package/dist/es/geometry/diamond.d.ts.map +1 -1
- package/dist/es/geometry/diamond.js +1 -16
- package/dist/es/geometry/ellipse.d.ts +2 -3
- package/dist/es/geometry/ellipse.d.ts.map +1 -1
- package/dist/es/geometry/ellipse.js +1 -16
- package/dist/es/geometry/polar.d.ts +2 -2
- package/dist/es/geometry/polar.d.ts.map +1 -1
- package/dist/es/geometry/polar.js +2 -6
- package/dist/es/geometry/rect.d.ts.map +1 -1
- package/dist/es/geometry/rect.js +1 -18
- package/dist/es/geometry/segment.d.ts +5 -1
- package/dist/es/geometry/segment.d.ts.map +1 -1
- package/dist/es/index.d.ts +10 -6
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +4 -2
- package/dist/es/ir/font.d.ts +21 -0
- package/dist/es/ir/font.d.ts.map +1 -0
- package/dist/es/ir/font.js +15 -0
- package/dist/es/ir/index.d.ts +2 -0
- package/dist/es/ir/index.d.ts.map +1 -1
- package/dist/es/ir/node.d.ts +28 -139
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +6 -30
- package/dist/es/ir/path/arrow.d.ts +12 -12
- package/dist/es/ir/path/path.d.ts +16 -16
- package/dist/es/ir/path/path.js +4 -4
- package/dist/es/ir/path/step.d.ts +1 -1
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +8 -8
- package/dist/es/ir/position/offset-position.js +1 -1
- package/dist/es/ir/position/polar-position.d.ts.map +1 -1
- package/dist/es/ir/position/polar-position.js +2 -2
- package/dist/es/ir/position/position.d.ts.map +1 -1
- package/dist/es/ir/position/position.js +1 -1
- package/dist/es/ir/scene.d.ts +112 -112
- package/dist/es/ir/text.d.ts +96 -0
- package/dist/es/ir/text.d.ts.map +1 -0
- package/dist/es/ir/text.js +20 -0
- package/dist/es/parsers/parseTargetSugar.d.ts +4 -0
- package/dist/es/parsers/parseTargetSugar.d.ts.map +1 -1
- package/dist/es/parsers/parseTargetSugar.js +3 -2
- package/dist/es/primitive/ellipse.d.ts +2 -2
- package/dist/es/primitive/group.d.ts +23 -7
- package/dist/es/primitive/group.d.ts.map +1 -1
- package/dist/es/primitive/path.d.ts +51 -11
- package/dist/es/primitive/path.d.ts.map +1 -1
- package/dist/es/primitive/rect.d.ts +2 -2
- package/dist/es/primitive/rect.d.ts.map +1 -1
- package/dist/es/primitive/text.d.ts +10 -3
- package/dist/es/primitive/text.d.ts.map +1 -1
- package/dist/es/primitive/view-box.d.ts +1 -1
- package/dist/es/primitive/view-box.d.ts.map +1 -1
- package/dist/es/types.d.ts +8 -0
- package/dist/es/types.d.ts.map +1 -1
- package/dist/lib/compile/compile.cjs +40 -15
- package/dist/lib/compile/compile.d.ts +17 -0
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/index.d.ts +1 -1
- package/dist/lib/compile/index.d.ts.map +1 -1
- package/dist/lib/compile/node.cjs +1 -1
- package/dist/lib/compile/node.d.ts +3 -3
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/path/anchor.cjs +58 -0
- package/dist/lib/compile/path/anchor.d.ts +19 -0
- package/dist/lib/compile/path/anchor.d.ts.map +1 -0
- package/dist/lib/compile/path/index.cjs +308 -0
- package/dist/lib/compile/{path.d.ts → path/index.d.ts} +18 -7
- package/dist/lib/compile/path/index.d.ts.map +1 -0
- package/dist/lib/compile/path/label.cjs +103 -0
- package/dist/lib/compile/path/label.d.ts +18 -0
- package/dist/lib/compile/path/label.d.ts.map +1 -0
- package/dist/lib/compile/path/relative.cjs +48 -0
- package/dist/lib/compile/path/relative.d.ts +8 -0
- package/dist/lib/compile/path/relative.d.ts.map +1 -0
- package/dist/lib/compile/path/shrink.cjs +138 -0
- package/dist/lib/compile/path/shrink.d.ts +24 -0
- package/dist/lib/compile/path/shrink.d.ts.map +1 -0
- package/dist/lib/compile/path/split.cjs +46 -0
- package/dist/lib/compile/path/split.d.ts +15 -0
- package/dist/lib/compile/path/split.d.ts.map +1 -0
- package/dist/lib/compile/text-metrics.cjs +11 -5
- package/dist/lib/compile/text-metrics.d.ts +4 -1
- package/dist/lib/compile/text-metrics.d.ts.map +1 -1
- package/dist/lib/geometry/_transform.cjs +28 -0
- package/dist/lib/geometry/_transform.d.ts +21 -0
- package/dist/lib/geometry/_transform.d.ts.map +1 -0
- package/dist/lib/geometry/bend.cjs +1 -1
- package/dist/lib/geometry/bend.d.ts +1 -1
- package/dist/lib/geometry/circle.cjs +5 -20
- package/dist/lib/geometry/circle.d.ts +2 -3
- package/dist/lib/geometry/circle.d.ts.map +1 -1
- package/dist/lib/geometry/diamond.cjs +5 -20
- package/dist/lib/geometry/diamond.d.ts +2 -3
- package/dist/lib/geometry/diamond.d.ts.map +1 -1
- package/dist/lib/geometry/ellipse.cjs +5 -20
- package/dist/lib/geometry/ellipse.d.ts +2 -3
- package/dist/lib/geometry/ellipse.d.ts.map +1 -1
- package/dist/lib/geometry/polar.cjs +2 -6
- package/dist/lib/geometry/polar.d.ts +2 -2
- package/dist/lib/geometry/polar.d.ts.map +1 -1
- package/dist/lib/geometry/rect.cjs +5 -22
- package/dist/lib/geometry/rect.d.ts.map +1 -1
- package/dist/lib/geometry/segment.d.ts +5 -1
- package/dist/lib/geometry/segment.d.ts.map +1 -1
- package/dist/lib/index.cjs +5 -3
- package/dist/lib/index.d.ts +10 -6
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/font.cjs +15 -0
- package/dist/lib/ir/font.d.ts +21 -0
- package/dist/lib/ir/font.d.ts.map +1 -0
- package/dist/lib/ir/index.d.ts +2 -0
- package/dist/lib/ir/index.d.ts.map +1 -1
- package/dist/lib/ir/node.cjs +7 -34
- package/dist/lib/ir/node.d.ts +28 -139
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/path/arrow.d.ts +12 -12
- package/dist/lib/ir/path/path.cjs +4 -4
- package/dist/lib/ir/path/path.d.ts +16 -16
- package/dist/lib/ir/path/step.cjs +8 -8
- package/dist/lib/ir/path/step.d.ts +1 -1
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/position/offset-position.cjs +1 -1
- package/dist/lib/ir/position/polar-position.cjs +2 -2
- package/dist/lib/ir/position/polar-position.d.ts.map +1 -1
- package/dist/lib/ir/position/position.cjs +1 -1
- package/dist/lib/ir/position/position.d.ts.map +1 -1
- package/dist/lib/ir/scene.d.ts +112 -112
- package/dist/lib/ir/text.cjs +21 -0
- package/dist/lib/ir/text.d.ts +96 -0
- package/dist/lib/ir/text.d.ts.map +1 -0
- package/dist/lib/parsers/parseTargetSugar.cjs +3 -2
- package/dist/lib/parsers/parseTargetSugar.d.ts +4 -0
- package/dist/lib/parsers/parseTargetSugar.d.ts.map +1 -1
- package/dist/lib/primitive/ellipse.d.ts +2 -2
- package/dist/lib/primitive/group.d.ts +23 -7
- package/dist/lib/primitive/group.d.ts.map +1 -1
- package/dist/lib/primitive/path.d.ts +51 -11
- package/dist/lib/primitive/path.d.ts.map +1 -1
- package/dist/lib/primitive/rect.d.ts +2 -2
- package/dist/lib/primitive/rect.d.ts.map +1 -1
- package/dist/lib/primitive/text.d.ts +10 -3
- package/dist/lib/primitive/text.d.ts.map +1 -1
- package/dist/lib/primitive/view-box.d.ts +1 -1
- package/dist/lib/primitive/view-box.d.ts.map +1 -1
- package/dist/lib/types.d.ts +8 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +13 -4
- package/dist/es/compile/path.d.ts.map +0 -1
- package/dist/es/compile/path.js +0 -636
- package/dist/lib/compile/path.cjs +0 -636
- package/dist/lib/compile/path.d.ts.map +0 -1
|
@@ -43,20 +43,20 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
44
|
length?: number | undefined;
|
|
45
45
|
fill?: string | undefined;
|
|
46
|
+
opacity?: number | undefined;
|
|
46
47
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
47
48
|
scale?: number | undefined;
|
|
48
49
|
width?: number | undefined;
|
|
49
50
|
color?: string | undefined;
|
|
50
|
-
opacity?: number | undefined;
|
|
51
51
|
lineWidth?: number | undefined;
|
|
52
52
|
}, {
|
|
53
53
|
length?: number | undefined;
|
|
54
54
|
fill?: string | undefined;
|
|
55
|
+
opacity?: number | undefined;
|
|
55
56
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
56
57
|
scale?: number | undefined;
|
|
57
58
|
width?: number | undefined;
|
|
58
59
|
color?: string | undefined;
|
|
59
|
-
opacity?: number | undefined;
|
|
60
60
|
lineWidth?: number | undefined;
|
|
61
61
|
}>>;
|
|
62
62
|
end: z.ZodOptional<z.ZodObject<{
|
|
@@ -79,78 +79,78 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
79
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
80
|
length?: number | undefined;
|
|
81
81
|
fill?: string | undefined;
|
|
82
|
+
opacity?: number | undefined;
|
|
82
83
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
83
84
|
scale?: number | undefined;
|
|
84
85
|
width?: number | undefined;
|
|
85
86
|
color?: string | undefined;
|
|
86
|
-
opacity?: number | undefined;
|
|
87
87
|
lineWidth?: number | undefined;
|
|
88
88
|
}, {
|
|
89
89
|
length?: number | undefined;
|
|
90
90
|
fill?: string | undefined;
|
|
91
|
+
opacity?: number | undefined;
|
|
91
92
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
92
93
|
scale?: number | undefined;
|
|
93
94
|
width?: number | undefined;
|
|
94
95
|
color?: string | undefined;
|
|
95
|
-
opacity?: number | undefined;
|
|
96
96
|
lineWidth?: number | undefined;
|
|
97
97
|
}>>;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
99
|
length?: number | undefined;
|
|
100
100
|
fill?: string | undefined;
|
|
101
|
+
opacity?: number | undefined;
|
|
101
102
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
102
103
|
scale?: number | undefined;
|
|
103
104
|
width?: number | undefined;
|
|
104
105
|
color?: string | undefined;
|
|
105
|
-
opacity?: number | undefined;
|
|
106
106
|
lineWidth?: number | undefined;
|
|
107
107
|
start?: {
|
|
108
108
|
length?: number | undefined;
|
|
109
109
|
fill?: string | undefined;
|
|
110
|
+
opacity?: number | undefined;
|
|
110
111
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
111
112
|
scale?: number | undefined;
|
|
112
113
|
width?: number | undefined;
|
|
113
114
|
color?: string | undefined;
|
|
114
|
-
opacity?: number | undefined;
|
|
115
115
|
lineWidth?: number | undefined;
|
|
116
116
|
} | undefined;
|
|
117
117
|
end?: {
|
|
118
118
|
length?: number | undefined;
|
|
119
119
|
fill?: string | undefined;
|
|
120
|
+
opacity?: number | undefined;
|
|
120
121
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
121
122
|
scale?: number | undefined;
|
|
122
123
|
width?: number | undefined;
|
|
123
124
|
color?: string | undefined;
|
|
124
|
-
opacity?: number | undefined;
|
|
125
125
|
lineWidth?: number | undefined;
|
|
126
126
|
} | undefined;
|
|
127
127
|
}, {
|
|
128
128
|
length?: number | undefined;
|
|
129
129
|
fill?: string | undefined;
|
|
130
|
+
opacity?: number | undefined;
|
|
130
131
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
131
132
|
scale?: number | undefined;
|
|
132
133
|
width?: number | undefined;
|
|
133
134
|
color?: string | undefined;
|
|
134
|
-
opacity?: number | undefined;
|
|
135
135
|
lineWidth?: number | undefined;
|
|
136
136
|
start?: {
|
|
137
137
|
length?: number | undefined;
|
|
138
138
|
fill?: string | undefined;
|
|
139
|
+
opacity?: number | undefined;
|
|
139
140
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
140
141
|
scale?: number | undefined;
|
|
141
142
|
width?: number | undefined;
|
|
142
143
|
color?: string | undefined;
|
|
143
|
-
opacity?: number | undefined;
|
|
144
144
|
lineWidth?: number | undefined;
|
|
145
145
|
} | undefined;
|
|
146
146
|
end?: {
|
|
147
147
|
length?: number | undefined;
|
|
148
148
|
fill?: string | undefined;
|
|
149
|
+
opacity?: number | undefined;
|
|
149
150
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
150
151
|
scale?: number | undefined;
|
|
151
152
|
width?: number | undefined;
|
|
152
153
|
color?: string | undefined;
|
|
153
|
-
opacity?: number | undefined;
|
|
154
154
|
lineWidth?: number | undefined;
|
|
155
155
|
} | undefined;
|
|
156
156
|
}>>;
|
|
@@ -843,30 +843,30 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
843
843
|
arrowDetail?: {
|
|
844
844
|
length?: number | undefined;
|
|
845
845
|
fill?: string | undefined;
|
|
846
|
+
opacity?: number | undefined;
|
|
846
847
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
847
848
|
scale?: number | undefined;
|
|
848
849
|
width?: number | undefined;
|
|
849
850
|
color?: string | undefined;
|
|
850
|
-
opacity?: number | undefined;
|
|
851
851
|
lineWidth?: number | undefined;
|
|
852
852
|
start?: {
|
|
853
853
|
length?: number | undefined;
|
|
854
854
|
fill?: string | undefined;
|
|
855
|
+
opacity?: number | undefined;
|
|
855
856
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
856
857
|
scale?: number | undefined;
|
|
857
858
|
width?: number | undefined;
|
|
858
859
|
color?: string | undefined;
|
|
859
|
-
opacity?: number | undefined;
|
|
860
860
|
lineWidth?: number | undefined;
|
|
861
861
|
} | undefined;
|
|
862
862
|
end?: {
|
|
863
863
|
length?: number | undefined;
|
|
864
864
|
fill?: string | undefined;
|
|
865
|
+
opacity?: number | undefined;
|
|
865
866
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
866
867
|
scale?: number | undefined;
|
|
867
868
|
width?: number | undefined;
|
|
868
869
|
color?: string | undefined;
|
|
869
|
-
opacity?: number | undefined;
|
|
870
870
|
lineWidth?: number | undefined;
|
|
871
871
|
} | undefined;
|
|
872
872
|
} | undefined;
|
|
@@ -1018,30 +1018,30 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
1018
1018
|
arrowDetail?: {
|
|
1019
1019
|
length?: number | undefined;
|
|
1020
1020
|
fill?: string | undefined;
|
|
1021
|
+
opacity?: number | undefined;
|
|
1021
1022
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
1022
1023
|
scale?: number | undefined;
|
|
1023
1024
|
width?: number | undefined;
|
|
1024
1025
|
color?: string | undefined;
|
|
1025
|
-
opacity?: number | undefined;
|
|
1026
1026
|
lineWidth?: number | undefined;
|
|
1027
1027
|
start?: {
|
|
1028
1028
|
length?: number | undefined;
|
|
1029
1029
|
fill?: string | undefined;
|
|
1030
|
+
opacity?: number | undefined;
|
|
1030
1031
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
1031
1032
|
scale?: number | undefined;
|
|
1032
1033
|
width?: number | undefined;
|
|
1033
1034
|
color?: string | undefined;
|
|
1034
|
-
opacity?: number | undefined;
|
|
1035
1035
|
lineWidth?: number | undefined;
|
|
1036
1036
|
} | undefined;
|
|
1037
1037
|
end?: {
|
|
1038
1038
|
length?: number | undefined;
|
|
1039
1039
|
fill?: string | undefined;
|
|
1040
|
+
opacity?: number | undefined;
|
|
1040
1041
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
1041
1042
|
scale?: number | undefined;
|
|
1042
1043
|
width?: number | undefined;
|
|
1043
1044
|
color?: string | undefined;
|
|
1044
|
-
opacity?: number | undefined;
|
|
1045
1045
|
lineWidth?: number | undefined;
|
|
1046
1046
|
} | undefined;
|
|
1047
1047
|
} | undefined;
|
|
@@ -27,12 +27,12 @@ var StepLabelSchema = zod.z.object({
|
|
|
27
27
|
}).describe("Edge label spec attached to a drawn step; compiled to a TextPrim positioned along the segment.");
|
|
28
28
|
var MoveStepSchema = zod.z.object({
|
|
29
29
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
30
|
-
kind: zod.z.literal("move").describe("Move the cursor to the target without drawing (
|
|
30
|
+
kind: zod.z.literal("move").describe("Move the cursor to the target without drawing (TikZ `(A)`, no drawing operation)"),
|
|
31
31
|
to: require_target.TargetSchema.describe("Destination point of the move")
|
|
32
32
|
}).describe("Move action: relocate the path cursor without drawing");
|
|
33
33
|
var LineStepSchema = zod.z.object({
|
|
34
34
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
35
|
-
kind: zod.z.literal("line").describe("Draw a straight line from the current cursor to the target (
|
|
35
|
+
kind: zod.z.literal("line").describe("Draw a straight line from the current cursor to the target (TikZ `(A) -- (B)`)"),
|
|
36
36
|
to: require_target.TargetSchema.describe("Destination point of the line segment"),
|
|
37
37
|
label: StepLabelSchema.optional().describe("Edge label attached to this line segment")
|
|
38
38
|
}).describe("Line action: straight-line segment from cursor to target");
|
|
@@ -45,7 +45,7 @@ var FoldStepSchema = zod.z.object({
|
|
|
45
45
|
}).describe("Fold action: TikZ-style right-angle fold with a single intermediate point chosen by `via`");
|
|
46
46
|
var CycleStepSchema = zod.z.object({
|
|
47
47
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
48
|
-
kind: zod.z.literal("cycle").describe("Close the path back to the most recent move target (TikZ `cycle`
|
|
48
|
+
kind: zod.z.literal("cycle").describe("Close the path back to the most recent move target (TikZ `cycle`)")
|
|
49
49
|
}).describe("Cycle action: close the current sub-path back to its starting point; carries no `to` field");
|
|
50
50
|
/**
|
|
51
51
|
* 控制点 schema 别名
|
|
@@ -54,14 +54,14 @@ var CycleStepSchema = zod.z.object({
|
|
|
54
54
|
var ControlPointSchema = require_position.PositionSchema.describe("Bezier control point. Currently Cartesian [x, y]; reserved for node ref / polar in future versions.");
|
|
55
55
|
var CurveStepSchema = zod.z.object({
|
|
56
56
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
57
|
-
kind: zod.z.literal("curve").describe("Quadratic Bezier curve from cursor to target with one control point (TikZ `.. controls (B)
|
|
57
|
+
kind: zod.z.literal("curve").describe("Quadratic Bezier curve from cursor to target with one control point (TikZ `.. controls (B) ..`)"),
|
|
58
58
|
to: require_target.TargetSchema.describe("Destination point of the curve"),
|
|
59
59
|
control: ControlPointSchema.describe("Single control point for the quadratic Bezier"),
|
|
60
60
|
label: StepLabelSchema.optional().describe("Edge label attached to this quadratic Bezier")
|
|
61
61
|
}).describe("Curve action: quadratic Bezier; one control point shapes the bend");
|
|
62
62
|
var CubicStepSchema = zod.z.object({
|
|
63
63
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
64
|
-
kind: zod.z.literal("cubic").describe("Cubic Bezier curve from cursor to target with two control points (TikZ `.. controls (B) and (C)
|
|
64
|
+
kind: zod.z.literal("cubic").describe("Cubic Bezier curve from cursor to target with two control points (TikZ `.. controls (B) and (C) ..`)"),
|
|
65
65
|
to: require_target.TargetSchema.describe("Destination point of the cubic curve"),
|
|
66
66
|
control1: ControlPointSchema.describe("First control point (influences the start tangent)"),
|
|
67
67
|
control2: ControlPointSchema.describe("Second control point (influences the end tangent)"),
|
|
@@ -78,20 +78,20 @@ var BendStepSchema = zod.z.object({
|
|
|
78
78
|
var ArcStepSchema = zod.z.object({
|
|
79
79
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
80
80
|
kind: zod.z.literal("arc").describe("Arc segment from cursor as center, sweeping startAngle → endAngle on a circle of given radius (TikZ `arc[start angle=…, end angle=…, radius=…]`); pen ends at the arc endpoint, not the center"),
|
|
81
|
-
startAngle: zod.z.number().describe("Arc start angle in degrees,
|
|
81
|
+
startAngle: zod.z.number().describe("Arc start angle in degrees, measured from +x axis. 0° = +x, 90° = +y = screen-down (visual clockwise under screen y-down); matches polar / Node label angle convention."),
|
|
82
82
|
endAngle: zod.z.number().describe("Arc end angle in degrees; sweep direction inferred from startAngle vs endAngle"),
|
|
83
83
|
radius: zod.z.number().positive().describe("Arc radius in user units"),
|
|
84
84
|
label: StepLabelSchema.optional().describe("Edge label attached to this arc")
|
|
85
85
|
}).describe("Arc action: TikZ-style arc with implicit center at the cursor; startAngle / endAngle / radius give the geometry. Pen is left at the arc endpoint.");
|
|
86
86
|
var CirclePathStepSchema = zod.z.object({
|
|
87
87
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
88
|
-
kind: zod.z.literal("circlePath").describe("Full circle centered at the cursor with given radius (TikZ `circle[radius=…]`);
|
|
88
|
+
kind: zod.z.literal("circlePath").describe("Full circle centered at the cursor with given radius (TikZ `circle[radius=…]`); compiled to a single full-sweep ellipse arc command. Pen returns to the center."),
|
|
89
89
|
radius: zod.z.number().positive().describe("Circle radius in user units"),
|
|
90
90
|
label: StepLabelSchema.optional().describe("Edge label attached to this full circle")
|
|
91
91
|
}).describe("CirclePath action: full closed circle around the cursor as center; pen returns to center after.");
|
|
92
92
|
var EllipsePathStepSchema = zod.z.object({
|
|
93
93
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
94
|
-
kind: zod.z.literal("ellipsePath").describe("Full ellipse centered at the cursor with given x/y radii (TikZ `ellipse[x radius=…, y radius=…]`);
|
|
94
|
+
kind: zod.z.literal("ellipsePath").describe("Full ellipse centered at the cursor with given x/y radii (TikZ `ellipse[x radius=…, y radius=…]`); compiled to a single full-sweep ellipse arc command. Pen returns to the center."),
|
|
95
95
|
radiusX: zod.z.number().positive().describe("Ellipse x-axis radius (semi-major or semi-minor on x)"),
|
|
96
96
|
radiusY: zod.z.number().positive().describe("Ellipse y-axis radius (semi-major or semi-minor on y)"),
|
|
97
97
|
label: StepLabelSchema.optional().describe("Edge label attached to this full ellipse")
|
|
@@ -1118,7 +1118,7 @@ export type IRMoveStep = z.infer<typeof MoveStepSchema>;
|
|
|
1118
1118
|
export type IRLineStep = z.infer<typeof LineStepSchema>;
|
|
1119
1119
|
/** Fold step:折角段,经一个直角中间点(TikZ `-|`/`|-`) */
|
|
1120
1120
|
export type IRFoldStep = z.infer<typeof FoldStepSchema>;
|
|
1121
|
-
/** Cycle step:闭合回起点(TikZ `cycle
|
|
1121
|
+
/** Cycle step:闭合回起点(TikZ `cycle`) */
|
|
1122
1122
|
export type IRCycleStep = z.infer<typeof CycleStepSchema>;
|
|
1123
1123
|
/** Curve step:二次贝塞尔,一个控制点 */
|
|
1124
1124
|
export type IRCurveStep = z.infer<typeof CurveStepSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;EA+BzB,CAAC;AAEJ,gBAAgB;AAChB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQyC,CAAC;AAErE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS4C,CAAC;AAExE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,qBAAqB,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -8,7 +8,7 @@ var OffsetPositionSchema = zod.z.object({
|
|
|
8
8
|
require_position.PositionSchema,
|
|
9
9
|
require_polar_position.PolarPositionSchema
|
|
10
10
|
]).describe("Reference base point: node id string (forward references rejected), Cartesian [x, y] literal (no pre-definition needed), or PolarPosition (recursive polar chain via its own origin). Mirrors PolarPosition.origin union shape."),
|
|
11
|
-
offset: zod.z.tuple([zod.z.number(), zod.z.number()]).describe("Offset (dx, dy) from the reference point in user units")
|
|
11
|
+
offset: zod.z.tuple([zod.z.number().finite(), zod.z.number().finite()]).describe("Offset (dx, dy) from the reference point in user units; rejects NaN / ±Infinity")
|
|
12
12
|
}).describe("Offset position: base point `of` plus a Cartesian `(dx, dy)` offset. Mirrors TikZ `calc` syntax `($(of) + (dx, dy)$)`. The base point may itself be a node id, a literal coordinate, or a polar expression — covering all referent shapes available to PolarPosition.origin.");
|
|
13
13
|
//#endregion
|
|
14
14
|
exports.OffsetPositionSchema = OffsetPositionSchema;
|
|
@@ -8,8 +8,8 @@ var PolarPositionSchema = zod.z.lazy(() => zod.z.object({
|
|
|
8
8
|
require_position.PositionSchema,
|
|
9
9
|
PolarPositionSchema
|
|
10
10
|
]).optional().describe("Origin reference: node id string, Cartesian [x, y], or nested PolarPosition (chained); defaults to [0, 0] when omitted"),
|
|
11
|
-
angle: zod.z.number().describe("Angle in degrees,
|
|
12
|
-
radius: zod.z.number().describe("Radius / distance in user units")
|
|
11
|
+
angle: zod.z.number().finite().describe("Angle in degrees, measured from +x axis (0°). 90° = +y = screen-down (visual clockwise under screen y-down); negative angles go upward. Matches retikz convention used by ArcStep / Node label."),
|
|
12
|
+
radius: zod.z.number().finite().describe("Radius / distance in user units")
|
|
13
13
|
}).describe("Polar coordinate position; resolved to Cartesian at Scene compile time"));
|
|
14
14
|
//#endregion
|
|
15
15
|
exports.PolarPositionSchema = PolarPositionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polar-position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/polar-position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"polar-position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/polar-position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAuBxD,CAAC;AAGF,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let zod = require("zod");
|
|
2
2
|
//#region src/ir/position/position.ts
|
|
3
|
-
var PositionSchema = zod.z.tuple([zod.z.number(), zod.z.number()]).describe("Cartesian position [x, y]");
|
|
3
|
+
var PositionSchema = zod.z.tuple([zod.z.number().finite(), zod.z.number().finite()]).describe("Cartesian position [x, y]; rejects NaN / ±Infinity to keep IR JSON-serializable round-trip stable");
|
|
4
4
|
//#endregion
|
|
5
5
|
exports.PositionSchema = PositionSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,8CAEqF,CAAC;AAEjH,mBAAmB;AACnB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|