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