@retikz/core 0.2.0-alpha.2 → 0.2.0-alpha.4
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 +8 -1
- package/dist/es/compile/compile.d.ts.map +1 -1
- package/dist/es/compile/compile.js +89 -14
- package/dist/es/compile/node.d.ts +19 -10
- package/dist/es/compile/node.d.ts.map +1 -1
- package/dist/es/compile/node.js +121 -207
- package/dist/es/compile/scope.d.ts.map +1 -1
- package/dist/es/compile/scope.js +3 -1
- package/dist/es/index.d.ts +3 -1
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +4 -2
- package/dist/es/ir/node.d.ts +45 -12
- package/dist/es/ir/node.d.ts.map +1 -1
- package/dist/es/ir/node.js +10 -3
- package/dist/es/ir/path/path.d.ts +3 -0
- package/dist/es/ir/path/path.d.ts.map +1 -1
- package/dist/es/ir/path/path.js +1 -0
- package/dist/es/ir/scope.d.ts +44 -22
- package/dist/es/ir/scope.d.ts.map +1 -1
- package/dist/es/ir/scope.js +5 -2
- package/dist/es/shapes/_shared.d.ts +7 -0
- package/dist/es/shapes/_shared.d.ts.map +1 -0
- package/dist/es/shapes/_shared.js +11 -0
- package/dist/es/shapes/circle.d.ts +8 -0
- package/dist/es/shapes/circle.d.ts.map +1 -0
- package/dist/es/shapes/circle.js +33 -0
- package/dist/es/shapes/diamond.d.ts +8 -0
- package/dist/es/shapes/diamond.d.ts.map +1 -0
- package/dist/es/shapes/diamond.js +65 -0
- package/dist/es/shapes/ellipse.d.ts +8 -0
- package/dist/es/shapes/ellipse.d.ts.map +1 -0
- package/dist/es/shapes/ellipse.js +45 -0
- package/dist/es/shapes/index.d.ts +14 -0
- package/dist/es/shapes/index.d.ts.map +1 -0
- package/dist/es/shapes/index.js +15 -0
- package/dist/es/shapes/rectangle.d.ts +8 -0
- package/dist/es/shapes/rectangle.d.ts.map +1 -0
- package/dist/es/shapes/rectangle.js +40 -0
- package/dist/es/shapes/types.d.ts +44 -0
- package/dist/es/shapes/types.d.ts.map +1 -0
- package/dist/lib/compile/compile.cjs +91 -16
- package/dist/lib/compile/compile.d.ts +8 -1
- package/dist/lib/compile/compile.d.ts.map +1 -1
- package/dist/lib/compile/node.cjs +121 -207
- package/dist/lib/compile/node.d.ts +19 -10
- package/dist/lib/compile/node.d.ts.map +1 -1
- package/dist/lib/compile/scope.cjs +3 -1
- package/dist/lib/compile/scope.d.ts.map +1 -1
- package/dist/lib/index.cjs +6 -1
- package/dist/lib/index.d.ts +3 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ir/node.cjs +10 -3
- package/dist/lib/ir/node.d.ts +45 -12
- package/dist/lib/ir/node.d.ts.map +1 -1
- package/dist/lib/ir/path/path.cjs +1 -0
- package/dist/lib/ir/path/path.d.ts +3 -0
- package/dist/lib/ir/path/path.d.ts.map +1 -1
- package/dist/lib/ir/scope.cjs +5 -2
- package/dist/lib/ir/scope.d.ts +44 -22
- package/dist/lib/ir/scope.d.ts.map +1 -1
- package/dist/lib/shapes/_shared.cjs +11 -0
- package/dist/lib/shapes/_shared.d.ts +7 -0
- package/dist/lib/shapes/_shared.d.ts.map +1 -0
- package/dist/lib/shapes/circle.cjs +33 -0
- package/dist/lib/shapes/circle.d.ts +8 -0
- package/dist/lib/shapes/circle.d.ts.map +1 -0
- package/dist/lib/shapes/diamond.cjs +65 -0
- package/dist/lib/shapes/diamond.d.ts +8 -0
- package/dist/lib/shapes/diamond.d.ts.map +1 -0
- package/dist/lib/shapes/ellipse.cjs +45 -0
- package/dist/lib/shapes/ellipse.d.ts +8 -0
- package/dist/lib/shapes/ellipse.d.ts.map +1 -0
- package/dist/lib/shapes/index.cjs +14 -0
- package/dist/lib/shapes/index.d.ts +14 -0
- package/dist/lib/shapes/index.d.ts.map +1 -0
- package/dist/lib/shapes/rectangle.cjs +40 -0
- package/dist/lib/shapes/rectangle.d.ts +8 -0
- package/dist/lib/shapes/rectangle.d.ts.map +1 -0
- package/dist/lib/shapes/types.d.ts +44 -0
- package/dist/lib/shapes/types.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/es/ir/node.d.ts
CHANGED
|
@@ -10,8 +10,17 @@ export declare const NODE_SHAPES: {
|
|
|
10
10
|
readonly ellipse: "ellipse";
|
|
11
11
|
readonly diamond: "diamond";
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* 内置 4 shape 名联合
|
|
15
|
+
* @description `BUILTIN_SHAPES` 的 Record key(保穷尽性约束,不随 `NodeShape` 开放而退化为 `string`)
|
|
16
|
+
*/
|
|
17
|
+
export type BuiltinShapeName = ValueOf<typeof NODE_SHAPES>;
|
|
18
|
+
/**
|
|
19
|
+
* 节点形状名:开放字符串
|
|
20
|
+
* @description 内置 `BuiltinShapeName`,或经 `CompileOptions.shapes` 注册的扩展 shape 名;
|
|
21
|
+
* `& {}` 让 IDE 仍对内置 4 名自动补全,同时接受任意非空字符串
|
|
22
|
+
*/
|
|
23
|
+
export type NodeShape = BuiltinShapeName | (string & {});
|
|
15
24
|
/** 节点文本对齐(TikZ `align=` 同义) */
|
|
16
25
|
export declare const NODE_TEXT_ALIGNS: {
|
|
17
26
|
readonly left: "left";
|
|
@@ -54,6 +63,8 @@ export declare const NodeLabelSchema: z.ZodObject<{
|
|
|
54
63
|
weight?: number | "normal" | "bold" | undefined;
|
|
55
64
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
56
65
|
}>>;
|
|
66
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
67
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
57
68
|
}, "strip", z.ZodTypeAny, {
|
|
58
69
|
text: string;
|
|
59
70
|
distance?: number | undefined;
|
|
@@ -66,6 +77,8 @@ export declare const NodeLabelSchema: z.ZodObject<{
|
|
|
66
77
|
} | undefined;
|
|
67
78
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
68
79
|
textColor?: string | undefined;
|
|
80
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
81
|
+
keepUpright?: boolean | undefined;
|
|
69
82
|
}, {
|
|
70
83
|
text: string;
|
|
71
84
|
distance?: number | undefined;
|
|
@@ -78,18 +91,15 @@ export declare const NodeLabelSchema: z.ZodObject<{
|
|
|
78
91
|
} | undefined;
|
|
79
92
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
80
93
|
textColor?: string | undefined;
|
|
94
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
95
|
+
keepUpright?: boolean | undefined;
|
|
81
96
|
}>;
|
|
82
97
|
/** Node label IR 类型 */
|
|
83
98
|
export type IRNodeLabel = z.infer<typeof NodeLabelSchema>;
|
|
84
99
|
export declare const NodeSchema: z.ZodObject<{
|
|
85
100
|
type: z.ZodLiteral<"node">;
|
|
86
101
|
id: z.ZodOptional<z.ZodString>;
|
|
87
|
-
shape: z.ZodOptional<z.
|
|
88
|
-
readonly rectangle: "rectangle";
|
|
89
|
-
readonly circle: "circle";
|
|
90
|
-
readonly ellipse: "ellipse";
|
|
91
|
-
readonly diamond: "diamond";
|
|
92
|
-
}>>;
|
|
102
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
93
103
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>, z.ZodObject<{
|
|
94
104
|
direction: z.ZodNativeEnum<{
|
|
95
105
|
readonly above: "above";
|
|
@@ -239,6 +249,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
239
249
|
weight?: number | "normal" | "bold" | undefined;
|
|
240
250
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
241
251
|
}>>;
|
|
252
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
253
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
242
254
|
}, "strip", z.ZodTypeAny, {
|
|
243
255
|
text: string;
|
|
244
256
|
distance?: number | undefined;
|
|
@@ -251,6 +263,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
251
263
|
} | undefined;
|
|
252
264
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
253
265
|
textColor?: string | undefined;
|
|
266
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
267
|
+
keepUpright?: boolean | undefined;
|
|
254
268
|
}, {
|
|
255
269
|
text: string;
|
|
256
270
|
distance?: number | undefined;
|
|
@@ -263,6 +277,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
263
277
|
} | undefined;
|
|
264
278
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
265
279
|
textColor?: string | undefined;
|
|
280
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
281
|
+
keepUpright?: boolean | undefined;
|
|
266
282
|
}>, z.ZodArray<z.ZodObject<{
|
|
267
283
|
text: z.ZodString;
|
|
268
284
|
position: z.ZodOptional<z.ZodUnion<[z.ZodNativeEnum<{
|
|
@@ -294,6 +310,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
294
310
|
weight?: number | "normal" | "bold" | undefined;
|
|
295
311
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
296
312
|
}>>;
|
|
313
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
314
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
297
315
|
}, "strip", z.ZodTypeAny, {
|
|
298
316
|
text: string;
|
|
299
317
|
distance?: number | undefined;
|
|
@@ -306,6 +324,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
306
324
|
} | undefined;
|
|
307
325
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
308
326
|
textColor?: string | undefined;
|
|
327
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
328
|
+
keepUpright?: boolean | undefined;
|
|
309
329
|
}, {
|
|
310
330
|
text: string;
|
|
311
331
|
distance?: number | undefined;
|
|
@@ -318,7 +338,10 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
318
338
|
} | undefined;
|
|
319
339
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
320
340
|
textColor?: string | undefined;
|
|
341
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
342
|
+
keepUpright?: boolean | undefined;
|
|
321
343
|
}>, "many">]>>;
|
|
344
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
322
345
|
}, "strip", z.ZodTypeAny, {
|
|
323
346
|
type: "node";
|
|
324
347
|
position: [number, number] | import('./position').PolarPosition | {
|
|
@@ -348,7 +371,7 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
348
371
|
weight?: number | "normal" | "bold" | undefined;
|
|
349
372
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
350
373
|
} | undefined;
|
|
351
|
-
shape?:
|
|
374
|
+
shape?: string | undefined;
|
|
352
375
|
scale?: number | undefined;
|
|
353
376
|
color?: string | undefined;
|
|
354
377
|
textColor?: string | undefined;
|
|
@@ -364,6 +387,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
364
387
|
} | undefined;
|
|
365
388
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
366
389
|
textColor?: string | undefined;
|
|
390
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
391
|
+
keepUpright?: boolean | undefined;
|
|
367
392
|
} | {
|
|
368
393
|
text: string;
|
|
369
394
|
distance?: number | undefined;
|
|
@@ -376,13 +401,16 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
376
401
|
} | undefined;
|
|
377
402
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
378
403
|
textColor?: string | undefined;
|
|
404
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
405
|
+
keepUpright?: boolean | undefined;
|
|
379
406
|
}[] | undefined;
|
|
380
407
|
stroke?: string | undefined;
|
|
381
408
|
strokeWidth?: number | undefined;
|
|
382
409
|
fillOpacity?: number | undefined;
|
|
383
410
|
drawOpacity?: number | undefined;
|
|
384
|
-
|
|
411
|
+
zIndex?: number | undefined;
|
|
385
412
|
rotate?: number | undefined;
|
|
413
|
+
id?: string | undefined;
|
|
386
414
|
align?: "left" | "right" | "center" | undefined;
|
|
387
415
|
lineHeight?: number | undefined;
|
|
388
416
|
dashed?: boolean | undefined;
|
|
@@ -428,7 +456,7 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
428
456
|
weight?: number | "normal" | "bold" | undefined;
|
|
429
457
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
430
458
|
} | undefined;
|
|
431
|
-
shape?:
|
|
459
|
+
shape?: string | undefined;
|
|
432
460
|
scale?: number | undefined;
|
|
433
461
|
color?: string | undefined;
|
|
434
462
|
textColor?: string | undefined;
|
|
@@ -444,6 +472,8 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
444
472
|
} | undefined;
|
|
445
473
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
446
474
|
textColor?: string | undefined;
|
|
475
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
476
|
+
keepUpright?: boolean | undefined;
|
|
447
477
|
} | {
|
|
448
478
|
text: string;
|
|
449
479
|
distance?: number | undefined;
|
|
@@ -456,13 +486,16 @@ export declare const NodeSchema: z.ZodObject<{
|
|
|
456
486
|
} | undefined;
|
|
457
487
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
458
488
|
textColor?: string | undefined;
|
|
489
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
490
|
+
keepUpright?: boolean | undefined;
|
|
459
491
|
}[] | undefined;
|
|
460
492
|
stroke?: string | undefined;
|
|
461
493
|
strokeWidth?: number | undefined;
|
|
462
494
|
fillOpacity?: number | undefined;
|
|
463
495
|
drawOpacity?: number | undefined;
|
|
464
|
-
|
|
496
|
+
zIndex?: number | undefined;
|
|
465
497
|
rotate?: number | undefined;
|
|
498
|
+
id?: string | undefined;
|
|
466
499
|
align?: "left" | "right" | "center" | undefined;
|
|
467
500
|
lineHeight?: number | undefined;
|
|
468
501
|
dashed?: boolean | undefined;
|
package/dist/es/ir/node.d.ts.map
CHANGED
|
@@ -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;AAKxC;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX
|
|
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;AAKxC;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8CzB,CAAC;AAEJ,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+LpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/es/ir/node.js
CHANGED
|
@@ -32,12 +32,18 @@ var NodeLabelSchema = z.object({
|
|
|
32
32
|
distance: z.number().nonnegative().optional().describe("Gap between the node border and the label center, in user units. Default 12."),
|
|
33
33
|
textColor: z.string().optional().describe("Label text color; falls back to currentColor."),
|
|
34
34
|
opacity: z.number().min(0).max(1).optional().describe("Label-only opacity 0..1; multiplied with the node opacity if both are set."),
|
|
35
|
-
font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults.")
|
|
35
|
+
font: FontSchema.optional().describe("Label font overrides; missing fields inherit from the parent node font, then renderer defaults."),
|
|
36
|
+
rotate: z.union([z.enum([
|
|
37
|
+
"none",
|
|
38
|
+
"radial",
|
|
39
|
+
"tangent"
|
|
40
|
+
]), z.number()]).optional().describe("Rotate the label text around its own center. `none` (default) = horizontal; `radial` = along the node-center -> label-center direction; `tangent` = radial + 90 deg; a number = explicit degrees (screen y-down: 0 = +x, 90 = +y). Only changes text orientation, not placement."),
|
|
41
|
+
keepUpright: z.boolean().optional().describe("When true, flips the rotated label 180 deg if it would otherwise read upside-down (more than 90 deg from upright). Default false (strict geometric angle).")
|
|
36
42
|
}).describe("Extra text attached around a node border. Multiple labels supported via array form on `Node.label`.");
|
|
37
43
|
var NodeSchema = z.object({
|
|
38
44
|
type: z.literal("node").describe("Discriminator marking this child as a node"),
|
|
39
45
|
id: z.string().min(1).optional().describe("Optional unique id; required if any path needs to reference this node by string"),
|
|
40
|
-
shape: z.
|
|
46
|
+
shape: z.string().min(1).optional().describe("Node visual shape name; built-in `rectangle` / `circle` / `ellipse` / `diamond`, or an extension shape registered via `CompileOptions.shapes`. Any non-empty string passes schema validation; unregistered names are rejected at compile time. Defaults to `rectangle`. The boundary fully contains text + padding (circumscribed for circle / ellipse / diamond)."),
|
|
41
47
|
position: z.union([
|
|
42
48
|
PositionSchema,
|
|
43
49
|
PolarPositionSchema,
|
|
@@ -72,7 +78,8 @@ var NodeSchema = z.object({
|
|
|
72
78
|
padding: z.number().nonnegative().optional().describe("Symmetric inner padding (alias for `innerXSep` + `innerYSep`); axis-specific fields take precedence."),
|
|
73
79
|
margin: z.number().nonnegative().optional().describe("Symmetric outer margin (alias for `outerSep`); axis-specific field takes precedence."),
|
|
74
80
|
font: FontSchema.optional().describe("Font spec for the inner text label (family / size / weight / style); all fields optional, all fall back to renderer defaults."),
|
|
75
|
-
label: z.union([NodeLabelSchema, z.array(NodeLabelSchema)]).optional().describe("Extra label(s) attached around the node border (TikZ `[label=above:foo]`); single object or array form. Compiled into one TextPrim per label, positioned by `position` direction / angle and `distance`.")
|
|
81
|
+
label: z.union([NodeLabelSchema, z.array(NodeLabelSchema)]).optional().describe("Extra label(s) attached around the node border (TikZ `[label=above:foo]`); single object or array form. Compiled into one TextPrim per label, positioned by `position` direction / angle and `distance`."),
|
|
82
|
+
zIndex: 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 node inside a scope only restacks within that scope).")
|
|
76
83
|
}).describe("Node primitive: a positioned, optionally textual shape (rectangle / circle / ellipse / diamond)");
|
|
77
84
|
//#endregion
|
|
78
85
|
export { NODE_SHAPES, NODE_TEXT_ALIGNS, NodeLabelSchema, NodeSchema };
|
|
@@ -163,6 +163,7 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
163
163
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
164
164
|
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
165
165
|
drawOpacity: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
166
167
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
167
168
|
type: z.ZodLiteral<"step">;
|
|
168
169
|
kind: z.ZodLiteral<"move">;
|
|
@@ -1342,6 +1343,7 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
1342
1343
|
thickness?: "ultraThin" | "veryThin" | "thin" | "semithick" | "thick" | "veryThick" | "ultraThick" | undefined;
|
|
1343
1344
|
fillOpacity?: number | undefined;
|
|
1344
1345
|
drawOpacity?: number | undefined;
|
|
1346
|
+
zIndex?: number | undefined;
|
|
1345
1347
|
}, {
|
|
1346
1348
|
type: "path";
|
|
1347
1349
|
children: ({
|
|
@@ -1582,6 +1584,7 @@ export declare const PathSchema: z.ZodObject<{
|
|
|
1582
1584
|
thickness?: "ultraThin" | "veryThin" | "thin" | "semithick" | "thick" | "veryThick" | "ultraThick" | undefined;
|
|
1583
1585
|
fillOpacity?: number | undefined;
|
|
1584
1586
|
drawOpacity?: number | undefined;
|
|
1587
|
+
zIndex?: number | undefined;
|
|
1585
1588
|
}>;
|
|
1586
1589
|
/** 路径:由若干 step 动作(move/line/...)组成 */
|
|
1587
1590
|
export type IRPath = z.infer<typeof PathSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/ir/path/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgHpB,CAAC;AAEJ,sCAAsC;AACtC,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/es/ir/path/path.js
CHANGED
|
@@ -39,6 +39,7 @@ var PathSchema = z.object({
|
|
|
39
39
|
opacity: z.number().min(0).max(1).optional().describe("Whole-path opacity 0..1; multiplies onto stroke and fill."),
|
|
40
40
|
fillOpacity: z.number().min(0).max(1).optional().describe("Fill opacity 0..1; affects only the closed-region fill."),
|
|
41
41
|
drawOpacity: z.number().min(0).max(1).optional().describe("Stroke opacity 0..1 (TikZ `draw opacity`); affects only the path stroke."),
|
|
42
|
+
zIndex: 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)."),
|
|
42
43
|
children: z.array(StepSchema).min(2).describe("Sequence of step actions defining the path; the first should usually be a `move`")
|
|
43
44
|
}).describe("A drawn path composed of a sequence of step actions (move / line / ...)");
|
|
44
45
|
//#endregion
|
package/dist/es/ir/scope.d.ts
CHANGED
|
@@ -11,12 +11,7 @@ import { IRTransform } from './transform';
|
|
|
11
11
|
export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
12
12
|
type: z.ZodLiteral<"node">;
|
|
13
13
|
id: z.ZodOptional<z.ZodString>;
|
|
14
|
-
shape: z.ZodOptional<z.
|
|
15
|
-
readonly rectangle: "rectangle";
|
|
16
|
-
readonly circle: "circle";
|
|
17
|
-
readonly ellipse: "ellipse";
|
|
18
|
-
readonly diamond: "diamond";
|
|
19
|
-
}>>;
|
|
14
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
20
15
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>, z.ZodObject<{
|
|
21
16
|
direction: z.ZodNativeEnum<{
|
|
22
17
|
readonly above: "above";
|
|
@@ -166,6 +161,8 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
166
161
|
weight?: number | "normal" | "bold" | undefined;
|
|
167
162
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
168
163
|
}>>;
|
|
164
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
165
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
169
166
|
}, "strip", z.ZodTypeAny, {
|
|
170
167
|
text: string;
|
|
171
168
|
distance?: number | undefined;
|
|
@@ -178,6 +175,8 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
178
175
|
} | undefined;
|
|
179
176
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
180
177
|
textColor?: string | undefined;
|
|
178
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
179
|
+
keepUpright?: boolean | undefined;
|
|
181
180
|
}, {
|
|
182
181
|
text: string;
|
|
183
182
|
distance?: number | undefined;
|
|
@@ -190,6 +189,8 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
190
189
|
} | undefined;
|
|
191
190
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
192
191
|
textColor?: string | undefined;
|
|
192
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
193
|
+
keepUpright?: boolean | undefined;
|
|
193
194
|
}>, z.ZodArray<z.ZodObject<{
|
|
194
195
|
text: z.ZodString;
|
|
195
196
|
position: z.ZodOptional<z.ZodUnion<[z.ZodNativeEnum<{
|
|
@@ -221,6 +222,8 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
221
222
|
weight?: number | "normal" | "bold" | undefined;
|
|
222
223
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
223
224
|
}>>;
|
|
225
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
226
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
224
227
|
}, "strip", z.ZodTypeAny, {
|
|
225
228
|
text: string;
|
|
226
229
|
distance?: number | undefined;
|
|
@@ -233,6 +236,8 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
233
236
|
} | undefined;
|
|
234
237
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
235
238
|
textColor?: string | undefined;
|
|
239
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
240
|
+
keepUpright?: boolean | undefined;
|
|
236
241
|
}, {
|
|
237
242
|
text: string;
|
|
238
243
|
distance?: number | undefined;
|
|
@@ -245,8 +250,11 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
245
250
|
} | undefined;
|
|
246
251
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
247
252
|
textColor?: string | undefined;
|
|
253
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
254
|
+
keepUpright?: boolean | undefined;
|
|
248
255
|
}>, "many">]>>;
|
|
249
|
-
|
|
256
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
}, "type" | "text" | "position" | "label" | "zIndex" | "id">, "strict", z.ZodTypeAny, {
|
|
250
258
|
fill?: string | undefined;
|
|
251
259
|
opacity?: number | undefined;
|
|
252
260
|
font?: {
|
|
@@ -255,7 +263,7 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
255
263
|
weight?: number | "normal" | "bold" | undefined;
|
|
256
264
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
257
265
|
} | undefined;
|
|
258
|
-
shape?:
|
|
266
|
+
shape?: string | undefined;
|
|
259
267
|
scale?: number | undefined;
|
|
260
268
|
color?: string | undefined;
|
|
261
269
|
textColor?: string | undefined;
|
|
@@ -289,7 +297,7 @@ export declare const NodeDefaultSchema: z.ZodObject<Omit<{
|
|
|
289
297
|
weight?: number | "normal" | "bold" | undefined;
|
|
290
298
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
291
299
|
} | undefined;
|
|
292
|
-
shape?:
|
|
300
|
+
shape?: string | undefined;
|
|
293
301
|
scale?: number | undefined;
|
|
294
302
|
color?: string | undefined;
|
|
295
303
|
textColor?: string | undefined;
|
|
@@ -483,6 +491,7 @@ export declare const PathDefaultSchema: z.ZodObject<Omit<{
|
|
|
483
491
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
484
492
|
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
485
493
|
drawOpacity: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
486
495
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
487
496
|
type: z.ZodLiteral<"step">;
|
|
488
497
|
kind: z.ZodLiteral<"move">;
|
|
@@ -1422,7 +1431,7 @@ export declare const PathDefaultSchema: z.ZodObject<Omit<{
|
|
|
1422
1431
|
textColor?: string | undefined;
|
|
1423
1432
|
} | undefined;
|
|
1424
1433
|
}>]>, "many">;
|
|
1425
|
-
}, "type" | "arrow" | "arrowDetail" | "children">, "strict", z.ZodTypeAny, {
|
|
1434
|
+
}, "type" | "arrow" | "arrowDetail" | "zIndex" | "children">, "strict", z.ZodTypeAny, {
|
|
1426
1435
|
fill?: string | undefined;
|
|
1427
1436
|
opacity?: number | undefined;
|
|
1428
1437
|
color?: string | undefined;
|
|
@@ -1679,6 +1688,7 @@ export type IRScope = {
|
|
|
1679
1688
|
labelDefault?: IRLabelDefault;
|
|
1680
1689
|
arrowDefault?: IRArrowDefault;
|
|
1681
1690
|
resetStyle?: boolean | Array<StyleChannel>;
|
|
1691
|
+
zIndex?: number;
|
|
1682
1692
|
children: Array<IRNode | IRPath | IRCoordinate | IRScope>;
|
|
1683
1693
|
};
|
|
1684
1694
|
/**
|
|
@@ -1798,12 +1808,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
1798
1808
|
nodeDefault: z.ZodOptional<z.ZodObject<Omit<{
|
|
1799
1809
|
type: z.ZodLiteral<"node">;
|
|
1800
1810
|
id: z.ZodOptional<z.ZodString>;
|
|
1801
|
-
shape: z.ZodOptional<z.
|
|
1802
|
-
readonly rectangle: "rectangle";
|
|
1803
|
-
readonly circle: "circle";
|
|
1804
|
-
readonly ellipse: "ellipse";
|
|
1805
|
-
readonly diamond: "diamond";
|
|
1806
|
-
}>>;
|
|
1811
|
+
shape: z.ZodOptional<z.ZodString>;
|
|
1807
1812
|
position: z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, z.ZodType<import('./position').PolarPosition, z.ZodTypeDef, import('./position').PolarPosition>, z.ZodObject<{
|
|
1808
1813
|
direction: z.ZodNativeEnum<{
|
|
1809
1814
|
readonly above: "above";
|
|
@@ -1953,6 +1958,8 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
1953
1958
|
weight?: number | "normal" | "bold" | undefined;
|
|
1954
1959
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
1955
1960
|
}>>;
|
|
1961
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
1962
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
1956
1963
|
}, "strip", z.ZodTypeAny, {
|
|
1957
1964
|
text: string;
|
|
1958
1965
|
distance?: number | undefined;
|
|
@@ -1965,6 +1972,8 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
1965
1972
|
} | undefined;
|
|
1966
1973
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
1967
1974
|
textColor?: string | undefined;
|
|
1975
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
1976
|
+
keepUpright?: boolean | undefined;
|
|
1968
1977
|
}, {
|
|
1969
1978
|
text: string;
|
|
1970
1979
|
distance?: number | undefined;
|
|
@@ -1977,6 +1986,8 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
1977
1986
|
} | undefined;
|
|
1978
1987
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
1979
1988
|
textColor?: string | undefined;
|
|
1989
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
1990
|
+
keepUpright?: boolean | undefined;
|
|
1980
1991
|
}>, z.ZodArray<z.ZodObject<{
|
|
1981
1992
|
text: z.ZodString;
|
|
1982
1993
|
position: z.ZodOptional<z.ZodUnion<[z.ZodNativeEnum<{
|
|
@@ -2008,6 +2019,8 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2008
2019
|
weight?: number | "normal" | "bold" | undefined;
|
|
2009
2020
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
2010
2021
|
}>>;
|
|
2022
|
+
rotate: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["none", "radial", "tangent"]>, z.ZodNumber]>>;
|
|
2023
|
+
keepUpright: z.ZodOptional<z.ZodBoolean>;
|
|
2011
2024
|
}, "strip", z.ZodTypeAny, {
|
|
2012
2025
|
text: string;
|
|
2013
2026
|
distance?: number | undefined;
|
|
@@ -2020,6 +2033,8 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2020
2033
|
} | undefined;
|
|
2021
2034
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
2022
2035
|
textColor?: string | undefined;
|
|
2036
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
2037
|
+
keepUpright?: boolean | undefined;
|
|
2023
2038
|
}, {
|
|
2024
2039
|
text: string;
|
|
2025
2040
|
distance?: number | undefined;
|
|
@@ -2032,8 +2047,11 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2032
2047
|
} | undefined;
|
|
2033
2048
|
position?: number | "above" | "below" | "left" | "right" | "above-left" | "above-right" | "below-left" | "below-right" | undefined;
|
|
2034
2049
|
textColor?: string | undefined;
|
|
2050
|
+
rotate?: number | "none" | "radial" | "tangent" | undefined;
|
|
2051
|
+
keepUpright?: boolean | undefined;
|
|
2035
2052
|
}>, "many">]>>;
|
|
2036
|
-
|
|
2053
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
2054
|
+
}, "type" | "text" | "position" | "label" | "zIndex" | "id">, "strict", z.ZodTypeAny, {
|
|
2037
2055
|
fill?: string | undefined;
|
|
2038
2056
|
opacity?: number | undefined;
|
|
2039
2057
|
font?: {
|
|
@@ -2042,7 +2060,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2042
2060
|
weight?: number | "normal" | "bold" | undefined;
|
|
2043
2061
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
2044
2062
|
} | undefined;
|
|
2045
|
-
shape?:
|
|
2063
|
+
shape?: string | undefined;
|
|
2046
2064
|
scale?: number | undefined;
|
|
2047
2065
|
color?: string | undefined;
|
|
2048
2066
|
textColor?: string | undefined;
|
|
@@ -2076,7 +2094,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2076
2094
|
weight?: number | "normal" | "bold" | undefined;
|
|
2077
2095
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
2078
2096
|
} | undefined;
|
|
2079
|
-
shape?:
|
|
2097
|
+
shape?: string | undefined;
|
|
2080
2098
|
scale?: number | undefined;
|
|
2081
2099
|
color?: string | undefined;
|
|
2082
2100
|
textColor?: string | undefined;
|
|
@@ -2266,6 +2284,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
2266
2284
|
opacity: z.ZodOptional<z.ZodNumber>;
|
|
2267
2285
|
fillOpacity: z.ZodOptional<z.ZodNumber>;
|
|
2268
2286
|
drawOpacity: z.ZodOptional<z.ZodNumber>;
|
|
2287
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
2269
2288
|
children: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
2270
2289
|
type: z.ZodLiteral<"step">;
|
|
2271
2290
|
kind: z.ZodLiteral<"move">;
|
|
@@ -3205,7 +3224,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3205
3224
|
textColor?: string | undefined;
|
|
3206
3225
|
} | undefined;
|
|
3207
3226
|
}>]>, "many">;
|
|
3208
|
-
}, "type" | "arrow" | "arrowDetail" | "children">, "strict", z.ZodTypeAny, {
|
|
3227
|
+
}, "type" | "arrow" | "arrowDetail" | "zIndex" | "children">, "strict", z.ZodTypeAny, {
|
|
3209
3228
|
fill?: string | undefined;
|
|
3210
3229
|
opacity?: number | undefined;
|
|
3211
3230
|
color?: string | undefined;
|
|
@@ -3423,6 +3442,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3423
3442
|
} | undefined;
|
|
3424
3443
|
}>>;
|
|
3425
3444
|
resetStyle: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEnum<["node", "path", "label", "arrow"]>, "many">]>>;
|
|
3445
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
3426
3446
|
children: z.ZodArray<z.ZodLazy<z.ZodTypeAny>, "many">;
|
|
3427
3447
|
}, "strip", z.ZodTypeAny, {
|
|
3428
3448
|
type: "scope";
|
|
@@ -3434,6 +3454,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3434
3454
|
strokeWidth?: number | undefined;
|
|
3435
3455
|
fillOpacity?: number | undefined;
|
|
3436
3456
|
drawOpacity?: number | undefined;
|
|
3457
|
+
zIndex?: number | undefined;
|
|
3437
3458
|
id?: string | undefined;
|
|
3438
3459
|
localNamespace?: boolean | undefined;
|
|
3439
3460
|
transforms?: ({
|
|
@@ -3473,7 +3494,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3473
3494
|
weight?: number | "normal" | "bold" | undefined;
|
|
3474
3495
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
3475
3496
|
} | undefined;
|
|
3476
|
-
shape?:
|
|
3497
|
+
shape?: string | undefined;
|
|
3477
3498
|
scale?: number | undefined;
|
|
3478
3499
|
color?: string | undefined;
|
|
3479
3500
|
textColor?: string | undefined;
|
|
@@ -3565,6 +3586,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3565
3586
|
strokeWidth?: number | undefined;
|
|
3566
3587
|
fillOpacity?: number | undefined;
|
|
3567
3588
|
drawOpacity?: number | undefined;
|
|
3589
|
+
zIndex?: number | undefined;
|
|
3568
3590
|
id?: string | undefined;
|
|
3569
3591
|
localNamespace?: boolean | undefined;
|
|
3570
3592
|
transforms?: ({
|
|
@@ -3604,7 +3626,7 @@ export declare const ScopeSchema: z.ZodObject<{
|
|
|
3604
3626
|
weight?: number | "normal" | "bold" | undefined;
|
|
3605
3627
|
style?: "normal" | "italic" | "oblique" | undefined;
|
|
3606
3628
|
} | undefined;
|
|
3607
|
-
shape?:
|
|
3629
|
+
shape?: string | undefined;
|
|
3608
3630
|
scale?: number | undefined;
|
|
3609
3631
|
color?: string | undefined;
|
|
3610
3632
|
textColor?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/ir/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,aAAa,CAAC;AAOhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB
|
|
1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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2GrB,CAAC"}
|
package/dist/es/ir/scope.js
CHANGED
|
@@ -15,7 +15,8 @@ var NodeDefaultSchema = NodeSchema.omit({
|
|
|
15
15
|
id: true,
|
|
16
16
|
position: true,
|
|
17
17
|
text: true,
|
|
18
|
-
label: true
|
|
18
|
+
label: true,
|
|
19
|
+
zIndex: true
|
|
19
20
|
}).strict();
|
|
20
21
|
/**
|
|
21
22
|
* every path 默认样式 schema
|
|
@@ -25,7 +26,8 @@ var PathDefaultSchema = PathSchema.omit({
|
|
|
25
26
|
type: true,
|
|
26
27
|
children: true,
|
|
27
28
|
arrow: true,
|
|
28
|
-
arrowDetail: true
|
|
29
|
+
arrowDetail: true,
|
|
30
|
+
zIndex: true
|
|
29
31
|
}).strict();
|
|
30
32
|
/**
|
|
31
33
|
* every label 默认样式 schema(node label 与 step label 共享)
|
|
@@ -80,6 +82,7 @@ var ScopeSchema = z.object({
|
|
|
80
82
|
"label",
|
|
81
83
|
"arrow"
|
|
82
84
|
]))]).optional().describe("Inheritance barrier: drop the outer scope cascade + every-X defaults for the listed channels (or all when true), falling back to the built-in baseline. Only cuts the scope-inheritance axis; labels / arrows still follow their host path / node resolved color (structural relation, not scope inheritance)."),
|
|
85
|
+
zIndex: z.number().int().finite().optional().describe("Explicit stacking order of this scope as a whole among its sibling IR children. Higher draws on top. Applies to the scope group as a single unit in the parent; does NOT affect how children stack inside the scope. Omitted = 0 = source order."),
|
|
83
86
|
children: z.array(z.lazy(() => {
|
|
84
87
|
if (!childSchemaRef) throw new Error("ScopeSchema: ChildSchema not registered yet; ensure scene.ts loaded");
|
|
85
88
|
return childSchemaRef;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RectAnchor } from '../geometry/rect';
|
|
2
|
+
/**
|
|
3
|
+
* 把任意字符串收窄为合法 RectAnchor,否则 undefined
|
|
4
|
+
* @description 内置 4 shape 的 anchor 只认这 9 名;不在集合内返回 undefined,由 `anchorOf` 抛 Unknown anchor
|
|
5
|
+
*/
|
|
6
|
+
export declare const asRectAnchor: (name: string) => RectAnchor | undefined;
|
|
7
|
+
//# sourceMappingURL=_shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../../src/shapes/_shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKjE;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG,UAAU,GAAG,SACK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RECT_ANCHORS } from "../geometry/rect.js";
|
|
2
|
+
//#region src/shapes/_shared.ts
|
|
3
|
+
/** RECT_ANCHORS 的 9 个合法 anchor 名集合(成员校验用) */
|
|
4
|
+
var RECT_ANCHOR_SET = new Set(Object.values(RECT_ANCHORS));
|
|
5
|
+
/**
|
|
6
|
+
* 把任意字符串收窄为合法 RectAnchor,否则 undefined
|
|
7
|
+
* @description 内置 4 shape 的 anchor 只认这 9 名;不在集合内返回 undefined,由 `anchorOf` 抛 Unknown anchor
|
|
8
|
+
*/
|
|
9
|
+
var asRectAnchor = (name) => RECT_ANCHOR_SET.has(name) ? name : void 0;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { asRectAnchor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShapeDefinition } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* circle 注册项
|
|
4
|
+
* @description circumscribe = 内框对角线/2(两轴相等);几何走 circle 数学层;
|
|
5
|
+
* emit 复用 `ellipse.emit`(circle = rx=ry 的 ellipse),与旧 circle→`emitEllipseShape` 等价
|
|
6
|
+
*/
|
|
7
|
+
export declare const circle: ShapeDefinition;
|
|
8
|
+
//# sourceMappingURL=circle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../src/shapes/circle.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK/C;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,eAWpB,CAAC"}
|