@cardenelabs/cdl 0.24.0 → 0.26.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,
@@ -10255,6 +10267,7 @@ var ROW_GLYPH_CX = ROW_PAD_X_PX + ROW_GLYPH_HALF + 1;
10255
10267
  var ROW_GLYPH_LEAD = 40;
10256
10268
  var ROW_TYPE_FONT = 22;
10257
10269
  var SUBTITLE_BASELINE = 118;
10270
+ var STRIPE_MIN_ROWS = 2;
10258
10271
  var SUBTITLE_FONT = 20;
10259
10272
  var UNDERLINE_DROP = 7;
10260
10273
  function RowGlyph({ mark, x, y, color }) {
@@ -10312,6 +10325,25 @@ function StorageNode({
10312
10325
  strokeWidth: active ? 3 : 1.25
10313
10326
  }
10314
10327
  ),
10328
+ node.rowStripe && rows.length >= STRIPE_MIN_ROWS && rows.map((_, idx) => {
10329
+ if (idx % 2 !== 0) return null;
10330
+ const \u5E2F = rowStripeBand("storage", idx, \u884C\u306E\u4E0B\u3052);
10331
+ if (!\u5E2F) return null;
10332
+ if (\u5E2F.y + \u5E2F.h > node.h) return null;
10333
+ return /* @__PURE__ */ jsx(
10334
+ "rect",
10335
+ {
10336
+ "data-cdl-role": "node-row-stripe",
10337
+ "data-cdl-row-index": idx,
10338
+ x: 1,
10339
+ y: \u5E2F.y,
10340
+ width: node.w - 2,
10341
+ height: \u5E2F.h,
10342
+ fill: "var(--cdl-row-stripe, var(--cdl-label-bg, #f3f4f6))"
10343
+ },
10344
+ `stripe-${idx}`
10345
+ );
10346
+ }),
10315
10347
  node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
10316
10348
  \u5370\u3067\u5206\u3051\u308B && node.subtitle && // 呼び名は **印で分ける箱でだけ** 出す (#578)。 従来の箱は題の下に区切り線が来るので
10317
10349
  // 置き場が無い
@@ -17159,6 +17191,7 @@ function CdlStage({
17159
17191
  "aria-label": buildDiagramAltText(laid.topic, currentPhase),
17160
17192
  "data-cdl-stage": "",
17161
17193
  "data-cdl-scale": diagramScale === 1 ? void 0 : diagramScale,
17194
+ "data-cdl-palette": laid.palette,
17162
17195
  children: [
17163
17196
  /* @__PURE__ */ jsxs("defs", { children: [
17164
17197
  Object.entries(TONE).flatMap(