@retikz/core 0.2.0-alpha.6 → 0.2.0-alpha.7
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.map +1 -1
- package/dist/es/compile/compile.js +10 -4
- 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 +16 -0
- package/dist/es/compile/paint.d.ts.map +1 -0
- package/dist/es/compile/paint.js +37 -0
- package/dist/es/compile/path/index.d.ts +3 -0
- package/dist/es/compile/path/index.d.ts.map +1 -1
- package/dist/es/compile/path/index.js +2 -1
- package/dist/es/index.d.ts +3 -3
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +2 -1
- package/dist/es/ir/index.d.ts +1 -0
- package/dist/es/ir/index.d.ts.map +1 -1
- 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 +132 -0
- package/dist/es/ir/paint.d.ts.map +1 -0
- package/dist/es/ir/paint.js +53 -0
- package/dist/es/ir/path/arrow.d.ts +24 -24
- package/dist/es/ir/path/path.d.ts +198 -37
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +2 -1
- package/dist/es/ir/scope.d.ts +1187 -165
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +2 -1
- package/dist/es/primitive/ellipse.d.ts +3 -5
- package/dist/es/primitive/ellipse.d.ts.map +1 -1
- package/dist/es/primitive/paint.d.ts +24 -0
- package/dist/es/primitive/paint.d.ts.map +1 -0
- package/dist/es/primitive/path.d.ts +3 -2
- 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/compile/compile.cjs +9 -3
- package/dist/lib/compile/compile.d.ts.map +1 -1
- 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 +37 -0
- package/dist/lib/compile/paint.d.ts +16 -0
- package/dist/lib/compile/paint.d.ts.map +1 -0
- package/dist/lib/compile/path/index.cjs +2 -1
- package/dist/lib/compile/path/index.d.ts +3 -0
- package/dist/lib/compile/path/index.d.ts.map +1 -1
- package/dist/lib/index.cjs +3 -0
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/index.d.ts +1 -0
- package/dist/lib/ir/index.d.ts.map +1 -1
- 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 +54 -0
- package/dist/lib/ir/paint.d.ts +132 -0
- package/dist/lib/ir/paint.d.ts.map +1 -0
- package/dist/lib/ir/path/arrow.d.ts +24 -24
- package/dist/lib/ir/path/path.cjs +2 -1
- package/dist/lib/ir/path/path.d.ts +198 -37
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +2 -1
- package/dist/lib/ir/scope.d.ts +1187 -165
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/primitive/ellipse.d.ts +3 -5
- package/dist/lib/primitive/ellipse.d.ts.map +1 -1
- package/dist/lib/primitive/paint.d.ts +24 -0
- package/dist/lib/primitive/paint.d.ts.map +1 -0
- package/dist/lib/primitive/path.d.ts +3 -2
- 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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
let zod = require("zod");
|
|
2
|
+
//#region src/ir/paint.ts
|
|
3
|
+
/**
|
|
4
|
+
* 渐变 stop:位置 + 颜色 + 可选透明度
|
|
5
|
+
* @description offset 0..1(沿渐变轴的位置);color 任意 CSS 颜色(含 `currentColor` 主题反应);opacity 0..1。
|
|
6
|
+
*/
|
|
7
|
+
var GradientStopSchema = zod.z.object({
|
|
8
|
+
offset: zod.z.number().min(0).max(1).describe("Stop position along the gradient axis, 0..1"),
|
|
9
|
+
color: zod.z.string().describe("Any CSS color (e.g. \"#08f\", \"navy\", \"currentColor\")"),
|
|
10
|
+
opacity: zod.z.number().min(0).max(1).optional().describe("Stop opacity 0..1; omitted = fully opaque")
|
|
11
|
+
}).describe("A single gradient color stop");
|
|
12
|
+
/**
|
|
13
|
+
* Paint server 规格(渐变 / 图案 / 图片);纯色仍是 `fill` / `stroke` 上的 string,不进此 schema
|
|
14
|
+
* @description 四种 paint server:linear / radial gradient、pattern(图案)、image(图片)。纯 JSON 形态,保 IR 可序列化。
|
|
15
|
+
* linear 方向用 `angle`(度,polar 约定:0°=+x,90°=+y 屏幕下);radial 的 `center` / `radius` 用 objectBoundingBox(0..1,随形状缩放)。
|
|
16
|
+
*/
|
|
17
|
+
var PaintSpecSchema = zod.z.discriminatedUnion("type", [
|
|
18
|
+
zod.z.object({
|
|
19
|
+
type: zod.z.literal("linearGradient"),
|
|
20
|
+
stops: zod.z.array(GradientStopSchema).min(2).describe("Gradient stops, at least 2"),
|
|
21
|
+
angle: zod.z.number().finite().optional().describe("Gradient direction in degrees (polar convention; 0°=+x, 90°=+y screen-down); omitted = renderer default (left→right)")
|
|
22
|
+
}).describe("Linear gradient paint server"),
|
|
23
|
+
zod.z.object({
|
|
24
|
+
type: zod.z.literal("radialGradient"),
|
|
25
|
+
stops: zod.z.array(GradientStopSchema).min(2).describe("Gradient stops, at least 2"),
|
|
26
|
+
center: zod.z.tuple([zod.z.number().finite(), zod.z.number().finite()]).optional().describe("Center in objectBoundingBox units (0..1 relative to the filled shape); omitted = (0.5, 0.5)"),
|
|
27
|
+
radius: zod.z.number().finite().positive().optional().describe("Radius in objectBoundingBox units (0..1); omitted = 0.5")
|
|
28
|
+
}).describe("Radial gradient paint server"),
|
|
29
|
+
zod.z.object({
|
|
30
|
+
type: zod.z.literal("pattern"),
|
|
31
|
+
shape: zod.z.enum([
|
|
32
|
+
"lines",
|
|
33
|
+
"dots",
|
|
34
|
+
"grid"
|
|
35
|
+
]).describe("Pattern motif: `lines` (hatching) / `dots` / `grid` (crosshatch)"),
|
|
36
|
+
color: zod.z.string().optional().describe("Motif color; any CSS color, defaults to `currentColor`"),
|
|
37
|
+
background: zod.z.string().optional().describe("Tile background fill; omitted = transparent"),
|
|
38
|
+
size: zod.z.number().finite().positive().optional().describe("Tile period in user units (line gap / dot spacing); default 8"),
|
|
39
|
+
lineWidth: zod.z.number().finite().positive().optional().describe("Line / grid stroke width; for dots, drives the dot radius. Default 1 (dots default to size/5)"),
|
|
40
|
+
rotation: zod.z.number().finite().optional().describe("Rotate the whole pattern, in degrees")
|
|
41
|
+
}).describe("Pattern paint server (hatching / dots / grid)"),
|
|
42
|
+
zod.z.object({
|
|
43
|
+
type: zod.z.literal("image"),
|
|
44
|
+
href: zod.z.string().min(1).describe("Image URL (http(s) or data URI)"),
|
|
45
|
+
fit: zod.z.enum([
|
|
46
|
+
"fill",
|
|
47
|
+
"contain",
|
|
48
|
+
"cover"
|
|
49
|
+
]).optional().describe("How the image maps to the shape: `fill` (stretch) / `contain` / `cover`. Default `cover`")
|
|
50
|
+
}).describe("Image paint server (fills the shape with an image)")
|
|
51
|
+
]).describe("Paint server spec: gradient / pattern / image. Solid color stays a plain string on `fill` / `stroke`.");
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.GradientStopSchema = GradientStopSchema;
|
|
54
|
+
exports.PaintSpecSchema = PaintSpecSchema;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* 渐变 stop:位置 + 颜色 + 可选透明度
|
|
4
|
+
* @description offset 0..1(沿渐变轴的位置);color 任意 CSS 颜色(含 `currentColor` 主题反应);opacity 0..1。
|
|
5
|
+
*/
|
|
6
|
+
export declare const GradientStopSchema: z.ZodObject<{
|
|
7
|
+
offset: z.ZodNumber;
|
|
8
|
+
color: z.ZodString;
|
|
9
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
offset: number;
|
|
12
|
+
color: string;
|
|
13
|
+
opacity?: number | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
offset: number;
|
|
16
|
+
color: string;
|
|
17
|
+
opacity?: number | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Paint server 规格(渐变 / 图案 / 图片);纯色仍是 `fill` / `stroke` 上的 string,不进此 schema
|
|
21
|
+
* @description 四种 paint server:linear / radial gradient、pattern(图案)、image(图片)。纯 JSON 形态,保 IR 可序列化。
|
|
22
|
+
* linear 方向用 `angle`(度,polar 约定:0°=+x,90°=+y 屏幕下);radial 的 `center` / `radius` 用 objectBoundingBox(0..1,随形状缩放)。
|
|
23
|
+
*/
|
|
24
|
+
export declare const PaintSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"linearGradient">;
|
|
26
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
27
|
+
offset: z.ZodNumber;
|
|
28
|
+
color: z.ZodString;
|
|
29
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
offset: number;
|
|
32
|
+
color: string;
|
|
33
|
+
opacity?: number | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
offset: number;
|
|
36
|
+
color: string;
|
|
37
|
+
opacity?: number | undefined;
|
|
38
|
+
}>, "many">;
|
|
39
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
type: "linearGradient";
|
|
42
|
+
stops: {
|
|
43
|
+
offset: number;
|
|
44
|
+
color: string;
|
|
45
|
+
opacity?: number | undefined;
|
|
46
|
+
}[];
|
|
47
|
+
angle?: number | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
type: "linearGradient";
|
|
50
|
+
stops: {
|
|
51
|
+
offset: number;
|
|
52
|
+
color: string;
|
|
53
|
+
opacity?: number | undefined;
|
|
54
|
+
}[];
|
|
55
|
+
angle?: number | undefined;
|
|
56
|
+
}>, z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"radialGradient">;
|
|
58
|
+
stops: z.ZodArray<z.ZodObject<{
|
|
59
|
+
offset: z.ZodNumber;
|
|
60
|
+
color: z.ZodString;
|
|
61
|
+
opacity: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
offset: number;
|
|
64
|
+
color: string;
|
|
65
|
+
opacity?: number | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
offset: number;
|
|
68
|
+
color: string;
|
|
69
|
+
opacity?: number | undefined;
|
|
70
|
+
}>, "many">;
|
|
71
|
+
center: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
72
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
type: "radialGradient";
|
|
75
|
+
stops: {
|
|
76
|
+
offset: number;
|
|
77
|
+
color: string;
|
|
78
|
+
opacity?: number | undefined;
|
|
79
|
+
}[];
|
|
80
|
+
radius?: number | undefined;
|
|
81
|
+
center?: [number, number] | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
type: "radialGradient";
|
|
84
|
+
stops: {
|
|
85
|
+
offset: number;
|
|
86
|
+
color: string;
|
|
87
|
+
opacity?: number | undefined;
|
|
88
|
+
}[];
|
|
89
|
+
radius?: number | undefined;
|
|
90
|
+
center?: [number, number] | undefined;
|
|
91
|
+
}>, z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"pattern">;
|
|
93
|
+
shape: z.ZodEnum<["lines", "dots", "grid"]>;
|
|
94
|
+
color: z.ZodOptional<z.ZodString>;
|
|
95
|
+
background: z.ZodOptional<z.ZodString>;
|
|
96
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
rotation: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
type: "pattern";
|
|
101
|
+
shape: "lines" | "dots" | "grid";
|
|
102
|
+
size?: number | undefined;
|
|
103
|
+
color?: string | undefined;
|
|
104
|
+
background?: string | undefined;
|
|
105
|
+
lineWidth?: number | undefined;
|
|
106
|
+
rotation?: number | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
type: "pattern";
|
|
109
|
+
shape: "lines" | "dots" | "grid";
|
|
110
|
+
size?: number | undefined;
|
|
111
|
+
color?: string | undefined;
|
|
112
|
+
background?: string | undefined;
|
|
113
|
+
lineWidth?: number | undefined;
|
|
114
|
+
rotation?: number | undefined;
|
|
115
|
+
}>, z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"image">;
|
|
117
|
+
href: z.ZodString;
|
|
118
|
+
fit: z.ZodOptional<z.ZodEnum<["fill", "contain", "cover"]>>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
type: "image";
|
|
121
|
+
href: string;
|
|
122
|
+
fit?: "fill" | "contain" | "cover" | undefined;
|
|
123
|
+
}, {
|
|
124
|
+
type: "image";
|
|
125
|
+
href: string;
|
|
126
|
+
fit?: "fill" | "contain" | "cover" | undefined;
|
|
127
|
+
}>]>;
|
|
128
|
+
/** 渐变 stop 类型 */
|
|
129
|
+
export type IRGradientStop = z.infer<typeof GradientStopSchema>;
|
|
130
|
+
/** Paint server 规格类型(渐变 / 图案 / 图片) */
|
|
131
|
+
export type IRPaintSpec = z.infer<typeof PaintSpecSchema>;
|
|
132
|
+
//# sourceMappingURL=paint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../../src/ir/paint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAMY,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmEwF,CAAC;AAErH,iBAAiB;AACjB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,sCAAsC;AACtC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -50,21 +50,21 @@ export declare const ArrowEndDetailSchema: z.ZodObject<{
|
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
51
|
length?: number | undefined;
|
|
52
52
|
fill?: string | undefined;
|
|
53
|
+
color?: string | undefined;
|
|
53
54
|
opacity?: number | undefined;
|
|
54
55
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
56
|
+
lineWidth?: number | undefined;
|
|
55
57
|
scale?: number | undefined;
|
|
56
58
|
width?: number | undefined;
|
|
57
|
-
color?: string | undefined;
|
|
58
|
-
lineWidth?: number | undefined;
|
|
59
59
|
}, {
|
|
60
60
|
length?: number | undefined;
|
|
61
61
|
fill?: string | undefined;
|
|
62
|
+
color?: string | undefined;
|
|
62
63
|
opacity?: number | undefined;
|
|
63
64
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
65
|
+
lineWidth?: number | undefined;
|
|
64
66
|
scale?: number | undefined;
|
|
65
67
|
width?: number | undefined;
|
|
66
|
-
color?: string | undefined;
|
|
67
|
-
lineWidth?: number | undefined;
|
|
68
68
|
}>;
|
|
69
69
|
/**
|
|
70
70
|
* Path 级箭头详细配置 schema
|
|
@@ -108,21 +108,21 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
108
108
|
}, "strip", z.ZodTypeAny, {
|
|
109
109
|
length?: number | undefined;
|
|
110
110
|
fill?: string | undefined;
|
|
111
|
+
color?: string | undefined;
|
|
111
112
|
opacity?: number | undefined;
|
|
112
113
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
114
|
+
lineWidth?: number | undefined;
|
|
113
115
|
scale?: number | undefined;
|
|
114
116
|
width?: number | undefined;
|
|
115
|
-
color?: string | undefined;
|
|
116
|
-
lineWidth?: number | undefined;
|
|
117
117
|
}, {
|
|
118
118
|
length?: number | undefined;
|
|
119
119
|
fill?: string | undefined;
|
|
120
|
+
color?: string | undefined;
|
|
120
121
|
opacity?: number | undefined;
|
|
121
122
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
123
|
+
lineWidth?: number | undefined;
|
|
122
124
|
scale?: number | undefined;
|
|
123
125
|
width?: number | undefined;
|
|
124
|
-
color?: string | undefined;
|
|
125
|
-
lineWidth?: number | undefined;
|
|
126
126
|
}>>;
|
|
127
127
|
end: z.ZodOptional<z.ZodObject<{
|
|
128
128
|
shape: z.ZodOptional<z.ZodNativeEnum<{
|
|
@@ -144,79 +144,79 @@ export declare const ArrowDetailSchema: z.ZodObject<{
|
|
|
144
144
|
}, "strip", z.ZodTypeAny, {
|
|
145
145
|
length?: number | undefined;
|
|
146
146
|
fill?: string | undefined;
|
|
147
|
+
color?: string | undefined;
|
|
147
148
|
opacity?: number | undefined;
|
|
148
149
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
150
|
+
lineWidth?: number | undefined;
|
|
149
151
|
scale?: number | undefined;
|
|
150
152
|
width?: number | undefined;
|
|
151
|
-
color?: string | undefined;
|
|
152
|
-
lineWidth?: number | undefined;
|
|
153
153
|
}, {
|
|
154
154
|
length?: number | undefined;
|
|
155
155
|
fill?: string | undefined;
|
|
156
|
+
color?: string | undefined;
|
|
156
157
|
opacity?: number | undefined;
|
|
157
158
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
159
|
+
lineWidth?: number | undefined;
|
|
158
160
|
scale?: number | undefined;
|
|
159
161
|
width?: number | undefined;
|
|
160
|
-
color?: string | undefined;
|
|
161
|
-
lineWidth?: number | undefined;
|
|
162
162
|
}>>;
|
|
163
163
|
}, "strip", z.ZodTypeAny, {
|
|
164
164
|
length?: number | undefined;
|
|
165
165
|
fill?: string | undefined;
|
|
166
|
+
color?: string | undefined;
|
|
166
167
|
opacity?: number | undefined;
|
|
167
168
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
169
|
+
lineWidth?: number | undefined;
|
|
168
170
|
scale?: number | undefined;
|
|
169
171
|
width?: number | undefined;
|
|
170
|
-
color?: string | undefined;
|
|
171
|
-
lineWidth?: number | undefined;
|
|
172
172
|
start?: {
|
|
173
173
|
length?: number | undefined;
|
|
174
174
|
fill?: string | undefined;
|
|
175
|
+
color?: string | undefined;
|
|
175
176
|
opacity?: number | undefined;
|
|
176
177
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
178
|
+
lineWidth?: number | undefined;
|
|
177
179
|
scale?: number | undefined;
|
|
178
180
|
width?: number | undefined;
|
|
179
|
-
color?: string | undefined;
|
|
180
|
-
lineWidth?: number | undefined;
|
|
181
181
|
} | undefined;
|
|
182
182
|
end?: {
|
|
183
183
|
length?: number | undefined;
|
|
184
184
|
fill?: string | undefined;
|
|
185
|
+
color?: string | undefined;
|
|
185
186
|
opacity?: number | undefined;
|
|
186
187
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
188
|
+
lineWidth?: number | undefined;
|
|
187
189
|
scale?: number | undefined;
|
|
188
190
|
width?: number | undefined;
|
|
189
|
-
color?: string | undefined;
|
|
190
|
-
lineWidth?: number | undefined;
|
|
191
191
|
} | undefined;
|
|
192
192
|
}, {
|
|
193
193
|
length?: number | undefined;
|
|
194
194
|
fill?: string | undefined;
|
|
195
|
+
color?: string | undefined;
|
|
195
196
|
opacity?: number | undefined;
|
|
196
197
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
198
|
+
lineWidth?: number | undefined;
|
|
197
199
|
scale?: number | undefined;
|
|
198
200
|
width?: number | undefined;
|
|
199
|
-
color?: string | undefined;
|
|
200
|
-
lineWidth?: number | undefined;
|
|
201
201
|
start?: {
|
|
202
202
|
length?: number | undefined;
|
|
203
203
|
fill?: string | undefined;
|
|
204
|
+
color?: string | undefined;
|
|
204
205
|
opacity?: number | undefined;
|
|
205
206
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
207
|
+
lineWidth?: number | undefined;
|
|
206
208
|
scale?: number | undefined;
|
|
207
209
|
width?: number | undefined;
|
|
208
|
-
color?: string | undefined;
|
|
209
|
-
lineWidth?: number | undefined;
|
|
210
210
|
} | undefined;
|
|
211
211
|
end?: {
|
|
212
212
|
length?: number | undefined;
|
|
213
213
|
fill?: string | undefined;
|
|
214
|
+
color?: string | undefined;
|
|
214
215
|
opacity?: number | undefined;
|
|
215
216
|
shape?: "normal" | "open" | "stealth" | "diamond" | "openDiamond" | "circle" | "openCircle" | undefined;
|
|
217
|
+
lineWidth?: number | undefined;
|
|
216
218
|
scale?: number | undefined;
|
|
217
219
|
width?: number | undefined;
|
|
218
|
-
color?: string | undefined;
|
|
219
|
-
lineWidth?: number | undefined;
|
|
220
220
|
} | undefined;
|
|
221
221
|
}>;
|
|
222
222
|
/** 端点级箭头视觉规格 */
|
|
@@ -1,3 +1,4 @@
|
|
|
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");
|
|
@@ -15,7 +16,7 @@ var PathSchema = zod.z.object({
|
|
|
15
16
|
"<->"
|
|
16
17
|
]).optional().describe("Path-level arrow direction. omitted/`none` = no arrows; `->` = arrow at end; `<-` = at start; `<->` = both."),
|
|
17
18
|
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
|
|
19
|
+
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
20
|
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
21
|
lineCap: zod.z.enum([
|
|
21
22
|
"butt",
|