@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
package/dist/es/ir/node.js
CHANGED
|
@@ -2,6 +2,8 @@ import { PositionSchema } from "./position/position.js";
|
|
|
2
2
|
import { PolarPositionSchema } from "./position/polar-position.js";
|
|
3
3
|
import { AT_DIRECTIONS, AtPositionSchema } from "./position/at-position.js";
|
|
4
4
|
import { OffsetPositionSchema } from "./position/offset-position.js";
|
|
5
|
+
import { FontSchema } from "./font.js";
|
|
6
|
+
import { TextBlockSchema } from "./text.js";
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
//#region src/ir/node.ts
|
|
7
9
|
/**
|
|
@@ -14,32 +16,6 @@ var NODE_SHAPES = {
|
|
|
14
16
|
ellipse: "ellipse",
|
|
15
17
|
diamond: "diamond"
|
|
16
18
|
};
|
|
17
|
-
/** 节点字体规格:family/size/weight/style 全部可选,透传 SVG `<text>` font-* 属性 */
|
|
18
|
-
var FontSchema = z.object({
|
|
19
|
-
family: z.string().optional().describe("CSS font-family string, e.g. \"serif\", \"monospace\", \"Inter, sans-serif\""),
|
|
20
|
-
size: z.number().positive().optional().describe("Font size in user units; falls back to the renderer default when omitted"),
|
|
21
|
-
weight: z.union([z.enum(["normal", "bold"]), z.number()]).optional().describe("CSS font-weight: keyword `normal` / `bold` or numeric 100..900"),
|
|
22
|
-
style: z.enum([
|
|
23
|
-
"normal",
|
|
24
|
-
"italic",
|
|
25
|
-
"oblique"
|
|
26
|
-
]).optional().describe("CSS font-style")
|
|
27
|
-
}).describe("Font properties for the node text label; all fields optional, nested object form.");
|
|
28
|
-
/**
|
|
29
|
-
* 单行文本规格:纯字符串走块级默认,对象形式可覆盖 fill/opacity/font
|
|
30
|
-
* @description 行级覆盖只生效于本行 `<tspan>`;font 子字段未填则继承块级;align/lineHeight 不可被行覆盖
|
|
31
|
-
*/
|
|
32
|
-
var LineSpecSchema = z.union([z.string(), z.object({
|
|
33
|
-
text: z.string().describe("Line content"),
|
|
34
|
-
fill: z.string().optional().describe("Per-line text color; overrides block default"),
|
|
35
|
-
opacity: z.number().min(0).max(1).optional().describe("Per-line opacity 0..1"),
|
|
36
|
-
font: FontSchema.optional().describe("Per-line font overrides; missing fields inherit from block-level `font`")
|
|
37
|
-
})]).describe("Single line of text: bare string for default styling, or an object with per-line `fill` / `opacity` / `font` overrides.");
|
|
38
|
-
/**
|
|
39
|
-
* 节点文本:单字符串或非空多行 LineSpec 数组
|
|
40
|
-
* @description 选数组而非 `\n` 字符串:JSON 友好无 escape,行级覆盖天然落字段
|
|
41
|
-
*/
|
|
42
|
-
var NodeTextSchema = z.union([z.string(), z.array(LineSpecSchema).min(1)]).describe("Text label rendered inside the node: a single string for one line, or a non-empty array of line specs (string for default, object for per-line overrides).");
|
|
43
19
|
/** 节点文本对齐(TikZ `align=` 同义) */
|
|
44
20
|
var NODE_TEXT_ALIGNS = {
|
|
45
21
|
left: "left",
|
|
@@ -69,7 +45,7 @@ var NodeSchema = z.object({
|
|
|
69
45
|
OffsetPositionSchema
|
|
70
46
|
]).describe("Center point of the node content box; Cartesian [x, y], polar, relative-to-another-node (`at`-style with `direction` / `of` / `distance?`), or offset from a base point (`{ of, offset }` form mirroring TikZ `calc`). All non-Cartesian forms resolve at compile time."),
|
|
71
47
|
rotate: z.number().optional().describe("Rotation in degrees around the node center; positive = clockwise (matches TikZ rotate=...)"),
|
|
72
|
-
text:
|
|
48
|
+
text: TextBlockSchema.optional(),
|
|
73
49
|
align: z.nativeEnum(NODE_TEXT_ALIGNS).optional().describe("Multi-line text alignment within the text block; `left` / `center` / `right`. Defaults to `center` (matches TikZ)."),
|
|
74
50
|
lineHeight: z.number().positive().optional().describe("Line height in user units; falls back to `font.size × 1.2` when omitted."),
|
|
75
51
|
fill: z.string().optional().describe("Background color of the node shape; any CSS color (e.g. \"lightblue\", \"#fafafa\", \"rgba(...)\")"),
|
|
@@ -79,8 +55,8 @@ var NodeSchema = z.object({
|
|
|
79
55
|
strokeWidth: z.number().optional().describe("Border width in user units; defaults to 1 when omitted"),
|
|
80
56
|
dashed: z.boolean().optional().describe("Border style preset: dashed line (TikZ `dashed`); compiled to a default dash pattern. `dashArray` takes precedence."),
|
|
81
57
|
dotted: z.boolean().optional().describe("Border style preset: dotted line (TikZ `dotted`); compiled to a default dot pattern. `dashArray` and `dashed` take precedence."),
|
|
82
|
-
dashArray: z.string().optional().describe("Explicit
|
|
83
|
-
roundedCorners: z.number().nonnegative().optional().describe("Corner radius in user units; only effective on `rectangle` shape
|
|
58
|
+
dashArray: z.string().optional().describe("Explicit stroke dash pattern (e.g. \"4 2\"; same format as SVG/CSS `stroke-dasharray`); overrides `dashed` / `dotted`."),
|
|
59
|
+
roundedCorners: z.number().nonnegative().optional().describe("Corner radius in user units; only effective on `rectangle` shape."),
|
|
84
60
|
minimumWidth: z.number().nonnegative().optional().describe("Minimum visual border width in user units; floors the bounding box width."),
|
|
85
61
|
minimumHeight: z.number().nonnegative().optional().describe("Minimum visual border height in user units; floors the bounding box height."),
|
|
86
62
|
minimumSize: z.number().nonnegative().optional().describe("Symmetric alias for `minimumWidth` + `minimumHeight`; axis-specific fields take precedence."),
|
|
@@ -98,4 +74,4 @@ var NodeSchema = z.object({
|
|
|
98
74
|
label: z.union([NodeLabelSchema, z.array(NodeLabelSchema)]).optional().describe("Extra label(s) attached around the node border (TikZ `[label=above:foo]`); single object or array form. Compiled into one TextPrim per label, positioned by `position` direction / angle and `distance`.")
|
|
99
75
|
}).describe("Node primitive: a positioned, optionally textual shape (rectangle / circle / ellipse / diamond)");
|
|
100
76
|
//#endregion
|
|
101
|
-
export {
|
|
77
|
+
export { NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema };
|
|
@@ -48,20 +48,20 @@ export declare const ArrowEndDetailSchema: z.ZodObject<{
|
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
49
|
length?: number | undefined;
|
|
50
50
|
fill?: string | undefined;
|
|
51
|
+
opacity?: number | undefined;
|
|
51
52
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
52
53
|
scale?: number | undefined;
|
|
53
54
|
width?: number | undefined;
|
|
54
55
|
color?: string | undefined;
|
|
55
|
-
opacity?: number | undefined;
|
|
56
56
|
lineWidth?: number | undefined;
|
|
57
57
|
}, {
|
|
58
58
|
length?: number | undefined;
|
|
59
59
|
fill?: string | undefined;
|
|
60
|
+
opacity?: number | undefined;
|
|
60
61
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
61
62
|
scale?: number | undefined;
|
|
62
63
|
width?: number | undefined;
|
|
63
64
|
color?: string | undefined;
|
|
64
|
-
opacity?: number | undefined;
|
|
65
65
|
lineWidth?: number | undefined;
|
|
66
66
|
}>;
|
|
67
67
|
/**
|
|
@@ -106,20 +106,20 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
106
106
|
}, "strip", z.ZodTypeAny, {
|
|
107
107
|
length?: number | undefined;
|
|
108
108
|
fill?: string | undefined;
|
|
109
|
+
opacity?: number | undefined;
|
|
109
110
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
110
111
|
scale?: number | undefined;
|
|
111
112
|
width?: number | undefined;
|
|
112
113
|
color?: string | undefined;
|
|
113
|
-
opacity?: number | undefined;
|
|
114
114
|
lineWidth?: number | undefined;
|
|
115
115
|
}, {
|
|
116
116
|
length?: number | undefined;
|
|
117
117
|
fill?: string | undefined;
|
|
118
|
+
opacity?: number | undefined;
|
|
118
119
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
119
120
|
scale?: number | undefined;
|
|
120
121
|
width?: number | undefined;
|
|
121
122
|
color?: string | undefined;
|
|
122
|
-
opacity?: number | undefined;
|
|
123
123
|
lineWidth?: number | undefined;
|
|
124
124
|
}>>;
|
|
125
125
|
end: z.ZodOptional<z.ZodObject<{
|
|
@@ -142,78 +142,78 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
142
142
|
}, "strip", z.ZodTypeAny, {
|
|
143
143
|
length?: number | undefined;
|
|
144
144
|
fill?: string | undefined;
|
|
145
|
+
opacity?: number | undefined;
|
|
145
146
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
146
147
|
scale?: number | undefined;
|
|
147
148
|
width?: number | undefined;
|
|
148
149
|
color?: string | undefined;
|
|
149
|
-
opacity?: number | undefined;
|
|
150
150
|
lineWidth?: number | undefined;
|
|
151
151
|
}, {
|
|
152
152
|
length?: number | undefined;
|
|
153
153
|
fill?: string | undefined;
|
|
154
|
+
opacity?: number | undefined;
|
|
154
155
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
155
156
|
scale?: number | undefined;
|
|
156
157
|
width?: number | undefined;
|
|
157
158
|
color?: string | undefined;
|
|
158
|
-
opacity?: number | undefined;
|
|
159
159
|
lineWidth?: number | undefined;
|
|
160
160
|
}>>;
|
|
161
161
|
}, "strip", z.ZodTypeAny, {
|
|
162
162
|
length?: number | undefined;
|
|
163
163
|
fill?: string | undefined;
|
|
164
|
+
opacity?: number | undefined;
|
|
164
165
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
165
166
|
scale?: number | undefined;
|
|
166
167
|
width?: number | undefined;
|
|
167
168
|
color?: string | undefined;
|
|
168
|
-
opacity?: number | undefined;
|
|
169
169
|
lineWidth?: number | undefined;
|
|
170
170
|
start?: {
|
|
171
171
|
length?: number | undefined;
|
|
172
172
|
fill?: string | undefined;
|
|
173
|
+
opacity?: number | undefined;
|
|
173
174
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
174
175
|
scale?: number | undefined;
|
|
175
176
|
width?: number | undefined;
|
|
176
177
|
color?: string | undefined;
|
|
177
|
-
opacity?: number | undefined;
|
|
178
178
|
lineWidth?: number | undefined;
|
|
179
179
|
} | undefined;
|
|
180
180
|
end?: {
|
|
181
181
|
length?: number | undefined;
|
|
182
182
|
fill?: string | undefined;
|
|
183
|
+
opacity?: number | undefined;
|
|
183
184
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
184
185
|
scale?: number | undefined;
|
|
185
186
|
width?: number | undefined;
|
|
186
187
|
color?: string | undefined;
|
|
187
|
-
opacity?: number | undefined;
|
|
188
188
|
lineWidth?: number | undefined;
|
|
189
189
|
} | undefined;
|
|
190
190
|
}, {
|
|
191
191
|
length?: number | undefined;
|
|
192
192
|
fill?: string | undefined;
|
|
193
|
+
opacity?: number | undefined;
|
|
193
194
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
194
195
|
scale?: number | undefined;
|
|
195
196
|
width?: number | undefined;
|
|
196
197
|
color?: string | undefined;
|
|
197
|
-
opacity?: number | undefined;
|
|
198
198
|
lineWidth?: number | undefined;
|
|
199
199
|
start?: {
|
|
200
200
|
length?: number | undefined;
|
|
201
201
|
fill?: string | undefined;
|
|
202
|
+
opacity?: number | undefined;
|
|
202
203
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
203
204
|
scale?: number | undefined;
|
|
204
205
|
width?: number | undefined;
|
|
205
206
|
color?: string | undefined;
|
|
206
|
-
opacity?: number | undefined;
|
|
207
207
|
lineWidth?: number | undefined;
|
|
208
208
|
} | undefined;
|
|
209
209
|
end?: {
|
|
210
210
|
length?: number | undefined;
|
|
211
211
|
fill?: string | undefined;
|
|
212
|
+
opacity?: number | undefined;
|
|
212
213
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
213
214
|
scale?: number | undefined;
|
|
214
215
|
width?: number | undefined;
|
|
215
216
|
color?: string | undefined;
|
|
216
|
-
opacity?: number | undefined;
|
|
217
217
|
lineWidth?: number | undefined;
|
|
218
218
|
} | undefined;
|
|
219
219
|
}>;
|
|
@@ -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;
|
package/dist/es/ir/path/path.js
CHANGED
|
@@ -6,7 +6,7 @@ var PathSchema = z.object({
|
|
|
6
6
|
type: z.literal("path").describe("Discriminator marking this child as a path"),
|
|
7
7
|
stroke: z.string().optional().describe("Stroke color of the path; any CSS color. Defaults to currentColor when omitted"),
|
|
8
8
|
strokeWidth: z.number().optional().describe("Stroke width in user units; defaults to 1 when omitted"),
|
|
9
|
-
strokeDasharray: z.string().optional().describe("
|
|
9
|
+
strokeDasharray: z.string().optional().describe("Stroke dash pattern (e.g. \"4 2\"; same format as SVG/CSS `stroke-dasharray`); leave empty for solid line"),
|
|
10
10
|
arrow: z.enum([
|
|
11
11
|
"none",
|
|
12
12
|
"->",
|
|
@@ -15,17 +15,17 @@ var PathSchema = z.object({
|
|
|
15
15
|
]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
|
|
16
16
|
arrowDetail: ArrowDetailSchema.optional().describe("Detailed arrow visual config (shape / scale / length / width / color / fill / opacity / lineWidth) with optional `start` / `end` per-end overrides. Omitted = built-in defaults (shape `normal`, all visuals inherit from path stroke / opacity)."),
|
|
17
17
|
fill: z.string().optional().describe("Fill color of the closed region; any CSS color. Omitted = no fill (stroke only). Pairs with `cycle` step for filled shapes."),
|
|
18
|
-
fillRule: z.enum(["nonzero", "evenodd"]).optional().describe("How self-intersecting / nested sub-paths are filled. `nonzero` (default
|
|
18
|
+
fillRule: z.enum(["nonzero", "evenodd"]).optional().describe("How self-intersecting / nested sub-paths are filled. `nonzero` (default) winds-by-direction; `evenodd` toggles fill on each crossing — useful for ring / donut shapes."),
|
|
19
19
|
lineCap: z.enum([
|
|
20
20
|
"butt",
|
|
21
21
|
"round",
|
|
22
22
|
"square"
|
|
23
|
-
]).optional().describe("Stroke endpoint shape (SVG `stroke-linecap`). Default `butt` (sharp end); `round` adds a half-disc cap; `square` extends a half-stroke past the endpoint."),
|
|
23
|
+
]).optional().describe("Stroke endpoint shape (`butt` / `round` / `square`; same semantics as SVG/CSS `stroke-linecap`). Default `butt` (sharp end); `round` adds a half-disc cap; `square` extends a half-stroke past the endpoint."),
|
|
24
24
|
lineJoin: z.enum([
|
|
25
25
|
"miter",
|
|
26
26
|
"round",
|
|
27
27
|
"bevel"
|
|
28
|
-
]).optional().describe("Stroke corner shape (SVG `stroke-linejoin`). Default `miter` (sharp corner); `round` rounds the join; `bevel` cuts the corner flat."),
|
|
28
|
+
]).optional().describe("Stroke corner shape (`miter` / `round` / `bevel`; same semantics as SVG/CSS `stroke-linejoin`). Default `miter` (sharp corner); `round` rounds the join; `bevel` cuts the corner flat."),
|
|
29
29
|
thickness: z.enum([
|
|
30
30
|
"ultraThin",
|
|
31
31
|
"veryThin",
|
|
@@ -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":[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AAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,4BAA4B;AAC5B,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,oCAAoC;AACpC,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,gCAAgC;AAChC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,kCAAkC;AAClC,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/es/ir/path/step.js
CHANGED
|
@@ -27,12 +27,12 @@ var StepLabelSchema = 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 = z.object({
|
|
29
29
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
30
|
-
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)"),
|
|
31
31
|
to: TargetSchema.describe("Destination point of the move")
|
|
32
32
|
}).describe("Move action: relocate the path cursor without drawing");
|
|
33
33
|
var LineStepSchema = z.object({
|
|
34
34
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
35
|
-
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)`)"),
|
|
36
36
|
to: 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 = z.object({
|
|
|
45
45
|
}).describe("Fold action: TikZ-style right-angle fold with a single intermediate point chosen by `via`");
|
|
46
46
|
var CycleStepSchema = z.object({
|
|
47
47
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
48
|
-
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`)")
|
|
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 = z.object({
|
|
|
54
54
|
var ControlPointSchema = PositionSchema.describe("Bezier control point. Currently Cartesian [x, y]; reserved for node ref / polar in future versions.");
|
|
55
55
|
var CurveStepSchema = z.object({
|
|
56
56
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
57
|
-
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) ..`)"),
|
|
58
58
|
to: 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 = z.object({
|
|
63
63
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
64
|
-
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) ..`)"),
|
|
65
65
|
to: 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 = z.object({
|
|
|
78
78
|
var ArcStepSchema = z.object({
|
|
79
79
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
80
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"),
|
|
81
|
-
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."),
|
|
82
82
|
endAngle: z.number().describe("Arc end angle in degrees; sweep direction inferred from startAngle vs endAngle"),
|
|
83
83
|
radius: 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 = z.object({
|
|
87
87
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
88
|
-
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."),
|
|
89
89
|
radius: 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 = z.object({
|
|
93
93
|
type: z.literal("step").describe("Discriminator marking this as a path step node"),
|
|
94
|
-
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."),
|
|
95
95
|
radiusX: z.number().positive().describe("Ellipse x-axis radius (semi-major or semi-minor on x)"),
|
|
96
96
|
radiusY: 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")
|
|
@@ -8,7 +8,7 @@ var OffsetPositionSchema = z.object({
|
|
|
8
8
|
PositionSchema,
|
|
9
9
|
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: z.tuple([z.number(), z.number()]).describe("Offset (dx, dy) from the reference point in user units")
|
|
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
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
|
export { OffsetPositionSchema };
|
|
@@ -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"}
|
|
@@ -8,8 +8,8 @@ var PolarPositionSchema = z.lazy(() => z.object({
|
|
|
8
8
|
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: z.number().describe("Angle in degrees,
|
|
12
|
-
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")
|
|
13
13
|
}).describe("Polar coordinate position; resolved to Cartesian at Scene compile time"));
|
|
14
14
|
//#endregion
|
|
15
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 };
|