s.type === 'topbar'); if (topbarSection) { topbarSection.config.background_color = $event.detail.topbarBackgroundColor; topbarSection.config.custom_background_color = $event.detail.topbarCustomBackgroundColor; topbarSection.config.logo_type = $event.detail.logoType; topbarSection.config.logo_text = $event.detail.logoText; topbarSection.config.logo_url = $event.detail.logoUrl; topbarSection.config.margin_top = $event.detail.topbarMarginTop; topbarSection.config.margin_bottom = $event.detail.topbarMarginBottom; topbarSection.config.button_phone = $event.detail.topbarButtonPhone; topbarSection.config.button_style = $event.detail.topbarButtonStyle; console.log('Topbar section updated:', topbarSection); }"
@hero-changed.window="const heroSection = sections.find(s => s.id === $event.detail.sectionId); if (heroSection) { heroSection.config.title = $event.detail.heroTitle; heroSection.config.subtitle = $event.detail.heroSubtitle; heroSection.config.button_text = $event.detail.heroButtonText; heroSection.config.button_url = $event.detail.heroButtonUrl; heroSection.config.button_style = $event.detail.heroButtonStyle; heroSection.config.image_url = $event.detail.heroImageUrl; heroSection.config.gradient_from_color = $event.detail.heroGradientFromColor; heroSection.config.gradient_from_shade = $event.detail.heroGradientFromShade; heroSection.config.gradient_to_color = $event.detail.heroGradientToColor; heroSection.config.gradient_to_shade = $event.detail.heroGradientToShade; heroSection.config.show_form = $event.detail.heroShowForm; }"
@testimonials-changed.window="showTestimonials = $event.detail.showTestimonials; testimonialsTitle = $event.detail.testimonialsTitle; testimonialsLayout = $event.detail.testimonialsLayout; testimonialsItemsPerLine = $event.detail.testimonialsItemsPerLine; testimonialsPosition = $event.detail.testimonialsPosition; testimonials = $event.detail.testimonials || []; console.log('Testimonials changed:', testimonials);"
@faqs-changed.window="showFaqs = $event.detail.showFaqs; faqsTitle = $event.detail.faqsTitle; faqsLayout = $event.detail.faqsLayout; faqsPosition = $event.detail.faqsPosition; faqs = $event.detail.faqs || []; console.log('FAQs changed:', faqs);"
@sections-updated.window="sections = $event.detail.sections; console.log('Sections updated:', sections); $nextTick(() => { window.dispatchEvent(new Event('resize')); });"
@sections-reordered.window="sections = $event.detail.sections; const debugForm = sections.find(s => s.type === 'form' && !s.config?.hidden); console.log('Sections reordered:', sections); console.log('Form section steps:', debugForm?.config?.steps?.length); console.log('Current step should stay at:', $data.currentStep || 'no currentStep in main');"
x-on:section-config-updated.window="const sec = sections.find(s => s.id === $event.detail.sectionId); if (sec) { Object.assign(sec.config, $event.detail.config); }">
s.type === 'form' && !s.config?.hidden); currentStep = 0"
@translations-applied.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
@sections-reordered.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
x-on:section-config-updated.window="$nextTick(() => { formSection = sections.find(s => s.type === 'form' && !s.config?.hidden); if (formSection && formSection.config.steps && currentStep >= formSection.config.steps.length) { currentStep = Math.max(0, formSection.config.steps.length - 1); } })"
class="mt-8">
s.type === 'form' && !s.config?.hidden); currentStep = 0"
@translations-applied.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
@sections-reordered.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
x-on:section-config-updated.window="$nextTick(() => { formSection = sections.find(s => s.type === 'form' && !s.config?.hidden); if (formSection && formSection.config.steps && currentStep >= formSection.config.steps.length) { currentStep = Math.max(0, formSection.config.steps.length - 1); } })">
s.type === 'form' && !s.config?.hidden); currentStep = 0"
@translations-applied.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
@sections-reordered.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
x-on:section-config-updated.window="$nextTick(() => { formSection = sections.find(s => s.type === 'form' && !s.config?.hidden); if (formSection && formSection.config.steps && currentStep >= formSection.config.steps.length) { currentStep = Math.max(0, formSection.config.steps.length - 1); } })"
class="mt-8">
s.type === 'form' && !s.config?.hidden); currentStep = 0"
@translations-applied.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
@sections-reordered.window="formSection = sections.find(s => s.type === 'form' && !s.config?.hidden)"
x-on:section-config-updated.window="$nextTick(() => { formSection = sections.find(s => s.type === 'form' && !s.config?.hidden); if (formSection && formSection.config.steps && currentStep >= formSection.config.steps.length) { currentStep = Math.max(0, formSection.config.steps.length - 1); } })">