@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/index.js CHANGED
@@ -14594,20 +14594,21 @@ function fitLabel(band, block, pos) {
14594
14594
  };
14595
14595
  }
14596
14596
  function fitArt(region, extent, art) {
14597
+ const \u7D44\u3080 = (k) => typeof art === "function" ? art(k) : art;
14597
14598
  const \u7E26 = extent.\u4E0A + extent.\u4E0B;
14598
14599
  const \u6A2A = extent.\u5DE6 + extent.\u53F3;
14599
- if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return art;
14600
+ if (!Number.isFinite(\u7E26) || !Number.isFinite(\u6A2A) || \u7E26 <= 0 || \u6A2A <= 0) return \u7D44\u3080(1);
14600
14601
  if (!Number.isFinite(region.availH) || !Number.isFinite(region.availW) || region.availH <= 0 || region.availW <= 0) {
14601
- return art;
14602
+ return \u7D44\u3080(1);
14602
14603
  }
14603
14604
  const s = Math.min(1, region.availH / \u7E26, region.availW / \u6A2A);
14604
- if (!Number.isFinite(s) || s <= 0) return art;
14605
+ if (!Number.isFinite(s) || s <= 0) return \u7D44\u3080(1);
14605
14606
  const \u7D75cx = region.cx + (extent.\u53F3 - extent.\u5DE6) / 2;
14606
14607
  const \u7D75cy = region.cy + (extent.\u4E0B - extent.\u4E0A) / 2;
14607
14608
  const dx = region.cx - s * \u7D75cx;
14608
14609
  const dy = region.cy - s * \u7D75cy;
14609
- if (s >= 1 && dx === 0 && dy === 0) return art;
14610
- return /* @__PURE__ */ jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: art });
14610
+ if (s >= 1 && dx === 0 && dy === 0) return \u7D44\u3080(1);
14611
+ return /* @__PURE__ */ jsx("g", { transform: `translate(${dx} ${dy}) scale(${s})`, children: \u7D44\u3080(s) });
14611
14612
  }
14612
14613
 
14613
14614
  // src/render/tone.ts
@@ -29841,6 +29842,20 @@ var SMART_CONTRACT_W = 220;
29841
29842
  var SMART_CONTRACT_H = 220;
29842
29843
  var BLOCK_W = 240;
29843
29844
  var BLOCK_H = 220;
29845
+ var \u898B\u51FA\u3057\u306E\u5B57 = 13;
29846
+ var \u540D\u306E\u5B57 = 10.5;
29847
+ var \u5024\u306E\u5B57 = 11;
29848
+ var \u884C\u306E\u9593\u9694 = 22;
29849
+ var \u898B\u51FA\u3057\u306E\u5E2F = 32;
29850
+ var \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 = 0.8;
29851
+ function \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(k) {
29852
+ const \u623B\u3057 = Number.isFinite(k) && k > 0 ? 1 / k : 1;
29853
+ const \u4E0A\u9650 = Math.min(
29854
+ \u884C\u306E\u9593\u9694 * \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u5024\u306E\u5B57,
29855
+ \u898B\u51FA\u3057\u306E\u5E2F * \u5E2F\u306B\u5BFE\u3059\u308B\u4E0A\u9650 / \u898B\u51FA\u3057\u306E\u5B57
29856
+ );
29857
+ return Math.max(1, Math.min(\u623B\u3057, \u4E0A\u9650));
29858
+ }
29844
29859
  var BLOCK_SHADOW = 6;
29845
29860
  var NFT_W = 220;
29846
29861
  var NFT_H = 240;
@@ -30016,23 +30031,29 @@ function ShapeBlockchainBlockNode({ node, active, lang }) {
30016
30031
  };
30017
30032
  });
30018
30033
  const \u898B\u51FA\u3057\u306E\u5E45 = bw - 14 - 30;
30019
- const art = /* @__PURE__ */ jsxs("g", { children: [
30020
- /* @__PURE__ */ jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
30021
- /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
30022
- /* @__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" }),
30023
- /* @__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) }),
30024
- /* @__PURE__ */ jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
30025
- fields.map((f, i) => /* @__PURE__ */ jsxs("g", { children: [
30026
- /* @__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 }),
30027
- /* @__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) }),
30028
- /* @__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 })
30029
- ] }, i)),
30030
- /* @__PURE__ */ jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
30031
- /* @__PURE__ */ jsx("rect", { x: 0, y: 0, width: 22, height: 18, rx: 3, fill: "none", stroke: frame.stroke, strokeWidth: 1.5 }),
30032
- /* @__PURE__ */ jsx("line", { x1: 22, y1: 9, x2: 42, y2: 9, stroke: frame.stroke, strokeWidth: 1.5 }),
30033
- /* @__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 })
30034
- ] })
30035
- ] });
30034
+ const art = (\u500D\u7387) => {
30035
+ const \u500D = \u6253\u3061\u6D88\u3057\u306E\u500D\u7387(\u500D\u7387);
30036
+ const \u984C\u306E\u5927\u304D\u3055 = \u898B\u51FA\u3057\u306E\u5B57 * \u500D;
30037
+ const \u540D\u306E\u5927\u304D\u3055 = \u540D\u306E\u5B57 * \u500D;
30038
+ const \u5024\u306E\u5927\u304D\u3055 = \u5024\u306E\u5B57 * \u500D;
30039
+ return /* @__PURE__ */ jsxs("g", { children: [
30040
+ /* @__PURE__ */ jsx("rect", { x: x + 6, y: y + 6, width: bw, height: bh, rx: 8, fill: frame.stroke, opacity: 0.2, stroke: "none" }),
30041
+ /* @__PURE__ */ jsx("rect", { "data-cdl-role": "node-body", x, y, width: bw, height: bh, rx: 8, ...frame }),
30042
+ /* @__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" }),
30043
+ /* @__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) }),
30044
+ /* @__PURE__ */ jsx("circle", { cx: x + bw - 16, cy: y + 16, r: 5.5, fill: "#7cd88f", stroke: "#ffffff", strokeWidth: 1.5 }),
30045
+ fields.map((f, i) => /* @__PURE__ */ jsxs("g", { children: [
30046
+ /* @__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 }),
30047
+ /* @__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) }),
30048
+ /* @__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 })
30049
+ ] }, i)),
30050
+ /* @__PURE__ */ jsxs("g", { transform: `translate(${cx - 32}, ${y + bh - 26})`, children: [
30051
+ /* @__PURE__ */ jsx("rect", { x: 0, y: 0, width: 22, height: 18, rx: 3, fill: "none", stroke: frame.stroke, strokeWidth: 1.5 }),
30052
+ /* @__PURE__ */ jsx("line", { x1: 22, y1: 9, x2: 42, y2: 9, stroke: frame.stroke, strokeWidth: 1.5 }),
30053
+ /* @__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 })
30054
+ ] })
30055
+ ] });
30056
+ };
30036
30057
  return /* @__PURE__ */ jsx("g", { children: fitArt(r, blockchainBlockExtent(frame.strokeWidth), art) });
30037
30058
  }
30038
30059
  function ShapeBlockchainNode({ node, active }) {
@@ -33666,7 +33687,7 @@ function flowchart(preset) {
33666
33687
  label,
33667
33688
  tone: e.tone ?? tone,
33668
33689
  style: "solid",
33669
- overlay: isConditionLabel
33690
+ overlay: isConditionLabel && !\u7E26\u306B\u7A4D\u3080
33670
33691
  });
33671
33692
  phaseActivate.push(edgeId);
33672
33693
  return api;