@cardenelabs/cdl 0.23.0 → 0.24.0
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/CHANGELOG.md +60 -1
- package/dist/index.cjs +109 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +109 -62
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +105 -62
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +105 -62
- package/dist/react.js.map +1 -1
- package/dist/{render-Czv0tUon.d.cts → render-CfXUl0Yz.d.cts} +18 -1
- package/dist/{render-Czv0tUon.d.ts → render-CfXUl0Yz.d.ts} +18 -1
- package/package.json +1 -1
- package/src/builder.ts +7 -0
- package/src/kinds/generic.tsx +92 -14
- package/src/presets.ts +7 -1
- package/src/render/edges.tsx +42 -17
- package/src/types.ts +18 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as
|
|
2
|
-
export {
|
|
1
|
+
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeRole, f as EdgeHead, g as EdgeHeadFill, h as CdlState, i as CdlEventTarget, j as Computed, k as CdlDerivedValue, l as CdlScrollTrigger, L as LaidDiagram, m as CdlDiagramViewProps, n as LaidEdge, o as LaidNode, p as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-CfXUl0Yz.cjs';
|
|
2
|
+
export { q as CdlDiagramView, r as CdlEventBinding, s as CdlEventKind, t as CdlFormula, u as CdlPhase, v as EDGE_HEADS, w as EDGE_HEAD_DEFAULT, x as EDGE_HEAD_FILLS, y as EDGE_HEAD_FILL_DEFAULT, z as EDGE_REVEALS, A as EDGE_REVEAL_DEFAULT, D as EDGE_STYLES, F as EdgeReveal, I as InteractiveHandlerMap, G as InteractiveSignalsAccessor, H as LaidLane, K as NODE_KINDS, M as ScrollProgressHandle, O as TONES, P as computeEventBindingKey, U as computeFormulaKey, V as computeInputSignalKey, W as computeScrollTriggerKey, X as computed, Y as createInteractiveSignalsAccessor, Z as createScrollProgressHandle, _ as createScrollProgressSignals, $ as hasInteractivePrimitives, a0 as sequenceBoardMetrics, a1 as sequenceStepId, a2 as signal } from './render-CfXUl0Yz.cjs';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
|
|
5
5
|
declare function effect(fn: () => void | (() => void)): () => void;
|
|
@@ -1030,6 +1030,10 @@ type DiagramBuilder = {
|
|
|
1030
1030
|
tone?: Tone;
|
|
1031
1031
|
side?: Side;
|
|
1032
1032
|
style?: EdgeStyle;
|
|
1033
|
+
/** 辺の役目 (#618)。 `main` を書いた辺だけ「いま」 の色で引く */
|
|
1034
|
+
role?: EdgeRole;
|
|
1035
|
+
/** 名前の下地を敷くか (#618)。 書かなければ敷く */
|
|
1036
|
+
labelPlate?: boolean;
|
|
1033
1037
|
/** 端の形 (#560)、 既定は塗った三角。 線の種類とは別の軸 */
|
|
1034
1038
|
head?: EdgeHead;
|
|
1035
1039
|
/** 端の印の塗り (#578)。 書かなければ形ごとの既定 */
|
|
@@ -3210,6 +3214,10 @@ type InfraConnection = {
|
|
|
3210
3214
|
sub?: string;
|
|
3211
3215
|
tone?: Tone;
|
|
3212
3216
|
style?: EdgeStyle;
|
|
3217
|
+
/** 辺の役目 (#618)。 `main` を書いた辺だけ「いま」 の色で引く */
|
|
3218
|
+
role?: EdgeRole;
|
|
3219
|
+
/** 名前の下地を敷くか (#618)。 書かなければ敷く */
|
|
3220
|
+
labelPlate?: boolean;
|
|
3213
3221
|
/** label の水平方向 fine offset (default 0)、 preset 交互 ±60 を override */
|
|
3214
3222
|
labelOffsetX?: number;
|
|
3215
3223
|
/** label の垂直方向 fine offset (default 0、 preset 交互 ±60 を override) */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as
|
|
2
|
-
export {
|
|
1
|
+
import { C as CdlDiagram, S as Signal, a as CdlInput, b as CdlLane, c as CdlNode, T as Tone, d as Side, E as EdgeStyle, e as EdgeRole, f as EdgeHead, g as EdgeHeadFill, h as CdlState, i as CdlEventTarget, j as Computed, k as CdlDerivedValue, l as CdlScrollTrigger, L as LaidDiagram, m as CdlDiagramViewProps, n as LaidEdge, o as LaidNode, p as CdlEdge, B as BBox, R as RowMark, N as NodeKind, J as JourneyEmotion, Q as QuadrantKey } from './render-CfXUl0Yz.js';
|
|
2
|
+
export { q as CdlDiagramView, r as CdlEventBinding, s as CdlEventKind, t as CdlFormula, u as CdlPhase, v as EDGE_HEADS, w as EDGE_HEAD_DEFAULT, x as EDGE_HEAD_FILLS, y as EDGE_HEAD_FILL_DEFAULT, z as EDGE_REVEALS, A as EDGE_REVEAL_DEFAULT, D as EDGE_STYLES, F as EdgeReveal, I as InteractiveHandlerMap, G as InteractiveSignalsAccessor, H as LaidLane, K as NODE_KINDS, M as ScrollProgressHandle, O as TONES, P as computeEventBindingKey, U as computeFormulaKey, V as computeInputSignalKey, W as computeScrollTriggerKey, X as computed, Y as createInteractiveSignalsAccessor, Z as createScrollProgressHandle, _ as createScrollProgressSignals, $ as hasInteractivePrimitives, a0 as sequenceBoardMetrics, a1 as sequenceStepId, a2 as signal } from './render-CfXUl0Yz.js';
|
|
3
3
|
import { JSX } from 'react';
|
|
4
4
|
|
|
5
5
|
declare function effect(fn: () => void | (() => void)): () => void;
|
|
@@ -1030,6 +1030,10 @@ type DiagramBuilder = {
|
|
|
1030
1030
|
tone?: Tone;
|
|
1031
1031
|
side?: Side;
|
|
1032
1032
|
style?: EdgeStyle;
|
|
1033
|
+
/** 辺の役目 (#618)。 `main` を書いた辺だけ「いま」 の色で引く */
|
|
1034
|
+
role?: EdgeRole;
|
|
1035
|
+
/** 名前の下地を敷くか (#618)。 書かなければ敷く */
|
|
1036
|
+
labelPlate?: boolean;
|
|
1033
1037
|
/** 端の形 (#560)、 既定は塗った三角。 線の種類とは別の軸 */
|
|
1034
1038
|
head?: EdgeHead;
|
|
1035
1039
|
/** 端の印の塗り (#578)。 書かなければ形ごとの既定 */
|
|
@@ -3210,6 +3214,10 @@ type InfraConnection = {
|
|
|
3210
3214
|
sub?: string;
|
|
3211
3215
|
tone?: Tone;
|
|
3212
3216
|
style?: EdgeStyle;
|
|
3217
|
+
/** 辺の役目 (#618)。 `main` を書いた辺だけ「いま」 の色で引く */
|
|
3218
|
+
role?: EdgeRole;
|
|
3219
|
+
/** 名前の下地を敷くか (#618)。 書かなければ敷く */
|
|
3220
|
+
labelPlate?: boolean;
|
|
3213
3221
|
/** label の水平方向 fine offset (default 0)、 preset 交互 ±60 を override */
|
|
3214
3222
|
labelOffsetX?: number;
|
|
3215
3223
|
/** label の垂直方向 fine offset (default 0、 preset 交互 ±60 を override) */
|
package/dist/index.js
CHANGED
|
@@ -9491,6 +9491,8 @@ function diagram(id, options) {
|
|
|
9491
9491
|
tone: opts.tone ?? "accent",
|
|
9492
9492
|
side: opts.side,
|
|
9493
9493
|
style: opts.style,
|
|
9494
|
+
role: opts.role,
|
|
9495
|
+
labelPlate: opts.labelPlate,
|
|
9494
9496
|
head: opts.head,
|
|
9495
9497
|
headFill: opts.headFill,
|
|
9496
9498
|
tailHead: opts.tailHead,
|
|
@@ -21977,6 +21979,12 @@ function edgeHeadPaint(head, fill, color) {
|
|
|
21977
21979
|
}
|
|
21978
21980
|
return { fill: color, stroke: "none" };
|
|
21979
21981
|
}
|
|
21982
|
+
function defaultEdgeWidth(active) {
|
|
21983
|
+
return active ? 2.5 : 1.25;
|
|
21984
|
+
}
|
|
21985
|
+
function edgeColor(edge) {
|
|
21986
|
+
return edge.role === "main" ? "var(--cdl-now, #c0421f)" : toneColor(edge.tone);
|
|
21987
|
+
}
|
|
21980
21988
|
function opacityAttr(opacity) {
|
|
21981
21989
|
return opacity < 1 ? opacity : void 0;
|
|
21982
21990
|
}
|
|
@@ -21990,7 +21998,7 @@ function CdlEdgeView({
|
|
|
21990
21998
|
progress,
|
|
21991
21999
|
stateValues
|
|
21992
22000
|
}) {
|
|
21993
|
-
const color =
|
|
22001
|
+
const color = edgeColor(edge);
|
|
21994
22002
|
const \u7AEF\u306E\u540D\u524D = (h, f) => {
|
|
21995
22003
|
const \u5F62 = h ?? EDGE_HEAD_DEFAULT;
|
|
21996
22004
|
if (\u5F62 === "none") return void 0;
|
|
@@ -22080,7 +22088,7 @@ function SolidEdgePath({
|
|
|
22080
22088
|
stateValues
|
|
22081
22089
|
}) {
|
|
22082
22090
|
const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
|
|
22083
|
-
const defaultWidth = active
|
|
22091
|
+
const defaultWidth = defaultEdgeWidth(active);
|
|
22084
22092
|
const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
|
|
22085
22093
|
const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
|
|
22086
22094
|
const boundDashOffset = edge.dashOffsetBind && stateValues ? resolveNumericAttr(edge.dashOffsetBind, stateValues, 0) : void 0;
|
|
@@ -22157,7 +22165,7 @@ function CdlEdgeGlowView({
|
|
|
22157
22165
|
active
|
|
22158
22166
|
}) {
|
|
22159
22167
|
if (!active) return null;
|
|
22160
|
-
const color =
|
|
22168
|
+
const color = edgeColor(edge);
|
|
22161
22169
|
return /* @__PURE__ */ jsx(EdgeGlowCircles, { color, edgeId: edge.id });
|
|
22162
22170
|
}
|
|
22163
22171
|
function CdlEdgeLabelView({
|
|
@@ -22165,7 +22173,7 @@ function CdlEdgeLabelView({
|
|
|
22165
22173
|
active
|
|
22166
22174
|
}) {
|
|
22167
22175
|
if (!hasRenderedLabel(edge)) return null;
|
|
22168
|
-
const color =
|
|
22176
|
+
const color = edgeColor(edge);
|
|
22169
22177
|
const bbox = computeLabelBBoxWorld(edge);
|
|
22170
22178
|
const boxW = bbox.w;
|
|
22171
22179
|
const boxH = bbox.h;
|
|
@@ -22183,7 +22191,7 @@ function CdlEdgeLabelView({
|
|
|
22183
22191
|
"data-cdl-edge-label-text": edge.label,
|
|
22184
22192
|
"data-cdl-edge-sub-text": edge.sub ?? "",
|
|
22185
22193
|
children: [
|
|
22186
|
-
/* @__PURE__ */ jsx(
|
|
22194
|
+
edge.labelPlate !== false && /* @__PURE__ */ jsx(
|
|
22187
22195
|
"rect",
|
|
22188
22196
|
{
|
|
22189
22197
|
"data-cdl-role": "edge-label-bg",
|
|
@@ -22906,9 +22914,29 @@ function StorageNode({
|
|
|
22906
22914
|
})
|
|
22907
22915
|
] });
|
|
22908
22916
|
}
|
|
22917
|
+
var TINT_FILL = "color-mix(in srgb, var(--cdl-text, #1a1f2a) 6%, transparent)";
|
|
22918
|
+
function lookPaint(look, accent, active) {
|
|
22919
|
+
const \u65E2\u5B9A\u67A0 = active ? accent : "var(--cdl-divider, #d4d4d8)";
|
|
22920
|
+
const \u65E2\u5B9A\u592A\u3055 = active ? 3 : 1.25;
|
|
22921
|
+
switch (look) {
|
|
22922
|
+
case "outline":
|
|
22923
|
+
return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22924
|
+
case "tint":
|
|
22925
|
+
return { fill: TINT_FILL, stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22926
|
+
case "solid":
|
|
22927
|
+
return { fill: "var(--cdl-text, #1a1f2a)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: true };
|
|
22928
|
+
case "ledger":
|
|
22929
|
+
return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22930
|
+
case "dashed":
|
|
22931
|
+
return { fill: "none", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, dash: "6 4", onSolid: false };
|
|
22932
|
+
default:
|
|
22933
|
+
return { fill: "var(--cdl-node-fill, #ffffff)", stroke: \u65E2\u5B9A\u67A0, strokeWidth: \u65E2\u5B9A\u592A\u3055, onSolid: false };
|
|
22934
|
+
}
|
|
22935
|
+
}
|
|
22909
22936
|
var STYLES = {
|
|
22910
22937
|
// 人系
|
|
22911
22938
|
person: {
|
|
22939
|
+
look: "outline",
|
|
22912
22940
|
accent: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22913
22941
|
eyebrowColor: "var(--cdl-tone-accent, #2d6a8f)",
|
|
22914
22942
|
icon: "M12 12c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm0 2c-2.7 0-8 1.3-8 4v2h16v-2c0-2.7-5.3-4-8-4z"
|
|
@@ -22941,11 +22969,13 @@ var STYLES = {
|
|
|
22941
22969
|
shape: "cylinder"
|
|
22942
22970
|
},
|
|
22943
22971
|
cache: {
|
|
22972
|
+
look: "dashed",
|
|
22944
22973
|
accent: "var(--cdl-tone-warning, #a67a2e)",
|
|
22945
22974
|
eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
|
|
22946
22975
|
icon: "M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"
|
|
22947
22976
|
},
|
|
22948
22977
|
queue: {
|
|
22978
|
+
look: "ledger",
|
|
22949
22979
|
accent: "var(--cdl-tone-warning, #a67a2e)",
|
|
22950
22980
|
eyebrowColor: "var(--cdl-tone-warning, #a67a2e)",
|
|
22951
22981
|
icon: "M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z"
|
|
@@ -22962,12 +22992,14 @@ var STYLES = {
|
|
|
22962
22992
|
shape: "cloud"
|
|
22963
22993
|
},
|
|
22964
22994
|
cdn: {
|
|
22995
|
+
look: "tint",
|
|
22965
22996
|
accent: "var(--cdl-tone-info, #5a8ec1)",
|
|
22966
22997
|
eyebrowColor: "var(--cdl-tone-info, #5a8ec1)",
|
|
22967
22998
|
icon: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
|
|
22968
22999
|
},
|
|
22969
23000
|
// アプリ系
|
|
22970
23001
|
service: {
|
|
23002
|
+
look: "solid",
|
|
22971
23003
|
accent: "var(--cdl-tone-teal, #2f8770)",
|
|
22972
23004
|
eyebrowColor: "var(--cdl-tone-teal, #2f8770)",
|
|
22973
23005
|
icon: "M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
|
|
@@ -23039,6 +23071,7 @@ function GenericNode({
|
|
|
23039
23071
|
const w = node.w;
|
|
23040
23072
|
const h = node.h;
|
|
23041
23073
|
const shape = style.shape ?? "rect";
|
|
23074
|
+
const paint = lookPaint(style.look, style.accent, active);
|
|
23042
23075
|
const shapeEl = (() => {
|
|
23043
23076
|
if (shape === "cylinder") {
|
|
23044
23077
|
const rx = w / 2;
|
|
@@ -23096,19 +23129,23 @@ function GenericNode({
|
|
|
23096
23129
|
circles.map((c, i) => /* @__PURE__ */ jsx("circle", { cx: c.cx, cy: c.cy, r: c.r - (active ? 1.5 : 0.75), fill: "var(--cdl-node-fill, #ffffff)" }, `mask-${i}`))
|
|
23097
23130
|
] });
|
|
23098
23131
|
}
|
|
23099
|
-
return /* @__PURE__ */
|
|
23100
|
-
|
|
23101
|
-
|
|
23102
|
-
|
|
23103
|
-
|
|
23104
|
-
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
|
|
23109
|
-
|
|
23110
|
-
|
|
23111
|
-
|
|
23132
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23133
|
+
/* @__PURE__ */ jsx(
|
|
23134
|
+
"rect",
|
|
23135
|
+
{
|
|
23136
|
+
x: 0,
|
|
23137
|
+
y: 0,
|
|
23138
|
+
width: w,
|
|
23139
|
+
height: h,
|
|
23140
|
+
rx: 18,
|
|
23141
|
+
fill: paint.fill,
|
|
23142
|
+
stroke: paint.stroke,
|
|
23143
|
+
strokeWidth: paint.strokeWidth,
|
|
23144
|
+
strokeDasharray: paint.dash
|
|
23145
|
+
}
|
|
23146
|
+
),
|
|
23147
|
+
style.look === "ledger" && /* @__PURE__ */ jsx("line", { x1: 1, y1: h - 7, x2: w - 1, y2: h - 7, stroke: paint.stroke, strokeWidth: 1 })
|
|
23148
|
+
] });
|
|
23112
23149
|
})();
|
|
23113
23150
|
const resolvedValue = value !== void 0 ? interpolate(value, stateValues) : void 0;
|
|
23114
23151
|
const hasRows = (node.rows?.length ?? 0) > 0;
|
|
@@ -23131,56 +23168,64 @@ function GenericNode({
|
|
|
23131
23168
|
const iconX = centered ? w / 2 + 40 : w - 48;
|
|
23132
23169
|
const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
|
|
23133
23170
|
const dominantBaseline = centered ? "middle" : void 0;
|
|
23134
|
-
return /* @__PURE__ */ jsxs(
|
|
23135
|
-
|
|
23136
|
-
|
|
23137
|
-
|
|
23138
|
-
|
|
23139
|
-
|
|
23140
|
-
|
|
23141
|
-
|
|
23142
|
-
|
|
23143
|
-
|
|
23144
|
-
|
|
23145
|
-
|
|
23146
|
-
x:
|
|
23147
|
-
y:
|
|
23148
|
-
fontSize:
|
|
23149
|
-
|
|
23150
|
-
textAnchor: "end",
|
|
23151
|
-
fill: "var(--cdl-text, #1a1f2a)",
|
|
23152
|
-
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23153
|
-
children: resolvedValue
|
|
23154
|
-
}
|
|
23155
|
-
),
|
|
23156
|
-
node.rows && node.rows.length > 0 && (() => {
|
|
23157
|
-
const resolved = node.rows.map((row) => interpolate(row, stateValues));
|
|
23158
|
-
const splits = resolved.map(splitRow);
|
|
23159
|
-
const leftMaxWidth = splits.reduce(
|
|
23160
|
-
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
|
|
23161
|
-
0
|
|
23162
|
-
);
|
|
23163
|
-
const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
|
|
23164
|
-
return /* @__PURE__ */ jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
|
|
23165
|
-
/* @__PURE__ */ jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
|
|
23166
|
-
/* @__PURE__ */ jsx(
|
|
23171
|
+
return /* @__PURE__ */ jsxs(
|
|
23172
|
+
"g",
|
|
23173
|
+
{
|
|
23174
|
+
transform: `translate(${x} ${y})`,
|
|
23175
|
+
"data-cdl-role": "node-body",
|
|
23176
|
+
"data-cdl-look": style.look,
|
|
23177
|
+
children: [
|
|
23178
|
+
shapeEl,
|
|
23179
|
+
/* @__PURE__ */ jsxs("g", { transform: `translate(${iconX} ${iconY}) scale(1)`, "data-cdl-role": "node-kind-icon", children: [
|
|
23180
|
+
/* @__PURE__ */ jsx("rect", { width: 24, height: 24, fill: "transparent" }),
|
|
23181
|
+
/* @__PURE__ */ jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
|
|
23182
|
+
] }),
|
|
23183
|
+
node.eyebrow && /* @__PURE__ */ jsx("text", { x: textX, y: eyebrowY, fontSize: 17, fontWeight: 700, letterSpacing: 1.5, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : style.eyebrowColor, textAnchor, dominantBaseline, children: node.eyebrow }),
|
|
23184
|
+
/* @__PURE__ */ jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.title }),
|
|
23185
|
+
node.subtitle && /* @__PURE__ */ jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: node.subtitle }),
|
|
23186
|
+
resolvedValue && /* @__PURE__ */ jsx(
|
|
23167
23187
|
"text",
|
|
23168
23188
|
{
|
|
23169
|
-
|
|
23170
|
-
|
|
23171
|
-
|
|
23172
|
-
y: 0,
|
|
23173
|
-
fontSize: 21,
|
|
23189
|
+
x: w - 20,
|
|
23190
|
+
y: h - 24,
|
|
23191
|
+
fontSize: 32,
|
|
23174
23192
|
fontWeight: 700,
|
|
23175
|
-
textAnchor: "
|
|
23193
|
+
textAnchor: "end",
|
|
23176
23194
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23177
23195
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23178
|
-
children:
|
|
23196
|
+
children: resolvedValue
|
|
23179
23197
|
}
|
|
23180
|
-
)
|
|
23181
|
-
|
|
23182
|
-
|
|
23183
|
-
|
|
23198
|
+
),
|
|
23199
|
+
node.rows && node.rows.length > 0 && (() => {
|
|
23200
|
+
const resolved = node.rows.map((row) => interpolate(row, stateValues));
|
|
23201
|
+
const splits = resolved.map(splitRow);
|
|
23202
|
+
const leftMaxWidth = splits.reduce(
|
|
23203
|
+
(m, s) => Math.max(m, rowColumnWidth(s.left, GENERIC_ROW_LEFT_SIZE_PX, false)),
|
|
23204
|
+
0
|
|
23205
|
+
);
|
|
23206
|
+
const rightColX = ROW_PAD_X_PX + leftMaxWidth + ROW_COL_GAP_PX;
|
|
23207
|
+
return /* @__PURE__ */ jsx("g", { children: splits.map((s, i) => /* @__PURE__ */ jsxs("g", { transform: `translate(0 ${rowBaselineY(node.kind, i)})`, children: [
|
|
23208
|
+
/* @__PURE__ */ jsx("text", { "data-cdl-role": "node-row", "data-cdl-row-index": i, x: ROW_PAD_X_PX, y: 0, fontSize: 18, fill: "var(--cdl-text-dim, #5a6270)", children: s.left }),
|
|
23209
|
+
/* @__PURE__ */ jsx(
|
|
23210
|
+
"text",
|
|
23211
|
+
{
|
|
23212
|
+
"data-cdl-role": "node-row",
|
|
23213
|
+
"data-cdl-row-index": i,
|
|
23214
|
+
x: rightColX,
|
|
23215
|
+
y: 0,
|
|
23216
|
+
fontSize: 21,
|
|
23217
|
+
fontWeight: 700,
|
|
23218
|
+
textAnchor: "start",
|
|
23219
|
+
fill: "var(--cdl-text, #1a1f2a)",
|
|
23220
|
+
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23221
|
+
children: s.right
|
|
23222
|
+
}
|
|
23223
|
+
)
|
|
23224
|
+
] }, i)) });
|
|
23225
|
+
})()
|
|
23226
|
+
]
|
|
23227
|
+
}
|
|
23228
|
+
);
|
|
23184
23229
|
}
|
|
23185
23230
|
var MARK_INNER_RATIO = 0.56;
|
|
23186
23231
|
var RING_WIDTH_ACTIVE = 6;
|
|
@@ -30709,6 +30754,8 @@ function infrastructure(preset) {
|
|
|
30709
30754
|
...c.sub ? { sub: c.sub } : {},
|
|
30710
30755
|
tone: c.tone ?? tone,
|
|
30711
30756
|
style: c.style ?? style,
|
|
30757
|
+
...c.role ? { role: c.role } : {},
|
|
30758
|
+
...c.labelPlate === void 0 ? {} : { labelPlate: c.labelPlate },
|
|
30712
30759
|
labelOffsetX: c.labelOffsetX ?? 0,
|
|
30713
30760
|
labelOffsetY: c.labelOffsetY ?? 0
|
|
30714
30761
|
});
|