@cardenelabs/cdl 0.79.0 → 0.80.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardenelabs/cdl",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
5
5
  "license": "MIT",
6
6
  "author": "cardene777",
@@ -1,4 +1,4 @@
1
- import type { JSX, KeyboardEvent as ReactKeyboardEvent } from "react";
1
+ import type { CSSProperties, JSX, KeyboardEvent as ReactKeyboardEvent } from "react";
2
2
  import { ActorNode } from "../kinds/actor";
3
3
  import { CardNode } from "../kinds/card";
4
4
  import { SequenceBoardNode } from "../kinds/sequence-board";
@@ -461,6 +461,20 @@ export function CdlNodeView({
461
461
  const offsetX = node.renderOffsetX !== undefined ? resolveNumericAttr(node.renderOffsetX, stateValues, 0) : 0;
462
462
  const offsetY = node.renderOffsetY !== undefined ? resolveNumericAttr(node.renderOffsetY, stateValues, 0) : 0;
463
463
  const hasOffset = offsetX !== 0 || offsetY !== 0;
464
+ /**
465
+ * 箱の `style` は **1 箇所でまとめて作る**。
466
+ *
467
+ * React は同じ要素に `style` を 2 回渡すと後の値が前を丸ごと置き換える。 押せる箱の
468
+ * `cursor: pointer` を条件つきで広げる側に置いていたため、後ろの `transition` に
469
+ * 置き換えられて消えていた (#869 実測 = 押せる箱 4 件の `style` が `transition` だけで、
470
+ * 計算済みの cursor は親から継承した値だった)。
471
+ *
472
+ * 押せない箱に `cursor` を入れない。 親から継承するのが正しい (編集画面では `grab`)。
473
+ */
474
+ const 箱のstyle: CSSProperties = {
475
+ transition: "opacity 120ms ease-out, transform 200ms ease-out",
476
+ ...(関係の受け口 === undefined ? {} : { cursor: "pointer" as const }),
477
+ };
464
478
  return (
465
479
  <g
466
480
  data-cdl-node={node.id}
@@ -483,7 +497,6 @@ export function CdlNodeView({
483
497
  role: "button" as const,
484
498
  tabIndex: 0,
485
499
  "aria-pressed": 関係の受け口.焦点 === node.id,
486
- style: { cursor: "pointer" as const },
487
500
  onPointerEnter: () => 関係の受け口.触れた(node.id),
488
501
  onPointerLeave: () => 関係の受け口.離れた(),
489
502
  onFocus: () => 関係の受け口.触れた(node.id),
@@ -498,7 +511,7 @@ export function CdlNodeView({
498
511
  transform={hasOffset ? `translate(${offsetX}, ${offsetY})` : undefined}
499
512
  opacity={boundOpacity}
500
513
  data-cdl-tone={node.tone}
501
- style={{ transition: "opacity 120ms ease-out, transform 200ms ease-out" }}
514
+ style={箱のstyle}
502
515
  >
503
516
  <rect
504
517
  // 実寸の枠 (#390)。 `data-cdl-w/h` は layout の静的値で、 `wBind` / `hBind` の縮小や