|
|
|
|
@ -2225,13 +2225,19 @@ HTML = """<!doctype html>
|
|
|
|
|
function configTemplateKey(block) {
|
|
|
|
|
return block.dataset.custom === 'true' ? (block.dataset.template || 'source') : block.dataset.section;
|
|
|
|
|
}
|
|
|
|
|
function canvasViewportFloor(canvas, fallback) {
|
|
|
|
|
if (!canvas) return fallback;
|
|
|
|
|
const top = Math.max(0, canvas.getBoundingClientRect().top);
|
|
|
|
|
return Math.max(fallback, Math.ceil(window.innerHeight - top + 12));
|
|
|
|
|
}
|
|
|
|
|
function updateConfigCanvasHeight() {
|
|
|
|
|
if (!configCanvas) return;
|
|
|
|
|
const bottom = configBlocks.reduce((value, block) => {
|
|
|
|
|
if (configBlockState(block)) return value;
|
|
|
|
|
return Math.max(value, (block.offsetTop || 0) + block.offsetHeight);
|
|
|
|
|
}, 0);
|
|
|
|
|
configCanvas.style.minHeight = `${Math.max(window.innerWidth <= 760 ? 900 : 760, bottom + 28)}px`;
|
|
|
|
|
const floor = canvasViewportFloor(configCanvas, window.innerWidth <= 760 ? 900 : 760);
|
|
|
|
|
configCanvas.style.minHeight = `${Math.max(floor, bottom + 28)}px`;
|
|
|
|
|
}
|
|
|
|
|
function fitConfigBlockContent(block) {
|
|
|
|
|
if (!block || configBlockState(block) || block._configManualHeight) return false;
|
|
|
|
|
@ -3048,7 +3054,8 @@ HTML = """<!doctype html>
|
|
|
|
|
function updateNetworkCanvasHeight() {
|
|
|
|
|
if (!networkCanvas) return;
|
|
|
|
|
const bottom = networkBlocks.reduce((value, block) => networkState(block) ? value : Math.max(value, (block.offsetTop || 0) + block.offsetHeight), 0);
|
|
|
|
|
networkCanvas.style.minHeight = `${Math.max(window.innerWidth <= 760 ? 900 : 720, bottom + 28)}px`;
|
|
|
|
|
const floor = canvasViewportFloor(networkCanvas, window.innerWidth <= 760 ? 900 : 720);
|
|
|
|
|
networkCanvas.style.minHeight = `${Math.max(floor, bottom + 28)}px`;
|
|
|
|
|
}
|
|
|
|
|
function applyNetworkLayout() {
|
|
|
|
|
if (!networkCanvas) return;
|
|
|
|
|
|