@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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, useEffect, useState, useSyncExternalStore, useRef, useCallback, useLayoutEffect, useId } from 'react';
|
|
1
|
+
import { useMemo, useEffect, useState, useSyncExternalStore, useRef, useCallback, useLayoutEffect, useId, createElement } from 'react';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
// src/reactive/internal.ts
|
|
@@ -22918,6 +22918,17 @@ function edgeHeadPaint(head, fill, color) {
|
|
|
22918
22918
|
}
|
|
22919
22919
|
return { fill: color, stroke: "none" };
|
|
22920
22920
|
}
|
|
22921
|
+
var \u89D2\u62EC\u5F27\u306E\u9699\u9593 = 0.08;
|
|
22922
|
+
function \u7B49\u5E45\u306E\u5B57(text, fontSize) {
|
|
22923
|
+
if (typeof text !== "string" || !text.includes("[]")) return text;
|
|
22924
|
+
const \u584A = text.split("[]");
|
|
22925
|
+
const out = [];
|
|
22926
|
+
\u584A.forEach((s, i) => {
|
|
22927
|
+
if (i > 0) out.push("[", createElement("tspan", { key: i, dx: fontSize * \u89D2\u62EC\u5F27\u306E\u9699\u9593 }, "]"));
|
|
22928
|
+
if (s !== "") out.push(s);
|
|
22929
|
+
});
|
|
22930
|
+
return out;
|
|
22931
|
+
}
|
|
22921
22932
|
function defaultEdgeWidth(active) {
|
|
22922
22933
|
return active ? 2.5 : 1.25;
|
|
22923
22934
|
}
|
|
@@ -23173,7 +23184,7 @@ function CdlEdgeLabelView({
|
|
|
23173
23184
|
fill: active ? color : "var(--cdl-text-dim, #5a6270)",
|
|
23174
23185
|
opacity: labelTextOpacity("sub"),
|
|
23175
23186
|
style: { fontFamily: fontFamilyAttr("sub") },
|
|
23176
|
-
children: edge.sub
|
|
23187
|
+
children: \u7B49\u5E45\u306E\u5B57(edge.sub, EDGE_LABEL_TEXT.sub.fontSize)
|
|
23177
23188
|
}
|
|
23178
23189
|
)
|
|
23179
23190
|
]
|
|
@@ -23253,7 +23264,7 @@ function ActorNode({ node, active, value }) {
|
|
|
23253
23264
|
textAnchor: "end",
|
|
23254
23265
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23255
23266
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23256
|
-
children: value
|
|
23267
|
+
children: \u7B49\u5E45\u306E\u5B57(value, 42)
|
|
23257
23268
|
}
|
|
23258
23269
|
)
|
|
23259
23270
|
] });
|
|
@@ -23429,7 +23440,7 @@ function SequenceBoardNode({
|
|
|
23429
23440
|
textAnchor: "middle",
|
|
23430
23441
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23431
23442
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23432
|
-
children: a.name
|
|
23443
|
+
children: \u7B49\u5E45\u306E\u5B57(a.name, SEQ_NAME)
|
|
23433
23444
|
}
|
|
23434
23445
|
),
|
|
23435
23446
|
a.subtitle && /* @__PURE__ */ jsx(
|
|
@@ -23619,7 +23630,7 @@ function EventNode({
|
|
|
23619
23630
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23620
23631
|
textAnchor: \u540D\u524D.anchor,
|
|
23621
23632
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23622
|
-
children: node.title
|
|
23633
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
23623
23634
|
}
|
|
23624
23635
|
),
|
|
23625
23636
|
node.subtitle && /* @__PURE__ */ jsx(
|
|
@@ -23630,7 +23641,7 @@ function EventNode({
|
|
|
23630
23641
|
fontSize: 21,
|
|
23631
23642
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
23632
23643
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23633
|
-
children: node.subtitle
|
|
23644
|
+
children: \u7B49\u5E45\u306E\u5B57(node.subtitle, 21)
|
|
23634
23645
|
}
|
|
23635
23646
|
)
|
|
23636
23647
|
] })
|
|
@@ -23679,7 +23690,7 @@ function FunctionNode({ node, active }) {
|
|
|
23679
23690
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23680
23691
|
textAnchor: \u540D\u524D.anchor,
|
|
23681
23692
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23682
|
-
children: node.title
|
|
23693
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
23683
23694
|
}
|
|
23684
23695
|
),
|
|
23685
23696
|
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 126 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle })
|
|
@@ -23792,7 +23803,7 @@ function StorageNode({
|
|
|
23792
23803
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23793
23804
|
textAnchor: \u540D\u524D.anchor,
|
|
23794
23805
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23795
|
-
children: node.title
|
|
23806
|
+
children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
|
|
23796
23807
|
}
|
|
23797
23808
|
),
|
|
23798
23809
|
rows.length > 0 && !\u5370\u3067\u5206\u3051\u308B && /* @__PURE__ */ jsx(
|
|
@@ -23853,7 +23864,7 @@ function StorageNode({
|
|
|
23853
23864
|
fontWeight: \u5370\u3067\u5206\u3051\u308B ? 500 : 600,
|
|
23854
23865
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
23855
23866
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23856
|
-
children: s.left
|
|
23867
|
+
children: \u7B49\u5E45\u306E\u5B57(s.left, 26)
|
|
23857
23868
|
}
|
|
23858
23869
|
),
|
|
23859
23870
|
/* @__PURE__ */ jsx(
|
|
@@ -23867,7 +23878,7 @@ function StorageNode({
|
|
|
23867
23878
|
textAnchor: \u5370\u3067\u5206\u3051\u308B ? "end" : "start",
|
|
23868
23879
|
fill: \u5370\u3067\u5206\u3051\u308B ? "var(--cdl-text-dim, #5a6270)" : highlightRows ? accent : "var(--cdl-text, #1a1f2a)",
|
|
23869
23880
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
23870
|
-
children: s.right
|
|
23881
|
+
children: \u7B49\u5E45\u306E\u5B57(s.right, \u5370\u3067\u5206\u3051\u308B ? ROW_TYPE_FONT : 26)
|
|
23871
23882
|
}
|
|
23872
23883
|
)
|
|
23873
23884
|
] }, idx);
|
|
@@ -24141,8 +24152,8 @@ function GenericNode({
|
|
|
24141
24152
|
/* @__PURE__ */ jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
|
|
24142
24153
|
] }),
|
|
24143
24154
|
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 }),
|
|
24144
|
-
/* @__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 }),
|
|
24145
|
-
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 }),
|
|
24155
|
+
/* @__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 }),
|
|
24156
|
+
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) }),
|
|
24146
24157
|
resolvedValue && /* @__PURE__ */ jsx(
|
|
24147
24158
|
"text",
|
|
24148
24159
|
{
|
|
@@ -24153,7 +24164,7 @@ function GenericNode({
|
|
|
24153
24164
|
textAnchor: "end",
|
|
24154
24165
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
24155
24166
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
24156
|
-
children: resolvedValue
|
|
24167
|
+
children: \u7B49\u5E45\u306E\u5B57(resolvedValue, 32)
|
|
24157
24168
|
}
|
|
24158
24169
|
),
|
|
24159
24170
|
node.rows && node.rows.length > 0 && (() => {
|
|
@@ -24178,7 +24189,7 @@ function GenericNode({
|
|
|
24178
24189
|
textAnchor: "start",
|
|
24179
24190
|
fill: "var(--cdl-text, #1a1f2a)",
|
|
24180
24191
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
24181
|
-
children: s.right
|
|
24192
|
+
children: \u7B49\u5E45\u306E\u5B57(s.right, 21)
|
|
24182
24193
|
}
|
|
24183
24194
|
)
|
|
24184
24195
|
] }, i)) });
|