diff --git a/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue b/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue index aa578e5..c37c5cb 100644 --- a/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue +++ b/apps/ops/src/modules/campaigns/pages/TemplateEditorPage.vue @@ -30,14 +30,20 @@ - + layers/structure panel, design tokens, etc. + Wrapped in an explicit-sized container so the inner iframe gets + enough height/width (Quasar's q-page doesn't propagate dimensions + that easyEditor's nested iframe can pick up automatically). --> +
+ +
@@ -179,22 +185,22 @@ async function loadTemplateIntoEditor (name) { if (!editorReady.value || !editor.value) return try { const data = await getTemplate(name) - // Priority: Unlayer's own design JSON > nothing (start blank) - // (MJML format from the previous editor isn't auto-importable into Unlayer. - // The .html stored from legacy MJML compile is still valid email HTML - // but Unlayer can't ingest arbitrary HTML — the user reconstructs once - // and the design JSON saved by the next "Enregistrer" fixes future loads.) + // Priority: Unlayer design JSON saved by a previous edit > nothing. + // Legacy MJML/HTML templates aren't auto-importable into Unlayer's + // component tree — the user reconstructs visually once, and the + // design saved by the next "Enregistrer" fixes future loads. if (data.design) { const design = typeof data.design === 'string' ? JSON.parse(data.design) : data.design editor.value.loadDesign(design) } else { - // No design yet — load a sensible blank starter so the canvas isn't fully empty - editor.value.loadBlank({ backgroundColor: '#F5FAF7' }) + // No saved design — vue-email-editor 2.x doesn't have a loadBlank() + // method on the ref, so we just let the editor show its default + // empty state ("No content here. Drag content from left.") and + // notify the user to start building. $q.notify({ type: 'info', - message: `Pas encore de design pour "${name}" — canvas vide. ` + - `Construis visuellement puis enregistre pour persister.`, - timeout: 7000, + message: `Pas encore de design pour "${name}" — drag des blocs depuis la sidebar gauche pour construire la template, puis "Enregistrer".`, + timeout: 8000, }) } } catch (e) {