@cardenelabs/cdl 0.62.0 → 0.64.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,42 @@ CDL (Chainome Diagram Language) の主要変更履歴。
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.64.0] - 2026-09-14
9
+
10
+ ### Fixed
11
+
12
+ - **札に書いた色の出どころ (`colorSource`) の状態で札の色を引くようにした** (#861)
13
+
14
+ 札 (`badge`) の型は `colorSource` を持ち「別 signal で色を切替可能」 と書いていたが、札を描く部品は 1 度も
15
+ 読まず、色は札の字 (`source` の値) でしか引いていなかった。 `colorSource` を書くと、その状態の値で `map` を
16
+ 引いた色で塗る。 札の字は今どおり `source` の値を描く。
17
+
18
+ | 書き方 | 色を引く鍵 |
19
+ |---|---|
20
+ | `colorSource` を書かない | `source` の値 (変更前と同じ) |
21
+ | `colorSource` を書き、その状態がある | `colorSource` の状態の値 |
22
+ | `colorSource` を書き、その状態が無い | 引かない (色を付けない)。 `source` の値に戻すと書き間違いが効いているように見える |
23
+
24
+ 読み出しの型 (`CdlReadout`) の 107 種の欄を、描く部品 (`ReadoutWidget`) が読むかを構文木で突き合わせる
25
+ 検査を足した。 読まない欄は `colorSource` の 1 つだけだった。
26
+
27
+ ## [0.63.0] - 2026-09-13
28
+
29
+ ### Changed
30
+
31
+ - **状態の図と発想の図の段の札を、図の型と同じ綴りにした** (#859)
32
+
33
+ 組み立て関数は最後の段に図の型と同じ綴りの札を付けるが、`stateMachine` は `fsm`、`stateMachine2` は
34
+ `statemachine2` を付けており、図の型 (`state`) と食い違っていた。 消費側は型の一覧で札を引けず、札だけが
35
+ 型の名前に無い英語として残った。 2 つとも札を `state` にした (2 つの図の見分けは図の題が持つ)。
36
+
37
+ `mindMap` は図の型を `mindmap` から `mind` にし、札も `mind` にした。 他の組み立て関数と同じく短い名前
38
+ (`state` / `class` / `journey`) の並びに揃える。 **図の根の `data-cdl-type` が `mind` になる** ので、
39
+ `[data-cdl-type="mindmap"]` で見た目を決めている消費側は書き換えが要る。
40
+
41
+ グラフ (`chart`) は描き方の種類 (`pie` / `bar` / `line`) を札にする形のまま変えない。 札を族の名前
42
+ (`chart`) にすると、全てのグラフが同じ字になり見出しの役に立たない。
43
+
8
44
  ## [0.62.0] - 2026-09-13
9
45
 
10
46
  ### Changed
@@ -2661,7 +2697,9 @@ Initial OSS release.
2661
2697
  使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
2662
2698
  行き止まりになる。
2663
2699
 
2664
- [Unreleased]: https://github.com/cardene777/cdl/compare/v0.62.0...HEAD
2700
+ [Unreleased]: https://github.com/cardene777/cdl/compare/v0.64.0...HEAD
2701
+ [0.64.0]: https://github.com/cardene777/cdl/compare/v0.63.0...v0.64.0
2702
+ [0.63.0]: https://github.com/cardene777/cdl/compare/v0.62.0...v0.63.0
2665
2703
  [0.62.0]: https://github.com/cardene777/cdl/compare/v0.61.0...v0.62.0
2666
2704
  [0.61.0]: https://github.com/cardene777/cdl/compare/v0.60.0...v0.61.0
2667
2705
  [0.60.0]: https://github.com/cardene777/cdl/compare/v0.59.1...v0.60.0
package/dist/index.cjs CHANGED
@@ -2697,16 +2697,12 @@ function ReadoutWidget({
2697
2697
  colors: readout.colors ?? ["#e0e6ef", "#2d6a8f"]
2698
2698
  }
2699
2699
  );
2700
- case "badge":
2701
- return /* @__PURE__ */ jsxRuntime.jsx(
2702
- BadgeReadout,
2703
- {
2704
- id: readout.id,
2705
- label,
2706
- value: typeof rawValue === "string" ? rawValue : String(rawValue ?? ""),
2707
- map: readout.map
2708
- }
2709
- );
2700
+ case "badge": {
2701
+ const value = typeof rawValue === "string" ? rawValue : String(rawValue ?? "");
2702
+ const colorRaw = readout.colorSource === void 0 ? void 0 : stateOverrides[readout.colorSource];
2703
+ const colorKey = readout.colorSource === void 0 ? value : colorRaw === void 0 ? void 0 : String(colorRaw);
2704
+ return /* @__PURE__ */ jsxRuntime.jsx(BadgeReadout, { id: readout.id, label, value, colorKey, map: readout.map });
2705
+ }
2710
2706
  case "status-dot":
2711
2707
  return /* @__PURE__ */ jsxRuntime.jsx(
2712
2708
  StatusDotReadout,
@@ -4428,9 +4424,10 @@ function BadgeReadout({
4428
4424
  id,
4429
4425
  label,
4430
4426
  value,
4427
+ colorKey,
4431
4428
  map
4432
4429
  }) {
4433
- const entry = map?.find((m) => m.value === value);
4430
+ const entry = colorKey === void 0 ? void 0 : map?.find((m) => m.value === colorKey);
4434
4431
  const color = entry?.color;
4435
4432
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cdl-ip-item cdl-ip-readout-badge", "data-cdl-readout": id, children: [
4436
4433
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cdl-ip-label", children: label }),
@@ -32929,7 +32926,8 @@ var FSM_ACTION_MARK = {
32929
32926
  function stateMachine(preset) {
32930
32927
  const stateW = resolveStateW(preset.stateWidth, "stateMachine");
32931
32928
  const tone = preset.defaultTone ?? "accent";
32932
- const b = diagram(preset.id, { topic: preset.topic, type: "state" });
32929
+ const diagramType = "state";
32930
+ const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
32933
32931
  const phaseActivate = [];
32934
32932
  const stateOrder = /* @__PURE__ */ new Map();
32935
32933
  const \u72B6\u614B = [];
@@ -33030,7 +33028,7 @@ function stateMachine(preset) {
33030
33028
  b.phase(
33031
33029
  "fsm",
33032
33030
  { duration: 2400, title: preset.topic, body: "\u3059\u3079\u3066\u306E\u72B6\u614B\u3068\u9077\u79FB\u3092\u4E26\u3079\u305F\u59FF\u3002" },
33033
- (p) => p.activate(...phaseActivate).badge("fsm")
33031
+ (p) => p.activate(...phaseActivate).badge(diagramType)
33034
33032
  );
33035
33033
  return b.build();
33036
33034
  }
@@ -33289,7 +33287,8 @@ function userJourney(preset) {
33289
33287
  function mindMap(preset) {
33290
33288
  const canvasW = preset.branchWidth ? preset.branchWidth * 2 : 720;
33291
33289
  const canvasH = 480;
33292
- const b = diagram(preset.id, { topic: preset.topic, type: "mindmap" });
33290
+ const diagramType = "mind";
33291
+ const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
33293
33292
  const branches = [];
33294
33293
  const api = {
33295
33294
  branch(br) {
@@ -33323,7 +33322,7 @@ function mindMap(preset) {
33323
33322
  b.phase(
33324
33323
  "mindmap",
33325
33324
  { duration: 2400, title: preset.topic, body: "\u4E2D\u5FC3\u306E\u4E3B\u984C\u304B\u3089\u3001\u3059\u3079\u3066\u306E\u679D\u3092\u653E\u5C04\u72B6\u306B\u5E83\u3052\u305F\u59FF\u3002" },
33326
- (p) => p.activate(nodeId).badge("mindmap")
33325
+ (p) => p.activate(nodeId).badge(diagramType)
33327
33326
  );
33328
33327
  return b.build();
33329
33328
  }
@@ -33656,7 +33655,8 @@ function stateMachine2(preset) {
33656
33655
  const stateW = resolveStateW(preset.stateWidth, "stateMachine2");
33657
33656
  const laneW = boxLaneW(stateW);
33658
33657
  const tone = preset.defaultTone ?? "accent";
33659
- const b = diagram(preset.id, { topic: preset.topic, type: "state" });
33658
+ const diagramType = "state";
33659
+ const b = diagram(preset.id, { topic: preset.topic, type: diagramType });
33660
33660
  const stateOrder = /* @__PURE__ */ new Map();
33661
33661
  const phaseActivate = [];
33662
33662
  let transIdx = 0;
@@ -33712,7 +33712,7 @@ function stateMachine2(preset) {
33712
33712
  title: preset.topic,
33713
33713
  body: "\u5165\u308C\u5B50\u306E\u72B6\u614B\u3068\u3001\u5165\u308B\u6642\u30FB\u51FA\u308B\u6642\u306E\u51E6\u7406\u3092\u542B\u3081\u305F\u3001\u3059\u3079\u3066\u306E\u72B6\u614B\u3068\u9077\u79FB\u3002"
33714
33714
  },
33715
- (p) => p.activate(...phaseActivate).badge("statemachine2")
33715
+ (p) => p.activate(...phaseActivate).badge(diagramType)
33716
33716
  );
33717
33717
  const d = b.build();
33718
33718
  return {