@cardenelabs/cdl 0.70.0 → 0.72.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 +61 -2
- package/dist/index.cjs +17 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -16
- package/dist/index.d.ts +14 -16
- package/dist/index.js +17 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/presets.ts +55 -8
package/CHANGELOG.md
CHANGED
|
@@ -5,11 +5,67 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.72.0] - 2026-09-26
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **縦に積んだ分かれ道の図で、分岐の字が行き先の箱に乗るのを直した** (#882 / #883)
|
|
13
|
+
|
|
14
|
+
0.71.0 で足した `direction: "vertical"` の図で、分岐の字が箱に重なっていた。
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
node:approve ↔ edge-label:fc-1-review-approve gap=1.0px (need 32px)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
分岐の字 (`true` / `false` / `はい` / `いいえ`) は道筋の上に重ねて描く。
|
|
21
|
+
重ねる形は **線が長い時に効く** = 横に並べた図の分岐は縦列をまたぐので線が長く、
|
|
22
|
+
道筋の上に字を置いても箱に掛からない。
|
|
23
|
+
|
|
24
|
+
縦 1 本に積むと分岐の線が上下に隣り合う箱の間の短い縦線になり、そこへ重ねた字が
|
|
25
|
+
行き先の箱に乗る。 重ねなければ段の間隔を字の分だけ広げる計算に入る
|
|
26
|
+
(`requiredStackGapForEdgeLabels`)。
|
|
27
|
+
|
|
28
|
+
縦に積む図でだけ重ねるのをやめた。 横に並べた図は今までどおり重ねる (対照で確認)。
|
|
29
|
+
|
|
30
|
+
## [0.71.0] - 2026-09-26
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- **分かれ道の図で並べる向きを選べるようにした** (#880 / #881)
|
|
35
|
+
|
|
36
|
+
分かれ道の図 (`flowchart`) の入口は縦列を横に並べる形に固定で、向きを選べなかった。
|
|
37
|
+
使う側 ([cardene777/dragon](https://github.com/cardene777/dragon)) は記法に `direction` を
|
|
38
|
+
持ち、`flow` と `swimlane` では効くのに、分かれ道の図では知らせが出て効かなかった。
|
|
39
|
+
|
|
40
|
+
`FlowchartPreset` に `direction` を足す。
|
|
41
|
+
|
|
42
|
+
| 値 | 並び | 役割の見せ方 |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `horizontal` (既定) | 今のまま。 縦列を横に並べ、箱をその中に上から積む | 縦列の見出し |
|
|
45
|
+
| `vertical` | 縦列 1 本に全部の箱を書いた順で積む | 箱の上の小さな字 |
|
|
46
|
+
|
|
47
|
+
`vertical` は縦列を 1 本しか作らないため、役割の名前を出す場所が無くなる。
|
|
48
|
+
黙って消すと書いた `lane` が図から読めなくなるので、箱の上の小さな字へ移す。
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
横に並べる ... 箱の上は 判断 (役割は縦列の見出し 承認者)
|
|
52
|
+
縦に積む ... 箱の上は 承認者 · 判断
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
縦列を 1 つしか書いていない図では足さない (全部の箱に同じ字が並ぶだけ)。
|
|
56
|
+
1 本の縦列に見出しも付けない = 役割が 1 つに畳まれるので、どれか 1 つを見出しにすると
|
|
57
|
+
他の役割の箱にもその名前が掛かって読める。
|
|
58
|
+
|
|
59
|
+
**縦列を横の帯にして縦に積む形は持たない**。 配置は格子で、縦列が横の位置を、段が縦の
|
|
60
|
+
位置を決める。 帯にするには軸の入れ替えが要り、入口の option では足りない。
|
|
61
|
+
|
|
62
|
+
既定は変えていない。 向きを渡さない図は 1 枚も並びが動かない (対照で確認)。
|
|
63
|
+
|
|
8
64
|
## [0.70.0] - 2026-09-26
|
|
9
65
|
|
|
10
66
|
### Fixed
|
|
11
67
|
|
|
12
|
-
- **箱の読み取り値を右端へ寄せ、縦の矢印が数字を割らないようにした** (#870)
|
|
68
|
+
- **箱の読み取り値を右端へ寄せ、縦の矢印が数字を割らないようにした** (#870 / #879)
|
|
13
69
|
|
|
14
70
|
箱に読み取り値 (`10 / 10` のような現在値と上限) を書くと、値は箱の上端の中央に出る。
|
|
15
71
|
同じ帯の上下に置いた箱を矢印で繋ぐと、道筋は受け手の上端の中央へ真下から入る。
|
|
@@ -2968,7 +3024,10 @@ Initial OSS release.
|
|
|
2968
3024
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
2969
3025
|
行き止まりになる。
|
|
2970
3026
|
|
|
2971
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
3027
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.72.0...HEAD
|
|
3028
|
+
[0.72.0]: https://github.com/cardene777/cdl/compare/v0.71.0...v0.72.0
|
|
3029
|
+
[0.71.0]: https://github.com/cardene777/cdl/compare/v0.70.0...v0.71.0
|
|
3030
|
+
[0.70.0]: https://github.com/cardene777/cdl/compare/v0.69.0...v0.70.0
|
|
2972
3031
|
[0.69.0]: https://github.com/cardene777/cdl/compare/v0.68.0...v0.69.0
|
|
2973
3032
|
[0.68.0]: https://github.com/cardene777/cdl/compare/v0.67.0...v0.68.0
|
|
2974
3033
|
[0.67.0]: https://github.com/cardene777/cdl/compare/v0.66.0...v0.67.0
|
package/dist/index.cjs
CHANGED
|
@@ -33621,30 +33621,39 @@ var SHAPE_EYEBROW = {
|
|
|
33621
33621
|
end: "\u7D42\u4E86",
|
|
33622
33622
|
loop: "\u7E70\u308A\u8FD4\u3057"
|
|
33623
33623
|
};
|
|
33624
|
+
var VERTICAL_LANE_ID = "flowchart-main";
|
|
33624
33625
|
function flowchart(preset) {
|
|
33625
33626
|
const laneW = preset.laneWidth ?? 380;
|
|
33626
33627
|
const tone = preset.defaultTone ?? "accent";
|
|
33628
|
+
const \u7E26\u306B\u7A4D\u3080 = (preset.direction ?? "horizontal") === "vertical";
|
|
33627
33629
|
const b = diagram(preset.id, { topic: preset.topic, type: "flowchart" });
|
|
33628
33630
|
const laneToId = /* @__PURE__ */ new Map();
|
|
33629
33631
|
const laneStackCount = /* @__PURE__ */ new Map();
|
|
33630
|
-
|
|
33631
|
-
|
|
33632
|
-
|
|
33633
|
-
|
|
33634
|
-
|
|
33632
|
+
if (\u7E26\u306B\u7A4D\u3080) {
|
|
33633
|
+
b.lane(VERTICAL_LANE_ID, { width: laneW });
|
|
33634
|
+
laneStackCount.set(VERTICAL_LANE_ID, 0);
|
|
33635
|
+
} else {
|
|
33636
|
+
for (const label of preset.lanes) {
|
|
33637
|
+
const id = slugify(label) || `lane-${laneToId.size}`;
|
|
33638
|
+
laneToId.set(label, id);
|
|
33639
|
+
laneStackCount.set(id, 0);
|
|
33640
|
+
b.lane(id, { width: laneW, label });
|
|
33641
|
+
}
|
|
33635
33642
|
}
|
|
33636
33643
|
const phaseActivate = [];
|
|
33637
33644
|
let edgeIdx = 0;
|
|
33645
|
+
const \u5F79\u5272\u3092\u8DB3\u3059 = \u7E26\u306B\u7A4D\u3080 && preset.lanes.length >= 2;
|
|
33646
|
+
const \u7BB1\u306E\u4E0A\u306E\u5B57 = (n) => \u5F79\u5272\u3092\u8DB3\u3059 ? `${n.lane} \xB7 ${SHAPE_EYEBROW[n.shape]}` : SHAPE_EYEBROW[n.shape];
|
|
33638
33647
|
const api = {
|
|
33639
33648
|
node(n) {
|
|
33640
|
-
const laneId = laneToId.get(n.lane) ?? n.lane;
|
|
33649
|
+
const laneId = \u7E26\u306B\u7A4D\u3080 ? VERTICAL_LANE_ID : laneToId.get(n.lane) ?? n.lane;
|
|
33641
33650
|
const stack = laneStackCount.get(laneId) ?? 0;
|
|
33642
33651
|
b.node(n.id, {
|
|
33643
33652
|
lane: laneId,
|
|
33644
33653
|
stack,
|
|
33645
33654
|
kind: SHAPE_KIND[n.shape],
|
|
33646
33655
|
title: n.title,
|
|
33647
|
-
eyebrow:
|
|
33656
|
+
eyebrow: \u7BB1\u306E\u4E0A\u306E\u5B57(n)
|
|
33648
33657
|
});
|
|
33649
33658
|
laneStackCount.set(laneId, stack + 1);
|
|
33650
33659
|
phaseActivate.push(n.id);
|
|
@@ -33659,7 +33668,7 @@ function flowchart(preset) {
|
|
|
33659
33668
|
label,
|
|
33660
33669
|
tone: e.tone ?? tone,
|
|
33661
33670
|
style: "solid",
|
|
33662
|
-
overlay: isConditionLabel
|
|
33671
|
+
overlay: isConditionLabel && !\u7E26\u306B\u7A4D\u3080
|
|
33663
33672
|
});
|
|
33664
33673
|
phaseActivate.push(edgeId);
|
|
33665
33674
|
return api;
|