@cardenelabs/cdl 0.15.0 → 0.16.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/dist/index.d.cts CHANGED
@@ -3042,6 +3042,12 @@ type UmlRelation = {
3042
3042
  /** 多重度 (例 "1..*" / "0..1") */
3043
3043
  cardinality?: string;
3044
3044
  tone?: Tone;
3045
+ /**
3046
+ * 矢印の先の形 (cdl#574)。 書かなければ種類から決まる (`CLASS_RELATION_HEAD`)。
3047
+ *
3048
+ * **書いた形が勝つ**。 表と違う形にしたい関係だけを個別に書ける。
3049
+ */
3050
+ head?: EdgeHead;
3045
3051
  };
3046
3052
  type ClassDiagramPreset = {
3047
3053
  id: string;
package/dist/index.d.ts CHANGED
@@ -3042,6 +3042,12 @@ type UmlRelation = {
3042
3042
  /** 多重度 (例 "1..*" / "0..1") */
3043
3043
  cardinality?: string;
3044
3044
  tone?: Tone;
3045
+ /**
3046
+ * 矢印の先の形 (cdl#574)。 書かなければ種類から決まる (`CLASS_RELATION_HEAD`)。
3047
+ *
3048
+ * **書いた形が勝つ**。 表と違う形にしたい関係だけを個別に書ける。
3049
+ */
3050
+ head?: EdgeHead;
3045
3051
  };
3046
3052
  type ClassDiagramPreset = {
3047
3053
  id: string;
package/dist/index.js CHANGED
@@ -29427,6 +29427,13 @@ function infrastructure(preset) {
29427
29427
  };
29428
29428
  return api;
29429
29429
  }
29430
+ var CLASS_RELATION_HEAD = {
29431
+ extends: "triangle",
29432
+ implements: "triangle",
29433
+ uses: "open",
29434
+ aggregates: "diamond",
29435
+ composes: "diamond"
29436
+ };
29430
29437
  function classDiagram(preset) {
29431
29438
  const classW = resolveStorageBoxW(preset.classWidth, "classDiagram", "classWidth");
29432
29439
  const tone = preset.defaultTone ?? "info";
@@ -29470,7 +29477,9 @@ function classDiagram(preset) {
29470
29477
  label,
29471
29478
  ...sub ? { sub } : {},
29472
29479
  tone: r.tone ?? tone,
29473
- style: "solid"
29480
+ style: "solid",
29481
+ // 関係の種類から端の形を決める (cdl#574)。 書いた形が勝つ
29482
+ head: r.head ?? CLASS_RELATION_HEAD[r.type]
29474
29483
  // CAR-531 SSOT ... 旧実装は `labelOffsetY: currentIdx % 2 === 0 ? -60 : 60` で
29475
29484
  // 複数 relation label の path 沿い集中を強制分散していた。 CAR-430 で導入した
29476
29485
  // engine 側 fan offset (FAN_STEP 40 world) が同 from / to 群を自動分散する現在、