Atualização automática: 2026-05-23 20:55:21

This commit is contained in:
Hermes
2026-05-23 20:55:21 +00:00
parent a81e273364
commit 7cfc1724d3
4 changed files with 73 additions and 33 deletions
+17 -5
View File
@@ -312,21 +312,33 @@ async function applyUltraModernRedesign(cloneDir) {
}
// Injetar o CSS de Redesign Ultra-Moderno gerado pela IA no site clonado
let newPreviewUrl = `/api/preview/${cloneDir.split('/').pop()}`;
try {
await fetch('/api/ai/inject-redesign', {
const response = await fetch('/api/ai/inject-redesign', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ cloneDir, appliedStyles, elementsRedesigned })
body: JSON.stringify({
cloneDir,
appliedStyles,
elementsRedesigned,
outputDir: settings.outputDir,
agentName: 'designer'
})
});
const data = await response.json();
if (data.newFolderName) {
newPreviewUrl = `/api/preview/${data.newFolderName}`;
if (agentsState.designer.currentClone) {
agentsState.designer.currentClone.directory = 'cloned-sites/' + data.newFolderName;
}
}
} catch (e) {
console.error("Erro ao injetar CSS de redesign:", e);
}
const previewUrl = `/api/preview/${cloneDir.split('/').pop()}`;
return {
success: true,
previewUrl,
previewUrl: newPreviewUrl,
appliedStyles,
elementsRedesigned
};