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