@retikz/core 0.2.0-alpha.4 → 0.2.0-alpha.6
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/anchor-cache.d.ts +10 -0
- package/dist/es/compile/anchor-cache.d.ts.map +1 -1
- package/dist/es/compile/anchor-cache.js +25 -1
- package/dist/es/compile/index.d.ts +0 -1
- package/dist/es/compile/index.d.ts.map +1 -1
- package/dist/es/compile/path/anchor.d.ts.map +1 -1
- package/dist/es/compile/path/anchor.js +17 -18
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +98 -13
- package/dist/es/compile/path/relative.d.ts.map +1 -1
- package/dist/es/compile/path/relative.js +5 -1
- package/dist/es/geometry/_edge.d.ts +29 -0
- package/dist/es/geometry/_edge.d.ts.map +1 -0
- package/dist/es/geometry/_edge.js +35 -0
- package/dist/es/geometry/arc.d.ts +11 -0
- package/dist/es/geometry/arc.d.ts.map +1 -1
- package/dist/es/geometry/arc.js +27 -1
- package/dist/es/geometry/circle.d.ts +3 -0
- package/dist/es/geometry/circle.d.ts.map +1 -1
- package/dist/es/geometry/circle.js +7 -0
- package/dist/es/geometry/diamond.d.ts +3 -0
- package/dist/es/geometry/diamond.d.ts.map +1 -1
- package/dist/es/geometry/diamond.js +29 -0
- package/dist/es/geometry/ellipse.d.ts +3 -0
- package/dist/es/geometry/ellipse.d.ts.map +1 -1
- package/dist/es/geometry/ellipse.js +7 -0
- package/dist/es/geometry/rect.d.ts +26 -0
- package/dist/es/geometry/rect.d.ts.map +1 -1
- package/dist/es/geometry/rect.js +90 -1
- package/dist/es/geometry/segment.d.ts +2 -0
- package/dist/es/geometry/segment.d.ts.map +1 -1
- package/dist/es/geometry/segment.js +12 -1
- package/dist/es/index.d.ts +3 -3
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +6 -5
- package/dist/es/ir/coordinate.d.ts +2 -2
- package/dist/es/ir/node.d.ts +4 -4
- package/dist/es/ir/path/path.d.ts +828 -111
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/step.d.ts +1209 -168
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +36 -11
- package/dist/es/ir/path/target.d.ts +71 -1
- package/dist/es/ir/path/target.d.ts.map +1 -1
- package/dist/es/ir/path/target.js +24 -3
- package/dist/es/ir/scope.d.ts +1228 -190
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/parsers/index.d.ts +1 -0
- package/dist/es/parsers/index.d.ts.map +1 -1
- package/dist/es/parsers/parseNodeTarget.d.ts +4 -0
- package/dist/es/parsers/parseNodeTarget.d.ts.map +1 -0
- package/dist/es/parsers/parseNodeTarget.js +33 -0
- package/dist/es/parsers/parseTargetSugar.d.ts +4 -2
- package/dist/es/parsers/parseTargetSugar.d.ts.map +1 -1
- package/dist/es/parsers/parseTargetSugar.js +6 -3
- package/dist/es/parsers/parseWay.d.ts +1 -1
- package/dist/es/parsers/parseWay.d.ts.map +1 -1
- package/dist/es/shapes/circle.d.ts.map +1 -1
- package/dist/es/shapes/circle.js +1 -0
- package/dist/es/shapes/diamond.d.ts.map +1 -1
- package/dist/es/shapes/diamond.js +1 -0
- package/dist/es/shapes/ellipse.d.ts.map +1 -1
- package/dist/es/shapes/ellipse.js +1 -0
- package/dist/es/shapes/rectangle.d.ts.map +1 -1
- package/dist/es/shapes/rectangle.js +1 -0
- package/dist/es/shapes/types.d.ts +6 -0
- package/dist/es/shapes/types.d.ts.map +1 -1
- package/dist/lib/compile/anchor-cache.cjs +25 -0
- package/dist/lib/compile/anchor-cache.d.ts +10 -0
- package/dist/lib/compile/anchor-cache.d.ts.map +1 -1
- package/dist/lib/compile/index.d.ts +0 -1
- package/dist/lib/compile/index.d.ts.map +1 -1
- package/dist/lib/compile/path/anchor.cjs +16 -17
- package/dist/lib/compile/path/anchor.d.ts.map +1 -1
- package/dist/lib/compile/path/index.cjs +96 -11
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/compile/path/relative.cjs +5 -1
- package/dist/lib/compile/path/relative.d.ts.map +1 -1
- package/dist/lib/geometry/_edge.cjs +38 -0
- package/dist/lib/geometry/_edge.d.ts +29 -0
- package/dist/lib/geometry/_edge.d.ts.map +1 -0
- package/dist/lib/geometry/arc.cjs +28 -0
- package/dist/lib/geometry/arc.d.ts +11 -0
- package/dist/lib/geometry/arc.d.ts.map +1 -1
- package/dist/lib/geometry/circle.cjs +7 -0
- package/dist/lib/geometry/circle.d.ts +3 -0
- package/dist/lib/geometry/circle.d.ts.map +1 -1
- package/dist/lib/geometry/diamond.cjs +29 -0
- package/dist/lib/geometry/diamond.d.ts +3 -0
- package/dist/lib/geometry/diamond.d.ts.map +1 -1
- package/dist/lib/geometry/ellipse.cjs +7 -0
- package/dist/lib/geometry/ellipse.d.ts +3 -0
- package/dist/lib/geometry/ellipse.d.ts.map +1 -1
- package/dist/lib/geometry/rect.cjs +90 -0
- package/dist/lib/geometry/rect.d.ts +26 -0
- package/dist/lib/geometry/rect.d.ts.map +1 -1
- package/dist/lib/geometry/segment.cjs +12 -0
- package/dist/lib/geometry/segment.d.ts +2 -0
- package/dist/lib/geometry/segment.d.ts.map +1 -1
- package/dist/lib/index.cjs +7 -2
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/coordinate.d.ts +2 -2
- package/dist/lib/ir/node.d.ts +4 -4
- package/dist/lib/ir/path/path.d.ts +828 -111
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +36 -10
- package/dist/lib/ir/path/step.d.ts +1209 -168
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/path/target.cjs +25 -2
- package/dist/lib/ir/path/target.d.ts +71 -1
- package/dist/lib/ir/path/target.d.ts.map +1 -1
- package/dist/lib/ir/scope.d.ts +1228 -190
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/parsers/index.d.ts +1 -0
- package/dist/lib/parsers/index.d.ts.map +1 -1
- package/dist/lib/parsers/parseNodeTarget.cjs +33 -0
- package/dist/lib/parsers/parseNodeTarget.d.ts +4 -0
- package/dist/lib/parsers/parseNodeTarget.d.ts.map +1 -0
- package/dist/lib/parsers/parseTargetSugar.cjs +6 -3
- package/dist/lib/parsers/parseTargetSugar.d.ts +4 -2
- package/dist/lib/parsers/parseTargetSugar.d.ts.map +1 -1
- package/dist/lib/parsers/parseWay.d.ts +1 -1
- package/dist/lib/parsers/parseWay.d.ts.map +1 -1
- package/dist/lib/shapes/circle.cjs +1 -0
- package/dist/lib/shapes/circle.d.ts.map +1 -1
- package/dist/lib/shapes/diamond.cjs +1 -0
- package/dist/lib/shapes/diamond.d.ts.map +1 -1
- package/dist/lib/shapes/ellipse.cjs +1 -0
- package/dist/lib/shapes/ellipse.d.ts.map +1 -1
- package/dist/lib/shapes/rectangle.cjs +1 -0
- package/dist/lib/shapes/rectangle.d.ts.map +1 -1
- package/dist/lib/shapes/types.d.ts +6 -0
- package/dist/lib/shapes/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/es/compile/parseTarget.d.ts +0 -20
- package/dist/es/compile/parseTarget.d.ts.map +0 -1
- package/dist/es/compile/parseTarget.js +0 -36
- package/dist/lib/compile/parseTarget.cjs +0 -36
- package/dist/lib/compile/parseTarget.d.ts +0 -20
- package/dist/lib/compile/parseTarget.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,U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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgHpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -81,25 +81,49 @@ var BendStepSchema = zod.z.object({
|
|
|
81
81
|
}).describe("Bend action: shorthand for an arc-like cubic; control points computed at compile time");
|
|
82
82
|
var ArcStepSchema = zod.z.object({
|
|
83
83
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
84
|
-
kind: zod.z.literal("arc").describe("Arc segment
|
|
84
|
+
kind: zod.z.literal("arc").describe("Arc segment sweeping startAngle → endAngle around a center. Circular (radius) or elliptical (radiusX/radiusY). Center defaults to the cursor but can be set explicitly. Pen ends at the arc endpoint, not the center (TikZ `arc[start angle=…, end angle=…, radius=…]`)."),
|
|
85
85
|
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."),
|
|
86
86
|
endAngle: zod.z.number().describe("Arc end angle in degrees; sweep direction inferred from startAngle vs endAngle"),
|
|
87
|
-
radius: zod.z.number().positive().describe("
|
|
87
|
+
radius: zod.z.number().positive().optional().describe("Circular arc radius in user units. Give EITHER radius (circular) OR both radiusX and radiusY (elliptical), never both — enforced by the sugar/compile layer, not schema."),
|
|
88
|
+
radiusX: zod.z.number().positive().optional().describe("Elliptical arc x-axis radius; requires radiusX and radiusY together (mutually exclusive with radius)."),
|
|
89
|
+
radiusY: zod.z.number().positive().optional().describe("Elliptical arc y-axis radius; requires radiusX and radiusY together (mutually exclusive with radius)."),
|
|
90
|
+
center: require_target.TargetSchema.optional().describe("Explicit arc center. Defaults to the cursor (previous step anchor) for backward compatibility; set it to anchor the arc independently of the cursor (used by <Sector> to draw a correct wedge)."),
|
|
88
91
|
label: StepLabelSchema.optional().describe("Edge label attached to this arc")
|
|
89
|
-
}).describe("Arc action:
|
|
92
|
+
}).describe("Arc action: circular (radius) or elliptical (radiusX/radiusY) arc around a center (cursor by default, or explicit). Pen is left at the arc endpoint.");
|
|
90
93
|
var CirclePathStepSchema = zod.z.object({
|
|
91
94
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
92
|
-
kind: zod.z.literal("circlePath").describe("
|
|
95
|
+
kind: zod.z.literal("circlePath").describe("Circle centered at the cursor. Without angles: a full circle (TikZ `circle[radius=…]`), pen returns to center. With startAngle + endAngle: a partial arc closed per `closed` (half circle / segment)."),
|
|
93
96
|
radius: zod.z.number().positive().describe("Circle radius in user units"),
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
startAngle: zod.z.number().optional().describe("Partial-circle start angle in degrees (same convention as arc: 0°=+x, 90°=+y screen-down). Give both startAngle and endAngle for a partial circle, or neither for a full circle (enforced by the sugar/compile layer, not schema)."),
|
|
98
|
+
endAngle: zod.z.number().optional().describe("Partial-circle end angle in degrees; sweep direction inferred from startAngle vs endAngle."),
|
|
99
|
+
closed: zod.z.enum([
|
|
100
|
+
"closed",
|
|
101
|
+
"chord",
|
|
102
|
+
"open"
|
|
103
|
+
]).optional().describe("Closing mode. 'closed' = full circle (only valid with no angles; the default then). With angles: 'chord' (straight chord between the two arc ends → half circle / segment; default) or 'open' (pure unclosed arc)."),
|
|
104
|
+
label: StepLabelSchema.optional().describe("Edge label attached to this circle")
|
|
105
|
+
}).describe("CirclePath action: full circle (no angles, pen returns to center) or partial arc (with angles, closed per chord/open).");
|
|
96
106
|
var EllipsePathStepSchema = zod.z.object({
|
|
97
107
|
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
98
|
-
kind: zod.z.literal("ellipsePath").describe("
|
|
108
|
+
kind: zod.z.literal("ellipsePath").describe("Ellipse centered at the cursor. Without angles: a full ellipse (TikZ `ellipse[x radius=…, y radius=…]`), pen returns to center. With startAngle + endAngle: a partial elliptical arc closed per `closed`."),
|
|
99
109
|
radiusX: zod.z.number().positive().describe("Ellipse x-axis radius (semi-major or semi-minor on x)"),
|
|
100
110
|
radiusY: zod.z.number().positive().describe("Ellipse y-axis radius (semi-major or semi-minor on y)"),
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
startAngle: zod.z.number().optional().describe("Partial-ellipse start angle in degrees (parametric, same convention as arc). Give both startAngle and endAngle for a partial ellipse, or neither for a full ellipse."),
|
|
112
|
+
endAngle: zod.z.number().optional().describe("Partial-ellipse end angle in degrees."),
|
|
113
|
+
closed: zod.z.enum([
|
|
114
|
+
"closed",
|
|
115
|
+
"chord",
|
|
116
|
+
"open"
|
|
117
|
+
]).optional().describe("Closing mode. 'closed' = full ellipse (only valid with no angles; default then). With angles: 'chord' (chord between arc ends; default) or 'open' (pure unclosed arc)."),
|
|
118
|
+
label: StepLabelSchema.optional().describe("Edge label attached to this ellipse")
|
|
119
|
+
}).describe("EllipsePath action: full ellipse (no angles, pen returns to center) or partial elliptical arc (with angles, closed per chord/open).");
|
|
120
|
+
var RectangleStepSchema = zod.z.object({
|
|
121
|
+
type: zod.z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
122
|
+
kind: zod.z.literal("rectangle").describe("Axis-aligned rectangle between two opposite corners (TikZ `(a) rectangle (b)`); compiled to path commands (4 lines + close, or rounded corners via quarter arcs). Self-contained: corners come from from/to, not the cursor."),
|
|
123
|
+
from: require_target.TargetSchema.describe("One corner of the rectangle"),
|
|
124
|
+
to: require_target.TargetSchema.describe("The opposite corner; order is irrelevant (compile normalizes to min/max)"),
|
|
125
|
+
roundedCorners: zod.z.number().nonnegative().optional().describe("Single corner radius applied to all four corners; omitted = sharp corners. Clamped to half the smaller side at compile time.")
|
|
126
|
+
}).describe("Rectangle action: closed axis-aligned rectangle (optionally rounded) drawn between two opposite corners.");
|
|
103
127
|
var StepSchema = zod.z.discriminatedUnion("kind", [
|
|
104
128
|
MoveStepSchema,
|
|
105
129
|
LineStepSchema,
|
|
@@ -110,7 +134,8 @@ var StepSchema = zod.z.discriminatedUnion("kind", [
|
|
|
110
134
|
BendStepSchema,
|
|
111
135
|
ArcStepSchema,
|
|
112
136
|
CirclePathStepSchema,
|
|
113
|
-
EllipsePathStepSchema
|
|
137
|
+
EllipsePathStepSchema,
|
|
138
|
+
RectangleStepSchema
|
|
114
139
|
]).describe("A single path action; the discriminator field is `kind`");
|
|
115
140
|
//#endregion
|
|
116
141
|
exports.ArcStepSchema = ArcStepSchema;
|
|
@@ -124,5 +149,6 @@ exports.EllipsePathStepSchema = EllipsePathStepSchema;
|
|
|
124
149
|
exports.FoldStepSchema = FoldStepSchema;
|
|
125
150
|
exports.LineStepSchema = LineStepSchema;
|
|
126
151
|
exports.MoveStepSchema = MoveStepSchema;
|
|
152
|
+
exports.RectangleStepSchema = RectangleStepSchema;
|
|
127
153
|
exports.StepLabelSchema = StepLabelSchema;
|
|
128
154
|
exports.StepSchema = StepSchema;
|