@retikz/core 0.2.0-alpha.6 → 0.2.0-alpha.8
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/arrows/index.d.ts +13 -0
- package/dist/es/arrows/index.d.ts.map +1 -0
- package/dist/es/arrows/index.js +118 -0
- package/dist/es/arrows/types.d.ts +43 -0
- package/dist/es/arrows/types.d.ts.map +1 -0
- package/dist/es/compile/compile.d.ts +26 -1
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +37 -4
- package/dist/es/compile/marker-prim.d.ts +22 -0
- package/dist/es/compile/marker-prim.d.ts.map +1 -0
- package/dist/es/compile/marker-prim.js +63 -0
- package/dist/es/compile/node.d.ts +19 -4
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +159 -29
- package/dist/es/compile/paint.d.ts +21 -0
- package/dist/es/compile/paint.d.ts.map +1 -0
- package/dist/es/compile/paint.js +94 -0
- package/dist/es/compile/path/index.d.ts +18 -0
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +260 -11
- package/dist/es/compile/path/relative.d.ts.map +1 -1
- package/dist/es/compile/path/relative.js +8 -0
- package/dist/es/compile/path/shrink.d.ts +19 -6
- package/dist/es/compile/path/shrink.d.ts.map +1 -1
- package/dist/es/compile/path/shrink.js +147 -25
- package/dist/es/geometry/bend.d.ts +7 -0
- package/dist/es/geometry/bend.d.ts.map +1 -1
- package/dist/es/geometry/bend.js +26 -1
- package/dist/es/index.d.ts +14 -4
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +7 -2
- package/dist/es/ir/index.d.ts +2 -0
- package/dist/es/ir/index.d.ts.map +1 -1
- package/dist/es/ir/json.d.ts +22 -0
- package/dist/es/ir/json.d.ts.map +1 -0
- package/dist/es/ir/json.js +25 -0
- package/dist/es/ir/node.d.ts +262 -9
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +9 -2
- package/dist/es/ir/paint.d.ts +154 -0
- package/dist/es/ir/paint.d.ts.map +1 -0
- package/dist/es/ir/paint.js +59 -0
- package/dist/es/ir/path/arrow.d.ts +52 -72
- package/dist/es/ir/path/arrow.d.ts.map +1 -1
- package/dist/es/ir/path/arrow.js +5 -5
- package/dist/es/ir/path/path.d.ts +637 -87
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +23 -2
- package/dist/es/ir/path/step.d.ts +363 -8
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +17 -4
- package/dist/es/ir/scope.d.ts +1874 -338
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +2 -1
- package/dist/es/pathGenerators/define.d.ts +16 -0
- package/dist/es/pathGenerators/define.d.ts.map +1 -0
- package/dist/es/pathGenerators/define.js +23 -0
- package/dist/es/pathGenerators/index.d.ts +9 -0
- package/dist/es/pathGenerators/index.d.ts.map +1 -0
- package/dist/es/pathGenerators/types.d.ts +45 -0
- package/dist/es/pathGenerators/types.d.ts.map +1 -0
- package/dist/es/patterns/index.d.ts +10 -0
- package/dist/es/patterns/index.d.ts.map +1 -0
- package/dist/es/patterns/index.js +83 -0
- package/dist/es/patterns/types.d.ts +38 -0
- package/dist/es/patterns/types.d.ts.map +1 -0
- package/dist/es/primitive/ellipse.d.ts +3 -5
- package/dist/es/primitive/ellipse.d.ts.map +1 -1
- package/dist/es/primitive/index.d.ts +1 -0
- package/dist/es/primitive/index.d.ts.map +1 -1
- package/dist/es/primitive/marker.d.ts +160 -0
- package/dist/es/primitive/marker.d.ts.map +1 -0
- package/dist/es/primitive/paint.d.ts +46 -0
- package/dist/es/primitive/paint.d.ts.map +1 -0
- package/dist/es/primitive/path.d.ts +25 -20
- package/dist/es/primitive/path.d.ts.map +1 -1
- package/dist/es/primitive/rect.d.ts +3 -2
- package/dist/es/primitive/rect.d.ts.map +1 -1
- package/dist/es/primitive/scene.d.ts +4 -0
- package/dist/es/primitive/scene.d.ts.map +1 -1
- package/dist/es/shapes/types.d.ts +2 -2
- package/dist/es/shapes/types.d.ts.map +1 -1
- package/dist/lib/arrows/index.cjs +118 -0
- package/dist/lib/arrows/index.d.ts +13 -0
- package/dist/lib/arrows/index.d.ts.map +1 -0
- package/dist/lib/arrows/types.d.ts +43 -0
- package/dist/lib/arrows/types.d.ts.map +1 -0
- package/dist/lib/compile/compile.cjs +38 -5
- package/dist/lib/compile/compile.d.ts +26 -1
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/marker-prim.cjs +63 -0
- package/dist/lib/compile/marker-prim.d.ts +22 -0
- package/dist/lib/compile/marker-prim.d.ts.map +1 -0
- package/dist/lib/compile/node.cjs +159 -28
- package/dist/lib/compile/node.d.ts +19 -4
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/paint.cjs +94 -0
- package/dist/lib/compile/paint.d.ts +21 -0
- package/dist/lib/compile/paint.d.ts.map +1 -0
- package/dist/lib/compile/path/index.cjs +258 -9
- package/dist/lib/compile/path/index.d.ts +18 -0
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/compile/path/relative.cjs +8 -0
- package/dist/lib/compile/path/relative.d.ts.map +1 -1
- package/dist/lib/compile/path/shrink.cjs +147 -25
- package/dist/lib/compile/path/shrink.d.ts +19 -6
- package/dist/lib/compile/path/shrink.d.ts.map +1 -1
- package/dist/lib/geometry/bend.cjs +26 -0
- package/dist/lib/geometry/bend.d.ts +7 -0
- package/dist/lib/geometry/bend.d.ts.map +1 -1
- package/dist/lib/index.cjs +14 -0
- package/dist/lib/index.d.ts +14 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/index.d.ts +2 -0
- package/dist/lib/ir/index.d.ts.map +1 -1
- package/dist/lib/ir/json.cjs +26 -0
- package/dist/lib/ir/json.d.ts +22 -0
- package/dist/lib/ir/json.d.ts.map +1 -0
- package/dist/lib/ir/node.cjs +9 -2
- package/dist/lib/ir/node.d.ts +262 -9
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/paint.cjs +61 -0
- package/dist/lib/ir/paint.d.ts +154 -0
- package/dist/lib/ir/paint.d.ts.map +1 -0
- package/dist/lib/ir/path/arrow.cjs +5 -5
- package/dist/lib/ir/path/arrow.d.ts +52 -72
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +22 -1
- package/dist/lib/ir/path/path.d.ts +637 -87
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +17 -3
- package/dist/lib/ir/path/step.d.ts +363 -8
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +2 -1
- package/dist/lib/ir/scope.d.ts +1874 -338
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/pathGenerators/define.cjs +23 -0
- package/dist/lib/pathGenerators/define.d.ts +16 -0
- package/dist/lib/pathGenerators/define.d.ts.map +1 -0
- package/dist/lib/pathGenerators/index.d.ts +9 -0
- package/dist/lib/pathGenerators/index.d.ts.map +1 -0
- package/dist/lib/pathGenerators/types.d.ts +45 -0
- package/dist/lib/pathGenerators/types.d.ts.map +1 -0
- package/dist/lib/patterns/index.cjs +83 -0
- package/dist/lib/patterns/index.d.ts +10 -0
- package/dist/lib/patterns/index.d.ts.map +1 -0
- package/dist/lib/patterns/types.d.ts +38 -0
- package/dist/lib/patterns/types.d.ts.map +1 -0
- package/dist/lib/primitive/ellipse.d.ts +3 -5
- package/dist/lib/primitive/ellipse.d.ts.map +1 -1
- package/dist/lib/primitive/index.d.ts +1 -0
- package/dist/lib/primitive/index.d.ts.map +1 -1
- package/dist/lib/primitive/marker.d.ts +160 -0
- package/dist/lib/primitive/marker.d.ts.map +1 -0
- package/dist/lib/primitive/paint.d.ts +46 -0
- package/dist/lib/primitive/paint.d.ts.map +1 -0
- package/dist/lib/primitive/path.d.ts +25 -20
- package/dist/lib/primitive/path.d.ts.map +1 -1
- package/dist/lib/primitive/rect.d.ts +3 -2
- package/dist/lib/primitive/rect.d.ts.map +1 -1
- package/dist/lib/primitive/scene.d.ts +4 -0
- package/dist/lib/primitive/scene.d.ts.map +1 -1
- package/dist/lib/shapes/types.d.ts +2 -2
- package/dist/lib/shapes/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/es/compile/path/arrow-geometry.d.ts +0 -22
- package/dist/es/compile/path/arrow-geometry.d.ts.map +0 -1
- package/dist/es/compile/path/arrow-geometry.js +0 -40
- package/dist/lib/compile/path/arrow-geometry.cjs +0 -41
- package/dist/lib/compile/path/arrow-geometry.d.ts +0 -22
- package/dist/lib/compile/path/arrow-geometry.d.ts.map +0 -1
|
@@ -15,6 +15,18 @@ export declare const ARROW_SHAPES: {
|
|
|
15
15
|
};
|
|
16
16
|
/** 箭头形状字面量类型 */
|
|
17
17
|
export type ArrowShape = ValueOf<typeof ARROW_SHAPES>;
|
|
18
|
+
/**
|
|
19
|
+
* 内置 7 箭头名联合
|
|
20
|
+
* @description `BUILTIN_ARROWS` 的 Record key(保穷尽性约束,不随 `ArrowShapeName` 开放而退化为 `string`);
|
|
21
|
+
* 等价于历史 `ArrowShape`,独立命名对齐 `node.ts` 的 `BuiltinShapeName` 范式
|
|
22
|
+
*/
|
|
23
|
+
export type BuiltinArrowName = ValueOf<typeof ARROW_SHAPES>;
|
|
24
|
+
/**
|
|
25
|
+
* 箭头形状名:开放字符串
|
|
26
|
+
* @description 内置 `BuiltinArrowName`,或经 `CompileOptions.arrows` 注册的扩展箭头名;
|
|
27
|
+
* `& {}` 让 IDE 仍对内置 7 名自动补全,同时接受任意非空字符串(对齐 `node.ts` 的 `NodeShape`)
|
|
28
|
+
*/
|
|
29
|
+
export type ArrowShapeName = BuiltinArrowName | (string & {});
|
|
18
30
|
/** 箭头默认形状 */
|
|
19
31
|
export declare const DEFAULT_ARROW_SHAPE: "stealth";
|
|
20
32
|
/**
|
|
@@ -31,15 +43,7 @@ export declare const ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = 1.5;
|
|
|
31
43
|
* @description 顶层 8 字段全 optional;fill 在空心 shape 上 silent no-op(schema 不拒绝、compile/render 丢字段);start/end 子对象用相同字段集(无 start/end 递归)
|
|
32
44
|
*/
|
|
33
45
|
export declare const ArrowEndDetailSchema: z.ZodObject<{
|
|
34
|
-
shape: z.ZodOptional<z.
|
|
35
|
-
readonly normal: "normal";
|
|
36
|
-
readonly open: "open";
|
|
37
|
-
readonly stealth: "stealth";
|
|
38
|
-
readonly diamond: "diamond";
|
|
39
|
-
readonly openDiamond: "openDiamond";
|
|
40
|
-
readonly circle: "circle";
|
|
41
|
-
readonly openCircle: "openCircle";
|
|
42
|
-
}>>;
|
|
46
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
43
47
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
44
48
|
length: z.ZodOptional<z.ZodNumber>;
|
|
45
49
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -50,36 +54,28 @@ export declare const ArrowEndDetailSchema: z.ZodObject<{
|
|
|
50
54
|
}, "strip", z.ZodTypeAny, {
|
|
51
55
|
length?: number | undefined;
|
|
52
56
|
fill?: string | undefined;
|
|
57
|
+
color?: string | undefined;
|
|
53
58
|
opacity?: number | undefined;
|
|
54
|
-
shape?:
|
|
59
|
+
shape?: string | undefined;
|
|
60
|
+
lineWidth?: number | undefined;
|
|
55
61
|
scale?: number | undefined;
|
|
56
62
|
width?: number | undefined;
|
|
57
|
-
color?: string | undefined;
|
|
58
|
-
lineWidth?: number | undefined;
|
|
59
63
|
}, {
|
|
60
64
|
length?: number | undefined;
|
|
61
65
|
fill?: string | undefined;
|
|
66
|
+
color?: string | undefined;
|
|
62
67
|
opacity?: number | undefined;
|
|
63
|
-
shape?:
|
|
68
|
+
shape?: string | undefined;
|
|
69
|
+
lineWidth?: number | undefined;
|
|
64
70
|
scale?: number | undefined;
|
|
65
71
|
width?: number | undefined;
|
|
66
|
-
color?: string | undefined;
|
|
67
|
-
lineWidth?: number | undefined;
|
|
68
72
|
}>;
|
|
69
73
|
/**
|
|
70
74
|
* Path 级箭头详细配置 schema
|
|
71
75
|
* @description 顶层视觉字段(与 `ArrowEndDetailSchema` 同字段集)作为起末共享默认;`start` / `end` 子对象逐字段 merge 顶层(缺省字段继承,已填字段 override)
|
|
72
76
|
*/
|
|
73
77
|
export declare const ArrowDetailSchema: z.ZodObject<{
|
|
74
|
-
shape: z.ZodOptional<z.
|
|
75
|
-
readonly normal: "normal";
|
|
76
|
-
readonly open: "open";
|
|
77
|
-
readonly stealth: "stealth";
|
|
78
|
-
readonly diamond: "diamond";
|
|
79
|
-
readonly openDiamond: "openDiamond";
|
|
80
|
-
readonly circle: "circle";
|
|
81
|
-
readonly openCircle: "openCircle";
|
|
82
|
-
}>>;
|
|
78
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
83
79
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
84
80
|
length: z.ZodOptional<z.ZodNumber>;
|
|
85
81
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -89,15 +85,7 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
89
85
|
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
90
86
|
} & {
|
|
91
87
|
start: z.ZodOptional<z.ZodObject<{
|
|
92
|
-
shape: z.ZodOptional<z.
|
|
93
|
-
readonly normal: "normal";
|
|
94
|
-
readonly open: "open";
|
|
95
|
-
readonly stealth: "stealth";
|
|
96
|
-
readonly diamond: "diamond";
|
|
97
|
-
readonly openDiamond: "openDiamond";
|
|
98
|
-
readonly circle: "circle";
|
|
99
|
-
readonly openCircle: "openCircle";
|
|
100
|
-
}>>;
|
|
88
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
101
89
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
102
90
|
length: z.ZodOptional<z.ZodNumber>;
|
|
103
91
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -108,32 +96,24 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
108
96
|
}, "strip", z.ZodTypeAny, {
|
|
109
97
|
length?: number | undefined;
|
|
110
98
|
fill?: string | undefined;
|
|
99
|
+
color?: string | undefined;
|
|
111
100
|
opacity?: number | undefined;
|
|
112
|
-
shape?:
|
|
101
|
+
shape?: string | undefined;
|
|
102
|
+
lineWidth?: number | undefined;
|
|
113
103
|
scale?: number | undefined;
|
|
114
104
|
width?: number | undefined;
|
|
115
|
-
color?: string | undefined;
|
|
116
|
-
lineWidth?: number | undefined;
|
|
117
105
|
}, {
|
|
118
106
|
length?: number | undefined;
|
|
119
107
|
fill?: string | undefined;
|
|
108
|
+
color?: string | undefined;
|
|
120
109
|
opacity?: number | undefined;
|
|
121
|
-
shape?:
|
|
110
|
+
shape?: string | undefined;
|
|
111
|
+
lineWidth?: number | undefined;
|
|
122
112
|
scale?: number | undefined;
|
|
123
113
|
width?: number | undefined;
|
|
124
|
-
color?: string | undefined;
|
|
125
|
-
lineWidth?: number | undefined;
|
|
126
114
|
}>>;
|
|
127
115
|
end: z.ZodOptional<z.ZodObject<{
|
|
128
|
-
shape: z.ZodOptional<z.
|
|
129
|
-
readonly normal: "normal";
|
|
130
|
-
readonly open: "open";
|
|
131
|
-
readonly stealth: "stealth";
|
|
132
|
-
readonly diamond: "diamond";
|
|
133
|
-
readonly openDiamond: "openDiamond";
|
|
134
|
-
readonly circle: "circle";
|
|
135
|
-
readonly openCircle: "openCircle";
|
|
136
|
-
}>>;
|
|
116
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
137
117
|
scale: z.ZodOptional<z.ZodNumber>;
|
|
138
118
|
length: z.ZodOptional<z.ZodNumber>;
|
|
139
119
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -144,79 +124,79 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
144
124
|
}, "strip", z.ZodTypeAny, {
|
|
145
125
|
length?: number | undefined;
|
|
146
126
|
fill?: string | undefined;
|
|
127
|
+
color?: string | undefined;
|
|
147
128
|
opacity?: number | undefined;
|
|
148
|
-
shape?:
|
|
129
|
+
shape?: string | undefined;
|
|
130
|
+
lineWidth?: number | undefined;
|
|
149
131
|
scale?: number | undefined;
|
|
150
132
|
width?: number | undefined;
|
|
151
|
-
color?: string | undefined;
|
|
152
|
-
lineWidth?: number | undefined;
|
|
153
133
|
}, {
|
|
154
134
|
length?: number | undefined;
|
|
155
135
|
fill?: string | undefined;
|
|
136
|
+
color?: string | undefined;
|
|
156
137
|
opacity?: number | undefined;
|
|
157
|
-
shape?:
|
|
138
|
+
shape?: string | undefined;
|
|
139
|
+
lineWidth?: number | undefined;
|
|
158
140
|
scale?: number | undefined;
|
|
159
141
|
width?: number | undefined;
|
|
160
|
-
color?: string | undefined;
|
|
161
|
-
lineWidth?: number | undefined;
|
|
162
142
|
}>>;
|
|
163
143
|
}, "strip", z.ZodTypeAny, {
|
|
164
144
|
length?: number | undefined;
|
|
165
145
|
fill?: string | undefined;
|
|
146
|
+
color?: string | undefined;
|
|
166
147
|
opacity?: number | undefined;
|
|
167
|
-
shape?:
|
|
148
|
+
shape?: string | undefined;
|
|
149
|
+
lineWidth?: number | undefined;
|
|
168
150
|
scale?: number | undefined;
|
|
169
151
|
width?: number | undefined;
|
|
170
|
-
color?: string | undefined;
|
|
171
|
-
lineWidth?: number | undefined;
|
|
172
152
|
start?: {
|
|
173
153
|
length?: number | undefined;
|
|
174
154
|
fill?: string | undefined;
|
|
155
|
+
color?: string | undefined;
|
|
175
156
|
opacity?: number | undefined;
|
|
176
|
-
shape?:
|
|
157
|
+
shape?: string | undefined;
|
|
158
|
+
lineWidth?: number | undefined;
|
|
177
159
|
scale?: number | undefined;
|
|
178
160
|
width?: number | undefined;
|
|
179
|
-
color?: string | undefined;
|
|
180
|
-
lineWidth?: number | undefined;
|
|
181
161
|
} | undefined;
|
|
182
162
|
end?: {
|
|
183
163
|
length?: number | undefined;
|
|
184
164
|
fill?: string | undefined;
|
|
165
|
+
color?: string | undefined;
|
|
185
166
|
opacity?: number | undefined;
|
|
186
|
-
shape?:
|
|
167
|
+
shape?: string | undefined;
|
|
168
|
+
lineWidth?: number | undefined;
|
|
187
169
|
scale?: number | undefined;
|
|
188
170
|
width?: number | undefined;
|
|
189
|
-
color?: string | undefined;
|
|
190
|
-
lineWidth?: number | undefined;
|
|
191
171
|
} | undefined;
|
|
192
172
|
}, {
|
|
193
173
|
length?: number | undefined;
|
|
194
174
|
fill?: string | undefined;
|
|
175
|
+
color?: string | undefined;
|
|
195
176
|
opacity?: number | undefined;
|
|
196
|
-
shape?:
|
|
177
|
+
shape?: string | undefined;
|
|
178
|
+
lineWidth?: number | undefined;
|
|
197
179
|
scale?: number | undefined;
|
|
198
180
|
width?: number | undefined;
|
|
199
|
-
color?: string | undefined;
|
|
200
|
-
lineWidth?: number | undefined;
|
|
201
181
|
start?: {
|
|
202
182
|
length?: number | undefined;
|
|
203
183
|
fill?: string | undefined;
|
|
184
|
+
color?: string | undefined;
|
|
204
185
|
opacity?: number | undefined;
|
|
205
|
-
shape?:
|
|
186
|
+
shape?: string | undefined;
|
|
187
|
+
lineWidth?: number | undefined;
|
|
206
188
|
scale?: number | undefined;
|
|
207
189
|
width?: number | undefined;
|
|
208
|
-
color?: string | undefined;
|
|
209
|
-
lineWidth?: number | undefined;
|
|
210
190
|
} | undefined;
|
|
211
191
|
end?: {
|
|
212
192
|
length?: number | undefined;
|
|
213
193
|
fill?: string | undefined;
|
|
194
|
+
color?: string | undefined;
|
|
214
195
|
opacity?: number | undefined;
|
|
215
|
-
shape?:
|
|
196
|
+
shape?: string | undefined;
|
|
197
|
+
lineWidth?: number | undefined;
|
|
216
198
|
scale?: number | undefined;
|
|
217
199
|
width?: number | undefined;
|
|
218
|
-
color?: string | undefined;
|
|
219
|
-
lineWidth?: number | undefined;
|
|
220
200
|
} | undefined;
|
|
221
201
|
}>;
|
|
222
202
|
/** 端点级箭头视觉规格 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.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,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD,aAAa;AACb,eAAO,MAAM,mBAAmB,WAAuB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/arrow.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,YAAY;;;;;;;;CAQf,CAAC;AAEX,gBAAgB;AAChB,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE9D,aAAa;AACb,eAAO,MAAM,mBAAmB,WAAuB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,iBAA6D,CAAC;AAE9F,wCAAwC;AACxC,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,MAAM,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgE9B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,mBAAmB;AACnB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
const require_paint = require("../paint.cjs");
|
|
1
2
|
const require_arrow = require("./arrow.cjs");
|
|
2
3
|
const require_step = require("./step.cjs");
|
|
3
4
|
let zod = require("zod");
|
|
4
5
|
//#region src/ir/path/path.ts
|
|
6
|
+
/**
|
|
7
|
+
* 路径整条缩放 schema:等比 number 或非等比 {x,y}
|
|
8
|
+
* @description 与 Node scale 字段对齐;number = 等比,{x,y} = 各轴独立。全部要求有限正数。
|
|
9
|
+
*/
|
|
10
|
+
var PathScaleSchema = zod.z.union([zod.z.number().finite().positive(), zod.z.object({
|
|
11
|
+
x: zod.z.number().finite().positive().describe("Scale factor on the x axis (finite, positive)."),
|
|
12
|
+
y: zod.z.number().finite().positive().describe("Scale factor on the y axis (finite, positive).")
|
|
13
|
+
}).describe("Anisotropic scale with independent x / y factors.")]).describe("Whole-path scale: a single finite positive number for uniform scaling, or an { x, y } object for anisotropic scaling. Applied around the path bounding-box center together with rotate.");
|
|
14
|
+
/**
|
|
15
|
+
* 路径中段标记 schema(首批仅箭头)
|
|
16
|
+
* @description `kind:'arrow'` 判别符 + 复用 ArrowEndDetail 视觉子集(shape / scale / length / width / color / fill / opacity / lineWidth);
|
|
17
|
+
* 方向由该处路径切线决定,shape 是已注册箭头名(不是 `->` 方向记号)。后续可扩展更多 mark kind。
|
|
18
|
+
*/
|
|
19
|
+
var ArrowMarkSchema = require_arrow.ArrowEndDetailSchema.extend({ kind: zod.z.literal("arrow").describe("Discriminator marking this mark as an arrow tip. Only `arrow` is supported in the first batch; other kinds are rejected by schema.") }).describe("Arrow mark placed along the path: an arrow tip whose direction follows the path tangent at the mark position. Reuses the per-end arrow visual subset (shape / scale / length / width / color / fill / opacity / lineWidth); `shape` is a registered arrow name, NOT a `->` direction token.");
|
|
5
20
|
var PathSchema = zod.z.object({
|
|
6
21
|
type: zod.z.literal("path").describe("Discriminator marking this child as a path"),
|
|
7
22
|
color: zod.z.string().optional().describe("Master color (TikZ `color=`). When set, the stroke, arrow tips, and step labels default to it unless individually overridden. Following the master color (not the stroke) is how a colored line shares its color with its labels and arrows — `stroke=` alone only paints the line."),
|
|
@@ -15,7 +30,7 @@ var PathSchema = zod.z.object({
|
|
|
15
30
|
"<->"
|
|
16
31
|
]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
|
|
17
32
|
arrowDetail: require_arrow.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 `stealth`, all visuals inherit from path stroke / opacity)."),
|
|
18
|
-
fill: zod.z.string().optional().describe("Fill
|
|
33
|
+
fill: zod.z.union([zod.z.string(), require_paint.PaintSpecSchema]).optional().describe("Fill of the closed region: any CSS color string, or a PaintSpec (linear / radial gradient, pattern, or image). Omitted = no fill (stroke only). Pairs with `cycle` step for filled shapes."),
|
|
19
34
|
fillRule: zod.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."),
|
|
20
35
|
lineCap: zod.z.enum([
|
|
21
36
|
"butt",
|
|
@@ -40,6 +55,12 @@ var PathSchema = zod.z.object({
|
|
|
40
55
|
fillOpacity: zod.z.number().min(0).max(1).optional().describe("Fill opacity 0..1; affects only the closed-region fill."),
|
|
41
56
|
drawOpacity: zod.z.number().min(0).max(1).optional().describe("Stroke opacity 0..1 (TikZ `draw opacity`); affects only the path stroke."),
|
|
42
57
|
zIndex: zod.z.number().int().finite().optional().describe("Explicit stacking order among sibling IR children. Higher draws on top. Omitted = 0 = source order. Sorting is stable: same zIndex keeps source order. Scoped per group (a path inside a scope only restacks within that scope)."),
|
|
58
|
+
rotate: zod.z.number().finite().optional().describe("Rotate the whole path by this many degrees about its bounding-box center (positive = visually clockwise under screen y-down). Equivalent to wrapping the path in a Scope with a rotate transform centered on the path. Endpoints are resolved in the current scope first; the rotation wraps the resulting geometry."),
|
|
59
|
+
scale: PathScaleSchema.optional().describe("Scale the whole path about its bounding-box center: a finite positive number (uniform) or { x, y } (anisotropic). Applied together with rotate around the same center."),
|
|
60
|
+
marks: zod.z.array(zod.z.object({
|
|
61
|
+
pos: zod.z.number().min(0).max(1).describe("Normalized position along the path in [0, 1] (0 = start, 1 = end). Values outside [0, 1] are rejected by schema. The geometric meaning of the parameter matches step labels: arc length for line/step, Bezier parameter for curve/cubic/bend."),
|
|
62
|
+
mark: ArrowMarkSchema.describe("The mark to place at this position; currently an arrow tip oriented by the path tangent.")
|
|
63
|
+
})).optional().describe("Marks placed along the path at normalized positions; each is rendered at its position with its direction taken from the path tangent there. First batch supports arrow marks only."),
|
|
43
64
|
children: zod.z.array(require_step.StepSchema).min(2).describe("Sequence of step actions defining the path; the first should usually be a `move`")
|
|
44
65
|
}).describe("A drawn path composed of a sequence of step actions (move / line / ...)");
|
|
45
66
|
//#endregion
|