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