@retikz/react 0.1.0-alpha.1 → 0.1.0-alpha.3
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/index.d.ts +5 -5
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +3 -1
- package/dist/es/kernel/Node.d.ts +59 -8
- package/dist/es/kernel/Node.d.ts.map +1 -1
- package/dist/es/kernel/Path.d.ts +12 -0
- package/dist/es/kernel/Path.d.ts.map +1 -1
- package/dist/es/kernel/Step.d.ts +86 -3
- package/dist/es/kernel/Step.d.ts.map +1 -1
- package/dist/es/kernel/Text.d.ts +31 -0
- package/dist/es/kernel/Text.d.ts.map +1 -0
- package/dist/es/kernel/Text.js +22 -0
- package/dist/es/kernel/_builder.d.ts.map +1 -1
- package/dist/es/kernel/_builder.js +215 -27
- package/dist/es/kernel/_displayNames.d.ts +4 -0
- package/dist/es/kernel/_displayNames.d.ts.map +1 -1
- package/dist/es/kernel/_displayNames.js +5 -1
- package/dist/es/kernel/_unbuilder.d.ts.map +1 -1
- package/dist/es/kernel/_unbuilder.js +78 -2
- package/dist/es/kernel/index.d.ts +1 -0
- package/dist/es/kernel/index.d.ts.map +1 -1
- package/dist/es/kernel/index.js +1 -0
- package/dist/es/render/renderPrim.d.ts.map +1 -1
- package/dist/es/render/renderPrim.js +31 -13
- package/dist/es/sugar/Draw.d.ts +20 -2
- package/dist/es/sugar/Draw.d.ts.map +1 -1
- package/dist/es/sugar/Draw.js +57 -3
- package/dist/es/sugar/EdgeLabel.d.ts +20 -0
- package/dist/es/sugar/EdgeLabel.d.ts.map +1 -0
- package/dist/es/sugar/EdgeLabel.js +13 -0
- package/dist/es/sugar/index.d.ts +1 -0
- package/dist/es/sugar/index.d.ts.map +1 -1
- package/dist/es/sugar/index.js +1 -0
- package/dist/lib/index.cjs +4 -0
- package/dist/lib/index.d.ts +5 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/kernel/Node.d.ts +59 -8
- package/dist/lib/kernel/Node.d.ts.map +1 -1
- package/dist/lib/kernel/Path.d.ts +12 -0
- package/dist/lib/kernel/Path.d.ts.map +1 -1
- package/dist/lib/kernel/Step.d.ts +86 -3
- package/dist/lib/kernel/Step.d.ts.map +1 -1
- package/dist/lib/kernel/Text.cjs +22 -0
- package/dist/lib/kernel/Text.d.ts +31 -0
- package/dist/lib/kernel/Text.d.ts.map +1 -0
- package/dist/lib/kernel/_builder.cjs +214 -26
- package/dist/lib/kernel/_builder.d.ts.map +1 -1
- package/dist/lib/kernel/_displayNames.cjs +6 -0
- package/dist/lib/kernel/_displayNames.d.ts +4 -0
- package/dist/lib/kernel/_displayNames.d.ts.map +1 -1
- package/dist/lib/kernel/_unbuilder.cjs +78 -2
- package/dist/lib/kernel/_unbuilder.d.ts.map +1 -1
- package/dist/lib/kernel/index.cjs +1 -0
- package/dist/lib/kernel/index.d.ts +1 -0
- package/dist/lib/kernel/index.d.ts.map +1 -1
- package/dist/lib/render/renderPrim.cjs +31 -13
- package/dist/lib/render/renderPrim.d.ts.map +1 -1
- package/dist/lib/sugar/Draw.cjs +57 -3
- package/dist/lib/sugar/Draw.d.ts +20 -2
- package/dist/lib/sugar/Draw.d.ts.map +1 -1
- package/dist/lib/sugar/EdgeLabel.cjs +13 -0
- package/dist/lib/sugar/EdgeLabel.d.ts +20 -0
- package/dist/lib/sugar/EdgeLabel.d.ts.map +1 -0
- package/dist/lib/sugar/index.cjs +1 -0
- package/dist/lib/sugar/index.d.ts +1 -0
- package/dist/lib/sugar/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -5,5 +5,9 @@ var TIKZ_NODE = "@retikz/Node";
|
|
|
5
5
|
var TIKZ_PATH = "@retikz/Path";
|
|
6
6
|
/** <Step> 组件的 displayName */
|
|
7
7
|
var TIKZ_STEP = "@retikz/Step";
|
|
8
|
+
/** <Text> 组件的 displayName(Node 内多行文本带样式) */
|
|
9
|
+
var TIKZ_TEXT = "@retikz/Text";
|
|
10
|
+
/** <EdgeLabel> 组件的 displayName(Step 内边标注,ADR-0004) */
|
|
11
|
+
var TIKZ_EDGE_LABEL = "@retikz/EdgeLabel";
|
|
8
12
|
//#endregion
|
|
9
|
-
export { TIKZ_NODE, TIKZ_PATH, TIKZ_STEP };
|
|
13
|
+
export { TIKZ_EDGE_LABEL, TIKZ_NODE, TIKZ_PATH, TIKZ_STEP, TIKZ_TEXT };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_unbuilder.d.ts","sourceRoot":"","sources":["../../../src/kernel/_unbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,EAA2B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"_unbuilder.d.ts","sourceRoot":"","sources":["../../../src/kernel/_unbuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,EAA2B,MAAM,cAAc,CAAC;AA2JhE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,EAAE,KAAG,SACW,CAAC"}
|
|
@@ -10,12 +10,31 @@ var nodePropsFromIR = (n) => {
|
|
|
10
10
|
if (n.shape !== void 0) props.shape = n.shape;
|
|
11
11
|
if (n.rotate !== void 0) props.rotate = n.rotate;
|
|
12
12
|
if (n.text !== void 0) props.text = n.text;
|
|
13
|
-
if (n.
|
|
13
|
+
if (n.align !== void 0) props.align = n.align;
|
|
14
|
+
if (n.lineHeight !== void 0) props.lineHeight = n.lineHeight;
|
|
15
|
+
if (n.font !== void 0) props.font = n.font;
|
|
16
|
+
if (n.innerXSep !== void 0) props.innerXSep = n.innerXSep;
|
|
17
|
+
if (n.innerYSep !== void 0) props.innerYSep = n.innerYSep;
|
|
18
|
+
if (n.outerSep !== void 0) props.outerSep = n.outerSep;
|
|
14
19
|
if (n.padding !== void 0) props.padding = n.padding;
|
|
15
20
|
if (n.margin !== void 0) props.margin = n.margin;
|
|
16
21
|
if (n.fill !== void 0) props.fill = n.fill;
|
|
22
|
+
if (n.fillOpacity !== void 0) props.fillOpacity = n.fillOpacity;
|
|
17
23
|
if (n.stroke !== void 0) props.stroke = n.stroke;
|
|
24
|
+
if (n.drawOpacity !== void 0) props.drawOpacity = n.drawOpacity;
|
|
18
25
|
if (n.strokeWidth !== void 0) props.strokeWidth = n.strokeWidth;
|
|
26
|
+
if (n.dashed !== void 0) props.dashed = n.dashed;
|
|
27
|
+
if (n.dotted !== void 0) props.dotted = n.dotted;
|
|
28
|
+
if (n.dashArray !== void 0) props.dashArray = n.dashArray;
|
|
29
|
+
if (n.roundedCorners !== void 0) props.roundedCorners = n.roundedCorners;
|
|
30
|
+
if (n.minimumWidth !== void 0) props.minimumWidth = n.minimumWidth;
|
|
31
|
+
if (n.minimumHeight !== void 0) props.minimumHeight = n.minimumHeight;
|
|
32
|
+
if (n.minimumSize !== void 0) props.minimumSize = n.minimumSize;
|
|
33
|
+
if (n.scale !== void 0) props.scale = n.scale;
|
|
34
|
+
if (n.xScale !== void 0) props.xScale = n.xScale;
|
|
35
|
+
if (n.yScale !== void 0) props.yScale = n.yScale;
|
|
36
|
+
if (n.textColor !== void 0) props.textColor = n.textColor;
|
|
37
|
+
if (n.opacity !== void 0) props.opacity = n.opacity;
|
|
19
38
|
return props;
|
|
20
39
|
};
|
|
21
40
|
/** 单个 IRStep → <Step /> element */
|
|
@@ -28,12 +47,63 @@ var stepToElement = (step, key) => {
|
|
|
28
47
|
key,
|
|
29
48
|
kind: "step",
|
|
30
49
|
via: step.via,
|
|
50
|
+
to: step.to,
|
|
51
|
+
...step.label !== void 0 && { label: step.label }
|
|
52
|
+
});
|
|
53
|
+
if (step.kind === "curve") return createElement(Step, {
|
|
54
|
+
key,
|
|
55
|
+
kind: "curve",
|
|
56
|
+
to: step.to,
|
|
57
|
+
control: step.control,
|
|
58
|
+
...step.label !== void 0 && { label: step.label }
|
|
59
|
+
});
|
|
60
|
+
if (step.kind === "cubic") return createElement(Step, {
|
|
61
|
+
key,
|
|
62
|
+
kind: "cubic",
|
|
63
|
+
to: step.to,
|
|
64
|
+
control1: step.control1,
|
|
65
|
+
control2: step.control2,
|
|
66
|
+
...step.label !== void 0 && { label: step.label }
|
|
67
|
+
});
|
|
68
|
+
if (step.kind === "bend") return createElement(Step, {
|
|
69
|
+
key,
|
|
70
|
+
kind: "bend",
|
|
71
|
+
to: step.to,
|
|
72
|
+
bendDirection: step.bendDirection,
|
|
73
|
+
...step.bendAngle !== void 0 && { bendAngle: step.bendAngle },
|
|
74
|
+
...step.label !== void 0 && { label: step.label }
|
|
75
|
+
});
|
|
76
|
+
if (step.kind === "arc") return createElement(Step, {
|
|
77
|
+
key,
|
|
78
|
+
kind: "arc",
|
|
79
|
+
startAngle: step.startAngle,
|
|
80
|
+
endAngle: step.endAngle,
|
|
81
|
+
radius: step.radius,
|
|
82
|
+
...step.label !== void 0 && { label: step.label }
|
|
83
|
+
});
|
|
84
|
+
if (step.kind === "circlePath") return createElement(Step, {
|
|
85
|
+
key,
|
|
86
|
+
kind: "circlePath",
|
|
87
|
+
radius: step.radius,
|
|
88
|
+
...step.label !== void 0 && { label: step.label }
|
|
89
|
+
});
|
|
90
|
+
if (step.kind === "ellipsePath") return createElement(Step, {
|
|
91
|
+
key,
|
|
92
|
+
kind: "ellipsePath",
|
|
93
|
+
radiusX: step.radiusX,
|
|
94
|
+
radiusY: step.radiusY,
|
|
95
|
+
...step.label !== void 0 && { label: step.label }
|
|
96
|
+
});
|
|
97
|
+
if (step.kind === "move") return createElement(Step, {
|
|
98
|
+
key,
|
|
99
|
+
kind: "move",
|
|
31
100
|
to: step.to
|
|
32
101
|
});
|
|
33
102
|
return createElement(Step, {
|
|
34
103
|
key,
|
|
35
104
|
kind: step.kind,
|
|
36
|
-
to: step.to
|
|
105
|
+
to: step.to,
|
|
106
|
+
...step.label !== void 0 && { label: step.label }
|
|
37
107
|
});
|
|
38
108
|
};
|
|
39
109
|
/** discriminated union 兜底:编译期保证不漏 case,运行时给出明确错误 */
|
|
@@ -52,10 +122,16 @@ var childToElement = (child, key) => {
|
|
|
52
122
|
stroke: child.stroke,
|
|
53
123
|
strokeWidth: child.strokeWidth,
|
|
54
124
|
strokeDasharray: child.strokeDasharray,
|
|
125
|
+
lineCap: child.lineCap,
|
|
126
|
+
lineJoin: child.lineJoin,
|
|
127
|
+
thickness: child.thickness,
|
|
55
128
|
arrow: child.arrow,
|
|
56
129
|
arrowShape: child.arrowShape,
|
|
57
130
|
fill: child.fill,
|
|
58
131
|
fillRule: child.fillRule,
|
|
132
|
+
opacity: child.opacity,
|
|
133
|
+
fillOpacity: child.fillOpacity,
|
|
134
|
+
drawOpacity: child.drawOpacity,
|
|
59
135
|
children: child.children.map((s, j) => stepToElement(s, j))
|
|
60
136
|
});
|
|
61
137
|
default: return assertNever(child);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kernel/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kernel/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
package/dist/es/kernel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderPrim.d.ts","sourceRoot":"","sources":["../../../src/render/renderPrim.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA6B/D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;CAClD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,GAAG,cAAc,EACjB,KAAK,GAAG,EACR,MAAK,aAAkB,KACtB,
|
|
1
|
+
{"version":3,"file":"renderPrim.d.ts","sourceRoot":"","sources":["../../../src/render/renderPrim.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA6B/D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC;CAClD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,GAAG,cAAc,EACjB,KAAK,GAAG,EACR,MAAK,aAAkB,KACtB,YAqHF,CAAC"}
|
|
@@ -25,6 +25,7 @@ var renderPrim = (p, key, ctx = {}) => {
|
|
|
25
25
|
fill: p.fill,
|
|
26
26
|
fillOpacity: p.fillOpacity,
|
|
27
27
|
stroke: p.stroke,
|
|
28
|
+
strokeOpacity: p.strokeOpacity,
|
|
28
29
|
strokeWidth: p.strokeWidth,
|
|
29
30
|
strokeDasharray: p.strokeDasharray,
|
|
30
31
|
rx: p.cornerRadius,
|
|
@@ -42,32 +43,49 @@ var renderPrim = (p, key, ctx = {}) => {
|
|
|
42
43
|
fill: p.fill,
|
|
43
44
|
fillOpacity: p.fillOpacity,
|
|
44
45
|
stroke: p.stroke,
|
|
46
|
+
strokeOpacity: p.strokeOpacity,
|
|
45
47
|
strokeWidth: p.strokeWidth,
|
|
46
48
|
strokeDasharray: p.strokeDasharray,
|
|
47
49
|
opacity: p.opacity
|
|
48
50
|
}, key);
|
|
49
51
|
}
|
|
50
|
-
case "text":
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
case "text": {
|
|
53
|
+
const n = p.lines.length;
|
|
54
|
+
const firstDy = p.baseline === "middle" ? -(n - 1) / 2 * p.lineHeight : p.baseline === "bottom" ? -(n - 1) * p.lineHeight : 0;
|
|
55
|
+
return /* @__PURE__ */ jsx("text", {
|
|
56
|
+
x: p.x,
|
|
57
|
+
y: p.y,
|
|
58
|
+
fontSize: p.fontSize,
|
|
59
|
+
fontFamily: p.fontFamily,
|
|
60
|
+
fontWeight: p.fontWeight,
|
|
61
|
+
fontStyle: p.fontStyle,
|
|
62
|
+
textAnchor: alignToAnchor(p.align),
|
|
63
|
+
dominantBaseline: baselineToDominant(p.baseline),
|
|
64
|
+
fill: p.fill,
|
|
65
|
+
opacity: p.opacity,
|
|
66
|
+
children: p.lines.map((line, i) => /* @__PURE__ */ jsx("tspan", {
|
|
67
|
+
x: p.x,
|
|
68
|
+
dy: i === 0 ? firstDy : p.lineHeight,
|
|
69
|
+
fill: line.fill,
|
|
70
|
+
opacity: line.opacity,
|
|
71
|
+
fontSize: line.fontSize,
|
|
72
|
+
fontFamily: line.fontFamily,
|
|
73
|
+
fontWeight: line.fontWeight,
|
|
74
|
+
fontStyle: line.fontStyle,
|
|
75
|
+
children: line.text
|
|
76
|
+
}, i))
|
|
77
|
+
}, key);
|
|
78
|
+
}
|
|
63
79
|
case "path": {
|
|
64
80
|
const startId = p.arrowStart && ctx.arrowMarkerIdFor ? ctx.arrowMarkerIdFor(p.arrowStart) : void 0;
|
|
65
81
|
const endId = p.arrowEnd && ctx.arrowMarkerIdFor ? ctx.arrowMarkerIdFor(p.arrowEnd) : void 0;
|
|
66
82
|
return /* @__PURE__ */ jsx("path", {
|
|
67
83
|
d: p.d,
|
|
68
84
|
fill: p.fill,
|
|
85
|
+
fillOpacity: p.fillOpacity,
|
|
69
86
|
fillRule: p.fillRule,
|
|
70
87
|
stroke: p.stroke,
|
|
88
|
+
strokeOpacity: p.strokeOpacity,
|
|
71
89
|
strokeWidth: p.strokeWidth,
|
|
72
90
|
strokeDasharray: p.strokeDasharray,
|
|
73
91
|
strokeLinecap: p.strokeLinecap,
|
package/dist/es/sugar/Draw.d.ts
CHANGED
|
@@ -2,7 +2,13 @@ import { FC } from 'react';
|
|
|
2
2
|
import { IRPath, WayDSL } from '@retikz/core';
|
|
3
3
|
/** <Draw> 组件的 props */
|
|
4
4
|
export type DrawProps = {
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* way 数组 DSL:节点 id / 笛卡尔 / 极坐标 / 相对偏移 `{ position, type: DrawWay.Relative | DrawWay.Accumulate }` /
|
|
7
|
+
* 折角算子 `'-|'` `'|-'`(或 `DrawWay.Hv` / `DrawWay.Vh`)/ 闭合 `DrawWay.Cycle` /
|
|
8
|
+
* 曲线算子 `{ curve | cubic | bend }`(infix)/
|
|
9
|
+
* 形状算子 `{ arc | circle | ellipse }`(infix,以"上一项"为圆心,不消耗下一项)/
|
|
10
|
+
* 边标注算子 `{ label }`(infix,修饰下一段)
|
|
11
|
+
*/
|
|
6
12
|
way: WayDSL;
|
|
7
13
|
/** 描边色,省略时用 currentColor */
|
|
8
14
|
stroke?: IRPath['stroke'];
|
|
@@ -10,6 +16,12 @@ export type DrawProps = {
|
|
|
10
16
|
strokeWidth?: IRPath['strokeWidth'];
|
|
11
17
|
/** SVG stroke-dasharray 模式(如 "4 2") */
|
|
12
18
|
strokeDasharray?: IRPath['strokeDasharray'];
|
|
19
|
+
/** 端点形状(SVG `stroke-linecap`) */
|
|
20
|
+
lineCap?: IRPath['lineCap'];
|
|
21
|
+
/** 拐点形状(SVG `stroke-linejoin`) */
|
|
22
|
+
lineJoin?: IRPath['lineJoin'];
|
|
23
|
+
/** 语义 stroke 档位(TikZ `ultra thin` … `ultra thick`);显式 `strokeWidth` 始终优先 */
|
|
24
|
+
thickness?: IRPath['thickness'];
|
|
13
25
|
/**
|
|
14
26
|
* 路径级箭头方向。`'->'` = 终点;`'<-'` = 起点;`'<->'` = 两端;
|
|
15
27
|
* 省略或 `'none'` = 无箭头。
|
|
@@ -19,10 +31,16 @@ export type DrawProps = {
|
|
|
19
31
|
* 箭头形状。默认 `'normal'`。其他:`'open'` / `'stealth'` / `'diamond'` / `'circle'`。
|
|
20
32
|
*/
|
|
21
33
|
arrowShape?: IRPath['arrowShape'];
|
|
22
|
-
/** 闭合区域填充色,省略 = 不填充。配合 way 末尾的 `DrawWay.
|
|
34
|
+
/** 闭合区域填充色,省略 = 不填充。配合 way 末尾的 `DrawWay.Cycle` 画填充形状 */
|
|
23
35
|
fill?: IRPath['fill'];
|
|
24
36
|
/** SVG fill-rule:`'nonzero'`(默认)/ `'evenodd'` */
|
|
25
37
|
fillRule?: IRPath['fillRule'];
|
|
38
|
+
/** 整 path 透明度 0~1 */
|
|
39
|
+
opacity?: IRPath['opacity'];
|
|
40
|
+
/** 仅 fill 透明度 0~1 */
|
|
41
|
+
fillOpacity?: IRPath['fillOpacity'];
|
|
42
|
+
/** 仅 stroke 透明度 0~1(TikZ `draw opacity`) */
|
|
43
|
+
drawOpacity?: IRPath['drawOpacity'];
|
|
26
44
|
};
|
|
27
45
|
/**
|
|
28
46
|
* Sugar 组件——展开为等价的 <Path><Step.../></Path> Kernel 子树。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Draw.d.ts","sourceRoot":"","sources":["../../../src/sugar/Draw.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKnD,uBAAuB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C,CAAC;CACrC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA0G9B,CAAC"}
|
package/dist/es/sugar/Draw.js
CHANGED
|
@@ -12,15 +12,21 @@ import { jsx } from "react/jsx-runtime";
|
|
|
12
12
|
* (useState / useMemo / useEffect 等会抛 "Invalid hook call")。
|
|
13
13
|
*/
|
|
14
14
|
var Draw = (props) => {
|
|
15
|
-
const { way, stroke, strokeWidth, strokeDasharray, arrow, arrowShape, fill, fillRule } = props;
|
|
15
|
+
const { way, stroke, strokeWidth, strokeDasharray, lineCap, lineJoin, thickness, arrow, arrowShape, fill, fillRule, opacity, fillOpacity, drawOpacity } = props;
|
|
16
16
|
return /* @__PURE__ */ jsx(Path, {
|
|
17
17
|
stroke,
|
|
18
18
|
strokeWidth,
|
|
19
19
|
strokeDasharray,
|
|
20
|
+
lineCap,
|
|
21
|
+
lineJoin,
|
|
22
|
+
thickness,
|
|
20
23
|
arrow,
|
|
21
24
|
arrowShape,
|
|
22
25
|
fill,
|
|
23
26
|
fillRule,
|
|
27
|
+
opacity,
|
|
28
|
+
fillOpacity,
|
|
29
|
+
drawOpacity,
|
|
24
30
|
children: parseWay(way).map((s, i) => {
|
|
25
31
|
if (s.kind === "cycle") return /* @__PURE__ */ jsx(Step, { kind: "cycle" }, i);
|
|
26
32
|
if (s.kind === "move") return /* @__PURE__ */ jsx(Step, {
|
|
@@ -30,11 +36,59 @@ var Draw = (props) => {
|
|
|
30
36
|
if (s.kind === "step") return /* @__PURE__ */ jsx(Step, {
|
|
31
37
|
kind: "step",
|
|
32
38
|
via: s.via,
|
|
33
|
-
to: s.to
|
|
39
|
+
to: s.to,
|
|
40
|
+
label: s.label
|
|
41
|
+
}, i);
|
|
42
|
+
if (s.kind === "curve") return /* @__PURE__ */ jsx(Step, {
|
|
43
|
+
kind: "curve",
|
|
44
|
+
to: s.to,
|
|
45
|
+
control: s.control,
|
|
46
|
+
label: s.label
|
|
47
|
+
}, i);
|
|
48
|
+
if (s.kind === "cubic") return /* @__PURE__ */ jsx(Step, {
|
|
49
|
+
kind: "cubic",
|
|
50
|
+
to: s.to,
|
|
51
|
+
control1: s.control1,
|
|
52
|
+
control2: s.control2,
|
|
53
|
+
label: s.label
|
|
54
|
+
}, i);
|
|
55
|
+
if (s.kind === "bend") {
|
|
56
|
+
if (s.bendAngle !== void 0) return /* @__PURE__ */ jsx(Step, {
|
|
57
|
+
kind: "bend",
|
|
58
|
+
to: s.to,
|
|
59
|
+
bendDirection: s.bendDirection,
|
|
60
|
+
bendAngle: s.bendAngle,
|
|
61
|
+
label: s.label
|
|
62
|
+
}, i);
|
|
63
|
+
return /* @__PURE__ */ jsx(Step, {
|
|
64
|
+
kind: "bend",
|
|
65
|
+
to: s.to,
|
|
66
|
+
bendDirection: s.bendDirection,
|
|
67
|
+
label: s.label
|
|
68
|
+
}, i);
|
|
69
|
+
}
|
|
70
|
+
if (s.kind === "arc") return /* @__PURE__ */ jsx(Step, {
|
|
71
|
+
kind: "arc",
|
|
72
|
+
startAngle: s.startAngle,
|
|
73
|
+
endAngle: s.endAngle,
|
|
74
|
+
radius: s.radius,
|
|
75
|
+
label: s.label
|
|
76
|
+
}, i);
|
|
77
|
+
if (s.kind === "circlePath") return /* @__PURE__ */ jsx(Step, {
|
|
78
|
+
kind: "circlePath",
|
|
79
|
+
radius: s.radius,
|
|
80
|
+
label: s.label
|
|
81
|
+
}, i);
|
|
82
|
+
if (s.kind === "ellipsePath") return /* @__PURE__ */ jsx(Step, {
|
|
83
|
+
kind: "ellipsePath",
|
|
84
|
+
radiusX: s.radiusX,
|
|
85
|
+
radiusY: s.radiusY,
|
|
86
|
+
label: s.label
|
|
34
87
|
}, i);
|
|
35
88
|
return /* @__PURE__ */ jsx(Step, {
|
|
36
89
|
kind: "line",
|
|
37
|
-
to: s.to
|
|
90
|
+
to: s.to,
|
|
91
|
+
label: s.label
|
|
38
92
|
}, i);
|
|
39
93
|
})
|
|
40
94
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IRStepLabel } from '@retikz/core';
|
|
3
|
+
/** <EdgeLabel> 组件的 props(ADR-0004) */
|
|
4
|
+
export type EdgeLabelProps = {
|
|
5
|
+
/** 段上位置(TikZ `midway` / `near start` / `near end`),缺省 'midway' */
|
|
6
|
+
position?: IRStepLabel['position'];
|
|
7
|
+
/** 相对段方向 / 视觉方位的偏移侧('sloped' = 沿切线旋转),缺省 'above' */
|
|
8
|
+
side?: IRStepLabel['side'];
|
|
9
|
+
/** 标签文字内容;必须是字符串 */
|
|
10
|
+
children: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Sugar 组件——挂在 <Step> 内作为子节点声明边标注。等价于在 Step 上写
|
|
14
|
+
* `label={{ text, position, side }}` prop;二者并存时 prop 优先。
|
|
15
|
+
*
|
|
16
|
+
* <EdgeLabel> 自身不渲染,由 buildIR 在收集 Step 时识别 displayName 后
|
|
17
|
+
* 提取到 IR `step.label`。
|
|
18
|
+
*/
|
|
19
|
+
export declare const EdgeLabel: FC<EdgeLabelProps>;
|
|
20
|
+
//# sourceMappingURL=EdgeLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdgeLabel.d.ts","sourceRoot":"","sources":["../../../src/sugar/EdgeLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,oDAAoD;IACpD,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TIKZ_EDGE_LABEL } from "../kernel/_displayNames.js";
|
|
2
|
+
//#region src/sugar/EdgeLabel.tsx
|
|
3
|
+
/**
|
|
4
|
+
* Sugar 组件——挂在 <Step> 内作为子节点声明边标注。等价于在 Step 上写
|
|
5
|
+
* `label={{ text, position, side }}` prop;二者并存时 prop 优先。
|
|
6
|
+
*
|
|
7
|
+
* <EdgeLabel> 自身不渲染,由 buildIR 在收集 Step 时识别 displayName 后
|
|
8
|
+
* 提取到 IR `step.label`。
|
|
9
|
+
*/
|
|
10
|
+
var EdgeLabel = () => null;
|
|
11
|
+
EdgeLabel.displayName = TIKZ_EDGE_LABEL;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { EdgeLabel };
|
package/dist/es/sugar/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sugar/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sugar/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
package/dist/es/sugar/index.js
CHANGED
package/dist/lib/index.cjs
CHANGED
|
@@ -4,8 +4,10 @@ const require_Tikz = require("./kernel/Tikz.cjs");
|
|
|
4
4
|
const require_Node = require("./kernel/Node.cjs");
|
|
5
5
|
const require_Path = require("./kernel/Path.cjs");
|
|
6
6
|
const require_Step = require("./kernel/Step.cjs");
|
|
7
|
+
const require_Text = require("./kernel/Text.cjs");
|
|
7
8
|
require("./kernel/index.cjs");
|
|
8
9
|
const require_Draw = require("./sugar/Draw.cjs");
|
|
10
|
+
const require_EdgeLabel = require("./sugar/EdgeLabel.cjs");
|
|
9
11
|
require("./sugar/index.cjs");
|
|
10
12
|
const require__unbuilder = require("./kernel/_unbuilder.cjs");
|
|
11
13
|
let _retikz_core = require("@retikz/core");
|
|
@@ -16,9 +18,11 @@ Object.defineProperty(exports, "DrawWay", {
|
|
|
16
18
|
return _retikz_core.DrawWay;
|
|
17
19
|
}
|
|
18
20
|
});
|
|
21
|
+
exports.EdgeLabel = require_EdgeLabel.EdgeLabel;
|
|
19
22
|
exports.Node = require_Node.Node;
|
|
20
23
|
exports.Path = require_Path.Path;
|
|
21
24
|
exports.Step = require_Step.Step;
|
|
25
|
+
exports.Text = require_Text.Text;
|
|
22
26
|
exports.Tikz = require_Tikz.Tikz;
|
|
23
27
|
exports.convertIRToReactNode = require__unbuilder.convertIRToReactNode;
|
|
24
28
|
exports.convertReactNodeToIR = require__builder.buildIR;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* 渲染管道:buildIR → compileToScene → renderPrim → SVG
|
|
8
8
|
*/
|
|
9
|
-
export { Tikz, Node, Path, Step } from './kernel';
|
|
10
|
-
export type { TikzProps, NodeProps, PathProps, StepProps } from './kernel';
|
|
11
|
-
export { Draw } from './sugar';
|
|
12
|
-
export type { DrawProps } from './sugar';
|
|
9
|
+
export { Tikz, Node, Path, Step, Text } from './kernel';
|
|
10
|
+
export type { TikzProps, NodeProps, PathProps, StepProps, TextProps } from './kernel';
|
|
11
|
+
export { Draw, EdgeLabel } from './sugar';
|
|
12
|
+
export type { DrawProps, EdgeLabelProps } from './sugar';
|
|
13
13
|
export { DrawWay } from '@retikz/core';
|
|
14
|
-
export type { WayItem, WayDSL, WayCycle, WayVia } from '@retikz/core';
|
|
14
|
+
export type { WayItem, WayDSL, WayCycle, WayVia, WayRelItem, WayLabel, WayLabelOp, } from '@retikz/core';
|
|
15
15
|
export { buildIR as convertReactNodeToIR } from './kernel/_builder';
|
|
16
16
|
export { convertIRToReactNode } from './kernel/_unbuilder';
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,GACX,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { IRNode, IRPosition, PolarPosition } from '@retikz/core';
|
|
2
|
+
import { IRFont, IRLineSpec, IRNode, IRPosition, NodeTextAlign, PolarPosition } from '@retikz/core';
|
|
3
3
|
/** <Node> 组件的 props */
|
|
4
4
|
export type NodeProps = {
|
|
5
5
|
/** 节点 id;其他 Path/Draw 通过这个 id 引用本节点 */
|
|
@@ -10,22 +10,73 @@ export type NodeProps = {
|
|
|
10
10
|
position: IRPosition | PolarPosition;
|
|
11
11
|
/** 旋转角度(度数,与 TikZ 一致),绕节点中心;正值顺时针 */
|
|
12
12
|
rotate?: number;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* 文本内容(也可以用 children 写);与 `text` 二选一,`text` 优先。
|
|
15
|
+
*
|
|
16
|
+
* children 多行写法:
|
|
17
|
+
* - `<Node>{'Line 1\nLine 2'}</Node>`(字符串内嵌 `\n`)
|
|
18
|
+
* - ``<Node>{`Line 1\nLine 2`}</Node>``(模板字面量)
|
|
19
|
+
* - `<Node>{['Line 1', 'Line 2']}</Node>`(数组)
|
|
20
|
+
* - `<Node><Text fill="red">L1</Text>L2</Node>`(混 `<Text>` 带样式行)
|
|
21
|
+
*/
|
|
14
22
|
children?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
/**
|
|
24
|
+
* 显式 text,优先级高于 children:
|
|
25
|
+
* - `string` — 单行
|
|
26
|
+
* - `Array<string>` — 多行无样式覆盖
|
|
27
|
+
* - `Array<string | LineSpec>` — 多行,可对单行覆盖 fill / opacity / font
|
|
28
|
+
*/
|
|
29
|
+
text?: string | Array<IRLineSpec>;
|
|
30
|
+
/** 多行文本对齐:left / center(默认)/ right;只影响多行块内各行的水平对齐 */
|
|
31
|
+
align?: NodeTextAlign;
|
|
32
|
+
/** 行高(user units);不填走 `font.size × 1.2` 默认 */
|
|
33
|
+
lineHeight?: number;
|
|
34
|
+
/** 字体规格:family / size / weight / style 全部可选;不填走渲染端默认值 */
|
|
35
|
+
font?: IRFont;
|
|
36
|
+
/** 横向内边距(text → 左右 border);不填走 `padding` 兜底,再走默认 */
|
|
37
|
+
innerXSep?: number;
|
|
38
|
+
/** 纵向内边距(text → 上下 border);不填走 `padding` 兜底,再走默认 */
|
|
39
|
+
innerYSep?: number;
|
|
40
|
+
/** 外边距(border → path 附着点);不影响 border 位置;不填走 `margin` 兜底 */
|
|
41
|
+
outerSep?: number;
|
|
42
|
+
/** 内边距对称别名——等价于同时设 `innerXSep` 和 `innerYSep`;轴特化字段优先 */
|
|
20
43
|
padding?: number;
|
|
21
|
-
/**
|
|
44
|
+
/** 外边距对称别名——等价于 `outerSep`;轴特化字段优先 */
|
|
22
45
|
margin?: number;
|
|
23
46
|
/** 背景色 */
|
|
24
47
|
fill?: IRNode['fill'];
|
|
48
|
+
/** 填充透明度 0~1 */
|
|
49
|
+
fillOpacity?: number;
|
|
25
50
|
/** 描边色 */
|
|
26
51
|
stroke?: IRNode['stroke'];
|
|
52
|
+
/** 描边透明度 0~1(TikZ `draw opacity`) */
|
|
53
|
+
drawOpacity?: number;
|
|
27
54
|
/** 描边宽度 */
|
|
28
55
|
strokeWidth?: number;
|
|
56
|
+
/** 描边虚线预设:等价于 dashArray="4 2";与 `dotted` / `dashArray` 优先级:dashArray > dashed > dotted */
|
|
57
|
+
dashed?: boolean;
|
|
58
|
+
/** 描边点线预设:等价于 dashArray="1 2" */
|
|
59
|
+
dotted?: boolean;
|
|
60
|
+
/** 显式 SVG stroke-dasharray 值(如 "4 2");优先级最高 */
|
|
61
|
+
dashArray?: string;
|
|
62
|
+
/** 圆角半径(user units);只对 `rectangle` shape 生效 */
|
|
63
|
+
roundedCorners?: number;
|
|
64
|
+
/** 最小 border 宽度(user units);不足时撑开 bbox */
|
|
65
|
+
minimumWidth?: number;
|
|
66
|
+
/** 最小 border 高度(user units) */
|
|
67
|
+
minimumHeight?: number;
|
|
68
|
+
/** 对称最小尺寸别名——等价于同时设 `minimumWidth` 与 `minimumHeight`;轴特化字段优先 */
|
|
69
|
+
minimumSize?: number;
|
|
70
|
+
/** 均匀缩放因子;同时影响 bbox / 字号 / padding / margin / 路径附着点(与 TikZ scale 一致) */
|
|
71
|
+
scale?: number;
|
|
72
|
+
/** 横向缩放,优先于 `scale` */
|
|
73
|
+
xScale?: number;
|
|
74
|
+
/** 纵向缩放,优先于 `scale` */
|
|
75
|
+
yScale?: number;
|
|
76
|
+
/** 文字颜色(块级默认;行级 LineSpec.fill 可覆盖);不填走 `currentColor` */
|
|
77
|
+
textColor?: string;
|
|
78
|
+
/** 整节点透明度 0~1(同时作用于 shape 与 text) */
|
|
79
|
+
opacity?: number;
|
|
29
80
|
};
|
|
30
81
|
/**
|
|
31
82
|
* Node 是 DSL 标记组件——本身不渲染任何 React 元素。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/kernel/Node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../src/kernel/Node.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,MAAM,EACN,UAAU,EACV,MAAM,EACN,UAAU,EACV,aAAa,EACb,aAAa,EACd,MAAM,cAAc,CAAC;AAGtB,uBAAuB;AACvB,MAAM,MAAM,SAAS,GAAG;IACtB,uCAAuC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB,oCAAoC;IACpC,QAAQ,EAAE,UAAU,GAAG,aAAa,CAAC;IACrC,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;IAClC,qDAAqD;IACrD,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,M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G;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAAc,CAAC"}
|
|
@@ -8,6 +8,12 @@ export type PathProps = {
|
|
|
8
8
|
strokeWidth?: IRPath['strokeWidth'];
|
|
9
9
|
/** SVG stroke-dasharray 模式(如 "4 2") */
|
|
10
10
|
strokeDasharray?: IRPath['strokeDasharray'];
|
|
11
|
+
/** 端点形状(SVG `stroke-linecap`):`'butt'`(默认 / 直角)/ `'round'`(半圆)/ `'square'`(方头外扩半 stroke) */
|
|
12
|
+
lineCap?: IRPath['lineCap'];
|
|
13
|
+
/** 拐点形状(SVG `stroke-linejoin`):`'miter'`(默认 / 尖角)/ `'round'`(圆角)/ `'bevel'`(切角) */
|
|
14
|
+
lineJoin?: IRPath['lineJoin'];
|
|
15
|
+
/** 语义 stroke 档位(TikZ `ultra thin` … `ultra thick`);显式 `strokeWidth` 始终优先 */
|
|
16
|
+
thickness?: IRPath['thickness'];
|
|
11
17
|
/**
|
|
12
18
|
* 路径级箭头方向。`'->'` = 终点;`'<-'` = 起点;`'<->'` = 两端;
|
|
13
19
|
* 省略或 `'none'` = 无箭头。
|
|
@@ -22,6 +28,12 @@ export type PathProps = {
|
|
|
22
28
|
fill?: IRPath['fill'];
|
|
23
29
|
/** SVG fill-rule:`'nonzero'`(默认)/ `'evenodd'`(环形 / 孔洞) */
|
|
24
30
|
fillRule?: IRPath['fillRule'];
|
|
31
|
+
/** 整 path 透明度 0~1;同时作用于 stroke 与 fill */
|
|
32
|
+
opacity?: IRPath['opacity'];
|
|
33
|
+
/** 仅 fill 透明度 0~1 */
|
|
34
|
+
fillOpacity?: IRPath['fillOpacity'];
|
|
35
|
+
/** 仅 stroke 透明度 0~1(TikZ `draw opacity`) */
|
|
36
|
+
drawOpacity?: IRPath['drawOpacity'];
|
|
25
37
|
/** 应当全部是 <Step /> */
|
|
26
38
|
children: ReactNode;
|
|
27
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/kernel/Path.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,uBAAuB;AACvB,MAAM,MAAM,SAAS,GAAG;IACtB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,uCAAuC;IACvC,eAAe,CAAC,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC5C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAClC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC9B,qBAAqB;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../../src/kernel/Path.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,uBAAuB;AACvB,MAAM,MAAM,SAAS,GAAG;IACtB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1B,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC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