@retikz/core 0.2.0-alpha.7 → 0.2.0-alpha.9
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/clip.d.ts +17 -0
- package/dist/es/compile/clip.d.ts.map +1 -0
- package/dist/es/compile/clip.js +84 -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 +60 -7
- 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 +2 -1
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +3 -3
- package/dist/es/compile/paint.d.ts +6 -1
- package/dist/es/compile/paint.d.ts.map +1 -1
- package/dist/es/compile/paint.js +60 -3
- package/dist/es/compile/path/anchor.d.ts.map +1 -1
- package/dist/es/compile/path/anchor.js +12 -0
- package/dist/es/compile/path/index.d.ts +15 -0
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +268 -12
- 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/compile/position.d.ts +8 -2
- package/dist/es/compile/position.d.ts.map +1 -1
- package/dist/es/compile/position.js +7 -1
- 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 +16 -4
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +13 -7
- package/dist/es/ir/clip.d.ts +72 -0
- package/dist/es/ir/clip.d.ts.map +1 -0
- package/dist/es/ir/clip.js +37 -0
- package/dist/es/ir/coordinate.d.ts +3 -3
- package/dist/es/ir/coordinate.d.ts.map +1 -1
- package/dist/es/ir/coordinate.js +4 -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 +10 -10
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +4 -2
- package/dist/es/ir/paint.d.ts +25 -3
- package/dist/es/ir/paint.d.ts.map +1 -1
- package/dist/es/ir/paint.js +12 -6
- package/dist/es/ir/path/arrow.d.ts +40 -60
- 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 +553 -164
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +21 -1
- package/dist/es/ir/path/step.d.ts +483 -128
- package/dist/es/ir/path/step.d.ts.map +1 -1
- package/dist/es/ir/path/step.js +18 -5
- package/dist/es/ir/path/target.d.ts +1 -1
- package/dist/es/ir/path/target.d.ts.map +1 -1
- package/dist/es/ir/path/target.js +4 -2
- package/dist/es/ir/position/between-position.d.ts +26 -0
- package/dist/es/ir/position/between-position.d.ts.map +1 -0
- package/dist/es/ir/position/between-position.js +21 -0
- package/dist/es/ir/position/index.d.ts +1 -0
- package/dist/es/ir/position/index.d.ts.map +1 -1
- package/dist/es/ir/scene.d.ts +51 -0
- package/dist/es/ir/scene.d.ts.map +1 -1
- package/dist/es/ir/scene.js +14 -2
- package/dist/es/ir/scope.d.ts +999 -380
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +2 -0
- 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/clip.d.ts +18 -0
- package/dist/es/primitive/clip.d.ts.map +1 -0
- package/dist/es/primitive/group.d.ts +6 -0
- package/dist/es/primitive/group.d.ts.map +1 -1
- package/dist/es/primitive/index.d.ts +2 -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 +32 -4
- package/dist/es/primitive/paint.d.ts.map +1 -1
- package/dist/es/primitive/path.d.ts +22 -18
- package/dist/es/primitive/path.d.ts.map +1 -1
- package/dist/es/primitive/scene.d.ts +2 -1
- package/dist/es/primitive/scene.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/clip.cjs +84 -0
- package/dist/lib/compile/clip.d.ts +17 -0
- package/dist/lib/compile/clip.d.ts.map +1 -0
- package/dist/lib/compile/compile.cjs +62 -9
- 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 +3 -3
- package/dist/lib/compile/node.d.ts +2 -1
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/paint.cjs +60 -3
- package/dist/lib/compile/paint.d.ts +6 -1
- package/dist/lib/compile/paint.d.ts.map +1 -1
- package/dist/lib/compile/path/anchor.cjs +12 -0
- package/dist/lib/compile/path/anchor.d.ts.map +1 -1
- package/dist/lib/compile/path/index.cjs +266 -10
- package/dist/lib/compile/path/index.d.ts +15 -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/compile/position.cjs +7 -1
- package/dist/lib/compile/position.d.ts +8 -2
- package/dist/lib/compile/position.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 +20 -3
- package/dist/lib/index.d.ts +16 -4
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/clip.cjs +37 -0
- package/dist/lib/ir/clip.d.ts +72 -0
- package/dist/lib/ir/clip.d.ts.map +1 -0
- package/dist/lib/ir/coordinate.cjs +4 -2
- package/dist/lib/ir/coordinate.d.ts +3 -3
- package/dist/lib/ir/coordinate.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 +4 -2
- package/dist/lib/ir/node.d.ts +10 -10
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/paint.cjs +12 -5
- package/dist/lib/ir/paint.d.ts +25 -3
- package/dist/lib/ir/paint.d.ts.map +1 -1
- package/dist/lib/ir/path/arrow.cjs +5 -5
- package/dist/lib/ir/path/arrow.d.ts +40 -60
- package/dist/lib/ir/path/arrow.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +20 -0
- package/dist/lib/ir/path/path.d.ts +553 -164
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/path/step.cjs +18 -4
- package/dist/lib/ir/path/step.d.ts +483 -128
- package/dist/lib/ir/path/step.d.ts.map +1 -1
- package/dist/lib/ir/path/target.cjs +4 -2
- package/dist/lib/ir/path/target.d.ts +1 -1
- package/dist/lib/ir/path/target.d.ts.map +1 -1
- package/dist/lib/ir/position/between-position.cjs +22 -0
- package/dist/lib/ir/position/between-position.d.ts +26 -0
- package/dist/lib/ir/position/between-position.d.ts.map +1 -0
- package/dist/lib/ir/position/index.d.ts +1 -0
- package/dist/lib/ir/position/index.d.ts.map +1 -1
- package/dist/lib/ir/scene.cjs +14 -1
- package/dist/lib/ir/scene.d.ts +51 -0
- package/dist/lib/ir/scene.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +2 -0
- package/dist/lib/ir/scope.d.ts +999 -380
- 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/clip.d.ts +18 -0
- package/dist/lib/primitive/clip.d.ts.map +1 -0
- package/dist/lib/primitive/group.d.ts +6 -0
- package/dist/lib/primitive/group.d.ts.map +1 -1
- package/dist/lib/primitive/index.d.ts +2 -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 +32 -4
- package/dist/lib/primitive/paint.d.ts.map +1 -1
- package/dist/lib/primitive/path.d.ts +22 -18
- package/dist/lib/primitive/path.d.ts.map +1 -1
- package/dist/lib/primitive/scene.d.ts +2 -1
- package/dist/lib/primitive/scene.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>;
|
|
@@ -52,34 +56,26 @@ export declare const ArrowEndDetailSchema: z.ZodObject<{
|
|
|
52
56
|
fill?: string | undefined;
|
|
53
57
|
color?: string | undefined;
|
|
54
58
|
opacity?: number | undefined;
|
|
55
|
-
shape?:
|
|
59
|
+
shape?: string | undefined;
|
|
56
60
|
lineWidth?: number | undefined;
|
|
57
|
-
scale?: number | undefined;
|
|
58
61
|
width?: number | undefined;
|
|
62
|
+
scale?: number | undefined;
|
|
59
63
|
}, {
|
|
60
64
|
length?: number | undefined;
|
|
61
65
|
fill?: string | undefined;
|
|
62
66
|
color?: string | undefined;
|
|
63
67
|
opacity?: number | undefined;
|
|
64
|
-
shape?:
|
|
68
|
+
shape?: string | undefined;
|
|
65
69
|
lineWidth?: number | undefined;
|
|
66
|
-
scale?: number | undefined;
|
|
67
70
|
width?: number | undefined;
|
|
71
|
+
scale?: 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>;
|
|
@@ -110,30 +98,22 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
110
98
|
fill?: string | undefined;
|
|
111
99
|
color?: string | undefined;
|
|
112
100
|
opacity?: number | undefined;
|
|
113
|
-
shape?:
|
|
101
|
+
shape?: string | undefined;
|
|
114
102
|
lineWidth?: number | undefined;
|
|
115
|
-
scale?: number | undefined;
|
|
116
103
|
width?: number | undefined;
|
|
104
|
+
scale?: number | undefined;
|
|
117
105
|
}, {
|
|
118
106
|
length?: number | undefined;
|
|
119
107
|
fill?: string | undefined;
|
|
120
108
|
color?: string | undefined;
|
|
121
109
|
opacity?: number | undefined;
|
|
122
|
-
shape?:
|
|
110
|
+
shape?: string | undefined;
|
|
123
111
|
lineWidth?: number | undefined;
|
|
124
|
-
scale?: number | undefined;
|
|
125
112
|
width?: number | undefined;
|
|
113
|
+
scale?: 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>;
|
|
@@ -146,77 +126,77 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
146
126
|
fill?: string | undefined;
|
|
147
127
|
color?: string | undefined;
|
|
148
128
|
opacity?: number | undefined;
|
|
149
|
-
shape?:
|
|
129
|
+
shape?: string | undefined;
|
|
150
130
|
lineWidth?: number | undefined;
|
|
151
|
-
scale?: number | undefined;
|
|
152
131
|
width?: number | undefined;
|
|
132
|
+
scale?: number | undefined;
|
|
153
133
|
}, {
|
|
154
134
|
length?: number | undefined;
|
|
155
135
|
fill?: string | undefined;
|
|
156
136
|
color?: string | undefined;
|
|
157
137
|
opacity?: number | undefined;
|
|
158
|
-
shape?:
|
|
138
|
+
shape?: string | undefined;
|
|
159
139
|
lineWidth?: number | undefined;
|
|
160
|
-
scale?: number | undefined;
|
|
161
140
|
width?: number | undefined;
|
|
141
|
+
scale?: number | undefined;
|
|
162
142
|
}>>;
|
|
163
143
|
}, "strip", z.ZodTypeAny, {
|
|
164
144
|
length?: number | undefined;
|
|
165
145
|
fill?: string | undefined;
|
|
166
146
|
color?: string | undefined;
|
|
167
147
|
opacity?: number | undefined;
|
|
168
|
-
shape?:
|
|
148
|
+
shape?: string | undefined;
|
|
169
149
|
lineWidth?: number | undefined;
|
|
170
|
-
scale?: number | undefined;
|
|
171
150
|
width?: number | undefined;
|
|
151
|
+
scale?: number | undefined;
|
|
172
152
|
start?: {
|
|
173
153
|
length?: number | undefined;
|
|
174
154
|
fill?: string | undefined;
|
|
175
155
|
color?: string | undefined;
|
|
176
156
|
opacity?: number | undefined;
|
|
177
|
-
shape?:
|
|
157
|
+
shape?: string | undefined;
|
|
178
158
|
lineWidth?: number | undefined;
|
|
179
|
-
scale?: number | undefined;
|
|
180
159
|
width?: number | undefined;
|
|
160
|
+
scale?: number | undefined;
|
|
181
161
|
} | undefined;
|
|
182
162
|
end?: {
|
|
183
163
|
length?: number | undefined;
|
|
184
164
|
fill?: string | undefined;
|
|
185
165
|
color?: string | undefined;
|
|
186
166
|
opacity?: number | undefined;
|
|
187
|
-
shape?:
|
|
167
|
+
shape?: string | undefined;
|
|
188
168
|
lineWidth?: number | undefined;
|
|
189
|
-
scale?: number | undefined;
|
|
190
169
|
width?: number | undefined;
|
|
170
|
+
scale?: number | undefined;
|
|
191
171
|
} | undefined;
|
|
192
172
|
}, {
|
|
193
173
|
length?: number | undefined;
|
|
194
174
|
fill?: string | undefined;
|
|
195
175
|
color?: string | undefined;
|
|
196
176
|
opacity?: number | undefined;
|
|
197
|
-
shape?:
|
|
177
|
+
shape?: string | undefined;
|
|
198
178
|
lineWidth?: number | undefined;
|
|
199
|
-
scale?: number | undefined;
|
|
200
179
|
width?: number | undefined;
|
|
180
|
+
scale?: number | undefined;
|
|
201
181
|
start?: {
|
|
202
182
|
length?: number | undefined;
|
|
203
183
|
fill?: string | undefined;
|
|
204
184
|
color?: string | undefined;
|
|
205
185
|
opacity?: number | undefined;
|
|
206
|
-
shape?:
|
|
186
|
+
shape?: string | undefined;
|
|
207
187
|
lineWidth?: number | undefined;
|
|
208
|
-
scale?: number | undefined;
|
|
209
188
|
width?: number | undefined;
|
|
189
|
+
scale?: number | undefined;
|
|
210
190
|
} | undefined;
|
|
211
191
|
end?: {
|
|
212
192
|
length?: number | undefined;
|
|
213
193
|
fill?: string | undefined;
|
|
214
194
|
color?: string | undefined;
|
|
215
195
|
opacity?: number | undefined;
|
|
216
|
-
shape?:
|
|
196
|
+
shape?: string | undefined;
|
|
217
197
|
lineWidth?: number | undefined;
|
|
218
|
-
scale?: number | undefined;
|
|
219
198
|
width?: number | undefined;
|
|
199
|
+
scale?: 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"}
|
|
@@ -3,6 +3,20 @@ const require_arrow = require("./arrow.cjs");
|
|
|
3
3
|
const require_step = require("./step.cjs");
|
|
4
4
|
let zod = require("zod");
|
|
5
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.");
|
|
6
20
|
var PathSchema = zod.z.object({
|
|
7
21
|
type: zod.z.literal("path").describe("Discriminator marking this child as a path"),
|
|
8
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."),
|
|
@@ -41,6 +55,12 @@ var PathSchema = zod.z.object({
|
|
|
41
55
|
fillOpacity: zod.z.number().min(0).max(1).optional().describe("Fill opacity 0..1; affects only the closed-region fill."),
|
|
42
56
|
drawOpacity: zod.z.number().min(0).max(1).optional().describe("Stroke opacity 0..1 (TikZ `draw opacity`); affects only the path stroke."),
|
|
43
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."),
|
|
44
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`")
|
|
45
65
|
}).describe("A drawn path composed of a sequence of step actions (move / line / ...)");
|
|
46
66
|
//#endregion
|