@cardenelabs/cdl 0.49.0 → 0.50.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 +15 -1
- package/dist/index.cjs +24 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -14
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +24 -13
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +25 -14
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/actor.tsx +2 -1
- package/src/kinds/event.tsx +3 -2
- package/src/kinds/function.tsx +2 -1
- package/src/kinds/generic.tsx +5 -4
- package/src/kinds/sequence-board.tsx +2 -1
- package/src/kinds/storage.tsx +4 -3
- package/src/render/edges.tsx +2 -1
- package/src/render/mono-text.ts +44 -0
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useEffect, useSyncExternalStore, useRef, useCallback, useState, useLayoutEffect, useId } from 'react';
|
|
1
|
+
import { useMemo, useEffect, useSyncExternalStore, useRef, useCallback, useState, useLayoutEffect, useId, createElement } from 'react';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
// src/render.tsx
|
|
@@ -10401,6 +10401,17 @@ function edgeHeadPaint(head, fill, color) {
|
|
|
10401
10401
|
}
|
|
10402
10402
|
return { fill: color, stroke: "none" };
|
|
10403
10403
|
}
|
|
10404
|
+
var \u89D2\u62EC\u5F27\u306E\u9699\u9593 = 0.08;
|
|
10405
|
+
function \u7B49\u5E45\u306E\u5B57(text, fontSize) {
|
|
10406
|
+
if (typeof text !== "string" || !text.includes("[]")) return text;
|
|
10407
|
+
const \u584A = text.split("[]");
|
|
10408
|
+
const out = [];
|
|
10409
|
+
\u584A.forEach((s, i) => {
|
|
10410
|
+
if (i > 0) out.push("[", createElement("tspan", { key: i, dx: fontSize * \u89D2\u62EC\u5F27\u306E\u9699\u9593 }, "]"));
|
|
10411
|
+
if (s !== "") out.push(s);
|
|
10412
|
+
});
|
|
10413
|
+
return out;
|
|
10414
|
+
}
|
|
10404
10415
|
function defaultEdgeWidth(active) {
|
|
10405
10416
|
return active ? 2.5 : 1.25;
|
|
10406
10417
|
}
|
|
@@ -10656,7 +10667,7 @@ function CdlEdgeLabelView({
|
|
|
10656
10667
|
fill: active ? color : "var(--cdl-text-dim, #5a6270)",
|
|
10657
10668
|
opacity: labelTextOpacity("sub"),
|
|
10658
10669
|
style: { fontFamily: fontFamilyAttr("sub") },
|
|
10659
|
-
children: edge.sub
|
|
10670
|
+
children: \u7B49\u5E45\u306E\u5B57(edge.sub, EDGE_LABEL_TEXT.sub.fontSize)
|
|
10660
10671
|
}
|
|
10661
10672
|
)
|
|
10662
10673
|
]
|
|
@@ -10736,7 +10747,7 @@ function ActorNode({ node, active, value }) {
|
|
|
10736
10747
|
textAnchor: "end",
|
|
10737
10748
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
10738
10749
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
10739
|
-
children: value
|
|
10750
|
+
children: \u7B49\u5E45\u306E\u5B57(value, 42)
|
|
10740
10751
|
}
|
|
10741
10752
|
)
|
|
10742
10753
|
] });
|
|
@@ -10909,7 +10920,7 @@ function SequenceBoardNode({
|
|
|
10909
10920
|
textAnchor: "middle",
|
|
10910
10921
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
10911
10922
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
10912
|
-
children: a.name
|
|
10923
|
+
children: \u7B49\u5E45\u306E\u5B57(a.name, SEQ_NAME)
|
|
10913
10924
|
}
|
|
10914
10925
|
),
|
|
10915
10926
|
a.subtitle && /* @__PURE__ */ jsx(
|
|
@@ -11099,7 +11110,7 @@ function EventNode({
|
|
|
11099
11110
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11100
11111
|
textAnchor: \u540D\u524D.anchor,
|
|
11101
11112
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11102
|
-
children: node.title
|
|
11113
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
11103
11114
|
}
|
|
11104
11115
|
),
|
|
11105
11116
|
node.subtitle && /* @__PURE__ */ jsx(
|
|
@@ -11110,7 +11121,7 @@ function EventNode({
|
|
|
11110
11121
|
fontSize: 21,
|
|
11111
11122
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
11112
11123
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11113
|
-
children: node.subtitle
|
|
11124
|
+
children: \u7B49\u5E45\u306E\u5B57(node.subtitle, 21)
|
|
11114
11125
|
}
|
|
11115
11126
|
)
|
|
11116
11127
|
] })
|
|
@@ -11159,7 +11170,7 @@ function FunctionNode({ node, active }) {
|
|
|
11159
11170
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11160
11171
|
textAnchor: \u540D\u524D.anchor,
|
|
11161
11172
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11162
|
-
children: node.title
|
|
11173
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
11163
11174
|
}
|
|
11164
11175
|
),
|
|
11165
11176
|
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 126 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle })
|
|
@@ -11272,7 +11283,7 @@ function StorageNode({
|
|
|
11272
11283
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11273
11284
|
textAnchor: \u540D\u524D.anchor,
|
|
11274
11285
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11275
|
-
children: node.title
|
|
11286
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
11276
11287
|
}
|
|
11277
11288
|
),
|
|
11278
11289
|
rows.length > 0 && !\u5370\u3067\u5206\u3051\u308B && /* @__PURE__ */ jsx(
|
|
@@ -11333,7 +11344,7 @@ function StorageNode({
|
|
|
11333
11344
|
fontWeight: \u5370\u3067\u5206\u3051\u308B ? 500 : 600,
|
|
11334
11345
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11335
11346
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11336
|
-
children: s.left
|
|
11347
|
+
children: \u7B49\u5E45\u306E\u5B57(s.left, 26)
|
|
11337
11348
|
}
|
|
11338
11349
|
),
|
|
11339
11350
|
/* @__PURE__ */ jsx(
|
|
@@ -11347,7 +11358,7 @@ function StorageNode({
|
|
|
11347
11358
|
textAnchor: \u5370\u3067\u5206\u3051\u308B ? "end" : "start",
|
|
11348
11359
|
fill: \u5370\u3067\u5206\u3051\u308B ? "var(--cdl-text-dim, #5a6270)" : highlightRows ? accent : "var(--cdl-text, #1a1f2a)",
|
|
11349
11360
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11350
|
-
children: s.right
|
|
11361
|
+
children: \u7B49\u5E45\u306E\u5B57(s.right, \u5370\u3067\u5206\u3051\u308B ? ROW_TYPE_FONT : 26)
|
|
11351
11362
|
}
|
|
11352
11363
|
)
|
|
11353
11364
|
] }, idx);
|
|
@@ -11621,8 +11632,8 @@ function GenericNode({
|
|
|
11621
11632
|
/* @__PURE__ */ jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
|
|
11622
11633
|
] }),
|
|
11623
11634
|
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 }),
|
|
11624
|
-
/* @__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 }),
|
|
11625
|
-
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 }),
|
|
11635
|
+
/* @__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.kind === "function" || node.kind === "api" ? \u7B49\u5E45\u306E\u5B57(node.title, 20) : node.title }),
|
|
11636
|
+
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: \u7B49\u5E45\u306E\u5B57(node.subtitle, 17) }),
|
|
11626
11637
|
resolvedValue && /* @__PURE__ */ jsx(
|
|
11627
11638
|
"text",
|
|
11628
11639
|
{
|
|
@@ -11633,7 +11644,7 @@ function GenericNode({
|
|
|
11633
11644
|
textAnchor: "end",
|
|
11634
11645
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11635
11646
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11636
|
-
children: resolvedValue
|
|
11647
|
+
children: \u7B49\u5E45\u306E\u5B57(resolvedValue, 32)
|
|
11637
11648
|
}
|
|
11638
11649
|
),
|
|
11639
11650
|
node.rows && node.rows.length > 0 && (() => {
|
|
@@ -11658,7 +11669,7 @@ function GenericNode({
|
|
|
11658
11669
|
textAnchor: "start",
|
|
11659
11670
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
11660
11671
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
11661
|
-
children: s.right
|
|
11672
|
+
children: \u7B49\u5E45\u306E\u5B57(s.right, 21)
|
|
11662
11673
|
}
|
|
11663
11674
|
)
|
|
11664
11675
|
] }, i)) });
|