@retikz/core 0.1.0-alpha.4 → 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 +23 -13
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +44 -25
- 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 +40 -59
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +51 -43
- package/dist/es/compile/parseTarget.d.ts +3 -8
- package/dist/es/compile/parseTarget.d.ts.map +1 -1
- package/dist/es/compile/parseTarget.js +7 -19
- 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/index.d.ts +24 -0
- 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/position.d.ts +4 -8
- package/dist/es/compile/position.d.ts.map +1 -1
- package/dist/es/compile/position.js +10 -10
- package/dist/es/compile/text-metrics.d.ts +6 -5
- package/dist/es/compile/text-metrics.d.ts.map +1 -1
- package/dist/es/compile/text-metrics.js +11 -5
- package/dist/es/compile/view-box.d.ts +1 -4
- package/dist/es/compile/view-box.d.ts.map +1 -1
- package/dist/es/compile/view-box.js +1 -4
- 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/arc.d.ts +3 -28
- package/dist/es/geometry/arc.d.ts.map +1 -1
- package/dist/es/geometry/arc.js +4 -31
- package/dist/es/geometry/bend.d.ts +2 -13
- package/dist/es/geometry/bend.d.ts.map +1 -1
- package/dist/es/geometry/bend.js +2 -13
- package/dist/es/geometry/circle.d.ts +6 -15
- package/dist/es/geometry/circle.d.ts.map +1 -1
- package/dist/es/geometry/circle.js +2 -20
- package/dist/es/geometry/diamond.d.ts +10 -26
- package/dist/es/geometry/diamond.d.ts.map +1 -1
- package/dist/es/geometry/diamond.js +5 -30
- package/dist/es/geometry/ellipse.d.ts +10 -17
- package/dist/es/geometry/ellipse.d.ts.map +1 -1
- package/dist/es/geometry/ellipse.js +5 -24
- package/dist/es/geometry/point.d.ts +8 -9
- package/dist/es/geometry/point.d.ts.map +1 -1
- package/dist/es/geometry/point.js +8 -9
- package/dist/es/geometry/polar.d.ts +12 -21
- package/dist/es/geometry/polar.d.ts.map +1 -1
- package/dist/es/geometry/polar.js +8 -19
- package/dist/es/geometry/rect.d.ts +8 -32
- package/dist/es/geometry/rect.d.ts.map +1 -1
- package/dist/es/geometry/rect.js +6 -49
- package/dist/es/geometry/segment.d.ts +15 -18
- package/dist/es/geometry/segment.d.ts.map +1 -1
- package/dist/es/geometry/segment.js +9 -16
- package/dist/es/index.d.ts +13 -13
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +7 -4
- package/dist/es/ir/coordinate.d.ts +18 -10
- package/dist/es/ir/coordinate.d.ts.map +1 -1
- package/dist/es/ir/coordinate.js +6 -11
- 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 +51 -181
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +15 -70
- package/dist/es/ir/path/arrow.d.ts +210 -12
- package/dist/es/ir/path/arrow.d.ts.map +1 -1
- package/dist/es/ir/path/arrow.js +39 -12
- package/dist/es/ir/path/path.d.ts +477 -153
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +6 -6
- package/dist/es/ir/path/step.d.ts +395 -223
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +21 -22
- package/dist/es/ir/path/target.d.ts +25 -16
- package/dist/es/ir/path/target.d.ts.map +1 -1
- package/dist/es/ir/path/target.js +8 -6
- package/dist/es/ir/position/at-position.d.ts +4 -11
- package/dist/es/ir/position/at-position.d.ts.map +1 -1
- package/dist/es/ir/position/at-position.js +2 -9
- package/dist/es/ir/position/index.d.ts +1 -0
- package/dist/es/ir/position/index.d.ts.map +1 -1
- package/dist/es/ir/position/offset-position.d.ts +14 -0
- package/dist/es/ir/position/offset-position.d.ts.map +1 -0
- package/dist/es/ir/position/offset-position.js +14 -0
- package/dist/es/ir/position/polar-position.d.ts +1 -4
- package/dist/es/ir/position/polar-position.d.ts.map +1 -1
- package/dist/es/ir/position/polar-position.js +3 -6
- 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 +1236 -422
- package/dist/es/ir/scene.d.ts.map +1 -1
- 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 +7 -19
- package/dist/es/parsers/parseWay.d.ts +26 -118
- package/dist/es/parsers/parseWay.d.ts.map +1 -1
- package/dist/es/parsers/parseWay.js +19 -61
- package/dist/es/primitive/ellipse.d.ts +4 -14
- package/dist/es/primitive/ellipse.d.ts.map +1 -1
- package/dist/es/primitive/group.d.ts +37 -3
- package/dist/es/primitive/group.d.ts.map +1 -1
- package/dist/es/primitive/path.d.ts +107 -7
- 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/scene.d.ts +2 -4
- package/dist/es/primitive/scene.d.ts.map +1 -1
- package/dist/es/primitive/text.d.ts +16 -32
- 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 +44 -25
- package/dist/lib/compile/compile.d.ts +23 -13
- 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 +51 -43
- package/dist/lib/compile/node.d.ts +40 -59
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/parseTarget.cjs +7 -19
- package/dist/lib/compile/parseTarget.d.ts +3 -8
- package/dist/lib/compile/parseTarget.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/index.d.ts +24 -0
- 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/position.cjs +10 -10
- package/dist/lib/compile/position.d.ts +4 -8
- package/dist/lib/compile/position.d.ts.map +1 -1
- package/dist/lib/compile/text-metrics.cjs +11 -5
- package/dist/lib/compile/text-metrics.d.ts +6 -5
- package/dist/lib/compile/text-metrics.d.ts.map +1 -1
- package/dist/lib/compile/view-box.cjs +1 -4
- package/dist/lib/compile/view-box.d.ts +1 -4
- package/dist/lib/compile/view-box.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/arc.cjs +3 -31
- package/dist/lib/geometry/arc.d.ts +3 -28
- package/dist/lib/geometry/arc.d.ts.map +1 -1
- package/dist/lib/geometry/bend.cjs +2 -13
- package/dist/lib/geometry/bend.d.ts +2 -13
- package/dist/lib/geometry/bend.d.ts.map +1 -1
- package/dist/lib/geometry/circle.cjs +6 -24
- package/dist/lib/geometry/circle.d.ts +6 -15
- package/dist/lib/geometry/circle.d.ts.map +1 -1
- package/dist/lib/geometry/diamond.cjs +9 -34
- package/dist/lib/geometry/diamond.d.ts +10 -26
- package/dist/lib/geometry/diamond.d.ts.map +1 -1
- package/dist/lib/geometry/ellipse.cjs +9 -28
- package/dist/lib/geometry/ellipse.d.ts +10 -17
- package/dist/lib/geometry/ellipse.d.ts.map +1 -1
- package/dist/lib/geometry/point.cjs +8 -9
- package/dist/lib/geometry/point.d.ts +8 -9
- package/dist/lib/geometry/point.d.ts.map +1 -1
- package/dist/lib/geometry/polar.cjs +8 -19
- package/dist/lib/geometry/polar.d.ts +12 -21
- package/dist/lib/geometry/polar.d.ts.map +1 -1
- package/dist/lib/geometry/rect.cjs +10 -53
- package/dist/lib/geometry/rect.d.ts +8 -32
- package/dist/lib/geometry/rect.d.ts.map +1 -1
- package/dist/lib/geometry/segment.cjs +9 -16
- package/dist/lib/geometry/segment.d.ts +15 -18
- package/dist/lib/geometry/segment.d.ts.map +1 -1
- package/dist/lib/index.cjs +14 -5
- package/dist/lib/index.d.ts +13 -13
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/coordinate.cjs +6 -11
- package/dist/lib/ir/coordinate.d.ts +18 -10
- package/dist/lib/ir/coordinate.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 +16 -74
- package/dist/lib/ir/node.d.ts +51 -181
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/path/arrow.cjs +43 -11
- package/dist/lib/ir/path/arrow.d.ts +210 -12
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +5 -5
- package/dist/lib/ir/path/path.d.ts +477 -153
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +21 -22
- package/dist/lib/ir/path/step.d.ts +395 -223
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/path/target.cjs +9 -7
- package/dist/lib/ir/path/target.d.ts +25 -16
- package/dist/lib/ir/path/target.d.ts.map +1 -1
- package/dist/lib/ir/position/at-position.cjs +2 -9
- package/dist/lib/ir/position/at-position.d.ts +4 -11
- package/dist/lib/ir/position/at-position.d.ts.map +1 -1
- package/dist/lib/ir/position/index.d.ts +1 -0
- package/dist/lib/ir/position/index.d.ts.map +1 -1
- package/dist/lib/ir/position/offset-position.cjs +14 -0
- package/dist/lib/ir/position/offset-position.d.ts +14 -0
- package/dist/lib/ir/position/offset-position.d.ts.map +1 -0
- package/dist/lib/ir/position/polar-position.cjs +3 -6
- package/dist/lib/ir/position/polar-position.d.ts +1 -4
- 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 +1236 -422
- package/dist/lib/ir/scene.d.ts.map +1 -1
- 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 +7 -19
- package/dist/lib/parsers/parseTargetSugar.d.ts +4 -0
- package/dist/lib/parsers/parseTargetSugar.d.ts.map +1 -1
- package/dist/lib/parsers/parseWay.cjs +19 -61
- package/dist/lib/parsers/parseWay.d.ts +26 -118
- package/dist/lib/parsers/parseWay.d.ts.map +1 -1
- package/dist/lib/primitive/ellipse.d.ts +4 -14
- package/dist/lib/primitive/ellipse.d.ts.map +1 -1
- package/dist/lib/primitive/group.d.ts +37 -3
- package/dist/lib/primitive/group.d.ts.map +1 -1
- package/dist/lib/primitive/path.d.ts +107 -7
- 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/scene.d.ts +2 -4
- package/dist/lib/primitive/scene.d.ts.map +1 -1
- package/dist/lib/primitive/text.d.ts +16 -32
- 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 +0 -30
- package/dist/es/compile/path.d.ts.map +0 -1
- package/dist/es/compile/path.js +0 -617
- package/dist/lib/compile/path.cjs +0 -617
- package/dist/lib/compile/path.d.ts +0 -30
- package/dist/lib/compile/path.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiGpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -3,17 +3,20 @@ const require_target = require("./target.cjs");
|
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
//#region src/ir/path/step.ts
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 标记,标签语义不清。
|
|
6
|
+
* 边标注:画线 step 上的 label
|
|
7
|
+
* @description 按段几何 + side 偏移翻译为 TextPrim;move/cycle 不挂 label
|
|
9
8
|
*/
|
|
10
9
|
var StepLabelSchema = zod.z.object({
|
|
11
10
|
text: zod.z.string().describe("Label text content. Single-line; for multi-line use \\n."),
|
|
12
|
-
position: zod.z.enum([
|
|
13
|
-
"
|
|
11
|
+
position: zod.z.union([zod.z.enum([
|
|
12
|
+
"at-start",
|
|
13
|
+
"very-near-start",
|
|
14
14
|
"near-start",
|
|
15
|
-
"
|
|
16
|
-
|
|
15
|
+
"midway",
|
|
16
|
+
"near-end",
|
|
17
|
+
"very-near-end",
|
|
18
|
+
"at-end"
|
|
19
|
+
]), zod.z.number().min(0).max(1)]).optional().describe("Normalized position t along the step (TikZ `pos`). Accepts a number 0..1 or one of 7 keyword sugars (at-start=0 / very-near-start=0.125 / near-start=0.25 / midway=0.5 / near-end=0.75 / very-near-end=0.875 / at-end=1). Geometric meaning of t varies by step kind: line/step use normalized arc length (fold partitions t equally across N legs — corner sits at t=j/N); curve/cubic/bend use the Bezier parameter (NOT arc length, so t=0.5 is not always the visual midpoint); arc maps t linearly across startAngle..endAngle; circlePath/ellipsePath use angle parametrization with t=0 at angle 0 (+x axis), CCW growth. Default `midway` (t=0.5)."),
|
|
17
20
|
side: zod.z.enum([
|
|
18
21
|
"above",
|
|
19
22
|
"below",
|
|
@@ -21,15 +24,15 @@ var StepLabelSchema = zod.z.object({
|
|
|
21
24
|
"right",
|
|
22
25
|
"sloped"
|
|
23
26
|
]).optional().describe("Side relative to segment direction. `above` / `below` / `left` / `right` offset along segment normal; `sloped` rotates label along the tangent (no normal offset). Default `above`.")
|
|
24
|
-
}).describe("Edge label spec attached to a drawn step
|
|
27
|
+
}).describe("Edge label spec attached to a drawn step; compiled to a TextPrim positioned along the segment.");
|
|
25
28
|
var MoveStepSchema = zod.z.object({
|
|
26
29
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
27
|
-
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)"),
|
|
28
31
|
to: require_target.TargetSchema.describe("Destination point of the move")
|
|
29
32
|
}).describe("Move action: relocate the path cursor without drawing");
|
|
30
33
|
var LineStepSchema = zod.z.object({
|
|
31
34
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
32
|
-
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)`)"),
|
|
33
36
|
to: require_target.TargetSchema.describe("Destination point of the line segment"),
|
|
34
37
|
label: StepLabelSchema.optional().describe("Edge label attached to this line segment")
|
|
35
38
|
}).describe("Line action: straight-line segment from cursor to target");
|
|
@@ -42,27 +45,23 @@ var FoldStepSchema = zod.z.object({
|
|
|
42
45
|
}).describe("Fold action: TikZ-style right-angle fold with a single intermediate point chosen by `via`");
|
|
43
46
|
var CycleStepSchema = zod.z.object({
|
|
44
47
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
45
|
-
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`)")
|
|
46
49
|
}).describe("Cycle action: close the current sub-path back to its starting point; carries no `to` field");
|
|
47
50
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* alpha.3:仅支持笛卡尔 `[x, y]`(与 ADR-0001 字面一致)。
|
|
51
|
-
* 未来扩展点:要支持节点 ref / 极坐标作为控制点(如 TikZ `controls (B)`)时,
|
|
52
|
-
* 只把这里改成 `z.union([PositionSchema, PolarPositionSchema, z.string().min(1)])`,
|
|
53
|
-
* curve / cubic schema 与下游消费侧不变。
|
|
51
|
+
* 控制点 schema 别名
|
|
52
|
+
* @description 当前仅支持笛卡尔 `[x,y]`;未来扩展节点 ref/极坐标时只改本处 union,curve/cubic schema 与下游不变
|
|
54
53
|
*/
|
|
55
54
|
var ControlPointSchema = require_position.PositionSchema.describe("Bezier control point. Currently Cartesian [x, y]; reserved for node ref / polar in future versions.");
|
|
56
55
|
var CurveStepSchema = zod.z.object({
|
|
57
56
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
58
|
-
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) ..`)"),
|
|
59
58
|
to: require_target.TargetSchema.describe("Destination point of the curve"),
|
|
60
59
|
control: ControlPointSchema.describe("Single control point for the quadratic Bezier"),
|
|
61
60
|
label: StepLabelSchema.optional().describe("Edge label attached to this quadratic Bezier")
|
|
62
61
|
}).describe("Curve action: quadratic Bezier; one control point shapes the bend");
|
|
63
62
|
var CubicStepSchema = zod.z.object({
|
|
64
63
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
65
|
-
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) ..`)"),
|
|
66
65
|
to: require_target.TargetSchema.describe("Destination point of the cubic curve"),
|
|
67
66
|
control1: ControlPointSchema.describe("First control point (influences the start tangent)"),
|
|
68
67
|
control2: ControlPointSchema.describe("Second control point (influences the end tangent)"),
|
|
@@ -79,20 +78,20 @@ var BendStepSchema = zod.z.object({
|
|
|
79
78
|
var ArcStepSchema = zod.z.object({
|
|
80
79
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
81
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"),
|
|
82
|
-
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."),
|
|
83
82
|
endAngle: zod.z.number().describe("Arc end angle in degrees; sweep direction inferred from startAngle vs endAngle"),
|
|
84
83
|
radius: zod.z.number().positive().describe("Arc radius in user units"),
|
|
85
84
|
label: StepLabelSchema.optional().describe("Edge label attached to this arc")
|
|
86
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.");
|
|
87
86
|
var CirclePathStepSchema = zod.z.object({
|
|
88
87
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
89
|
-
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."),
|
|
90
89
|
radius: zod.z.number().positive().describe("Circle radius in user units"),
|
|
91
90
|
label: StepLabelSchema.optional().describe("Edge label attached to this full circle")
|
|
92
91
|
}).describe("CirclePath action: full closed circle around the cursor as center; pen returns to center after.");
|
|
93
92
|
var EllipsePathStepSchema = zod.z.object({
|
|
94
93
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
95
|
-
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."),
|
|
96
95
|
radiusX: zod.z.number().positive().describe("Ellipse x-axis radius (semi-major or semi-minor on x)"),
|
|
97
96
|
radiusY: zod.z.number().positive().describe("Ellipse y-axis radius (semi-major or semi-minor on y)"),
|
|
98
97
|
label: StepLabelSchema.optional().describe("Edge label attached to this full ellipse")
|