@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.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { n as CdlDiagramView, j as CdlDiagramViewProps } from './render-
|
|
2
|
+
export { n as CdlDiagramView, j as CdlDiagramViewProps } from './render-B5JHcUrb.cjs';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { n as CdlDiagramView, j as CdlDiagramViewProps } from './render-
|
|
2
|
+
export { n as CdlDiagramView, j as CdlDiagramViewProps } from './render-B5JHcUrb.js';
|
package/dist/react.js
CHANGED
|
@@ -4857,6 +4857,7 @@ function payloadTexts(node) {
|
|
|
4857
4857
|
}
|
|
4858
4858
|
if (node.mindData) {
|
|
4859
4859
|
\u8DB3\u3059(node.mindData.rootTitle);
|
|
4860
|
+
\u8DB3\u3059(node.mindData.rootSubtitle);
|
|
4860
4861
|
for (const b of node.mindData.branches) {
|
|
4861
4862
|
\u8DB3\u3059(b.title);
|
|
4862
4863
|
\u8DB3\u3059(b.subtitle);
|
|
@@ -6575,9 +6576,10 @@ function resolveTreeData(nodes, values) {
|
|
|
6575
6576
|
});
|
|
6576
6577
|
}
|
|
6577
6578
|
function resolveMindData(data, values) {
|
|
6578
|
-
const \u8AAD\u3080 = data.rootTitle.includes("{") || data.branches.some((b) => b.title.includes("{") || (b.subtitle?.includes("{") ?? false));
|
|
6579
|
+
const \u8AAD\u3080 = data.rootTitle.includes("{") || (data.rootSubtitle?.includes("{") ?? false) || data.branches.some((b) => b.title.includes("{") || (b.subtitle?.includes("{") ?? false));
|
|
6579
6580
|
if (!\u8AAD\u3080) return data;
|
|
6580
6581
|
const root = resolveBoundText(data.rootTitle, values);
|
|
6582
|
+
const rootSubtitle = data.rootSubtitle === void 0 ? void 0 : resolveBoundText(data.rootSubtitle, values);
|
|
6581
6583
|
const branches = data.branches.map((b) => {
|
|
6582
6584
|
const title = resolveBoundText(b.title, values);
|
|
6583
6585
|
const subtitle = b.subtitle === void 0 ? void 0 : resolveBoundText(b.subtitle, values);
|
|
@@ -6588,8 +6590,13 @@ function resolveMindData(data, values) {
|
|
|
6588
6590
|
};
|
|
6589
6591
|
return title.ok && (subtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C2 : { ...\u89E3\u6C7A\u5F8C2, unresolved: true };
|
|
6590
6592
|
});
|
|
6591
|
-
const \u89E3\u6C7A\u5F8C = {
|
|
6592
|
-
|
|
6593
|
+
const \u89E3\u6C7A\u5F8C = {
|
|
6594
|
+
...data,
|
|
6595
|
+
rootTitle: root.value,
|
|
6596
|
+
...rootSubtitle ? { rootSubtitle: rootSubtitle.value } : {},
|
|
6597
|
+
branches
|
|
6598
|
+
};
|
|
6599
|
+
return root.ok && (rootSubtitle?.ok ?? true) ? \u89E3\u6C7A\u5F8C : { ...\u89E3\u6C7A\u5F8C, unresolved: true };
|
|
6593
6600
|
}
|
|
6594
6601
|
|
|
6595
6602
|
// src/kinds/draw-progress.ts
|
|
@@ -7463,6 +7470,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
|
|
|
7463
7470
|
nodes.push({
|
|
7464
7471
|
id: mindData.rootId,
|
|
7465
7472
|
title: mindData.rootTitle,
|
|
7473
|
+
// 中心も枝と同じく 2 行に積める (#530)。 高さ 52 に 15px + 9px の 2 行が入る
|
|
7474
|
+
...mindData.rootSubtitle === void 0 ? {} : { subtitle: mindData.rootSubtitle },
|
|
7466
7475
|
x: cx,
|
|
7467
7476
|
y: cy,
|
|
7468
7477
|
w: rootW,
|