@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 CHANGED
@@ -5,6 +5,45 @@ CDL (Chainome Diagram Language) の主要変更履歴。
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.19.0] - 2026-08-29
9
+
10
+ ### Changed
11
+
12
+ - **字だけの箱で上下の余白を揃えた** (#586)
13
+
14
+ 字しか持たない箱が、字の下に余白を大きく残したまま並んでいた (user 実機指摘)。
15
+ 実測で `service` は上 15.7 に対し下が 81、 `merkle-tree` は下が 121 空いていた。
16
+ 字は上から描かれるので、箱を高くしたぶんがそのまま下の空きになっていた。
17
+
18
+ 上の余白と同じだけを下にも取る形へ揃える (`新 h = 上の余白 × 2 + 字の高さ`)。
19
+ 23 種別が 19 から 104 縮む。 `person` / `service` / `api` 等 18 種別は 116 に揃う。
20
+
21
+ **絵を持つ種別は動かさない**。 `shape-` の 49 種別は箱いっぱいに絵を描くので、
22
+ 詰めると絵が入らない (実測で `cloud` は絵が 200 あり、箱 173 を既に超えている)。
23
+ 差が 5 未満の 2 種別 (`card` -1 / `decision` -3) も、見た目が変わらないので据え置く。
24
+
25
+ 行を持たない `storage` だけは token ではなく `autoStorageHeight` の中の値で決まるため、
26
+ そちらを 150 から 115 にした。 行を持つ形 (token 240 が下限) は変えていない。
27
+
28
+ ## [0.18.1] - 2026-08-29
29
+
30
+ ### Fixed
31
+
32
+ - **矢印を伸ばすのは初めて出る段だけにした** (#584)
33
+
34
+ 伸ばすかを「その矢印が光っているか」 で引いていたため、段をまたいで光り続ける図で
35
+ **既に見えている線が段の変わるたびに引き直されて** いた (実測 = 表の図で 3 本とも毎段伸び直す)。
36
+
37
+ 「増えた」 のは 1 度だけなので、動くのも 1 度にする。 段の並びから矢印ごとの初出を求め、
38
+ その段でだけ起点から伸ばす。
39
+
40
+ **隠さない図 (`edgeReveal: "all"`) でも初出は数える**。 `all` は「最初から見せる」 だけの
41
+ 指定で、伸びる動きまで毎段繰り返してよいという意味ではない。
42
+
43
+ 段が矢印を 1 度も名指ししない図では伸ばさない = 初出が無く、いつ伸ばすか決められない。
44
+
45
+ 検査が実際の描画から読めるよう、`data-cdl-drawing` を矢印に出す。
46
+
8
47
  ## [0.18.0] - 2026-08-29
9
48
 
10
49
  ### Added
@@ -945,7 +984,9 @@ Initial OSS release.
945
984
  使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
946
985
  行き止まりになる。
947
986
 
948
- [Unreleased]: https://github.com/cardene777/cdl/compare/v0.18.0...HEAD
987
+ [Unreleased]: https://github.com/cardene777/cdl/compare/v0.19.0...HEAD
988
+ [0.19.0]: https://github.com/cardene777/cdl/compare/v0.18.1...v0.19.0
989
+ [0.18.1]: https://github.com/cardene777/cdl/compare/v0.18.0...v0.18.1
949
990
  [0.18.0]: https://github.com/cardene777/cdl/compare/v0.17.1...v0.18.0
950
991
  [0.17.1]: https://github.com/cardene777/cdl/compare/v0.17.0...v0.17.1
951
992
  [0.17.0]: https://github.com/cardene777/cdl/compare/v0.16.0...v0.17.0
package/dist/index.cjs CHANGED
@@ -13300,35 +13300,35 @@ var TOKENS = {
13300
13300
  contain_pad: 28,
13301
13301
  // node sizes (kind ごと、 unified row h は engine が max() で算出)
13302
13302
  node: {
13303
- actor: { w: 340, h: 200 },
13304
- function: { w: 380, h: 170 },
13303
+ actor: { w: 340, h: 165 },
13304
+ function: { w: 380, h: 151 },
13305
13305
  storage: { w: 400, h: 240 },
13306
- event: { w: 360, h: 200 },
13306
+ event: { w: 360, h: 156 },
13307
13307
  card: { w: 320, h: 150 },
13308
13308
  // 人系
13309
- person: { w: 280, h: 180 },
13310
- "user-group": { w: 320, h: 180 },
13311
- admin: { w: 280, h: 180 },
13312
- developer: { w: 280, h: 180 },
13313
- "external-user": { w: 300, h: 180 },
13309
+ person: { w: 280, h: 116 },
13310
+ "user-group": { w: 320, h: 116 },
13311
+ admin: { w: 280, h: 116 },
13312
+ developer: { w: 280, h: 116 },
13313
+ "external-user": { w: 300, h: 116 },
13314
13314
  // インフラ
13315
- database: { w: 320, h: 200 },
13316
- cache: { w: 280, h: 160 },
13317
- queue: { w: 340, h: 140 },
13318
- "message-bus": { w: 380, h: 140 },
13315
+ database: { w: 320, h: 172 },
13316
+ cache: { w: 280, h: 116 },
13317
+ queue: { w: 340, h: 116 },
13318
+ "message-bus": { w: 380, h: 116 },
13319
13319
  cloud: { w: 320, h: 180 },
13320
- cdn: { w: 320, h: 160 },
13320
+ cdn: { w: 320, h: 116 },
13321
13321
  // アプリ系
13322
- service: { w: 320, h: 180 },
13323
- api: { w: 320, h: 160 },
13324
- frontend: { w: 320, h: 180 },
13325
- backend: { w: 320, h: 180 },
13326
- webhook: { w: 320, h: 160 },
13327
- microservice: { w: 320, h: 180 },
13322
+ service: { w: 320, h: 116 },
13323
+ api: { w: 320, h: 116 },
13324
+ frontend: { w: 320, h: 116 },
13325
+ backend: { w: 320, h: 116 },
13326
+ webhook: { w: 320, h: 116 },
13327
+ microservice: { w: 320, h: 116 },
13328
13328
  // データ / 判定
13329
- signer: { w: 300, h: 180 },
13330
- oracle: { w: 320, h: 180 },
13331
- "merkle-tree": { w: 340, h: 220 },
13329
+ signer: { w: 300, h: 116 },
13330
+ oracle: { w: 320, h: 116 },
13331
+ "merkle-tree": { w: 340, h: 116 },
13332
13332
  decision: { w: 300, h: 180 },
13333
13333
  // Chart 系 (CAR-994 Phase A) ... 1 node に datum 配列を持ち、 kind 内で SVG geometry 描画。
13334
13334
  // 実際の w/h は preset chart() が w/h override で指定 (default fallback は preset 未指定時のみ)。
@@ -15088,7 +15088,7 @@ function autoStorageHeight(n, defaultH) {
15088
15088
  if (n.h != null) return n.h;
15089
15089
  const \u5370\u3042\u308A = n.rowMarks !== void 0;
15090
15090
  const \u547C\u3073\u540D\u306E\u5206 = \u5370\u3042\u308A && n.subtitle ? SUBTITLE_ROW_SHIFT : 0;
15091
- if (!n.rows || n.rows.length === 0) return 150 + \u547C\u3073\u540D\u306E\u5206;
15091
+ if (!n.rows || n.rows.length === 0) return 115 + \u547C\u3073\u540D\u306E\u5206;
15092
15092
  const \u5FC5\u8981 = requiredRowsHeight("storage", n.rows.length) ?? defaultH;
15093
15093
  if (\u5370\u3042\u308A) return \u5FC5\u8981 + \u547C\u3073\u540D\u306E\u5206;
15094
15094
  return Math.max(defaultH, \u5FC5\u8981);
@@ -21274,6 +21274,7 @@ function labelTextOpacity(line) {
21274
21274
  function CdlEdgeView({
21275
21275
  edge,
21276
21276
  active,
21277
+ drawing,
21277
21278
  progress,
21278
21279
  stateValues
21279
21280
  }) {
@@ -21298,6 +21299,7 @@ function CdlEdgeView({
21298
21299
  "data-cdl-from": edge.from,
21299
21300
  "data-cdl-to": edge.to,
21300
21301
  "data-cdl-active": active ? "true" : "false",
21302
+ "data-cdl-drawing": drawing ? "true" : "false",
21301
21303
  "data-cdl-path-d": edge.d,
21302
21304
  "data-cdl-label-x": edge.labelX,
21303
21305
  "data-cdl-label-y": edge.labelY,
@@ -21329,6 +21331,7 @@ function CdlEdgeView({
21329
21331
  {
21330
21332
  edge,
21331
21333
  active,
21334
+ drawing,
21332
21335
  progress,
21333
21336
  color,
21334
21337
  marker,
@@ -21356,6 +21359,7 @@ function CdlEdgeView({
21356
21359
  function SolidEdgePath({
21357
21360
  edge,
21358
21361
  active,
21362
+ drawing,
21359
21363
  progress,
21360
21364
  color,
21361
21365
  marker,
@@ -21363,7 +21367,7 @@ function SolidEdgePath({
21363
21367
  dashed,
21364
21368
  stateValues
21365
21369
  }) {
21366
- const visibleD = active ? pathSubpath(edge.d, progress) : edge.d;
21370
+ const visibleD = drawing ? pathSubpath(edge.d, progress) : edge.d;
21367
21371
  const defaultWidth = active ? 5 : 2.5;
21368
21372
  const boundWidth = edge.widthBind && stateValues ? resolveNumericAttr(edge.widthBind, stateValues, defaultWidth) : defaultWidth;
21369
21373
  const boundStroke = edge.strokeBind && stateValues ? interpolate(edge.strokeBind, stateValues) : color;
@@ -28807,19 +28811,36 @@ function CdlStage({
28807
28811
  svgRef
28808
28812
  }) {
28809
28813
  const activeSet = new Set(currentPhase?.activate ?? []);
28810
- const \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370 = react.useMemo(() => {
28811
- if ((laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) === "all") return () => true;
28814
+ const \u77E2\u5370\u306E\u51FA\u756A = react.useMemo(() => {
28812
28815
  const \u521D\u51FA = /* @__PURE__ */ new Map();
28813
28816
  laid.phases.forEach((p, i) => {
28814
28817
  for (const id of p.activate ?? []) if (!\u521D\u51FA.has(id)) \u521D\u51FA.set(id, i);
28815
28818
  });
28816
28819
  const \u4ECA = currentPhase === void 0 ? -1 : laid.phases.findIndex((p) => p.id === currentPhase.id);
28817
- return (edgeId) => {
28818
- const first = \u521D\u51FA.get(edgeId);
28819
- if (first === void 0) return true;
28820
- return \u4ECA < 0 || \u4ECA >= first;
28820
+ const \u96A0\u3059 = (laid.edgeReveal ?? EDGE_REVEAL_DEFAULT) !== "all";
28821
+ return {
28822
+ \u51FA\u308B\u304B: (edgeId) => {
28823
+ if (!\u96A0\u3059) return true;
28824
+ const first = \u521D\u51FA.get(edgeId);
28825
+ if (first === void 0) return true;
28826
+ return \u4ECA < 0 || \u4ECA >= first;
28827
+ },
28828
+ /*
28829
+ * この段で初めて出るか (#584)。
28830
+ *
28831
+ * 起点から伸ばすのはこの段だけ。 光っているかで引くと、段をまたいで光り続ける図で
28832
+ * 既に見えている線が毎段引き直される (実測 = 表の図で 3 本とも段が変わるたびに伸び直した)。
28833
+ *
28834
+ * **隠さない図でも初出は数える**。 `all` は「最初から見せる」 だけの指定で、
28835
+ * 伸びる動きまで毎段繰り返してよいという意味ではない。
28836
+ */
28837
+ \u4F38\u3070\u3059\u304B: (edgeId) => {
28838
+ const first = \u521D\u51FA.get(edgeId);
28839
+ if (first === void 0) return false;
28840
+ return \u4ECA === first;
28841
+ }
28821
28842
  };
28822
- }, [laid.phases, currentPhase]);
28843
+ }, [laid.phases, currentPhase, laid.edgeReveal]);
28823
28844
  const drawSet = new Set(currentPhase?.draw ?? []);
28824
28845
  const \u63CF\u304F\u9032\u307F = \u63CF\u304F\u9032\u307F\u306B\u76F4\u3059(progress, currentPhase?.drawRatio);
28825
28846
  const { lifelineStarts, uniformFooterTop } = react.useMemo(() => {
@@ -28979,7 +29000,17 @@ function CdlStage({
28979
29000
  },
28980
29001
  lane.id
28981
29002
  )),
28982
- laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeView, { edge, active: activeSet.has(edge.id), progress, stateValues }, edge.id)),
29003
+ laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
29004
+ CdlEdgeView,
29005
+ {
29006
+ edge,
29007
+ active: activeSet.has(edge.id),
29008
+ drawing: \u77E2\u5370\u306E\u51FA\u756A.\u4F38\u3070\u3059\u304B(edge.id),
29009
+ progress,
29010
+ stateValues
29011
+ },
29012
+ edge.id
29013
+ )),
28983
29014
  laid.nodes.map((node) => {
28984
29015
  const \u63CF\u304F = drawSet.has(node.id);
28985
29016
  const view = /* @__PURE__ */ jsxRuntime.jsx(
@@ -28995,8 +29026,8 @@ function CdlStage({
28995
29026
  );
28996
29027
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: view }, node.id);
28997
29028
  }),
28998
- laid.edges.filter((edge) => Boolean(edge.dThrough) && \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(CdlEdgeGlowView, { edge, active: activeSet.has(edge.id) }, `glow-${edge.id}`)),
28999
- laid.edges.filter((edge) => \u51FA\u756A\u306E\u6765\u305F\u77E2\u5370(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
29029
+ 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}`)),
29030
+ laid.edges.filter((edge) => \u77E2\u5370\u306E\u51FA\u756A.\u51FA\u308B\u304B(edge.id)).map((edge) => /* @__PURE__ */ jsxRuntime.jsx(
29000
29031
  CdlEdgeLabelView,
29001
29032
  {
29002
29033
  edge,