@cardenelabs/cdl 0.18.0 → 0.19.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 +42 -1
- package/dist/index.cjs +65 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +65 -34
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +65 -34
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +65 -34
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/layout/nodes.ts +4 -2
- package/src/layout/tokens.ts +22 -22
- package/src/render/edges.tsx +18 -2
- package/src/render/stage.tsx +36 -12
package/dist/react.cjs
CHANGED
|
@@ -1964,35 +1964,35 @@ var TOKENS = {
|
|
|
1964
1964
|
contain_pad: 28,
|
|
1965
1965
|
// node sizes (kind ごと、 unified row h は engine が max() で算出)
|
|
1966
1966
|
node: {
|
|
1967
|
-
actor: { w: 340, h:
|
|
1968
|
-
function: { w: 380, h:
|
|
1967
|
+
actor: { w: 340, h: 165 },
|
|
1968
|
+
function: { w: 380, h: 151 },
|
|
1969
1969
|
storage: { w: 400, h: 240 },
|
|
1970
|
-
event: { w: 360, h:
|
|
1970
|
+
event: { w: 360, h: 156 },
|
|
1971
1971
|
card: { w: 320, h: 150 },
|
|
1972
1972
|
// 人系
|
|
1973
|
-
person: { w: 280, h:
|
|
1974
|
-
"user-group": { w: 320, h:
|
|
1975
|
-
admin: { w: 280, h:
|
|
1976
|
-
developer: { w: 280, h:
|
|
1977
|
-
"external-user": { w: 300, h:
|
|
1973
|
+
person: { w: 280, h: 116 },
|
|
1974
|
+
"user-group": { w: 320, h: 116 },
|
|
1975
|
+
admin: { w: 280, h: 116 },
|
|
1976
|
+
developer: { w: 280, h: 116 },
|
|
1977
|
+
"external-user": { w: 300, h: 116 },
|
|
1978
1978
|
// インフラ
|
|
1979
|
-
database: { w: 320, h:
|
|
1980
|
-
cache: { w: 280, h:
|
|
1981
|
-
queue: { w: 340, h:
|
|
1982
|
-
"message-bus": { w: 380, h:
|
|
1979
|
+
database: { w: 320, h: 172 },
|
|
1980
|
+
cache: { w: 280, h: 116 },
|
|
1981
|
+
queue: { w: 340, h: 116 },
|
|
1982
|
+
"message-bus": { w: 380, h: 116 },
|
|
1983
1983
|
cloud: { w: 320, h: 180 },
|
|
1984
|
-
cdn: { w: 320, h:
|
|
1984
|
+
cdn: { w: 320, h: 116 },
|
|
1985
1985
|
// アプリ系
|
|
1986
|
-
service: { w: 320, h:
|
|
1987
|
-
api: { w: 320, h:
|
|
1988
|
-
frontend: { w: 320, h:
|
|
1989
|
-
backend: { w: 320, h:
|
|
1990
|
-
webhook: { w: 320, h:
|
|
1991
|
-
microservice: { w: 320, h:
|
|
1986
|
+
service: { w: 320, h: 116 },
|
|
1987
|
+
api: { w: 320, h: 116 },
|
|
1988
|
+
frontend: { w: 320, h: 116 },
|
|
1989
|
+
backend: { w: 320, h: 116 },
|
|
1990
|
+
webhook: { w: 320, h: 116 },
|
|
1991
|
+
microservice: { w: 320, h: 116 },
|
|
1992
1992
|
// データ / 判定
|
|
1993
|
-
signer: { w: 300, h:
|
|
1994
|
-
oracle: { w: 320, h:
|
|
1995
|
-
"merkle-tree": { w: 340, h:
|
|
1993
|
+
signer: { w: 300, h: 116 },
|
|
1994
|
+
oracle: { w: 320, h: 116 },
|
|
1995
|
+
"merkle-tree": { w: 340, h: 116 },
|
|
1996
1996
|
decision: { w: 300, h: 180 },
|
|
1997
1997
|
// Chart 系 (CAR-994 Phase A) ... 1 node に datum 配列を持ち、 kind 内で SVG geometry 描画。
|
|
1998
1998
|
// 実際の w/h は preset chart() が w/h override で指定 (default fallback は preset 未指定時のみ)。
|
|
@@ -3752,7 +3752,7 @@ function autoStorageHeight(n, defaultH) {
|
|
|
3752
3752
|
if (n.h != null) return n.h;
|
|
3753
3753
|
const \u5370\u3042\u308A = n.rowMarks !== void 0;
|
|
3754
3754
|
const \u547C\u3073\u540D\u306E\u5206 = \u5370\u3042\u308A && n.subtitle ? SUBTITLE_ROW_SHIFT : 0;
|
|
3755
|
-
if (!n.rows || n.rows.length === 0) return
|
|
3755
|
+
if (!n.rows || n.rows.length === 0) return 115 + \u547C\u3073\u540D\u306E\u5206;
|
|
3756
3756
|
const \u5FC5\u8981 = requiredRowsHeight("storage", n.rows.length) ?? defaultH;
|
|
3757
3757
|
if (\u5370\u3042\u308A) return \u5FC5\u8981 + \u547C\u3073\u540D\u306E\u5206;
|
|
3758
3758
|
return Math.max(defaultH, \u5FC5\u8981);
|
|
@@ -5576,6 +5576,7 @@ function labelTextOpacity(line) {
|
|
|
5576
5576
|
function CdlEdgeView({
|
|
5577
5577
|
edge,
|
|
5578
5578
|
active,
|
|
5579
|
+
drawing,
|
|
5579
5580
|
progress,
|
|
5580
5581
|
stateValues
|
|
5581
5582
|
}) {
|
|
@@ -5600,6 +5601,7 @@ function CdlEdgeView({
|
|
|
5600
5601
|
"data-cdl-from": edge.from,
|
|
5601
5602
|
"data-cdl-to": edge.to,
|
|
5602
5603
|
"data-cdl-active": active ? "true" : "false",
|
|
5604
|
+
"data-cdl-drawing": drawing ? "true" : "false",
|
|
5603
5605
|
"data-cdl-path-d": edge.d,
|
|
5604
5606
|
"data-cdl-label-x": edge.labelX,
|
|
5605
5607
|
"data-cdl-label-y": edge.labelY,
|
|
@@ -5631,6 +5633,7 @@ function CdlEdgeView({
|
|
|
5631
5633
|
{
|
|
5632
5634
|
edge,
|
|
5633
5635
|
active,
|
|
5636
|
+
drawing,
|
|
5634
5637
|
progress,
|
|
5635
5638
|
color,
|
|
5636
5639
|
marker,
|
|
@@ -5658,6 +5661,7 @@ function CdlEdgeView({
|
|
|
5658
5661
|
function SolidEdgePath({
|
|
5659
5662
|
edge,
|
|
5660
5663
|
active,
|
|
5664
|
+
drawing,
|
|
5661
5665
|
progress,
|
|
5662
5666
|
color,
|
|
5663
5667
|
marker,
|
|
@@ -5665,7 +5669,7 @@ function SolidEdgePath({
|
|
|
5665
5669
|
dashed,
|
|
5666
5670
|
stateValues
|
|
5667
5671
|
}) {
|
|
5668
|
-
const visibleD =
|
|
5672
|
+
const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
|
|
5669
5673
|
const defaultWidth = active ? 5 : 2.5;
|
|
5670
5674
|
const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
|
|
5671
5675
|
const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
|
|
@@ -14200,19 +14204,36 @@ function CdlStage({
|
|
|
14200
14204
|
svgRef
|
|
14201
14205
|
}) {
|
|
14202
14206
|
const activeSet = new Set(currentPhase?.activate ?? []);
|
|
14203
|
-
const \
|
|
14204
|
-
if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
|
|
14207
|
+
const \u77E2\u5370\u306E\u51FA\u756A = react.useMemo(() => {
|
|
14205
14208
|
const \u521D\u51FA = /* @__PURE__ */ new Map();
|
|
14206
14209
|
laid.phases.forEach((p, i) => {
|
|
14207
14210
|
for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
|
|
14208
14211
|
});
|
|
14209
14212
|
const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14213
|
+
const \u96A0\u3059 = (laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) !== "all";
|
|
14214
|
+
return {
|
|
14215
|
+
\u51FA\u308B\u304B: (edgeId) => {
|
|
14216
|
+
if (!\u96A0\u3059) return true;
|
|
14217
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
14218
|
+
if (first === void 0) return true;
|
|
14219
|
+
return \u4ECA < 0 || \u4ECA >= first;
|
|
14220
|
+
},
|
|
14221
|
+
/*
|
|
14222
|
+
* この段で初めて出るか (#584)。
|
|
14223
|
+
*
|
|
14224
|
+
* 起点から伸ばすのはこの段だけ。 光っているかで引くと、段をまたいで光り続ける図で
|
|
14225
|
+
* 既に見えている線が毎段引き直される (実測 = 表の図で 3 本とも段が変わるたびに伸び直した)。
|
|
14226
|
+
*
|
|
14227
|
+
* **隠さない図でも初出は数える**。 `all` は「最初から見せる」 だけの指定で、
|
|
14228
|
+
* 伸びる動きまで毎段繰り返してよいという意味ではない。
|
|
14229
|
+
*/
|
|
14230
|
+
\u4F38\u3070\u3059\u304B: (edgeId) => {
|
|
14231
|
+
const first = \u521D\u51FA.get(edgeId);
|
|
14232
|
+
if (first === void 0) return false;
|
|
14233
|
+
return \u4ECA === first;
|
|
14234
|
+
}
|
|
14214
14235
|
};
|
|
14215
|
-
}, [laid.phases, currentPhase]);
|
|
14236
|
+
}, [laid.phases, currentPhase, laid.edgeReveal]);
|
|
14216
14237
|
const drawSet = new Set(currentPhase?.draw ?? []);
|
|
14217
14238
|
const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
|
|
14218
14239
|
const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
|
|
@@ -14372,7 +14393,17 @@ function CdlStage({
|
|
|
14372
14393
|
},
|
|
14373
14394
|
lane.id
|
|
14374
14395
|
)),
|
|
14375
|
-
laid.edges.filter((edge) => \
|
|
14396
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14397
|
+
CdlEdgeView,
|
|
14398
|
+
{
|
|
14399
|
+
edge,
|
|
14400
|
+
active: activeSet.has(edge.id),
|
|
14401
|
+
drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
|
|
14402
|
+
progress,
|
|
14403
|
+
stateValues
|
|
14404
|
+
},
|
|
14405
|
+
edge.id
|
|
14406
|
+
)),
|
|
14376
14407
|
laid.nodes.map((node) => {
|
|
14377
14408
|
const \u63CF\u304F = drawSet.has(node.id);
|
|
14378
14409
|
const view = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14388,8 +14419,8 @@ function CdlStage({
|
|
|
14388
14419
|
);
|
|
14389
14420
|
return /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id);
|
|
14390
14421
|
}),
|
|
14391
|
-
laid.edges.filter((edge) => Boolean(edge.dThrough) && \
|
|
14392
|
-
laid.edges.filter((edge) => \
|
|
14422
|
+
laid.edges.filter((edge) => Boolean(edge.dThrough) && \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
|
|
14423
|
+
laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
14393
14424
|
CdlEdgeLabelView,
|
|
14394
14425
|
{
|
|
14395
14426
|
edge,
|