@cardenelabs/cdl 0.112.0 → 0.113.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
@@ -5198,7 +5198,15 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5198
5198
  const preferredSubDx = subBranchW + 20;
5199
5199
  const reserve = maxSubDepth > 0 ? branchW / 2 + maxSubDepth * preferredSubDx : 0;
5200
5200
  const maxLayer1XOffset = Math.max(minLayer1XOffset, canvasW / 2 - reserve);
5201
- const layer1XOffset = Math.max(minLayer1XOffset, Math.min(canvasW * 0.32, maxLayer1XOffset));
5201
+ const \u8449\u306E\u540D\u524D\u306E\u6700\u5927\u5E45 = Math.max(
5202
+ 0,
5203
+ ...firstLevel.filter((br) => (childrenOf.get(br.id) ?? []).length === 0).map((br) => {
5204
+ const \u540D\u524D = \u653E\u5C04\u306E\u884C({ title: br.title, isRoot: false })[0];
5205
+ return measureTextWidth(\u540D\u524D.text, { fontSize: \u540D\u524D.fontSize});
5206
+ })
5207
+ );
5208
+ const \u540D\u524D\u3067\u6C7A\u307E\u308B\u4E0A\u9650 = canvasW / 2 + branchW / 2 - \u8449\u306E\u540D\u524D\u306E\u6700\u5927\u5E45;
5209
+ const layer1XOffset = Math.max(minLayer1XOffset, Math.min(\u540D\u524D\u3067\u6C7A\u307E\u308B\u4E0A\u9650, maxLayer1XOffset));
5202
5210
  const room = canvasW / 2 - layer1XOffset;
5203
5211
  const MIN_SUB_W = 56;
5204
5212
  const PREFERRED_GAP = MIND_BOX_GAP;
@@ -5296,7 +5304,8 @@ function computeMindMapLayout(mindData, cx, cy, canvasW, canvasH) {
5296
5304
  let maxExtentX = rootW / 2;
5297
5305
  let maxExtentY = rootH / 2;
5298
5306
  for (const n of nodes) {
5299
- maxExtentX = Math.max(maxExtentX, Math.abs(n.x - cx) + n.w / 2);
5307
+ const [\u5DE6, \u53F3] = \u63CF\u304F\u6A2A\u306E\u7AEF(n);
5308
+ maxExtentX = Math.max(maxExtentX, Math.abs(\u5DE6 - cx), Math.abs(\u53F3 - cx));
5300
5309
  maxExtentY = Math.max(maxExtentY, Math.abs(n.y - cy) + n.h / 2);
5301
5310
  }
5302
5311
  const scale = Math.min(1, drawableHalfW / maxExtentX, drawableHalfH / maxExtentY);