@cardenelabs/cdl 0.49.0 → 0.50.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,19 @@ CDL (Chainome Diagram Language) の主要変更履歴。
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.50.0] - 2026-09-11
9
+
10
+ ### Fixed
11
+
12
+ - **等幅の文字で `[` と `]` が隣り合うと四角 1 つに見えるのを直した** (#817)
13
+
14
+ 見本帳のクラス図で、型の `string[]` が画面では `string□` と読めた。 等幅の書体 (`JetBrains Mono`) の
15
+ `[` と `]` は横棒が字の枠いっぱいまで伸びており、図を画面の幅に合わせて縮めると (画面上 14px 前後)
16
+ 2 本の横棒がつながる。 合字ではない (合字を止めても変わらない)。
17
+
18
+ engine が等幅の書体で描く全ての文字で、 `[]` の間にだけ字の大きさの 0.08 倍の隙間を足す。
19
+ 隙間は `<tspan dx>` で足すので、 文字の中身 (`textContent`) は `string[]` のまま変わらない。
20
+
8
21
  ## [0.49.0] - 2026-09-11
9
22
 
10
23
  ### Added
@@ -2405,7 +2418,8 @@ Initial OSS release.
2405
2418
  使わない = annotated tag を push しても GitHub Release は作られず、 Release を作っていない版で
2406
2419
  行き止まりになる。
2407
2420
 
2408
- [Unreleased]: https://github.com/cardene777/cdl/compare/v0.49.0...HEAD
2421
+ [Unreleased]: https://github.com/cardene777/cdl/compare/v0.50.0...HEAD
2422
+ [0.50.0]: https://github.com/cardene777/cdl/compare/v0.49.0...v0.50.0
2409
2423
  [0.49.0]: https://github.com/cardene777/cdl/compare/v0.48.0...v0.49.0
2410
2424
  [0.48.0]: https://github.com/cardene777/cdl/compare/v0.47.0...v0.48.0
2411
2425
  [0.47.0]: https://github.com/cardene777/cdl/compare/v0.46.0...v0.47.0
package/dist/index.cjs CHANGED
@@ -22920,6 +22920,17 @@ function edgeHeadPaint(head, fill, color) {
22920
22920
  }
22921
22921
  return { fill: color, stroke: "none" };
22922
22922
  }
22923
+ var \u89D2\u62EC\u5F27\u306E\u9699\u9593 = 0.08;
22924
+ function \u7B49\u5E45\u306E\u5B57(text, fontSize) {
22925
+ if (typeof text !== "string" || !text.includes("[]")) return text;
22926
+ const \u584A = text.split("[]");
22927
+ const out = [];
22928
+ \u584A.forEach((s, i) => {
22929
+ if (i > 0) out.push("[", react.createElement("tspan", { key: i, dx: fontSize * \u89D2\u62EC\u5F27\u306E\u9699\u9593 }, "]"));
22930
+ if (s !== "") out.push(s);
22931
+ });
22932
+ return out;
22933
+ }
22923
22934
  function defaultEdgeWidth(active) {
22924
22935
  return active ? 2.5 : 1.25;
22925
22936
  }
@@ -23175,7 +23186,7 @@ function CdlEdgeLabelView({
23175
23186
  fill: active ? color : "var(--cdl-text-dim, #5a6270)",
23176
23187
  opacity: labelTextOpacity("sub"),
23177
23188
  style: { fontFamily: fontFamilyAttr("sub") },
23178
- children: edge.sub
23189
+ children: \u7B49\u5E45\u306E\u5B57(edge.sub, EDGE_LABEL_TEXT.sub.fontSize)
23179
23190
  }
23180
23191
  )
23181
23192
  ]
@@ -23255,7 +23266,7 @@ function ActorNode({ node, active, value }) {
23255
23266
  textAnchor: "end",
23256
23267
  fill: "var(--cdl-text, #1a1f2a)",
23257
23268
  style: { fontFamily: "'JetBrains Mono', monospace" },
23258
- children: value
23269
+ children: \u7B49\u5E45\u306E\u5B57(value, 42)
23259
23270
  }
23260
23271
  )
23261
23272
  ] });
@@ -23431,7 +23442,7 @@ function SequenceBoardNode({
23431
23442
  textAnchor: "middle",
23432
23443
  fill: "var(--cdl-text, #1a1f2a)",
23433
23444
  style: { fontFamily: "'JetBrains Mono', monospace" },
23434
- children: a.name
23445
+ children: \u7B49\u5E45\u306E\u5B57(a.name, SEQ_NAME)
23435
23446
  }
23436
23447
  ),
23437
23448
  a.subtitle && /* @__PURE__ */ jsxRuntime.jsx(
@@ -23621,7 +23632,7 @@ function EventNode({
23621
23632
  fill: "var(--cdl-text, #1a1f2a)",
23622
23633
  textAnchor: \u540D\u524D.anchor,
23623
23634
  style: { fontFamily: "'JetBrains Mono', monospace" },
23624
- children: node.title
23635
+ children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
23625
23636
  }
23626
23637
  ),
23627
23638
  node.subtitle && /* @__PURE__ */ jsxRuntime.jsx(
@@ -23632,7 +23643,7 @@ function EventNode({
23632
23643
  fontSize: 21,
23633
23644
  fill: "var(--cdl-text-dim, #5a6270)",
23634
23645
  style: { fontFamily: "'JetBrains Mono', monospace" },
23635
- children: node.subtitle
23646
+ children: \u7B49\u5E45\u306E\u5B57(node.subtitle, 21)
23636
23647
  }
23637
23648
  )
23638
23649
  ] })
@@ -23681,7 +23692,7 @@ function FunctionNode({ node, active }) {
23681
23692
  fill: "var(--cdl-text, #1a1f2a)",
23682
23693
  textAnchor: \u540D\u524D.anchor,
23683
23694
  style: { fontFamily: "'JetBrains Mono', monospace" },
23684
- children: node.title
23695
+ children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
23685
23696
  }
23686
23697
  ),
23687
23698
  node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: 26, y: 126 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle })
@@ -23794,7 +23805,7 @@ function StorageNode({
23794
23805
  fill: "var(--cdl-text, #1a1f2a)",
23795
23806
  textAnchor: \u540D\u524D.anchor,
23796
23807
  style: { fontFamily: "'JetBrains Mono', monospace" },
23797
- children: node.title
23808
+ children: \u7B49\u5E45\u306E\u5B57(node.title, \u540D\u524D.size)
23798
23809
  }
23799
23810
  ),
23800
23811
  rows.length > 0 && !\u5370\u3067\u5206\u3051\u308B && /* @__PURE__ */ jsxRuntime.jsx(
@@ -23855,7 +23866,7 @@ function StorageNode({
23855
23866
  fontWeight: \u5370\u3067\u5206\u3051\u308B ? 500 : 600,
23856
23867
  fill: "var(--cdl-text, #1a1f2a)",
23857
23868
  style: { fontFamily: "'JetBrains Mono', monospace" },
23858
- children: s.left
23869
+ children: \u7B49\u5E45\u306E\u5B57(s.left, 26)
23859
23870
  }
23860
23871
  ),
23861
23872
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -23869,7 +23880,7 @@ function StorageNode({
23869
23880
  textAnchor: \u5370\u3067\u5206\u3051\u308B ? "end" : "start",
23870
23881
  fill: \u5370\u3067\u5206\u3051\u308B ? "var(--cdl-text-dim, #5a6270)" : highlightRows ? accent : "var(--cdl-text, #1a1f2a)",
23871
23882
  style: { fontFamily: "'JetBrains Mono', monospace" },
23872
- children: s.right
23883
+ children: \u7B49\u5E45\u306E\u5B57(s.right, \u5370\u3067\u5206\u3051\u308B ? ROW_TYPE_FONT : 26)
23873
23884
  }
23874
23885
  )
23875
23886
  ] }, idx);
@@ -24143,8 +24154,8 @@ function GenericNode({
24143
24154
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: style.icon, fill: style.eyebrowColor, opacity: 0.7, transform: "scale(1)" })
24144
24155
  ] }),
24145
24156
  node.eyebrow && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: eyebrowY, fontSize: 17, fontWeight: 700, letterSpacing: 1.5, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : style.eyebrowColor, textAnchor, dominantBaseline, children: node.eyebrow }),
24146
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.title }),
24147
- node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: node.subtitle }),
24157
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "node-label", x: textX, y: titleY, fontSize: 20, fontWeight: 700, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text, #1a1f2a)", textAnchor, dominantBaseline, style: node.kind === "function" || node.kind === "api" ? { fontFamily: "'JetBrains Mono', monospace" } : void 0, children: node.kind === "function" || node.kind === "api" ? \u7B49\u5E45\u306E\u5B57(node.title, 20) : node.title }),
24158
+ node.subtitle && /* @__PURE__ */ jsxRuntime.jsx("text", { x: textX, y: subtitleY, fontSize: 17, fill: paint.onSolid ? "var(--cdl-node-fill, #ffffff)" : "var(--cdl-text-dim, #5a6270)", textAnchor, dominantBaseline, style: { fontFamily: "'JetBrains Mono', monospace" }, children: \u7B49\u5E45\u306E\u5B57(node.subtitle, 17) }),
24148
24159
  resolvedValue && /* @__PURE__ */ jsxRuntime.jsx(
24149
24160
  "text",
24150
24161
  {
@@ -24155,7 +24166,7 @@ function GenericNode({
24155
24166
  textAnchor: "end",
24156
24167
  fill: "var(--cdl-text, #1a1f2a)",
24157
24168
  style: { fontFamily: "'JetBrains Mono', monospace" },
24158
- children: resolvedValue
24169
+ children: \u7B49\u5E45\u306E\u5B57(resolvedValue, 32)
24159
24170
  }
24160
24171
  ),
24161
24172
  node.rows && node.rows.length > 0 && (() => {
@@ -24180,7 +24191,7 @@ function GenericNode({
24180
24191
  textAnchor: "start",
24181
24192
  fill: "var(--cdl-text, #1a1f2a)",
24182
24193
  style: { fontFamily: "'JetBrains Mono', monospace" },
24183
- children: s.right
24194
+ children: \u7B49\u5E45\u306E\u5B57(s.right, 21)
24184
24195
  }
24185
24196
  )
24186
24197
  ] }, i)) });