@retikz/core 0.1.0-alpha.0 → 0.1.0-alpha.2

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.
Files changed (121) hide show
  1. package/dist/es/compile/index.d.ts +1 -0
  2. package/dist/es/compile/index.d.ts.map +1 -1
  3. package/dist/es/compile/node.d.ts +73 -22
  4. package/dist/es/compile/node.d.ts.map +1 -1
  5. package/dist/es/compile/node.js +276 -52
  6. package/dist/es/compile/parseTarget.d.ts +25 -0
  7. package/dist/es/compile/parseTarget.d.ts.map +1 -0
  8. package/dist/es/compile/parseTarget.js +48 -0
  9. package/dist/es/compile/path.d.ts +17 -7
  10. package/dist/es/compile/path.d.ts.map +1 -1
  11. package/dist/es/compile/path.js +276 -33
  12. package/dist/es/compile/text-metrics.d.ts +2 -2
  13. package/dist/es/compile/text-metrics.d.ts.map +1 -1
  14. package/dist/es/geometry/circle.d.ts +32 -0
  15. package/dist/es/geometry/circle.d.ts.map +1 -0
  16. package/dist/es/geometry/circle.js +79 -0
  17. package/dist/es/geometry/diamond.d.ts +44 -0
  18. package/dist/es/geometry/diamond.d.ts.map +1 -0
  19. package/dist/es/geometry/diamond.js +87 -0
  20. package/dist/es/geometry/ellipse.d.ts +38 -0
  21. package/dist/es/geometry/ellipse.d.ts.map +1 -0
  22. package/dist/es/geometry/ellipse.js +86 -0
  23. package/dist/es/geometry/index.d.ts +3 -0
  24. package/dist/es/geometry/index.d.ts.map +1 -1
  25. package/dist/es/index.d.ts +9 -7
  26. package/dist/es/index.d.ts.map +1 -1
  27. package/dist/es/index.js +8 -4
  28. package/dist/es/ir/node.d.ts +319 -7
  29. package/dist/es/ir/node.d.ts.map +1 -1
  30. package/dist/es/ir/node.js +96 -8
  31. package/dist/es/ir/path/arrow.d.ts +26 -0
  32. package/dist/es/ir/path/arrow.d.ts.map +1 -0
  33. package/dist/es/ir/path/arrow.js +25 -0
  34. package/dist/es/ir/path/index.d.ts +1 -0
  35. package/dist/es/ir/path/index.d.ts.map +1 -1
  36. package/dist/es/ir/path/path.d.ts +60 -0
  37. package/dist/es/ir/path/path.d.ts.map +1 -1
  38. package/dist/es/ir/path/path.js +10 -0
  39. package/dist/es/ir/path/step.d.ts +56 -2
  40. package/dist/es/ir/path/step.d.ts.map +1 -1
  41. package/dist/es/ir/path/step.js +17 -2
  42. package/dist/es/ir/scene.d.ts +538 -16
  43. package/dist/es/ir/scene.d.ts.map +1 -1
  44. package/dist/es/parsers/parseWay.d.ts +56 -10
  45. package/dist/es/parsers/parseWay.d.ts.map +1 -1
  46. package/dist/es/parsers/parseWay.js +68 -6
  47. package/dist/es/primitive/ellipse.d.ts +34 -0
  48. package/dist/es/primitive/ellipse.d.ts.map +1 -0
  49. package/dist/es/primitive/index.d.ts +1 -0
  50. package/dist/es/primitive/index.d.ts.map +1 -1
  51. package/dist/es/primitive/path.d.ts +11 -0
  52. package/dist/es/primitive/path.d.ts.map +1 -1
  53. package/dist/es/primitive/rect.d.ts +2 -0
  54. package/dist/es/primitive/rect.d.ts.map +1 -1
  55. package/dist/es/primitive/scene.d.ts +2 -1
  56. package/dist/es/primitive/scene.d.ts.map +1 -1
  57. package/dist/es/primitive/text.d.ts +43 -13
  58. package/dist/es/primitive/text.d.ts.map +1 -1
  59. package/dist/es/types.d.ts +3 -0
  60. package/dist/es/types.d.ts.map +1 -0
  61. package/dist/lib/compile/index.d.ts +1 -0
  62. package/dist/lib/compile/index.d.ts.map +1 -1
  63. package/dist/lib/compile/node.cjs +278 -52
  64. package/dist/lib/compile/node.d.ts +73 -22
  65. package/dist/lib/compile/node.d.ts.map +1 -1
  66. package/dist/lib/compile/parseTarget.cjs +48 -0
  67. package/dist/lib/compile/parseTarget.d.ts +25 -0
  68. package/dist/lib/compile/parseTarget.d.ts.map +1 -0
  69. package/dist/lib/compile/path.cjs +275 -32
  70. package/dist/lib/compile/path.d.ts +17 -7
  71. package/dist/lib/compile/path.d.ts.map +1 -1
  72. package/dist/lib/compile/text-metrics.d.ts +2 -2
  73. package/dist/lib/compile/text-metrics.d.ts.map +1 -1
  74. package/dist/lib/geometry/circle.cjs +79 -0
  75. package/dist/lib/geometry/circle.d.ts +32 -0
  76. package/dist/lib/geometry/circle.d.ts.map +1 -0
  77. package/dist/lib/geometry/diamond.cjs +87 -0
  78. package/dist/lib/geometry/diamond.d.ts +44 -0
  79. package/dist/lib/geometry/diamond.d.ts.map +1 -0
  80. package/dist/lib/geometry/ellipse.cjs +86 -0
  81. package/dist/lib/geometry/ellipse.d.ts +38 -0
  82. package/dist/lib/geometry/ellipse.d.ts.map +1 -0
  83. package/dist/lib/geometry/index.d.ts +3 -0
  84. package/dist/lib/geometry/index.d.ts.map +1 -1
  85. package/dist/lib/index.cjs +16 -0
  86. package/dist/lib/index.d.ts +9 -7
  87. package/dist/lib/index.d.ts.map +1 -1
  88. package/dist/lib/ir/node.cjs +100 -7
  89. package/dist/lib/ir/node.d.ts +319 -7
  90. package/dist/lib/ir/node.d.ts.map +1 -1
  91. package/dist/lib/ir/path/arrow.cjs +25 -0
  92. package/dist/lib/ir/path/arrow.d.ts +26 -0
  93. package/dist/lib/ir/path/arrow.d.ts.map +1 -0
  94. package/dist/lib/ir/path/index.d.ts +1 -0
  95. package/dist/lib/ir/path/index.d.ts.map +1 -1
  96. package/dist/lib/ir/path/path.cjs +10 -0
  97. package/dist/lib/ir/path/path.d.ts +60 -0
  98. package/dist/lib/ir/path/path.d.ts.map +1 -1
  99. package/dist/lib/ir/path/step.cjs +18 -1
  100. package/dist/lib/ir/path/step.d.ts +56 -2
  101. package/dist/lib/ir/path/step.d.ts.map +1 -1
  102. package/dist/lib/ir/scene.d.ts +538 -16
  103. package/dist/lib/ir/scene.d.ts.map +1 -1
  104. package/dist/lib/parsers/parseWay.cjs +68 -5
  105. package/dist/lib/parsers/parseWay.d.ts +56 -10
  106. package/dist/lib/parsers/parseWay.d.ts.map +1 -1
  107. package/dist/lib/primitive/ellipse.d.ts +34 -0
  108. package/dist/lib/primitive/ellipse.d.ts.map +1 -0
  109. package/dist/lib/primitive/index.d.ts +1 -0
  110. package/dist/lib/primitive/index.d.ts.map +1 -1
  111. package/dist/lib/primitive/path.d.ts +11 -0
  112. package/dist/lib/primitive/path.d.ts.map +1 -1
  113. package/dist/lib/primitive/rect.d.ts +2 -0
  114. package/dist/lib/primitive/rect.d.ts.map +1 -1
  115. package/dist/lib/primitive/scene.d.ts +2 -1
  116. package/dist/lib/primitive/scene.d.ts.map +1 -1
  117. package/dist/lib/primitive/text.d.ts +43 -13
  118. package/dist/lib/primitive/text.d.ts.map +1 -1
  119. package/dist/lib/types.d.ts +3 -0
  120. package/dist/lib/types.d.ts.map +1 -0
  121. package/package.json +1 -1
@@ -0,0 +1,26 @@
1
+ import { ValueOf } from '../../types';
2
+ /**
3
+ * 箭头形状常量。值就是 IR / Scene 中 arrow 字段的字面字符串;
4
+ * 用 const 而不是 TS enum——避免 enum 在数值场景生成 reverse-mapping、
5
+ * 在 string 场景与字面量类型不互通的两个坑。
6
+ *
7
+ * - `normal`:实心三角(默认;最常见)
8
+ * - `open`:空心三角(UML 泛化 / 继承)
9
+ * - `stealth`:尖锐倒钩三角(流图常见、视觉锐利)
10
+ * - `diamond`:实心菱形(UML 组合)
11
+ * - `openDiamond`:空心菱形(UML 聚合)
12
+ * - `circle`:实心圆点(连接点 / dot end)
13
+ * - `openCircle`:空心圆点(白圈 / o-end)
14
+ */
15
+ export declare const ARROW_SHAPES: {
16
+ readonly normal: "normal";
17
+ readonly open: "open";
18
+ readonly stealth: "stealth";
19
+ readonly diamond: "diamond";
20
+ readonly openDiamond: "openDiamond";
21
+ readonly circle: "circle";
22
+ readonly openCircle: "openCircle";
23
+ };
24
+ /** 箭头形状字面量类型,由 `ARROW_SHAPES` 派生 */
25
+ export type ArrowShape = ValueOf<typeof ARROW_SHAPES>;
26
+ //# sourceMappingURL=arrow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,oCAAoC;AACpC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ //#region src/ir/path/arrow.ts
2
+ /**
3
+ * 箭头形状常量。值就是 IR / Scene 中 arrow 字段的字面字符串;
4
+ * 用 const 而不是 TS enum——避免 enum 在数值场景生成 reverse-mapping、
5
+ * 在 string 场景与字面量类型不互通的两个坑。
6
+ *
7
+ * - `normal`:实心三角(默认;最常见)
8
+ * - `open`:空心三角(UML 泛化 / 继承)
9
+ * - `stealth`:尖锐倒钩三角(流图常见、视觉锐利)
10
+ * - `diamond`:实心菱形(UML 组合)
11
+ * - `openDiamond`:空心菱形(UML 聚合)
12
+ * - `circle`:实心圆点(连接点 / dot end)
13
+ * - `openCircle`:空心圆点(白圈 / o-end)
14
+ */
15
+ var ARROW_SHAPES = {
16
+ normal: "normal",
17
+ open: "open",
18
+ stealth: "stealth",
19
+ diamond: "diamond",
20
+ openDiamond: "openDiamond",
21
+ circle: "circle",
22
+ openCircle: "openCircle"
23
+ };
24
+ //#endregion
25
+ export { ARROW_SHAPES };
@@ -1,3 +1,4 @@
1
+ export * from './arrow';
1
2
  export * from './path';
2
3
  export * from './step';
3
4
  export * from './target';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
@@ -4,6 +4,18 @@ export declare const PathSchema: z.ZodObject<{
4
4
  stroke: z.ZodOptional<z.ZodString>;
5
5
  strokeWidth: z.ZodOptional<z.ZodNumber>;
6
6
  strokeDasharray: z.ZodOptional<z.ZodString>;
7
+ arrow: z.ZodOptional<z.ZodEnum<["none", "->", "<-", "<->"]>>;
8
+ arrowShape: z.ZodOptional<z.ZodNativeEnum<{
9
+ readonly normal: "normal";
10
+ readonly open: "open";
11
+ readonly stealth: "stealth";
12
+ readonly diamond: "diamond";
13
+ readonly openDiamond: "openDiamond";
14
+ readonly circle: "circle";
15
+ readonly openCircle: "openCircle";
16
+ }>>;
17
+ fill: z.ZodOptional<z.ZodString>;
18
+ fillRule: z.ZodOptional<z.ZodEnum<["nonzero", "evenodd"]>>;
7
19
  children: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
8
20
  type: z.ZodLiteral<"step">;
9
21
  kind: z.ZodLiteral<"move">;
@@ -28,6 +40,30 @@ export declare const PathSchema: z.ZodObject<{
28
40
  type: "step";
29
41
  kind: "line";
30
42
  to: string | [number, number] | import('..').PolarPosition;
43
+ }>, z.ZodObject<{
44
+ type: z.ZodLiteral<"step">;
45
+ kind: z.ZodLiteral<"step">;
46
+ via: z.ZodEnum<["-|", "|-"]>;
47
+ to: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('..').PolarPosition, z.ZodTypeDef, import('..').PolarPosition>, z.ZodString]>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ type: "step";
50
+ kind: "step";
51
+ to: string | [number, number] | import('..').PolarPosition;
52
+ via: "-|" | "|-";
53
+ }, {
54
+ type: "step";
55
+ kind: "step";
56
+ to: string | [number, number] | import('..').PolarPosition;
57
+ via: "-|" | "|-";
58
+ }>, z.ZodObject<{
59
+ type: z.ZodLiteral<"step">;
60
+ kind: z.ZodLiteral<"cycle">;
61
+ }, "strip", z.ZodTypeAny, {
62
+ type: "step";
63
+ kind: "cycle";
64
+ }, {
65
+ type: "step";
66
+ kind: "cycle";
31
67
  }>]>, "many">;
32
68
  }, "strip", z.ZodTypeAny, {
33
69
  type: "path";
@@ -39,10 +75,22 @@ export declare const PathSchema: z.ZodObject<{
39
75
  type: "step";
40
76
  kind: "line";
41
77
  to: string | [number, number] | import('..').PolarPosition;
78
+ } | {
79
+ type: "step";
80
+ kind: "step";
81
+ to: string | [number, number] | import('..').PolarPosition;
82
+ via: "-|" | "|-";
83
+ } | {
84
+ type: "step";
85
+ kind: "cycle";
42
86
  })[];
87
+ fill?: string | undefined;
43
88
  stroke?: string | undefined;
44
89
  strokeWidth?: number | undefined;
45
90
  strokeDasharray?: string | undefined;
91
+ arrow?: "none" | "->" | "<-" | "<->" | undefined;
92
+ arrowShape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
93
+ fillRule?: "nonzero" | "evenodd" | undefined;
46
94
  }, {
47
95
  type: "path";
48
96
  children: ({
@@ -53,10 +101,22 @@ export declare const PathSchema: z.ZodObject<{
53
101
  type: "step";
54
102
  kind: "line";
55
103
  to: string | [number, number] | import('..').PolarPosition;
104
+ } | {
105
+ type: "step";
106
+ kind: "step";
107
+ to: string | [number, number] | import('..').PolarPosition;
108
+ via: "-|" | "|-";
109
+ } | {
110
+ type: "step";
111
+ kind: "cycle";
56
112
  })[];
113
+ fill?: string | undefined;
57
114
  stroke?: string | undefined;
58
115
  strokeWidth?: number | undefined;
59
116
  strokeDasharray?: string | undefined;
117
+ arrow?: "none" | "->" | "<-" | "<->" | undefined;
118
+ arrowShape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
119
+ fillRule?: "nonzero" | "evenodd" | undefined;
60
120
  }>;
61
121
  /** 路径:由若干 step 动作(move / line / ...)组成的绘制路径 */
62
122
  export type IRPath = z.infer<typeof PathSchema>;
@@ -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;AAGxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BpB,CAAC;AAEJ,+CAA+C;AAC/C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDpB,CAAC;AAEJ,+CAA+C;AAC/C,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { ARROW_SHAPES } from "./arrow.js";
1
2
  import { StepSchema } from "./step.js";
2
3
  import { z } from "zod";
3
4
  //#region src/ir/path/path.ts
@@ -6,6 +7,15 @@ var PathSchema = z.object({
6
7
  stroke: z.string().optional().describe("Stroke color of the path; any CSS color. Defaults to currentColor when omitted"),
7
8
  strokeWidth: z.number().optional().describe("Stroke width in user units; defaults to 1 when omitted"),
8
9
  strokeDasharray: z.string().optional().describe("SVG stroke-dasharray pattern (e.g. \"4 2\"); leave empty for solid line"),
10
+ arrow: z.enum([
11
+ "none",
12
+ "->",
13
+ "<-",
14
+ "<->"
15
+ ]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
16
+ arrowShape: z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape; default `normal` (filled triangle). Other values: `open` (hollow triangle), `stealth` (sharp barb), `diamond`, `circle`."),
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, SVG default) winds-by-direction; `evenodd` toggles fill on each crossing — useful for ring / donut shapes."),
9
19
  children: z.array(StepSchema).min(2).describe("Sequence of step actions defining the path; the first should usually be a `move`")
10
20
  }).describe("A drawn path composed of a sequence of step actions (move / line / ...)");
11
21
  //#endregion
@@ -25,6 +25,32 @@ export declare const LineStepSchema: z.ZodObject<{
25
25
  kind: "line";
26
26
  to: string | [number, number] | import('..').PolarPosition;
27
27
  }>;
28
+ export declare const FoldStepSchema: z.ZodObject<{
29
+ type: z.ZodLiteral<"step">;
30
+ kind: z.ZodLiteral<"step">;
31
+ via: z.ZodEnum<["-|", "|-"]>;
32
+ to: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('..').PolarPosition, z.ZodTypeDef, import('..').PolarPosition>, z.ZodString]>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ type: "step";
35
+ kind: "step";
36
+ to: string | [number, number] | import('..').PolarPosition;
37
+ via: "-|" | "|-";
38
+ }, {
39
+ type: "step";
40
+ kind: "step";
41
+ to: string | [number, number] | import('..').PolarPosition;
42
+ via: "-|" | "|-";
43
+ }>;
44
+ export declare const CycleStepSchema: z.ZodObject<{
45
+ type: z.ZodLiteral<"step">;
46
+ kind: z.ZodLiteral<"cycle">;
47
+ }, "strip", z.ZodTypeAny, {
48
+ type: "step";
49
+ kind: "cycle";
50
+ }, {
51
+ type: "step";
52
+ kind: "cycle";
53
+ }>;
28
54
  export declare const StepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
29
55
  type: z.ZodLiteral<"step">;
30
56
  kind: z.ZodLiteral<"move">;
@@ -49,14 +75,42 @@ export declare const StepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
49
75
  type: "step";
50
76
  kind: "line";
51
77
  to: string | [number, number] | import('..').PolarPosition;
78
+ }>, z.ZodObject<{
79
+ type: z.ZodLiteral<"step">;
80
+ kind: z.ZodLiteral<"step">;
81
+ via: z.ZodEnum<["-|", "|-"]>;
82
+ to: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('..').PolarPosition, z.ZodTypeDef, import('..').PolarPosition>, z.ZodString]>;
83
+ }, "strip", z.ZodTypeAny, {
84
+ type: "step";
85
+ kind: "step";
86
+ to: string | [number, number] | import('..').PolarPosition;
87
+ via: "-|" | "|-";
88
+ }, {
89
+ type: "step";
90
+ kind: "step";
91
+ to: string | [number, number] | import('..').PolarPosition;
92
+ via: "-|" | "|-";
93
+ }>, z.ZodObject<{
94
+ type: z.ZodLiteral<"step">;
95
+ kind: z.ZodLiteral<"cycle">;
96
+ }, "strip", z.ZodTypeAny, {
97
+ type: "step";
98
+ kind: "cycle";
99
+ }, {
100
+ type: "step";
101
+ kind: "cycle";
52
102
  }>]>;
53
103
  /** Move step:移动游标但不绘制 */
54
104
  export type IRMoveStep = z.infer<typeof MoveStepSchema>;
55
105
  /** Line step:从游标到目标画直线 */
56
106
  export type IRLineStep = z.infer<typeof LineStepSchema>;
107
+ /** Fold step:折角段,从游标到目标经一个直角中间点(TikZ `-|` / `|-`) */
108
+ export type IRFoldStep = z.infer<typeof FoldStepSchema>;
109
+ /** Cycle step:把当前子路径闭合回起点(TikZ `cycle` / SVG `Z`) */
110
+ export type IRCycleStep = z.infer<typeof CycleStepSchema>;
57
111
  /**
58
- * 路径上的一个动作。v0.1.0-alpha 仅支持 'move' 'line'
59
- * 后续会加 'step'(折角)、'curve'、'cubic'、'rel'、'close' 等。
112
+ * 路径上的一个动作。v0.1.0-alpha.1 支持 'move' / 'line' / 'step'(折角)/ 'cycle'(闭合)。
113
+ * 后续会加 'curve'、'cubic'、'rel' 等。
60
114
  */
61
115
  export type IRStep = z.infer<typeof StepSchema>;
62
116
  //# sourceMappingURL=step.d.ts.map
@@ -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;AAGxB,eAAO,MAAM,cAAc;;;;;;;;;;;;EAQyC,CAAC;AAErE,eAAO,MAAM,cAAc;;;;;;;;;;;;EAQ4C,CAAC;AAExE,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;IAE+C,CAAC;AAEvE,yBAAyB;AACzB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,0BAA0B;AAC1B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,cAAc;;;;;;;;;;;;EAQyC,CAAC;AAErE,eAAO,MAAM,cAAc;;;;;;;;;;;;EAQ4C,CAAC;AAExE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEJ,eAAO,MAAM,eAAe;;;;;;;;;EAWzB,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAE+C,CAAC;AAEvE,yBAAyB;AACzB,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,0BAA0B;AAC1B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAExD,qDAAqD;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -11,6 +11,21 @@ var LineStepSchema = z.object({
11
11
  kind: z.literal("line").describe("Draw a straight line from the current cursor to the target (like SVG path \"L\")"),
12
12
  to: TargetSchema.describe("Destination point of the line segment")
13
13
  }).describe("Line action: straight-line segment from cursor to target");
14
- var StepSchema = z.discriminatedUnion("kind", [MoveStepSchema, LineStepSchema]).describe("A single path action; the discriminator field is `kind`");
14
+ var FoldStepSchema = z.object({
15
+ type: z.literal("step").describe("Discriminator marking this as a path step node"),
16
+ kind: z.literal("step").describe("Folded right-angle segment from cursor to target through one intermediate point (TikZ `-|` / `|-`)"),
17
+ via: z.enum(["-|", "|-"]).describe("Folding direction: `-|` first horizontal then vertical; `|-` first vertical then horizontal"),
18
+ to: TargetSchema.describe("Destination point of the folded segment")
19
+ }).describe("Fold action: TikZ-style right-angle fold with a single intermediate point chosen by `via`");
20
+ var CycleStepSchema = z.object({
21
+ type: z.literal("step").describe("Discriminator marking this as a path step node"),
22
+ kind: z.literal("cycle").describe("Close the path back to the most recent move target (TikZ `cycle` / SVG path \"Z\")")
23
+ }).describe("Cycle action: close the current sub-path back to its starting point; carries no `to` field");
24
+ var StepSchema = z.discriminatedUnion("kind", [
25
+ MoveStepSchema,
26
+ LineStepSchema,
27
+ FoldStepSchema,
28
+ CycleStepSchema
29
+ ]).describe("A single path action; the discriminator field is `kind`");
15
30
  //#endregion
16
- export { LineStepSchema, MoveStepSchema, StepSchema };
31
+ export { CycleStepSchema, FoldStepSchema, LineStepSchema, MoveStepSchema, StepSchema };