@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":"step.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/step.ts"],"names":[],"mappings":"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"}
|
package/dist/es/ir/path/step.js
CHANGED
|
@@ -3,17 +3,20 @@ import { TargetSchema } from "./target.js";
|
|
|
3
3
|
import { z } from "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 = z.object({
|
|
11
10
|
text: z.string().describe("Label text content. Single-line; for multi-line use \\n."),
|
|
12
|
-
position: z.enum([
|
|
13
|
-
"
|
|
11
|
+
position: z.union([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
|
+
]), 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: z.enum([
|
|
18
21
|
"above",
|
|
19
22
|
"below",
|
|
@@ -21,15 +24,15 @@ var StepLabelSchema = 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 = z.object({
|
|
26
29
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
27
|
-
kind: z.literal("move").describe("Move the cursor to the target without drawing (
|
|
30
|
+
kind: z.literal("move").describe("Move the cursor to the target without drawing (TikZ `(A)`, no drawing operation)"),
|
|
28
31
|
to: TargetSchema.describe("Destination point of the move")
|
|
29
32
|
}).describe("Move action: relocate the path cursor without drawing");
|
|
30
33
|
var LineStepSchema = z.object({
|
|
31
34
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
32
|
-
kind: z.literal("line").describe("Draw a straight line from the current cursor to the target (
|
|
35
|
+
kind: z.literal("line").describe("Draw a straight line from the current cursor to the target (TikZ `(A) -- (B)`)"),
|
|
33
36
|
to: 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 = z.object({
|
|
|
42
45
|
}).describe("Fold action: TikZ-style right-angle fold with a single intermediate point chosen by `via`");
|
|
43
46
|
var CycleStepSchema = z.object({
|
|
44
47
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
45
|
-
kind: z.literal("cycle").describe("Close the path back to the most recent move target (TikZ `cycle`
|
|
48
|
+
kind: 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 = PositionSchema.describe("Bezier control point. Currently Cartesian [x, y]; reserved for node ref / polar in future versions.");
|
|
56
55
|
var CurveStepSchema = z.object({
|
|
57
56
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
58
|
-
kind: z.literal("curve").describe("Quadratic Bezier curve from cursor to target with one control point (TikZ `.. controls (B)
|
|
57
|
+
kind: z.literal("curve").describe("Quadratic Bezier curve from cursor to target with one control point (TikZ `.. controls (B) ..`)"),
|
|
59
58
|
to: 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 = z.object({
|
|
64
63
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
65
|
-
kind: z.literal("cubic").describe("Cubic Bezier curve from cursor to target with two control points (TikZ `.. controls (B) and (C)
|
|
64
|
+
kind: z.literal("cubic").describe("Cubic Bezier curve from cursor to target with two control points (TikZ `.. controls (B) and (C) ..`)"),
|
|
66
65
|
to: 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 = z.object({
|
|
|
79
78
|
var ArcStepSchema = z.object({
|
|
80
79
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
81
80
|
kind: 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: z.number().describe("Arc start angle in degrees,
|
|
81
|
+
startAngle: 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: z.number().describe("Arc end angle in degrees; sweep direction inferred from startAngle vs endAngle"),
|
|
84
83
|
radius: 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 = z.object({
|
|
88
87
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
89
|
-
kind: z.literal("circlePath").describe("Full circle centered at the cursor with given radius (TikZ `circle[radius=…]`);
|
|
88
|
+
kind: 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: 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 = z.object({
|
|
94
93
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
95
|
-
kind: z.literal("ellipsePath").describe("Full ellipse centered at the cursor with given x/y radii (TikZ `ellipse[x radius=…, y radius=…]`);
|
|
94
|
+
kind: 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: z.number().positive().describe("Ellipse x-axis radius (semi-major or semi-minor on x)"),
|
|
97
96
|
radiusY: 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")
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
2
|
+
export declare const RelativeTargetSchema: z.ZodObject<{
|
|
3
|
+
relative: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
4
4
|
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
|
|
5
|
+
relative: [number, number];
|
|
6
6
|
}, {
|
|
7
|
-
|
|
7
|
+
relative: [number, number];
|
|
8
8
|
}>;
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
9
|
+
export declare const RelativeAccumulateTargetSchema: z.ZodObject<{
|
|
10
|
+
relativeAccumulate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
|
|
12
|
+
relativeAccumulate: [number, number];
|
|
13
13
|
}, {
|
|
14
|
-
|
|
14
|
+
relativeAccumulate: [number, number];
|
|
15
15
|
}>;
|
|
16
16
|
export declare const TargetSchema: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('..').PolarPosition, z.ZodTypeDef, import('..').PolarPosition>, z.ZodString, z.ZodObject<{
|
|
17
|
-
|
|
17
|
+
relative: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
|
|
19
|
+
relative: [number, number];
|
|
20
20
|
}, {
|
|
21
|
-
|
|
21
|
+
relative: [number, number];
|
|
22
22
|
}>, z.ZodObject<{
|
|
23
|
-
|
|
23
|
+
relativeAccumulate: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
|
|
25
|
+
relativeAccumulate: [number, number];
|
|
26
26
|
}, {
|
|
27
|
-
|
|
27
|
+
relativeAccumulate: [number, number];
|
|
28
|
+
}>, z.ZodObject<{
|
|
29
|
+
of: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('..').PolarPosition, z.ZodTypeDef, import('..').PolarPosition>]>;
|
|
30
|
+
offset: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
of: string | [number, number] | import('..').PolarPosition;
|
|
33
|
+
offset: [number, number];
|
|
34
|
+
}, {
|
|
35
|
+
of: string | [number, number] | import('..').PolarPosition;
|
|
36
|
+
offset: [number, number];
|
|
28
37
|
}>]>;
|
|
29
38
|
/** 路径端点:直接坐标 [x, y]、极坐标、节点 id 字符串、相对偏移对象 */
|
|
30
39
|
export type IRTarget = z.infer<typeof TargetSchema>;
|
|
31
40
|
/** 相对前一 step 终点的偏移;不更新 prevEnd(TikZ `(+x, +y)`) */
|
|
32
|
-
export type
|
|
41
|
+
export type IRRelativeTarget = z.infer<typeof RelativeTargetSchema>;
|
|
33
42
|
/** 累积相对偏移;更新 prevEnd(TikZ `(++x, ++y)`) */
|
|
34
|
-
export type
|
|
43
|
+
export type IRRelativeAccumulateTarget = z.infer<typeof RelativeAccumulateTargetSchema>;
|
|
35
44
|
//# sourceMappingURL=target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;EAQ9B,CAAC;AAEJ,eAAO,MAAM,8BAA8B;;;;;;EAQxC,CAAC;AAEJ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;IAWtB,CAAC;AAEJ,4CAA4C;AAC5C,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAEpD,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEpE,2CAA2C;AAC3C,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { PositionSchema } from "../position/position.js";
|
|
2
2
|
import { PolarPositionSchema } from "../position/polar-position.js";
|
|
3
|
+
import { OffsetPositionSchema } from "../position/offset-position.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region src/ir/path/target.ts
|
|
5
|
-
var
|
|
6
|
-
var
|
|
6
|
+
var RelativeTargetSchema = z.object({ relative: z.tuple([z.number(), z.number()]).describe("Relative offset (dx, dy)") }).describe("Relative offset from the previous step end point (does NOT update the cursor position; matches TikZ `(+x, +y)` syntax)");
|
|
7
|
+
var RelativeAccumulateTargetSchema = z.object({ relativeAccumulate: z.tuple([z.number(), z.number()]).describe("Accumulated relative offset (dx, dy)") }).describe("Accumulated relative offset from the previous step end point (DOES update the cursor; matches TikZ `(++x, ++y)` syntax)");
|
|
7
8
|
var TargetSchema = z.union([
|
|
8
9
|
PositionSchema,
|
|
9
10
|
PolarPositionSchema,
|
|
10
11
|
z.string().min(1),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
RelativeTargetSchema,
|
|
13
|
+
RelativeAccumulateTargetSchema,
|
|
14
|
+
OffsetPositionSchema
|
|
15
|
+
]).describe("Path endpoint: Cartesian [x, y], polar position, node id reference, relative offset object ({ relative } / { relativeAccumulate }), or offset position ({ of, offset } mirroring TikZ `calc`) resolved at compile time");
|
|
14
16
|
//#endregion
|
|
15
|
-
export {
|
|
17
|
+
export { RelativeAccumulateTargetSchema, RelativeTargetSchema, TargetSchema };
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ValueOf } from '../../types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* - below: y 增大(视觉下方)
|
|
7
|
-
* - left: x 减小(视觉左方)
|
|
8
|
-
* - right: x 增大(视觉右方)
|
|
9
|
-
* - 4 对角:两轴各 1/√2 单位向量分量(对角距离与 distance 等长)
|
|
10
|
-
*
|
|
11
|
-
* 与 TikZ `positioning` library 的 `above of` / `right of` / `above right of` 对齐
|
|
12
|
-
* (TikZ y 向上、retikz y 向下,但 `above` 视觉语义在两边一致——视觉上方)。
|
|
4
|
+
* 节点相对方向 8 方向常量(视觉语义)
|
|
5
|
+
* @description above/below=y 减/增(视觉上/下);left/right=x 减/增;4 对角分量 1/√2 让对角距离与 distance 等长。与 TikZ positioning 的 `above of` 等对齐(TikZ y 向上 retikz y 向下,但视觉语义一致)
|
|
13
6
|
*/
|
|
14
7
|
export declare const AT_DIRECTIONS: {
|
|
15
8
|
readonly above: "above";
|
|
@@ -21,7 +14,7 @@ export declare const AT_DIRECTIONS: {
|
|
|
21
14
|
readonly 'below-left': "below-left";
|
|
22
15
|
readonly 'below-right': "below-right";
|
|
23
16
|
};
|
|
24
|
-
/** at
|
|
17
|
+
/** at 方向字面量类型 */
|
|
25
18
|
export type AtDirection = ValueOf<typeof AT_DIRECTIONS>;
|
|
26
19
|
export declare const AtPositionSchema: z.ZodObject<{
|
|
27
20
|
direction: z.ZodNativeEnum<{
|
|
@@ -45,6 +38,6 @@ export declare const AtPositionSchema: z.ZodObject<{
|
|
|
45
38
|
of: string;
|
|
46
39
|
distance?: number | undefined;
|
|
47
40
|
}>;
|
|
48
|
-
/**
|
|
41
|
+
/** 相对定位 IR 类型 `{ direction, of, distance? }`,与 IRPosition/PolarPosition union 平级 */
|
|
49
42
|
export type IRAtPosition = z.infer<typeof AtPositionSchema>;
|
|
50
43
|
//# sourceMappingURL=at-position.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"at-position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/at-position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"at-position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/at-position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;CAShB,CAAC;AAEX,iBAAiB;AACjB,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,aAAa,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAuB1B,CAAC;AAEJ,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/ir/position/at-position.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* - below: y 增大(视觉下方)
|
|
7
|
-
* - left: x 减小(视觉左方)
|
|
8
|
-
* - right: x 增大(视觉右方)
|
|
9
|
-
* - 4 对角:两轴各 1/√2 单位向量分量(对角距离与 distance 等长)
|
|
10
|
-
*
|
|
11
|
-
* 与 TikZ `positioning` library 的 `above of` / `right of` / `above right of` 对齐
|
|
12
|
-
* (TikZ y 向上、retikz y 向下,但 `above` 视觉语义在两边一致——视觉上方)。
|
|
4
|
+
* 节点相对方向 8 方向常量(视觉语义)
|
|
5
|
+
* @description above/below=y 减/增(视觉上/下);left/right=x 减/增;4 对角分量 1/√2 让对角距离与 distance 等长。与 TikZ positioning 的 `above of` 等对齐(TikZ y 向上 retikz y 向下,但视觉语义一致)
|
|
13
6
|
*/
|
|
14
7
|
var AT_DIRECTIONS = {
|
|
15
8
|
above: "above",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OffsetPositionSchema: z.ZodObject<{
|
|
3
|
+
of: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./polar-position').PolarPosition, z.ZodTypeDef, import('./polar-position').PolarPosition>]>;
|
|
4
|
+
offset: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
of: string | [number, number] | import('./polar-position').PolarPosition;
|
|
7
|
+
offset: [number, number];
|
|
8
|
+
}, {
|
|
9
|
+
of: string | [number, number] | import('./polar-position').PolarPosition;
|
|
10
|
+
offset: [number, number];
|
|
11
|
+
}>;
|
|
12
|
+
/** 偏移定位 IR 类型 `{ of, offset }`,与 IRPosition/PolarPosition/IRAtPosition union 平级 */
|
|
13
|
+
export type IROffsetPosition = z.infer<typeof OffsetPositionSchema>;
|
|
14
|
+
//# sourceMappingURL=offset-position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offset-position.d.ts","sourceRoot":"","sources":["../../../../src/ir/position/offset-position.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;EAa9B,CAAC;AAEJ,mFAAmF;AACnF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PositionSchema } from "./position.js";
|
|
2
|
+
import { PolarPositionSchema } from "./polar-position.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/ir/position/offset-position.ts
|
|
5
|
+
var OffsetPositionSchema = z.object({
|
|
6
|
+
of: z.union([
|
|
7
|
+
z.string().min(1),
|
|
8
|
+
PositionSchema,
|
|
9
|
+
PolarPositionSchema
|
|
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: z.tuple([z.number().finite(), z.number().finite()]).describe("Offset (dx, dy) from the reference point in user units; rejects NaN / ±Infinity")
|
|
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
|
+
//#endregion
|
|
14
|
+
export { OffsetPositionSchema };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { PolarPosition } from '../../geometry/polar';
|
|
3
|
-
/**
|
|
4
|
-
* 极坐标点 schema(递归——origin 可嵌套)。
|
|
5
|
-
* 用 z.lazy 处理自引用;TS 类型从 geometry/polar 导入并 cast 到 schema。
|
|
6
|
-
*/
|
|
3
|
+
/** 极坐标点 schema(递归 origin 可嵌套);z.lazy 处理自引用,TS 类型从 geometry/polar 导入 */
|
|
7
4
|
export declare const PolarPositionSchema: z.ZodType<PolarPosition>;
|
|
8
5
|
export type { PolarPosition } from '../../geometry/polar';
|
|
9
6
|
//# sourceMappingURL=polar-position.d.ts.map
|
|
@@ -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
|
|
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,18 +1,15 @@
|
|
|
1
1
|
import { PositionSchema } from "./position.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/ir/position/polar-position.ts
|
|
4
|
-
/**
|
|
5
|
-
* 极坐标点 schema(递归——origin 可嵌套)。
|
|
6
|
-
* 用 z.lazy 处理自引用;TS 类型从 geometry/polar 导入并 cast 到 schema。
|
|
7
|
-
*/
|
|
4
|
+
/** 极坐标点 schema(递归 origin 可嵌套);z.lazy 处理自引用,TS 类型从 geometry/polar 导入 */
|
|
8
5
|
var PolarPositionSchema = z.lazy(() => z.object({
|
|
9
6
|
origin: z.union([
|
|
10
7
|
z.string().min(1),
|
|
11
8
|
PositionSchema,
|
|
12
9
|
PolarPositionSchema
|
|
13
10
|
]).optional().describe("Origin reference: node id string, Cartesian [x, y], or nested PolarPosition (chained); defaults to [0, 0] when omitted"),
|
|
14
|
-
angle: z.number().describe("Angle in degrees,
|
|
15
|
-
radius: z.number().describe("Radius / distance in user units")
|
|
11
|
+
angle: 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: z.number().finite().describe("Radius / distance in user units")
|
|
16
13
|
}).describe("Polar coordinate position; resolved to Cartesian at Scene compile time"));
|
|
17
14
|
//#endregion
|
|
18
15
|
export { PolarPositionSchema };
|
|
@@ -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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/ir/position/position.ts
|
|
3
|
-
var PositionSchema = z.tuple([z.number(), z.number()]).describe("Cartesian position [x, y]");
|
|
3
|
+
var PositionSchema = z.tuple([z.number().finite(), z.number().finite()]).describe("Cartesian position [x, y]; rejects NaN / ±Infinity to keep IR JSON-serializable round-trip stable");
|
|
4
4
|
//#endregion
|
|
5
5
|
export { PositionSchema };
|