@cardenelabs/cdl 0.24.0 → 0.25.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/react.d.cts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-CfXUl0Yz.cjs';
2
+ export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-ViWKnlu1.cjs';
package/dist/react.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import 'react';
2
- export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-CfXUl0Yz.js';
2
+ export { q as CdlDiagramView, m as CdlDiagramViewProps } from './render-ViWKnlu1.js';
package/dist/react.js CHANGED
@@ -627,6 +627,12 @@ function rowBaselineY(kind, index) {
627
627
  if (!rendersRows(kind)) return null;
628
628
  return kind === "storage" ? ROW_TOP_STORAGE + index * ROW_PITCH_STORAGE : ROW_TOP_GENERIC + genericTextShift(kind) + index * ROW_PITCH_GENERIC;
629
629
  }
630
+ function rowStripeBand(kind, index, shift) {
631
+ const baseline = rowBaselineY(kind, index);
632
+ if (baseline === null) return null;
633
+ const pitch = ROW_PITCH_STORAGE ;
634
+ return { y: baseline + shift - pitch / 2, h: pitch };
635
+ }
630
636
  function genericTextShift(kind) {
631
637
  return KINDS_SHAPE_CYLINDER.has(kind ?? "") ? GENERIC_TEXT_SHIFT_CYLINDER : 0;
632
638
  }
@@ -8978,6 +8984,12 @@ function layout(diag) {
8978
8984
  ...diag.derived ? { derived: diag.derived } : {},
8979
8985
  // 矢印をいつ出すか (#582)。 描き手が読む欄なので、そのまま持ち越す
8980
8986
  ...diag.edgeReveal ? { edgeReveal: diag.edgeReveal } : {},
8987
+ // どの配色で描くか (#1553)。 空文字は書かなかった扱いにする = 空の目印を出すと、
8988
+ // 消費側の `[data-cdl-palette]` が配色を書いていない図にも当たる。
8989
+ //
8990
+ // **遮断はここだけに置く**。 描画は必ず組み立てを通り、組み立て API も `er` も
8991
+ // 素通しにしてある。 上流にも置くと、どの入力でも通らない分岐が残る
8992
+ ...diag.palette ? { palette: diag.palette } : {},
8981
8993
  bboxes,
8982
8994
  collisions,
8983
8995
  nearCollisions,
@@ -10312,6 +10324,25 @@ function StorageNode({
10312
10324
  strokeWidth: active ? 3 : 1.25
10313
10325
  }
10314
10326
  ),
10327
+ node.rowStripe && rows.map((_, idx) => {
10328
+ if (idx % 2 !== 0) return null;
10329
+ const \u5E2F = rowStripeBand("storage", idx, \u884C\u306E\u4E0B\u3052);
10330
+ if (!\u5E2F) return null;
10331
+ if (\u5E2F.y + \u5E2F.h > node.h) return null;
10332
+ return /* @__PURE__ */ jsx(
10333
+ "rect",
10334
+ {
10335
+ "data-cdl-role": "node-row-stripe",
10336
+ "data-cdl-row-index": idx,
10337
+ x: 1,
10338
+ y: \u5E2F.y,
10339
+ width: node.w - 2,
10340
+ height: \u5E2F.h,
10341
+ fill: "var(--cdl-row-stripe, var(--cdl-label-bg, #f3f4f6))"
10342
+ },
10343
+ `stripe-${idx}`
10344
+ );
10345
+ }),
10315
10346
  node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
10316
10347
  \u5370\u3067\u5206\u3051\u308B && node.subtitle && // 呼び名は **印で分ける箱でだけ** 出す (#578)。 従来の箱は題の下に区切り線が来るので
10317
10348
  // 置き場が無い
@@ -17159,6 +17190,7 @@ function CdlStage({
17159
17190
  "aria-label": buildDiagramAltText(laid.topic, currentPhase),
17160
17191
  "data-cdl-stage": "",
17161
17192
  "data-cdl-scale": diagramScale === 1 ? void 0 : diagramScale,
17193
+ "data-cdl-palette": laid.palette,
17162
17194
  children: [
17163
17195
  /* @__PURE__ */ jsxs("defs", { children: [
17164
17196
  Object.entries(TONE).flatMap(