@cardenelabs/cdl 0.21.2 → 0.22.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 +20 -1
- package/dist/index.cjs +59 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +59 -17
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +59 -17
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +59 -17
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/actor.tsx +15 -6
- package/src/kinds/card.tsx +15 -4
- package/src/kinds/event.tsx +13 -4
- package/src/kinds/function.tsx +13 -4
- package/src/kinds/generic.tsx +15 -3
- package/src/layout/spec.ts +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,24 @@ CDL (Chainome Diagram Language) の主要変更履歴。
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.22.0] - 2026-08-30
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **箱が中身より高い時、字を中央へ寄せるようにした** (#597)
|
|
13
|
+
|
|
14
|
+
段の高さは行内の最大値で決まるので、行に高い箱が 1 つあると同じ行の箱もそこまで伸びる。
|
|
15
|
+
字は上から置かれるため、伸びたぶんがそのまま下に空いていた。
|
|
16
|
+
|
|
17
|
+
実測 = dragon の見本で `BEGIN tx` の箱が 240 に伸びているのに中身は 67。 字が上端に
|
|
18
|
+
貼り付き、同じ縦列の下 2 つ (67 のまま) と不揃いに見えていた。
|
|
19
|
+
|
|
20
|
+
余りを上下で分ける。 3 段 (小見出し / 名前 / 説明) は同じ量だけ動かすので、段どうしの
|
|
21
|
+
間隔は変わらない。
|
|
22
|
+
|
|
23
|
+
行を持つ箱と値を持つ箱は動かさない (行は上端から数え、値は下端から置くので重なる)。
|
|
24
|
+
小型の箱と、字を中央へ寄せる 2 種別も元から中央にあるので対象外。
|
|
25
|
+
|
|
8
26
|
## [0.21.2] - 2026-08-30
|
|
9
27
|
|
|
10
28
|
### Fixed
|
|
@@ -1095,7 +1113,8 @@ Initial OSS release.
|
|
|
1095
1113
|
使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
|
|
1096
1114
|
行き止まりになる。
|
|
1097
1115
|
|
|
1098
|
-
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.
|
|
1116
|
+
[Unreleased]: https://github.com/cardene777/cdl/compare/v0.22.0...HEAD
|
|
1117
|
+
[0.22.0]: https://github.com/cardene777/cdl/compare/v0.21.2...v0.22.0
|
|
1099
1118
|
[0.21.2]: https://github.com/cardene777/cdl/compare/v0.21.1...v0.21.2
|
|
1100
1119
|
[0.21.1]: https://github.com/cardene777/cdl/compare/v0.21.0...v0.21.1
|
|
1101
1120
|
[0.21.0]: https://github.com/cardene777/cdl/compare/v0.20.1...v0.21.0
|
package/dist/index.cjs
CHANGED
|
@@ -12038,6 +12038,13 @@ var CLOUD_ART_CENTER_RISE = (() => {
|
|
|
12038
12038
|
const \u4E0B = Math.max(...CLOUD_CIRCLES.map((c) => c.cy + c.r));
|
|
12039
12039
|
return -(\u4E0A + \u4E0B) / 2;
|
|
12040
12040
|
})();
|
|
12041
|
+
function \u4F59\u308A\u3092\u5206\u3051\u308B(kind, \u6E80\u8F09h, \u5B9F\u969B\u306Eh, \u4E2D\u8EAB) {
|
|
12042
|
+
if (!\u6BB5\u3092\u7A4D\u3080\u7BB1\u304B(kind, \u4E2D\u8EAB.hasRows)) return 0;
|
|
12043
|
+
if (\u4E2D\u8EAB.hasValue) return 0;
|
|
12044
|
+
const \u8981\u308B\u9AD8\u3055 = \u4E2D\u8EAB\u304B\u3089\u51FA\u3059\u9AD8\u3055(kind, \u6E80\u8F09h, \u4E2D\u8EAB);
|
|
12045
|
+
const \u4F59\u308A = \u5B9F\u969B\u306Eh - \u8981\u308B\u9AD8\u3055;
|
|
12046
|
+
return \u4F59\u308A > 0 ? Math.round(\u4F59\u308A / 2) : 0;
|
|
12047
|
+
}
|
|
12041
12048
|
|
|
12042
12049
|
// src/layout/footer-shape.ts
|
|
12043
12050
|
var SHAPE_DRAW_UP_EXTENT = {
|
|
@@ -21717,7 +21724,14 @@ function ActorNode({ node, active, value }) {
|
|
|
21717
21724
|
const x = node.cx - node.w / 2;
|
|
21718
21725
|
const y = node.cy - node.h / 2;
|
|
21719
21726
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("actor");
|
|
21720
|
-
const \
|
|
21727
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("actor", NODE_SIZE.actor.h, node.h, {
|
|
21728
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
21729
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
21730
|
+
hasValue: Boolean(value),
|
|
21731
|
+
hasRows: false
|
|
21732
|
+
});
|
|
21733
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
21734
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 86 - \u305A\u3089\u3057, size: 32 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
21721
21735
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x} ${y})`, children: [
|
|
21722
21736
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21723
21737
|
"rect",
|
|
@@ -21733,7 +21747,7 @@ function ActorNode({ node, active, value }) {
|
|
|
21733
21747
|
strokeWidth: active ? 3 : 1.25
|
|
21734
21748
|
}
|
|
21735
21749
|
),
|
|
21736
|
-
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21750
|
+
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21737
21751
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21738
21752
|
"text",
|
|
21739
21753
|
{
|
|
@@ -21752,13 +21766,13 @@ function ActorNode({ node, active, value }) {
|
|
|
21752
21766
|
{
|
|
21753
21767
|
"data-cdl-role": "node-row-divider",
|
|
21754
21768
|
x1: 26,
|
|
21755
|
-
y1: 110 - \
|
|
21769
|
+
y1: 110 - \u305A\u3089\u3057,
|
|
21756
21770
|
x2: node.w - 26,
|
|
21757
|
-
y2: 110 - \
|
|
21771
|
+
y2: 110 - \u305A\u3089\u3057,
|
|
21758
21772
|
stroke: "var(--cdl-row-divider, #7e848e)"
|
|
21759
21773
|
}
|
|
21760
21774
|
),
|
|
21761
|
-
node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 140 - \
|
|
21775
|
+
node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 140 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle }),
|
|
21762
21776
|
value && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21763
21777
|
"text",
|
|
21764
21778
|
{
|
|
@@ -21784,7 +21798,14 @@ function CardNode({ node, active }) {
|
|
|
21784
21798
|
const compact = isCompactBox(node.h);
|
|
21785
21799
|
const \u5C0F\u578B\u306B\u547C\u3073\u540D = compact && Boolean(node.subtitle);
|
|
21786
21800
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("card");
|
|
21787
|
-
const
|
|
21801
|
+
const \u4F59\u308A = compact ? 0 : \u4F59\u308A\u3092\u5206\u3051\u308B("card", NODE_SIZE.card.h, node.h, {
|
|
21802
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
21803
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
21804
|
+
hasValue: false,
|
|
21805
|
+
hasRows: false
|
|
21806
|
+
});
|
|
21807
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
21808
|
+
const titleY = compact ? \u5C0F\u578B\u306B\u547C\u3073\u540D ? node.h / 2 - 2 : node.h / 2 + 8 : 86 - \u305A\u3089\u3057;
|
|
21788
21809
|
const titleX = compact ? node.w / 2 : 26;
|
|
21789
21810
|
const paddingX = compact ? 16 : 52;
|
|
21790
21811
|
const availableW = node.w - paddingX;
|
|
@@ -21807,7 +21828,7 @@ function CardNode({ node, active }) {
|
|
|
21807
21828
|
strokeWidth: active ? 3 : 1.25
|
|
21808
21829
|
}
|
|
21809
21830
|
),
|
|
21810
|
-
!compact && node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21831
|
+
!compact && node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21811
21832
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21812
21833
|
"text",
|
|
21813
21834
|
{
|
|
@@ -21821,7 +21842,7 @@ function CardNode({ node, active }) {
|
|
|
21821
21842
|
children: node.title
|
|
21822
21843
|
}
|
|
21823
21844
|
),
|
|
21824
|
-
!compact && node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 124 - \
|
|
21845
|
+
!compact && node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 124 - \u305A\u3089\u3057, fontSize: subtitleSize, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle }),
|
|
21825
21846
|
\u5C0F\u578B\u306B\u547C\u3073\u540D && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21826
21847
|
"text",
|
|
21827
21848
|
{
|
|
@@ -22086,7 +22107,14 @@ function EventNode({
|
|
|
22086
22107
|
const x = node.cx - node.w / 2;
|
|
22087
22108
|
const y = node.cy - node.h / 2;
|
|
22088
22109
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("event");
|
|
22089
|
-
const \
|
|
22110
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("event", NODE_SIZE.event.h, node.h, {
|
|
22111
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22112
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22113
|
+
hasValue: false,
|
|
22114
|
+
hasRows: false
|
|
22115
|
+
});
|
|
22116
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22117
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 88 - \u305A\u3089\u3057, size: 26 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
22090
22118
|
const scale = active ? 0.78 + 0.22 * progress : 0.92;
|
|
22091
22119
|
const opacity = active ? 0.5 + 0.5 * progress : 0.65;
|
|
22092
22120
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -22109,7 +22137,7 @@ function EventNode({
|
|
|
22109
22137
|
strokeWidth: active ? 3 : 1.25
|
|
22110
22138
|
}
|
|
22111
22139
|
),
|
|
22112
|
-
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22140
|
+
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22113
22141
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22114
22142
|
"text",
|
|
22115
22143
|
{
|
|
@@ -22128,7 +22156,7 @@ function EventNode({
|
|
|
22128
22156
|
"text",
|
|
22129
22157
|
{
|
|
22130
22158
|
x: 26,
|
|
22131
|
-
y: 128 - \
|
|
22159
|
+
y: 128 - \u305A\u3089\u3057,
|
|
22132
22160
|
fontSize: 21,
|
|
22133
22161
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
22134
22162
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
@@ -22145,7 +22173,14 @@ function FunctionNode({ node, active }) {
|
|
|
22145
22173
|
const x = node.cx - node.w / 2;
|
|
22146
22174
|
const y = node.cy - node.h / 2;
|
|
22147
22175
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("function");
|
|
22148
|
-
const \
|
|
22176
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("function", NODE_SIZE.function.h, node.h, {
|
|
22177
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22178
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22179
|
+
hasValue: false,
|
|
22180
|
+
hasRows: false
|
|
22181
|
+
});
|
|
22182
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22183
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 86 - \u305A\u3089\u3057, size: 24 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
22149
22184
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${x} ${y})`, children: [
|
|
22150
22185
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22151
22186
|
"rect",
|
|
@@ -22162,7 +22197,7 @@ function FunctionNode({ node, active }) {
|
|
|
22162
22197
|
strokeOpacity: active ? 1 : 0.5
|
|
22163
22198
|
}
|
|
22164
22199
|
),
|
|
22165
|
-
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22200
|
+
node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22166
22201
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
22167
22202
|
"text",
|
|
22168
22203
|
{
|
|
@@ -22177,7 +22212,7 @@ function FunctionNode({ node, active }) {
|
|
|
22177
22212
|
children: node.title
|
|
22178
22213
|
}
|
|
22179
22214
|
),
|
|
22180
|
-
node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 126 - \
|
|
22215
|
+
node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 126 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle })
|
|
22181
22216
|
] });
|
|
22182
22217
|
}
|
|
22183
22218
|
var ROW_GLYPH_HALF = 7;
|
|
@@ -22560,10 +22595,17 @@ function GenericNode({
|
|
|
22560
22595
|
const textX = centered ? w / 2 : 20;
|
|
22561
22596
|
const cylinderShift = genericTextShift(node.kind);
|
|
22562
22597
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow || centered ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052(node.kind, hasRows);
|
|
22598
|
+
const \u4F59\u308A = centered ? 0 : \u4F59\u308A\u3092\u5206\u3051\u308B(node.kind, NODE_SIZE[node.kind]?.h ?? h, h, {
|
|
22599
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22600
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22601
|
+
hasValue: Boolean(resolvedValue),
|
|
22602
|
+
hasRows
|
|
22603
|
+
});
|
|
22604
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22563
22605
|
const \u7D75\u306E\u82AF = centered && STYLES[node.kind]?.shape === "cloud" ? h * CLOUD_ART_CENTER_RISE : 0;
|
|
22564
|
-
const eyebrowY = centered ? h / 2 - 26 - \u7D75\u306E\u82AF : 32 + cylinderShift;
|
|
22565
|
-
const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \
|
|
22566
|
-
const subtitleY = centered ? h / 2 + 28 - \u7D75\u306E\u82AF : 96 + cylinderShift - \
|
|
22606
|
+
const eyebrowY = centered ? h / 2 - 26 - \u7D75\u306E\u82AF : 32 + cylinderShift + \u4F59\u308A;
|
|
22607
|
+
const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \u305A\u3089\u3057 - \u7D75\u306E\u82AF;
|
|
22608
|
+
const subtitleY = centered ? h / 2 + 28 - \u7D75\u306E\u82AF : 96 + cylinderShift - \u305A\u3089\u3057;
|
|
22567
22609
|
const iconX = centered ? w / 2 + 40 : w - 48;
|
|
22568
22610
|
const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
|
|
22569
22611
|
const dominantBaseline = centered ? "middle" : void 0;
|