/** * Style Customizer v2 — live preview bridge. Owns the `?evf_preview` iframe: tags the form * wrapper, injects the rule template, writes token values as CSS variables, and maps clicks * inside the iframe back to their style section for click-to-edit. */ import { getActiveSync } from './BuilderSync'; import { resolveValue, tokenDeclarations } from './cssVars'; import { ALL_FORCE_CLASSES, PREVIEW_TARGETS } from './constants'; import { StyleStore } from './store'; import { Token } from './types'; const __ = ( window as any ).wp?.i18n?.__ || ( ( s: string ) => s ); const CUSTOM_STYLE_ID = 'evf-scv2-custom-css'; const TEMPLATE_STYLE_ID = 'evf-scv2-rule-template'; const CHROME_STYLE_ID = 'evf-scv2-chrome'; const SELECT_STYLE_ID = 'evf-scv2-select'; const DEVICE_STYLE_ID = 'evf-scv2-device'; const FONT_LINK_ID = 'evf-scv2-font'; /** Legacy `?evf_preview` theme-toggle class: adding it applies theme styling, removing it applies EVF's default. */ const PREVIEW_THEME_CLASS = 'evf-frontend-form-preview'; const HOVER_CLASS = 'evf-scv2-hover'; const SELECTED_CLASS = 'evf-scv2-selected'; /** Mirrors FrontendEnqueue::container_class()'s `evf-choice-{variation}` classes. */ const CHOICE_VARIATION_CLASSES = [ 'evf-choice-outline', 'evf-choice-filled' ]; /** Mirrors FrontendEnqueue::container_class()'s `evf-choice-align-{center|right}` classes. */ const CHOICE_ALIGN_CLASSES = [ 'evf-choice-align-center', 'evf-choice-align-right' ]; /** Mirrors EverestForms_MultiPart::field_submit_visibility_class()'s `everest-forms-nav-align--{value}` class. */ const PAGINATION_NAV_ALIGN_CLASSES = [ 'everest-forms-nav-align--left', 'everest-forms-nav-align--right', 'everest-forms-nav-align--center', 'everest-forms-nav-align--split', ]; // indicatorType can't be live-patched client-side — its themes render genuinely different child // DOM per value (progress bar vs. an
    /