@cardenelabs/cdl 0.71.0 → 0.73.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.cjs CHANGED
@@ -3038,20 +3038,21 @@ function fitLabel(band, block, pos) {
3038
3038
  };
3039
3039
  }
3040
3040
  function fitArt(region, extent, art) {
3041
+ const \u7D44\u3080 = (k) => typeof art === "function" ? art(k) : art;
3041
3042
  const \u7E26 = extent.\u4E0A + extent.\u4E0B;
3042
3043
  const \u6A2A = extent.\u5DE6 + extent.\u53F3;
3043
- if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return art;
3044
+ if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return \u7D44\u3080(1);
3044
3045
  if (!Number.isFinite(region.availH) || !Number.isFinite(region.availW) || region.availH <= 0 || region.availW <= 0) {
3045
- return art;
3046
+ return \u7D44\u3080(1);
3046
3047
  }
3047
3048
  const s = Math.min(1, region.availH / \u7E26, region.availW / \u6A2A);
3048
- if (!Number.isFinite(s) || s <= 0) return art;
3049
+ if (!Number.isFinite(s) || s <= 0) return \u7D44\u3080(1);
3049
3050
  const \u7D75cx = region.cx + (extent.\u53F3 - extent.\u5DE6) / 2;
3050
3051
  const \u7D75cy = region.cy + (extent.\u4E0B - extent.\u4E0A) / 2;
3051
3052
  const dx = region.cx - s * \u7D75cx;
3052
3053
  const dy = region.cy - s * \u7D75cy;
3053
- if (s >= 1 && dx === 0 && dy === 0) return art;
3054
- return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: art });
3054
+ if (s >= 1 && dx === 0 && dy === 0) return \u7D44\u3080(1);
3055
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: \u7D44\u3080(s) });
3055
3056
  }
3056
3057
 
3057
3058
  // src/kinds/compact-title.ts
@@ -17305,6 +17306,20 @@ var SMART_CONTRACT_W = 220;
17305
17306
  var SMART_CONTRACT_H = 220;
17306
17307
  var BLOCK_W = 240;
17307
17308
  var BLOCK_H = 220;
17309
+ var \u898B\u51FA\u3057\u306E\u5B57 = 13;
17310
+ var \u540D\u306E\u5B57 = 10.5;
17311
+ var \u5024\u306E\u5B57 = 11;
17312
+ var \u884C\u306E\u9593\u9694 = 22;
17313
+ var \u898B\u51FA\u3057\u306E\u5E2F = 32;
17314
+ var \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
17315
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(k) {
17316
+ const \u623B\u3057 = Number.isFinite(k) && k > 0 ? 1 / k : 1;
17317
+ const \u4E0A\u9650 = Math.min(
17318
+ \u884C\u306E\u9593\u9694 * \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5024\u306E\u5B57,
17319
+ \u898B\u51FA\u3057\u306E\u5E2F * \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u898B\u51FA\u3057\u306E\u5B57
17320
+ );
17321
+ return Math.max(1, Math.min(\u623B\u3057, \u4E0A\u9650));
17322
+ }
17308
17323
  var BLOCK_SHADOW = 6;
17309
17324
  var NFT_W = 220;
17310
17325
  var NFT_H = 240;
@@ -17480,23 +17495,29 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
17480
17495
  };
17481
17496
  });
17482
17497
  const \u898B\u51FA\u3057\u306E\u5E45 = bw - 14 - 30;
17483
- const art = /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
17484
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
17485
- /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
17486
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
17487
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", x: x + 14, y: y + 22, fontSize: 13, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, 13, \u898B\u51FA\u3057\u306E\u5E45, \u5B57\u306E\u5E45) }),
17488
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
17489
- fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
17490
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: y + 54 + i * 22, fontSize: 10.5, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
17491
- /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, x: x + bw - 14, y: y + 54 + i * 22, fontSize: 11, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(f.value, 11, bw - 28 - \u5B57\u306E\u5E45(f.label, 10.5) - 8, \u5B57\u306E\u5E45) }),
17492
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: x + 14, y1: y + 60 + i * 22, x2: x + bw - 14, y2: y + 60 + i * 22, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
17493
- ] }, i)),
17494
- /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
17495
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: 22, height: 18, rx: 3, fill: "none", stroke: frame.stroke, strokeWidth: 1.5 }),
17496
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 22, y1: 9, x2: 42, y2: 9, stroke: frame.stroke, strokeWidth: 1.5 }),
17497
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 42, y: 0, width: 22, height: 18, rx: 3, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.5, stroke: frame.stroke, strokeWidth: 1.5 })
17498
- ] })
17499
- ] });
17498
+ const art = (\u500D\u7387) => {
17499
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387);
17500
+ const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
17501
+ const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
17502
+ const \u5024\u306E\u5927\u304D\u3055 = \u5024\u306E\u5B57 * \u500D;
17503
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
17504
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
17505
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
17506
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: `M ${x} ${y + 32} L ${x} ${y + 8} Q ${x} ${y}, ${x + 8} ${y} L ${x + bw - 8} ${y} Q ${x + bw} ${y}, ${x + bw} ${y + 8} L ${x + bw} ${y + 32} Z`, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.9, stroke: "none" }),
17507
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": "blockchain-block-title", x: x + 14, y: y + 22, fontSize: \u984C\u306E\u5927\u304D\u3055, fontWeight: 700, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "#ffffff", children: \u5E45\u3067\u5207\u308B(\u898B\u51FA\u3057, \u984C\u306E\u5927\u304D\u3055, \u898B\u51FA\u3057\u306E\u5E45, \u5B57\u306E\u5E45) }),
17508
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
17509
+ fields.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
17510
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: x + 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u540D\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fill: "var(--cdl-text-dim, #5a6270)", children: f.label }),
17511
+ /* @__PURE__ */ jsxRuntime.jsx("text", { "data-cdl-role": `blockchain-block-${f.key}`, x: x + bw - 14, y: y + 54 + i * \u884C\u306E\u9593\u9694, fontSize: \u5024\u306E\u5927\u304D\u3055, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontWeight: 600, textAnchor: "end", fill: "var(--cdl-text, #1a1f2a)", children: \u5E45\u3067\u5207\u308B(f.value, \u5024\u306E\u5927\u304D\u3055, bw - 28 - \u5B57\u306E\u5E45(f.label, \u540D\u306E\u5927\u304D\u3055) - 8, \u5B57\u306E\u5E45) }),
17512
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: x + 14, y1: y + 60 + i * \u884C\u306E\u9593\u9694, x2: x + bw - 14, y2: y + 60 + i * \u884C\u306E\u9593\u9694, stroke: "var(--cdl-divider, #d4d4d8)", strokeWidth: 0.5, opacity: 0.5 })
17513
+ ] }, i)),
17514
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
17515
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 0, width: 22, height: 18, rx: 3, fill: "none", stroke: frame.stroke, strokeWidth: 1.5 }),
17516
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: 22, y1: 9, x2: 42, y2: 9, stroke: frame.stroke, strokeWidth: 1.5 }),
17517
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 42, y: 0, width: 22, height: 18, rx: 3, fill: "var(--cdl-tone-accent, #2d6a8f)", fillOpacity: 0.5, stroke: frame.stroke, strokeWidth: 1.5 })
17518
+ ] })
17519
+ ] });
17520
+ };
17500
17521
  return /* @__PURE__ */ jsxRuntime.jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
17501
17522
  }
17502
17523
  function ShapeBlockchainNode({ node, active }) {