@cardenelabs/cdl 0.21.2 → 0.22.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/CHANGELOG.md +20 -1
- package/dist/index.cjs +59 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +59 -17
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +59 -17
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +59 -17
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/src/kinds/actor.tsx +15 -6
- package/src/kinds/card.tsx +15 -4
- package/src/kinds/event.tsx +13 -4
- package/src/kinds/function.tsx +13 -4
- package/src/kinds/generic.tsx +15 -3
- package/src/layout/spec.ts +26 -0
package/dist/index.js
CHANGED
|
@@ -12036,6 +12036,13 @@ var CLOUD_ART_CENTER_RISE = (() => {
|
|
|
12036
12036
|
const \u4E0B = Math.max(...CLOUD_CIRCLES.map((c) => c.cy + c.r));
|
|
12037
12037
|
return -(\u4E0A + \u4E0B) / 2;
|
|
12038
12038
|
})();
|
|
12039
|
+
function \u4F59\u308A\u3092\u5206\u3051\u308B(kind, \u6E80\u8F09h, \u5B9F\u969B\u306Eh, \u4E2D\u8EAB) {
|
|
12040
|
+
if (!\u6BB5\u3092\u7A4D\u3080\u7BB1\u304B(kind, \u4E2D\u8EAB.hasRows)) return 0;
|
|
12041
|
+
if (\u4E2D\u8EAB.hasValue) return 0;
|
|
12042
|
+
const \u8981\u308B\u9AD8\u3055 = \u4E2D\u8EAB\u304B\u3089\u51FA\u3059\u9AD8\u3055(kind, \u6E80\u8F09h, \u4E2D\u8EAB);
|
|
12043
|
+
const \u4F59\u308A = \u5B9F\u969B\u306Eh - \u8981\u308B\u9AD8\u3055;
|
|
12044
|
+
return \u4F59\u308A > 0 ? Math.round(\u4F59\u308A / 2) : 0;
|
|
12045
|
+
}
|
|
12039
12046
|
|
|
12040
12047
|
// src/layout/footer-shape.ts
|
|
12041
12048
|
var SHAPE_DRAW_UP_EXTENT = {
|
|
@@ -21715,7 +21722,14 @@ function ActorNode({ node, active, value }) {
|
|
|
21715
21722
|
const x = node.cx - node.w / 2;
|
|
21716
21723
|
const y = node.cy - node.h / 2;
|
|
21717
21724
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("actor");
|
|
21718
|
-
const \
|
|
21725
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("actor", NODE_SIZE.actor.h, node.h, {
|
|
21726
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
21727
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
21728
|
+
hasValue: Boolean(value),
|
|
21729
|
+
hasRows: false
|
|
21730
|
+
});
|
|
21731
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
21732
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 86 - \u305A\u3089\u3057, size: 32 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
21719
21733
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x} ${y})`, children: [
|
|
21720
21734
|
/* @__PURE__ */ jsx(
|
|
21721
21735
|
"rect",
|
|
@@ -21731,7 +21745,7 @@ function ActorNode({ node, active, value }) {
|
|
|
21731
21745
|
strokeWidth: active ? 3 : 1.25
|
|
21732
21746
|
}
|
|
21733
21747
|
),
|
|
21734
|
-
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21748
|
+
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21735
21749
|
/* @__PURE__ */ jsx(
|
|
21736
21750
|
"text",
|
|
21737
21751
|
{
|
|
@@ -21750,13 +21764,13 @@ function ActorNode({ node, active, value }) {
|
|
|
21750
21764
|
{
|
|
21751
21765
|
"data-cdl-role": "node-row-divider",
|
|
21752
21766
|
x1: 26,
|
|
21753
|
-
y1: 110 - \
|
|
21767
|
+
y1: 110 - \u305A\u3089\u3057,
|
|
21754
21768
|
x2: node.w - 26,
|
|
21755
|
-
y2: 110 - \
|
|
21769
|
+
y2: 110 - \u305A\u3089\u3057,
|
|
21756
21770
|
stroke: "var(--cdl-row-divider, #7e848e)"
|
|
21757
21771
|
}
|
|
21758
21772
|
),
|
|
21759
|
-
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 140 - \
|
|
21773
|
+
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 140 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle }),
|
|
21760
21774
|
value && /* @__PURE__ */ jsx(
|
|
21761
21775
|
"text",
|
|
21762
21776
|
{
|
|
@@ -21782,7 +21796,14 @@ function CardNode({ node, active }) {
|
|
|
21782
21796
|
const compact = isCompactBox(node.h);
|
|
21783
21797
|
const \u5C0F\u578B\u306B\u547C\u3073\u540D = compact && Boolean(node.subtitle);
|
|
21784
21798
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("card");
|
|
21785
|
-
const
|
|
21799
|
+
const \u4F59\u308A = compact ? 0 : \u4F59\u308A\u3092\u5206\u3051\u308B("card", NODE_SIZE.card.h, node.h, {
|
|
21800
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
21801
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
21802
|
+
hasValue: false,
|
|
21803
|
+
hasRows: false
|
|
21804
|
+
});
|
|
21805
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
21806
|
+
const titleY = compact ? \u5C0F\u578B\u306B\u547C\u3073\u540D ? node.h / 2 - 2 : node.h / 2 + 8 : 86 - \u305A\u3089\u3057;
|
|
21786
21807
|
const titleX = compact ? node.w / 2 : 26;
|
|
21787
21808
|
const paddingX = compact ? 16 : 52;
|
|
21788
21809
|
const availableW = node.w - paddingX;
|
|
@@ -21805,7 +21826,7 @@ function CardNode({ node, active }) {
|
|
|
21805
21826
|
strokeWidth: active ? 3 : 1.25
|
|
21806
21827
|
}
|
|
21807
21828
|
),
|
|
21808
|
-
!compact && node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21829
|
+
!compact && node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
21809
21830
|
/* @__PURE__ */ jsx(
|
|
21810
21831
|
"text",
|
|
21811
21832
|
{
|
|
@@ -21819,7 +21840,7 @@ function CardNode({ node, active }) {
|
|
|
21819
21840
|
children: node.title
|
|
21820
21841
|
}
|
|
21821
21842
|
),
|
|
21822
|
-
!compact && node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 124 - \
|
|
21843
|
+
!compact && node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 124 - \u305A\u3089\u3057, fontSize: subtitleSize, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle }),
|
|
21823
21844
|
\u5C0F\u578B\u306B\u547C\u3073\u540D && /* @__PURE__ */ jsx(
|
|
21824
21845
|
"text",
|
|
21825
21846
|
{
|
|
@@ -22084,7 +22105,14 @@ function EventNode({
|
|
|
22084
22105
|
const x = node.cx - node.w / 2;
|
|
22085
22106
|
const y = node.cy - node.h / 2;
|
|
22086
22107
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("event");
|
|
22087
|
-
const \
|
|
22108
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("event", NODE_SIZE.event.h, node.h, {
|
|
22109
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22110
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22111
|
+
hasValue: false,
|
|
22112
|
+
hasRows: false
|
|
22113
|
+
});
|
|
22114
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22115
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 88 - \u305A\u3089\u3057, size: 26 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
22088
22116
|
const scale = active ? 0.78 + 0.22 * progress : 0.92;
|
|
22089
22117
|
const opacity = active ? 0.5 + 0.5 * progress : 0.65;
|
|
22090
22118
|
return /* @__PURE__ */ jsx(
|
|
@@ -22107,7 +22135,7 @@ function EventNode({
|
|
|
22107
22135
|
strokeWidth: active ? 3 : 1.25
|
|
22108
22136
|
}
|
|
22109
22137
|
),
|
|
22110
|
-
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22138
|
+
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22111
22139
|
/* @__PURE__ */ jsx(
|
|
22112
22140
|
"text",
|
|
22113
22141
|
{
|
|
@@ -22126,7 +22154,7 @@ function EventNode({
|
|
|
22126
22154
|
"text",
|
|
22127
22155
|
{
|
|
22128
22156
|
x: 26,
|
|
22129
|
-
y: 128 - \
|
|
22157
|
+
y: 128 - \u305A\u3089\u3057,
|
|
22130
22158
|
fontSize: 21,
|
|
22131
22159
|
fill: "var(--cdl-text-dim, #5a6270)",
|
|
22132
22160
|
style: { fontFamily: "'JetBrains Mono', monospace" },
|
|
@@ -22143,7 +22171,14 @@ function FunctionNode({ node, active }) {
|
|
|
22143
22171
|
const x = node.cx - node.w / 2;
|
|
22144
22172
|
const y = node.cy - node.h / 2;
|
|
22145
22173
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052("function");
|
|
22146
|
-
const \
|
|
22174
|
+
const \u4F59\u308A = \u4F59\u308A\u3092\u5206\u3051\u308B("function", NODE_SIZE.function.h, node.h, {
|
|
22175
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22176
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22177
|
+
hasValue: false,
|
|
22178
|
+
hasRows: false
|
|
22179
|
+
});
|
|
22180
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22181
|
+
const \u540D\u524D = titlePlacement(node, { x: 26, y: 86 - \u305A\u3089\u3057, size: 24 }, { hasEyebrow: Boolean(node.eyebrow) });
|
|
22147
22182
|
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x} ${y})`, children: [
|
|
22148
22183
|
/* @__PURE__ */ jsx(
|
|
22149
22184
|
"rect",
|
|
@@ -22160,7 +22195,7 @@ function FunctionNode({ node, active }) {
|
|
|
22160
22195
|
strokeOpacity: active ? 1 : 0.5
|
|
22161
22196
|
}
|
|
22162
22197
|
),
|
|
22163
|
-
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22198
|
+
node.eyebrow && /* @__PURE__ */ jsx("text", { x: 26, y: 38 - \u4F59\u308A, fontSize: 18, fontWeight: 700, letterSpacing: 2, fill: accent, children: node.eyebrow }),
|
|
22164
22199
|
/* @__PURE__ */ jsx(
|
|
22165
22200
|
"text",
|
|
22166
22201
|
{
|
|
@@ -22175,7 +22210,7 @@ function FunctionNode({ node, active }) {
|
|
|
22175
22210
|
children: node.title
|
|
22176
22211
|
}
|
|
22177
22212
|
),
|
|
22178
|
-
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 126 - \
|
|
22213
|
+
node.subtitle && /* @__PURE__ */ jsx("text", { x: 26, y: 126 - \u305A\u3089\u3057, fontSize: 20, fill: "var(--cdl-text-dim, #5a6270)", children: node.subtitle })
|
|
22179
22214
|
] });
|
|
22180
22215
|
}
|
|
22181
22216
|
var ROW_GLYPH_HALF = 7;
|
|
@@ -22558,10 +22593,17 @@ function GenericNode({
|
|
|
22558
22593
|
const textX = centered ? w / 2 : 20;
|
|
22559
22594
|
const cylinderShift = genericTextShift(node.kind);
|
|
22560
22595
|
const \u7E70\u308A\u4E0A\u3052 = node.eyebrow || centered ? 0 : \u76EE\u5370\u306A\u3057\u306E\u7E70\u308A\u4E0A\u3052(node.kind, hasRows);
|
|
22596
|
+
const \u4F59\u308A = centered ? 0 : \u4F59\u308A\u3092\u5206\u3051\u308B(node.kind, NODE_SIZE[node.kind]?.h ?? h, h, {
|
|
22597
|
+
hasEyebrow: Boolean(node.eyebrow),
|
|
22598
|
+
hasSubtitle: Boolean(node.subtitle),
|
|
22599
|
+
hasValue: Boolean(resolvedValue),
|
|
22600
|
+
hasRows
|
|
22601
|
+
});
|
|
22602
|
+
const \u305A\u3089\u3057 = \u7E70\u308A\u4E0A\u3052 - \u4F59\u308A;
|
|
22561
22603
|
const \u7D75\u306E\u82AF = centered && STYLES[node.kind]?.shape === "cloud" ? h * CLOUD_ART_CENTER_RISE : 0;
|
|
22562
|
-
const eyebrowY = centered ? h / 2 - 26 - \u7D75\u306E\u82AF : 32 + cylinderShift;
|
|
22563
|
-
const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \
|
|
22564
|
-
const subtitleY = centered ? h / 2 + 28 - \u7D75\u306E\u82AF : 96 + cylinderShift - \
|
|
22604
|
+
const eyebrowY = centered ? h / 2 - 26 - \u7D75\u306E\u82AF : 32 + cylinderShift + \u4F59\u308A;
|
|
22605
|
+
const titleY = genericTitleBaselineY(node.kind, h, hasRows) - \u305A\u3089\u3057 - \u7D75\u306E\u82AF;
|
|
22606
|
+
const subtitleY = centered ? h / 2 + 28 - \u7D75\u306E\u82AF : 96 + cylinderShift - \u305A\u3089\u3057;
|
|
22565
22607
|
const iconX = centered ? w / 2 + 40 : w - 48;
|
|
22566
22608
|
const iconY = centered ? h / 2 - 44 - \u7D75\u306E\u82AF : 18 + cylinderShift;
|
|
22567
22609
|
const dominantBaseline = centered ? "middle" : void 0;
|