@cardenelabs/cdl 0.12.1 → 0.13.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 +17 -1
- package/dist/index.cjs +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +12 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +12 -3
- package/dist/react.js.map +1 -1
- package/dist/{render-C7FKvMqq.d.cts → render-B5JHcUrb.d.cts} +8 -0
- package/dist/{render-C7FKvMqq.d.ts → render-B5JHcUrb.d.ts} +8 -0
- package/package.json +1 -1
- package/src/kinds/mind-map.tsx +4 -2
- package/src/presets.ts +3 -0
- package/src/render/payload-binding.ts +14 -4
- package/src/render/template-fields.ts +1 -0
- package/src/types.ts +8 -0
package/dist/react.cjs
CHANGED
|
@@ -4859,6 +4859,7 @@ function payloadTexts(node) {
|
|
|
4859
4859
|
}
|
|
4860
4860
|
if (node.mindData) {
|
|
4861
4861
|
\u8DB3\u3059(node.mindData.rootTitle);
|
|
4862
|
+
\u8DB3\u3059(node.mindData.rootSubtitle);
|
|
4862
4863
|
for (const b of node.mindData.branches) {
|
|
4863
4864
|
\u8DB3\u3059(b.title);
|
|
4864
4865
|
\u8DB3\u3059(b.subtitle);
|
|
@@ -6577,9 +6578,10 @@ function resolveTreeData(nodes, values) {
|
|
|
6577
6578
|
});
|
|
6578
6579
|
}
|
|
6579
6580
|
function resolveMindData(data, values) {
|
|
6580
|
-
const \u8AAD\u3080 = data.rootTitle.includes("{") || data.branches.some((b) => b.title.includes("{") || (b.subtitle?.includes("{") ?? false));
|
|
6581
|
+
const \u8AAD\u3080 = data.rootTitle.includes("{") || (data.rootSubtitle?.includes("{") ?? false) || data.branches.some((b) => b.title.includes("{") || (b.subtitle?.includes("{") ?? false));
|
|
6581
6582
|
if (!\u8AAD\u3080) return data;
|
|
6582
6583
|
const root = resolveBoundText(data.rootTitle, values);
|
|
6584
|
+
const rootSubtitle = data.rootSubtitle === void 0 ? void 0 : resolveBoundText(data.rootSubtitle, values);
|
|
6583
6585
|
const branches = data.branches.map((b) => {
|
|
6584
6586
|
const title = resolveBoundText(b.title, values);
|
|
6585
6587
|
const subtitle = b.subtitle === void 0 ? void 0 : resolveBoundText(b.subtitle, values);
|
|
@@ -6590,8 +6592,13 @@ function resolveMindData(data, values) {
|
|
|
6590
6592
|
};
|
|
6591
6593
|
return title.ok && (subtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C2 : { ...\u89E3\u6C7A\u5F8C2, unresolved: true };
|
|
6592
6594
|
});
|
|
6593
|
-
const \u89E3\u6C7A\u5F8C = {
|
|
6594
|
-
|
|
6595
|
+
const \u89E3\u6C7A\u5F8C = {
|
|
6596
|
+
...data,
|
|
6597
|
+
rootTitle: root.value,
|
|
6598
|
+
...rootSubtitle ? { rootSubtitle: rootSubtitle.value } : {},
|
|
6599
|
+
branches
|
|
6600
|
+
};
|
|
6601
|
+
return root.ok && (rootSubtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
6595
6602
|
}
|
|
6596
6603
|
|
|
6597
6604
|
// src/kinds/draw-progress.ts
|
|
@@ -7465,6 +7472,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7465
7472
|
nodes.push({
|
|
7466
7473
|
id: mindData.rootId,
|
|
7467
7474
|
title: mindData.rootTitle,
|
|
7475
|
+
// 中心も枝と同じく 2 行に積める (#530)。 高さ 52 に 15px + 9px の 2 行が入る
|
|
7476
|
+
...mindData.rootSubtitle === void 0 ? {} : { subtitle: mindData.rootSubtitle },
|
|
7468
7477
|
x: cx,
|
|
7469
7478
|
y: cy,
|
|
7470
7479
|
w: rootW,
|