@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.
Files changed (217) hide show
  1. package/dist/es/arrows/index.d.ts +13 -0
  2. package/dist/es/arrows/index.d.ts.map +1 -0
  3. package/dist/es/arrows/index.js +118 -0
  4. package/dist/es/arrows/types.d.ts +43 -0
  5. package/dist/es/arrows/types.d.ts.map +1 -0
  6. package/dist/es/compile/clip.d.ts +17 -0
  7. package/dist/es/compile/clip.d.ts.map +1 -0
  8. package/dist/es/compile/clip.js +84 -0
  9. package/dist/es/compile/compile.d.ts +26 -1
  10. package/dist/es/compile/compile.d.ts.map +1 -1
  11. package/dist/es/compile/compile.js +60 -7
  12. package/dist/es/compile/marker-prim.d.ts +22 -0
  13. package/dist/es/compile/marker-prim.d.ts.map +1 -0
  14. package/dist/es/compile/marker-prim.js +63 -0
  15. package/dist/es/compile/node.d.ts +2 -1
  16. package/dist/es/compile/node.d.ts.map +1 -1
  17. package/dist/es/compile/node.js +3 -3
  18. package/dist/es/compile/paint.d.ts +6 -1
  19. package/dist/es/compile/paint.d.ts.map +1 -1
  20. package/dist/es/compile/paint.js +60 -3
  21. package/dist/es/compile/path/anchor.d.ts.map +1 -1
  22. package/dist/es/compile/path/anchor.js +12 -0
  23. package/dist/es/compile/path/index.d.ts +15 -0
  24. package/dist/es/compile/path/index.d.ts.map +1 -1
  25. package/dist/es/compile/path/index.js +268 -12
  26. package/dist/es/compile/path/relative.d.ts.map +1 -1
  27. package/dist/es/compile/path/relative.js +8 -0
  28. package/dist/es/compile/path/shrink.d.ts +19 -6
  29. package/dist/es/compile/path/shrink.d.ts.map +1 -1
  30. package/dist/es/compile/path/shrink.js +147 -25
  31. package/dist/es/compile/position.d.ts +8 -2
  32. package/dist/es/compile/position.d.ts.map +1 -1
  33. package/dist/es/compile/position.js +7 -1
  34. package/dist/es/geometry/bend.d.ts +7 -0
  35. package/dist/es/geometry/bend.d.ts.map +1 -1
  36. package/dist/es/geometry/bend.js +26 -1
  37. package/dist/es/index.d.ts +16 -4
  38. package/dist/es/index.d.ts.map +1 -1
  39. package/dist/es/index.js +13 -7
  40. package/dist/es/ir/clip.d.ts +72 -0
  41. package/dist/es/ir/clip.d.ts.map +1 -0
  42. package/dist/es/ir/clip.js +37 -0
  43. package/dist/es/ir/coordinate.d.ts +3 -3
  44. package/dist/es/ir/coordinate.d.ts.map +1 -1
  45. package/dist/es/ir/coordinate.js +4 -2
  46. package/dist/es/ir/index.d.ts +2 -0
  47. package/dist/es/ir/index.d.ts.map +1 -1
  48. package/dist/es/ir/json.d.ts +22 -0
  49. package/dist/es/ir/json.d.ts.map +1 -0
  50. package/dist/es/ir/json.js +25 -0
  51. package/dist/es/ir/node.d.ts +10 -10
  52. package/dist/es/ir/node.d.ts.map +1 -1
  53. package/dist/es/ir/node.js +4 -2
  54. package/dist/es/ir/paint.d.ts +25 -3
  55. package/dist/es/ir/paint.d.ts.map +1 -1
  56. package/dist/es/ir/paint.js +12 -6
  57. package/dist/es/ir/path/arrow.d.ts +40 -60
  58. package/dist/es/ir/path/arrow.d.ts.map +1 -1
  59. package/dist/es/ir/path/arrow.js +5 -5
  60. package/dist/es/ir/path/path.d.ts +553 -164
  61. package/dist/es/ir/path/path.d.ts.map +1 -1
  62. package/dist/es/ir/path/path.js +21 -1
  63. package/dist/es/ir/path/step.d.ts +483 -128
  64. package/dist/es/ir/path/step.d.ts.map +1 -1
  65. package/dist/es/ir/path/step.js +18 -5
  66. package/dist/es/ir/path/target.d.ts +1 -1
  67. package/dist/es/ir/path/target.d.ts.map +1 -1
  68. package/dist/es/ir/path/target.js +4 -2
  69. package/dist/es/ir/position/between-position.d.ts +26 -0
  70. package/dist/es/ir/position/between-position.d.ts.map +1 -0
  71. package/dist/es/ir/position/between-position.js +21 -0
  72. package/dist/es/ir/position/index.d.ts +1 -0
  73. package/dist/es/ir/position/index.d.ts.map +1 -1
  74. package/dist/es/ir/scene.d.ts +51 -0
  75. package/dist/es/ir/scene.d.ts.map +1 -1
  76. package/dist/es/ir/scene.js +14 -2
  77. package/dist/es/ir/scope.d.ts +999 -380
  78. package/dist/es/ir/scope.d.ts.map +1 -1
  79. package/dist/es/ir/scope.js +2 -0
  80. package/dist/es/pathGenerators/define.d.ts +16 -0
  81. package/dist/es/pathGenerators/define.d.ts.map +1 -0
  82. package/dist/es/pathGenerators/define.js +23 -0
  83. package/dist/es/pathGenerators/index.d.ts +9 -0
  84. package/dist/es/pathGenerators/index.d.ts.map +1 -0
  85. package/dist/es/pathGenerators/types.d.ts +45 -0
  86. package/dist/es/pathGenerators/types.d.ts.map +1 -0
  87. package/dist/es/patterns/index.d.ts +10 -0
  88. package/dist/es/patterns/index.d.ts.map +1 -0
  89. package/dist/es/patterns/index.js +83 -0
  90. package/dist/es/patterns/types.d.ts +38 -0
  91. package/dist/es/patterns/types.d.ts.map +1 -0
  92. package/dist/es/primitive/clip.d.ts +18 -0
  93. package/dist/es/primitive/clip.d.ts.map +1 -0
  94. package/dist/es/primitive/group.d.ts +6 -0
  95. package/dist/es/primitive/group.d.ts.map +1 -1
  96. package/dist/es/primitive/index.d.ts +2 -0
  97. package/dist/es/primitive/index.d.ts.map +1 -1
  98. package/dist/es/primitive/marker.d.ts +160 -0
  99. package/dist/es/primitive/marker.d.ts.map +1 -0
  100. package/dist/es/primitive/paint.d.ts +32 -4
  101. package/dist/es/primitive/paint.d.ts.map +1 -1
  102. package/dist/es/primitive/path.d.ts +22 -18
  103. package/dist/es/primitive/path.d.ts.map +1 -1
  104. package/dist/es/primitive/scene.d.ts +2 -1
  105. package/dist/es/primitive/scene.d.ts.map +1 -1
  106. package/dist/lib/arrows/index.cjs +118 -0
  107. package/dist/lib/arrows/index.d.ts +13 -0
  108. package/dist/lib/arrows/index.d.ts.map +1 -0
  109. package/dist/lib/arrows/types.d.ts +43 -0
  110. package/dist/lib/arrows/types.d.ts.map +1 -0
  111. package/dist/lib/compile/clip.cjs +84 -0
  112. package/dist/lib/compile/clip.d.ts +17 -0
  113. package/dist/lib/compile/clip.d.ts.map +1 -0
  114. package/dist/lib/compile/compile.cjs +62 -9
  115. package/dist/lib/compile/compile.d.ts +26 -1
  116. package/dist/lib/compile/compile.d.ts.map +1 -1
  117. package/dist/lib/compile/marker-prim.cjs +63 -0
  118. package/dist/lib/compile/marker-prim.d.ts +22 -0
  119. package/dist/lib/compile/marker-prim.d.ts.map +1 -0
  120. package/dist/lib/compile/node.cjs +3 -3
  121. package/dist/lib/compile/node.d.ts +2 -1
  122. package/dist/lib/compile/node.d.ts.map +1 -1
  123. package/dist/lib/compile/paint.cjs +60 -3
  124. package/dist/lib/compile/paint.d.ts +6 -1
  125. package/dist/lib/compile/paint.d.ts.map +1 -1
  126. package/dist/lib/compile/path/anchor.cjs +12 -0
  127. package/dist/lib/compile/path/anchor.d.ts.map +1 -1
  128. package/dist/lib/compile/path/index.cjs +266 -10
  129. package/dist/lib/compile/path/index.d.ts +15 -0
  130. package/dist/lib/compile/path/index.d.ts.map +1 -1
  131. package/dist/lib/compile/path/relative.cjs +8 -0
  132. package/dist/lib/compile/path/relative.d.ts.map +1 -1
  133. package/dist/lib/compile/path/shrink.cjs +147 -25
  134. package/dist/lib/compile/path/shrink.d.ts +19 -6
  135. package/dist/lib/compile/path/shrink.d.ts.map +1 -1
  136. package/dist/lib/compile/position.cjs +7 -1
  137. package/dist/lib/compile/position.d.ts +8 -2
  138. package/dist/lib/compile/position.d.ts.map +1 -1
  139. package/dist/lib/geometry/bend.cjs +26 -0
  140. package/dist/lib/geometry/bend.d.ts +7 -0
  141. package/dist/lib/geometry/bend.d.ts.map +1 -1
  142. package/dist/lib/index.cjs +20 -3
  143. package/dist/lib/index.d.ts +16 -4
  144. package/dist/lib/index.d.ts.map +1 -1
  145. package/dist/lib/ir/clip.cjs +37 -0
  146. package/dist/lib/ir/clip.d.ts +72 -0
  147. package/dist/lib/ir/clip.d.ts.map +1 -0
  148. package/dist/lib/ir/coordinate.cjs +4 -2
  149. package/dist/lib/ir/coordinate.d.ts +3 -3
  150. package/dist/lib/ir/coordinate.d.ts.map +1 -1
  151. package/dist/lib/ir/index.d.ts +2 -0
  152. package/dist/lib/ir/index.d.ts.map +1 -1
  153. package/dist/lib/ir/json.cjs +26 -0
  154. package/dist/lib/ir/json.d.ts +22 -0
  155. package/dist/lib/ir/json.d.ts.map +1 -0
  156. package/dist/lib/ir/node.cjs +4 -2
  157. package/dist/lib/ir/node.d.ts +10 -10
  158. package/dist/lib/ir/node.d.ts.map +1 -1
  159. package/dist/lib/ir/paint.cjs +12 -5
  160. package/dist/lib/ir/paint.d.ts +25 -3
  161. package/dist/lib/ir/paint.d.ts.map +1 -1
  162. package/dist/lib/ir/path/arrow.cjs +5 -5
  163. package/dist/lib/ir/path/arrow.d.ts +40 -60
  164. package/dist/lib/ir/path/arrow.d.ts.map +1 -1
  165. package/dist/lib/ir/path/path.cjs +20 -0
  166. package/dist/lib/ir/path/path.d.ts +553 -164
  167. package/dist/lib/ir/path/path.d.ts.map +1 -1
  168. package/dist/lib/ir/path/step.cjs +18 -4
  169. package/dist/lib/ir/path/step.d.ts +483 -128
  170. package/dist/lib/ir/path/step.d.ts.map +1 -1
  171. package/dist/lib/ir/path/target.cjs +4 -2
  172. package/dist/lib/ir/path/target.d.ts +1 -1
  173. package/dist/lib/ir/path/target.d.ts.map +1 -1
  174. package/dist/lib/ir/position/between-position.cjs +22 -0
  175. package/dist/lib/ir/position/between-position.d.ts +26 -0
  176. package/dist/lib/ir/position/between-position.d.ts.map +1 -0
  177. package/dist/lib/ir/position/index.d.ts +1 -0
  178. package/dist/lib/ir/position/index.d.ts.map +1 -1
  179. package/dist/lib/ir/scene.cjs +14 -1
  180. package/dist/lib/ir/scene.d.ts +51 -0
  181. package/dist/lib/ir/scene.d.ts.map +1 -1
  182. package/dist/lib/ir/scope.cjs +2 -0
  183. package/dist/lib/ir/scope.d.ts +999 -380
  184. package/dist/lib/ir/scope.d.ts.map +1 -1
  185. package/dist/lib/pathGenerators/define.cjs +23 -0
  186. package/dist/lib/pathGenerators/define.d.ts +16 -0
  187. package/dist/lib/pathGenerators/define.d.ts.map +1 -0
  188. package/dist/lib/pathGenerators/index.d.ts +9 -0
  189. package/dist/lib/pathGenerators/index.d.ts.map +1 -0
  190. package/dist/lib/pathGenerators/types.d.ts +45 -0
  191. package/dist/lib/pathGenerators/types.d.ts.map +1 -0
  192. package/dist/lib/patterns/index.cjs +83 -0
  193. package/dist/lib/patterns/index.d.ts +10 -0
  194. package/dist/lib/patterns/index.d.ts.map +1 -0
  195. package/dist/lib/patterns/types.d.ts +38 -0
  196. package/dist/lib/patterns/types.d.ts.map +1 -0
  197. package/dist/lib/primitive/clip.d.ts +18 -0
  198. package/dist/lib/primitive/clip.d.ts.map +1 -0
  199. package/dist/lib/primitive/group.d.ts +6 -0
  200. package/dist/lib/primitive/group.d.ts.map +1 -1
  201. package/dist/lib/primitive/index.d.ts +2 -0
  202. package/dist/lib/primitive/index.d.ts.map +1 -1
  203. package/dist/lib/primitive/marker.d.ts +160 -0
  204. package/dist/lib/primitive/marker.d.ts.map +1 -0
  205. package/dist/lib/primitive/paint.d.ts +32 -4
  206. package/dist/lib/primitive/paint.d.ts.map +1 -1
  207. package/dist/lib/primitive/path.d.ts +22 -18
  208. package/dist/lib/primitive/path.d.ts.map +1 -1
  209. package/dist/lib/primitive/scene.d.ts +2 -1
  210. package/dist/lib/primitive/scene.d.ts.map +1 -1
  211. package/package.json +1 -1
  212. package/dist/es/compile/path/arrow-geometry.d.ts +0 -22
  213. package/dist/es/compile/path/arrow-geometry.d.ts.map +0 -1
  214. package/dist/es/compile/path/arrow-geometry.js +0 -40
  215. package/dist/lib/compile/path/arrow-geometry.cjs +0 -41
  216. package/dist/lib/compile/path/arrow-geometry.d.ts +0 -22
  217. package/dist/lib/compile/path/arrow-geometry.d.ts.map +0 -1
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * 裁剪区规格(4 种结构化形状之一)
4
+ * @description renderer-agnostic 的纯数值裁剪区:`rect` 取景窗 / `circle` 圆形遮罩 / `ellipse` 椭圆遮罩 /
5
+ * `polygon` 任意直边区域。坐标为所在 scope 的局部坐标系(与 scope children 同帧)。
6
+ * 尺寸字段 `.positive().finite()`、坐标 `.finite()` 守 Scene JSON 可序列化(NaN/Infinity round-trip 失真)。
7
+ * 不含 SVG path 迷你语言(任意贝塞尔裁剪推迟)。
8
+ */
9
+ export declare const ClipSpecSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
10
+ kind: z.ZodLiteral<"rect">;
11
+ x: z.ZodNumber;
12
+ y: z.ZodNumber;
13
+ width: z.ZodNumber;
14
+ height: z.ZodNumber;
15
+ }, "strip", z.ZodTypeAny, {
16
+ kind: "rect";
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ }, {
22
+ kind: "rect";
23
+ x: number;
24
+ y: number;
25
+ width: number;
26
+ height: number;
27
+ }>, z.ZodObject<{
28
+ kind: z.ZodLiteral<"circle">;
29
+ cx: z.ZodNumber;
30
+ cy: z.ZodNumber;
31
+ r: z.ZodNumber;
32
+ }, "strip", z.ZodTypeAny, {
33
+ kind: "circle";
34
+ cx: number;
35
+ cy: number;
36
+ r: number;
37
+ }, {
38
+ kind: "circle";
39
+ cx: number;
40
+ cy: number;
41
+ r: number;
42
+ }>, z.ZodObject<{
43
+ kind: z.ZodLiteral<"ellipse">;
44
+ cx: z.ZodNumber;
45
+ cy: z.ZodNumber;
46
+ rx: z.ZodNumber;
47
+ ry: z.ZodNumber;
48
+ }, "strip", z.ZodTypeAny, {
49
+ kind: "ellipse";
50
+ cx: number;
51
+ cy: number;
52
+ rx: number;
53
+ ry: number;
54
+ }, {
55
+ kind: "ellipse";
56
+ cx: number;
57
+ cy: number;
58
+ rx: number;
59
+ ry: number;
60
+ }>, z.ZodObject<{
61
+ kind: z.ZodLiteral<"polygon">;
62
+ points: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">;
63
+ }, "strip", z.ZodTypeAny, {
64
+ kind: "polygon";
65
+ points: [number, number][];
66
+ }, {
67
+ kind: "polygon";
68
+ points: [number, number][];
69
+ }>]>;
70
+ /** 裁剪区 IR 类型(4 形状判别 union) */
71
+ export type IRClipSpec = z.infer<typeof ClipSpecSchema>;
72
+ //# sourceMappingURL=clip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../../src/ir/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwCxB,CAAC;AAEJ,8BAA8B;AAC9B,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -2,6 +2,7 @@ const require_position = require("./position/position.cjs");
2
2
  const require_polar_position = require("./position/polar-position.cjs");
3
3
  const require_at_position = require("./position/at-position.cjs");
4
4
  const require_offset_position = require("./position/offset-position.cjs");
5
+ const require_between_position = require("./position/between-position.cjs");
5
6
  let zod = require("zod");
6
7
  //#region src/ir/coordinate.ts
7
8
  /**
@@ -15,8 +16,9 @@ var CoordinateSchema = zod.z.object({
15
16
  require_position.PositionSchema,
16
17
  require_polar_position.PolarPositionSchema,
17
18
  require_at_position.AtPositionSchema,
18
- require_offset_position.OffsetPositionSchema
19
- ]).describe("Coordinate position; Cartesian [x, y], polar, relative-to-another-node (`at`-style), or offset from a base point (`{ of, offset }` form). Resolved at compile time.")
19
+ require_offset_position.OffsetPositionSchema,
20
+ require_between_position.BetweenPositionSchema
21
+ ]).describe("Coordinate position; Cartesian [x, y], polar, relative-to-another-node (`at`-style), offset from a base point (`{ of, offset }` form), or between two endpoints (`{ between: [A, B], t }`). Resolved at compile time.")
20
22
  }).describe("Coordinate placeholder: a named point with no visual; usable as a target for paths and as an anchor for relative positioning. Mirrors TikZ `\\coordinate (id) at (...);`");
21
23
  //#endregion
22
24
  exports.CoordinateSchema = CoordinateSchema;
@@ -36,7 +36,7 @@ export declare const CoordinateSchema: z.ZodObject<{
36
36
  }, {
37
37
  of: string | [number, number] | import('./position').PolarPosition;
38
38
  offset: [number, number];
39
- }>]>;
39
+ }>, z.ZodType<import('./position').IRBetweenPosition, z.ZodTypeDef, import('./position').IRBetweenPosition>]>;
40
40
  }, "strip", z.ZodTypeAny, {
41
41
  type: "coordinate";
42
42
  id: string;
@@ -47,7 +47,7 @@ export declare const CoordinateSchema: z.ZodObject<{
47
47
  } | {
48
48
  of: string | [number, number] | import('./position').PolarPosition;
49
49
  offset: [number, number];
50
- };
50
+ } | import('./position').IRBetweenPosition;
51
51
  }, {
52
52
  type: "coordinate";
53
53
  id: string;
@@ -58,7 +58,7 @@ export declare const CoordinateSchema: z.ZodObject<{
58
58
  } | {
59
59
  of: string | [number, number] | import('./position').PolarPosition;
60
60
  offset: [number, number];
61
- };
61
+ } | import('./position').IRBetweenPosition;
62
62
  }>;
63
63
  /** Coordinate IR 类型 `{ type:'coordinate', id, position }` */
64
64
  export type IRCoordinate = z.infer<typeof CoordinateSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"coordinate.d.ts","sourceRoot":"","sources":["../../../src/ir/coordinate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB1B,CAAC;AAEJ,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"coordinate.d.ts","sourceRoot":"","sources":["../../../src/ir/coordinate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyB1B,CAAC;AAEJ,6DAA6D;AAC7D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  export * from './position';
2
2
  export * from './font';
3
+ export * from './json';
3
4
  export * from './paint';
5
+ export * from './clip';
4
6
  export * from './text';
5
7
  export * from './path';
6
8
  export * from './node';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,26 @@
1
+ let zod = require("zod");
2
+ //#region src/ir/json.ts
3
+ /**
4
+ * 递归 JSON 值 schema
5
+ * @description 守 IR 100% JSON 可序列化:path generator step 的 params 只能由 JSON 值构成;
6
+ * 函数 / undefined / class 实例 / Symbol / Map / Set 等非 JSON 值在 parse 阶段被拒。
7
+ * `z.lazy` 让 array / object 分支可递归引用本 schema,深度不限。
8
+ */
9
+ var JsonValueSchema = zod.z.lazy(() => zod.z.union([
10
+ zod.z.string(),
11
+ zod.z.number().finite(),
12
+ zod.z.boolean(),
13
+ zod.z.null(),
14
+ zod.z.array(JsonValueSchema),
15
+ JsonObjectSchema
16
+ ]).describe("A JSON value: string, finite number, boolean, null, an array of JSON values, or an object of JSON values. Recursive with no depth limit. Functions, undefined, Symbol, class instances, Map, and Set are rejected to keep the IR fully JSON-serializable."));
17
+ /**
18
+ * JSON 对象 schema
19
+ * @description path generator step 的 `params` 类型;键为字符串、值为递归 JSON 值。
20
+ * 作为 compile 运行时的第二道护栏:即便外部 `paramsSchema` 是宽松类型,对其 parse 结果再跑本 schema
21
+ * 可拦下非 JSON 输出(function / undefined 等)。core 公开供外部 refine。
22
+ */
23
+ var JsonObjectSchema = zod.z.record(JsonValueSchema).describe("A JSON object: string keys mapping to recursive JSON values. Used as the params payload of a path generator step and as the runtime guard that the value is fully JSON-serializable. No maximum depth or size is enforced.");
24
+ //#endregion
25
+ exports.JsonObjectSchema = JsonObjectSchema;
26
+ exports.JsonValueSchema = JsonValueSchema;
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * 递归 JSON 值 schema
4
+ * @description 守 IR 100% JSON 可序列化:path generator step 的 params 只能由 JSON 值构成;
5
+ * 函数 / undefined / class 实例 / Symbol / Map / Set 等非 JSON 值在 parse 阶段被拒。
6
+ * `z.lazy` 让 array / object 分支可递归引用本 schema,深度不限。
7
+ */
8
+ export declare const JsonValueSchema: z.ZodType<JsonValue>;
9
+ /**
10
+ * JSON 对象 schema
11
+ * @description path generator step 的 `params` 类型;键为字符串、值为递归 JSON 值。
12
+ * 作为 compile 运行时的第二道护栏:即便外部 `paramsSchema` 是宽松类型,对其 parse 结果再跑本 schema
13
+ * 可拦下非 JSON 输出(function / undefined 等)。core 公开供外部 refine。
14
+ */
15
+ export declare const JsonObjectSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>>;
16
+ /** 单个 JSON 值(字符串 / 数字 / 布尔 / null / 数组 / 对象,递归) */
17
+ export type JsonValue = string | number | boolean | null | Array<JsonValue> | {
18
+ [key: string]: JsonValue;
19
+ };
20
+ /** JSON 对象类型(path generator step 的 params 形态) */
21
+ export type IRJsonObject = z.infer<typeof JsonObjectSchema>;
22
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/ir/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAahD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yEAI1B,CAAC;AAEJ,mDAAmD;AACnD,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,KAAK,CAAC,SAAS,CAAC,GAChB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEjC,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -2,6 +2,7 @@ const require_position = require("./position/position.cjs");
2
2
  const require_polar_position = require("./position/polar-position.cjs");
3
3
  const require_at_position = require("./position/at-position.cjs");
4
4
  const require_offset_position = require("./position/offset-position.cjs");
5
+ const require_between_position = require("./position/between-position.cjs");
5
6
  const require_font = require("./font.cjs");
6
7
  const require_paint = require("./paint.cjs");
7
8
  const require_text = require("./text.cjs");
@@ -54,8 +55,9 @@ var NodeSchema = zod.z.object({
54
55
  require_position.PositionSchema,
55
56
  require_polar_position.PolarPositionSchema,
56
57
  require_at_position.AtPositionSchema,
57
- require_offset_position.OffsetPositionSchema
58
- ]).describe("Center point of the node content box; Cartesian [x, y], polar, relative-to-another-node (`at`-style with `direction` / `of` / `distance?`), or offset from a base point (`{ of, offset }` form mirroring TikZ `calc`). All non-Cartesian forms resolve at compile time."),
58
+ require_offset_position.OffsetPositionSchema,
59
+ require_between_position.BetweenPositionSchema
60
+ ]).describe("Center point of the node content box; Cartesian [x, y], polar, relative-to-another-node (`at`-style with `direction` / `of` / `distance?`), offset from a base point (`{ of, offset }` form mirroring TikZ `calc`), or between two endpoints (`{ between: [A, B], t }` proportional point). All non-Cartesian forms resolve at compile time."),
59
61
  rotate: zod.z.number().optional().describe("Rotation in degrees around the node center; positive = clockwise (matches TikZ rotate=...)"),
60
62
  text: require_text.TextBlockSchema.optional(),
61
63
  align: zod.z.nativeEnum(NODE_TEXT_ALIGNS).optional().describe("Multi-line text alignment within the text block; `left` / `center` / `right`. Defaults to `center` (matches TikZ)."),
@@ -153,7 +153,7 @@ export declare const NodeSchema: z.ZodObject<{
153
153
  }, {
154
154
  of: string | [number, number] | import('./position').PolarPosition;
155
155
  offset: [number, number];
156
- }>]>;
156
+ }>, z.ZodType<import('./position').IRBetweenPosition, z.ZodTypeDef, import('./position').IRBetweenPosition>]>;
157
157
  rotate: z.ZodOptional<z.ZodNumber>;
158
158
  text: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
159
159
  text: z.ZodString;
@@ -273,7 +273,7 @@ export declare const NodeSchema: z.ZodObject<{
273
273
  center?: [number, number] | undefined;
274
274
  }>, z.ZodObject<{
275
275
  type: z.ZodLiteral<"pattern">;
276
- shape: z.ZodEnum<["lines", "dots", "grid"]>;
276
+ shape: z.ZodString;
277
277
  color: z.ZodOptional<z.ZodString>;
278
278
  background: z.ZodOptional<z.ZodString>;
279
279
  size: z.ZodOptional<z.ZodNumber>;
@@ -281,7 +281,7 @@ export declare const NodeSchema: z.ZodObject<{
281
281
  rotation: z.ZodOptional<z.ZodNumber>;
282
282
  }, "strip", z.ZodTypeAny, {
283
283
  type: "pattern";
284
- shape: "lines" | "dots" | "grid";
284
+ shape: string;
285
285
  size?: number | undefined;
286
286
  color?: string | undefined;
287
287
  background?: string | undefined;
@@ -289,7 +289,7 @@ export declare const NodeSchema: z.ZodObject<{
289
289
  rotation?: number | undefined;
290
290
  }, {
291
291
  type: "pattern";
292
- shape: "lines" | "dots" | "grid";
292
+ shape: string;
293
293
  size?: number | undefined;
294
294
  color?: string | undefined;
295
295
  background?: string | undefined;
@@ -524,7 +524,7 @@ export declare const NodeSchema: z.ZodObject<{
524
524
  } | {
525
525
  of: string | [number, number] | import('./position').PolarPosition;
526
526
  offset: [number, number];
527
- };
527
+ } | import('./position').IRBetweenPosition;
528
528
  fill?: string | {
529
529
  type: "linearGradient";
530
530
  stops: {
@@ -544,7 +544,7 @@ export declare const NodeSchema: z.ZodObject<{
544
544
  center?: [number, number] | undefined;
545
545
  } | {
546
546
  type: "pattern";
547
- shape: "lines" | "dots" | "grid";
547
+ shape: string;
548
548
  size?: number | undefined;
549
549
  color?: string | undefined;
550
550
  background?: string | undefined;
@@ -555,6 +555,7 @@ export declare const NodeSchema: z.ZodObject<{
555
555
  href: string;
556
556
  fit?: "fill" | "contain" | "cover" | undefined;
557
557
  } | undefined;
558
+ id?: string | undefined;
558
559
  color?: string | undefined;
559
560
  opacity?: number | undefined;
560
561
  shape?: string | undefined;
@@ -576,7 +577,6 @@ export declare const NodeSchema: z.ZodObject<{
576
577
  style?: "normal" | "italic" | "oblique" | undefined;
577
578
  } | undefined;
578
579
  scale?: number | undefined;
579
- id?: string | undefined;
580
580
  textColor?: string | undefined;
581
581
  label?: {
582
582
  text: string;
@@ -649,7 +649,7 @@ export declare const NodeSchema: z.ZodObject<{
649
649
  } | {
650
650
  of: string | [number, number] | import('./position').PolarPosition;
651
651
  offset: [number, number];
652
- };
652
+ } | import('./position').IRBetweenPosition;
653
653
  fill?: string | {
654
654
  type: "linearGradient";
655
655
  stops: {
@@ -669,7 +669,7 @@ export declare const NodeSchema: z.ZodObject<{
669
669
  center?: [number, number] | undefined;
670
670
  } | {
671
671
  type: "pattern";
672
- shape: "lines" | "dots" | "grid";
672
+ shape: string;
673
673
  size?: number | undefined;
674
674
  color?: string | undefined;
675
675
  background?: string | undefined;
@@ -680,6 +680,7 @@ export declare const NodeSchema: z.ZodObject<{
680
680
  href: string;
681
681
  fit?: "fill" | "contain" | "cover" | undefined;
682
682
  } | undefined;
683
+ id?: string | undefined;
683
684
  color?: string | undefined;
684
685
  opacity?: number | undefined;
685
686
  shape?: string | undefined;
@@ -701,7 +702,6 @@ export declare const NodeSchema: z.ZodObject<{
701
702
  style?: "normal" | "italic" | "oblique" | undefined;
702
703
  } | undefined;
703
704
  scale?: number | undefined;
704
- id?: string | undefined;
705
705
  textColor?: string | undefined;
706
706
  label?: {
707
707
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/ir/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMxC;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEzD,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DzB,CAAC;AAEJ,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuMpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/ir/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMxC;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEzD,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DzB,CAAC;AAEJ,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6MpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,6 +1,16 @@
1
1
  let zod = require("zod");
2
2
  //#region src/ir/paint.ts
3
3
  /**
4
+ * 内置 pattern motif 名常量(用 const + ValueOf 派生,不用 TS enum)
5
+ * @description 内置 3 motif:`lines`(横向阴影线)/ `dots`(波点)/ `grid`(横竖网格)。
6
+ * 各 motif 的 tile 几何由 `BUILTIN_PATTERNS` 的 `PatternDefinition.emit` 在 compile 期产出。
7
+ */
8
+ var PATTERN_SHAPES = {
9
+ lines: "lines",
10
+ dots: "dots",
11
+ grid: "grid"
12
+ };
13
+ /**
4
14
  * 渐变 stop:位置 + 颜色 + 可选透明度
5
15
  * @description offset 0..1(沿渐变轴的位置);color 任意 CSS 颜色(含 `currentColor` 主题反应);opacity 0..1。
6
16
  */
@@ -28,11 +38,7 @@ var PaintSpecSchema = zod.z.discriminatedUnion("type", [
28
38
  }).describe("Radial gradient paint server"),
29
39
  zod.z.object({
30
40
  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)"),
41
+ shape: zod.z.string().min(1).describe("Registered pattern motif name; built-in `lines` (hatching) / `dots` / `grid` (crosshatch), or an extension motif registered via `CompileOptions.patterns`. Any non-empty string passes schema validation; unregistered names are rejected at compile time."),
36
42
  color: zod.z.string().optional().describe("Motif color; any CSS color, defaults to `currentColor`"),
37
43
  background: zod.z.string().optional().describe("Tile background fill; omitted = transparent"),
38
44
  size: zod.z.number().finite().positive().optional().describe("Tile period in user units (line gap / dot spacing); default 8"),
@@ -51,4 +57,5 @@ var PaintSpecSchema = zod.z.discriminatedUnion("type", [
51
57
  ]).describe("Paint server spec: gradient / pattern / image. Solid color stays a plain string on `fill` / `stroke`.");
52
58
  //#endregion
53
59
  exports.GradientStopSchema = GradientStopSchema;
60
+ exports.PATTERN_SHAPES = PATTERN_SHAPES;
54
61
  exports.PaintSpecSchema = PaintSpecSchema;
@@ -1,4 +1,26 @@
1
1
  import { z } from 'zod';
2
+ import { ValueOf } from '../types';
3
+ /**
4
+ * 内置 pattern motif 名常量(用 const + ValueOf 派生,不用 TS enum)
5
+ * @description 内置 3 motif:`lines`(横向阴影线)/ `dots`(波点)/ `grid`(横竖网格)。
6
+ * 各 motif 的 tile 几何由 `BUILTIN_PATTERNS` 的 `PatternDefinition.emit` 在 compile 期产出。
7
+ */
8
+ export declare const PATTERN_SHAPES: {
9
+ readonly lines: "lines";
10
+ readonly dots: "dots";
11
+ readonly grid: "grid";
12
+ };
13
+ /**
14
+ * 内置 3 pattern motif 名联合
15
+ * @description `BUILTIN_PATTERNS` 的 Record key(保穷尽性约束,不随 `PatternShapeName` 开放而退化为 `string`)
16
+ */
17
+ export type BuiltinPatternName = ValueOf<typeof PATTERN_SHAPES>;
18
+ /**
19
+ * pattern motif 名:开放字符串
20
+ * @description 内置 `BuiltinPatternName`,或经 `CompileOptions.patterns` 注册的扩展 motif 名;
21
+ * `& {}` 让 IDE 仍对内置 3 名自动补全,同时接受任意非空字符串
22
+ */
23
+ export type PatternShapeName = BuiltinPatternName | (string & {});
2
24
  /**
3
25
  * 渐变 stop:位置 + 颜色 + 可选透明度
4
26
  * @description offset 0..1(沿渐变轴的位置);color 任意 CSS 颜色(含 `currentColor` 主题反应);opacity 0..1。
@@ -90,7 +112,7 @@ export declare const PaintSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
90
112
  center?: [number, number] | undefined;
91
113
  }>, z.ZodObject<{
92
114
  type: z.ZodLiteral<"pattern">;
93
- shape: z.ZodEnum<["lines", "dots", "grid"]>;
115
+ shape: z.ZodString;
94
116
  color: z.ZodOptional<z.ZodString>;
95
117
  background: z.ZodOptional<z.ZodString>;
96
118
  size: z.ZodOptional<z.ZodNumber>;
@@ -98,7 +120,7 @@ export declare const PaintSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
98
120
  rotation: z.ZodOptional<z.ZodNumber>;
99
121
  }, "strip", z.ZodTypeAny, {
100
122
  type: "pattern";
101
- shape: "lines" | "dots" | "grid";
123
+ shape: string;
102
124
  size?: number | undefined;
103
125
  color?: string | undefined;
104
126
  background?: string | undefined;
@@ -106,7 +128,7 @@ export declare const PaintSpecSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
106
128
  rotation?: number | undefined;
107
129
  }, {
108
130
  type: "pattern";
109
- shape: "lines" | "dots" | "grid";
131
+ shape: string;
110
132
  size?: number | undefined;
111
133
  color?: string | undefined;
112
134
  background?: string | undefined;
@@ -1 +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"}
1
+ {"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../../../src/ir/paint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAMY,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsEwF,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"}
@@ -33,14 +33,14 @@ var ARROW_MARKER_HOLLOW_DEFAULT_LINE_WIDTH = 1.5;
33
33
  * @description 顶层 8 字段全 optional;fill 在空心 shape 上 silent no-op(schema 不拒绝、compile/render 丢字段);start/end 子对象用相同字段集(无 start/end 递归)
34
34
  */
35
35
  var ArrowEndDetailSchema = zod.z.object({
36
- shape: zod.z.nativeEnum(ARROW_SHAPES).optional().describe("Arrow tip shape. Defaults to `stealth` (sharp barb). Other values: `normal` (filled triangle), `open` (hollow triangle), `diamond`, `openDiamond`, `circle`, `openCircle`."),
37
- scale: zod.z.number().positive().optional().describe("Uniform tip scale factor; multiplies `length` and `width` (e.g. `length=10, scale=1.5` → effective 15). Defaults to 1."),
38
- length: zod.z.number().nonnegative().optional().describe("Tip length in user units (the dimension along the path direction). Defaults to ~6."),
39
- width: zod.z.number().nonnegative().optional().describe("Tip width in user units (perpendicular to the path). Defaults to ~6."),
36
+ shape: zod.z.string().min(1).optional().describe("Registered arrow name: built-in 7 (`normal` / `open` / `stealth` / `diamond` / `openDiamond` / `circle` / `openCircle`) or an extension arrow registered via `CompileOptions.arrows`. Any non-empty string passes schema validation; unregistered names are rejected at compile time (throw). Defaults to `stealth`."),
37
+ scale: zod.z.number().finite().positive().optional().describe("Uniform tip scale factor; multiplies `length` and `width` (e.g. `length=10, scale=1.5` → effective 15). Defaults to 1."),
38
+ length: zod.z.number().finite().nonnegative().optional().describe("Tip length in user units (the dimension along the path direction). Defaults to ~6."),
39
+ width: zod.z.number().finite().nonnegative().optional().describe("Tip width in user units (perpendicular to the path). Defaults to ~6."),
40
40
  color: zod.z.string().optional().describe("Stroke color override. When omitted, the renderer should inherit the path stroke."),
41
41
  fill: zod.z.string().optional().describe("Fill color override (effective only on solid shapes). Hollow shapes (`open` / `openDiamond` / `openCircle`) silently ignore this field — `color` drives the stroke."),
42
42
  opacity: zod.z.number().min(0).max(1).optional().describe("Arrow opacity 0..1, independent from the path opacity. When omitted, inherits the path opacity."),
43
- lineWidth: zod.z.number().nonnegative().optional().describe("Stroke width for hollow shapes (user units). Defaults to 1.5. Solid shapes ignore this field.")
43
+ lineWidth: zod.z.number().finite().nonnegative().optional().describe("Stroke width for hollow shapes (user units). Defaults to 1.5. Solid shapes ignore this field.")
44
44
  }).describe("Per-end arrow visual spec: shape + visual fields (scale / length / width / color / fill / opacity / lineWidth). All optional; omitted fields fall through to top-level `arrowDetail` defaults and then built-in defaults.");
45
45
  /**
46
46
  * Path 级箭头详细配置 schema