mirror of
https://gh.wpcy.net/https://github.com/elementor/elementor.git
synced 2026-06-18 04:33:19 +08:00
<!--start_gitstream_placeholder--> ### ✨ PR Description ## 1. Problem & Context Refactoring popup/promotion display logic to respect a new feature flag (`e_panel_promotions`) that gates experimental sticky promotion rendering in the editor panel. Centralizes promotion data fetching and improves layout stability. ## 2. What Changed (Where) - **experiments/manager.php**: Added `e_panel_promotions` hidden feature flag (dev status, active by default) - **core/utils/promotions/filtered-promotions-manager.php**: Extracted sticky promotion data fetching into dedicated method - **includes/widget-base.php**: Conditional `upsale_data` assignment based on feature flag - **editor-templates/panel-elements.php**: Extracted inline sticky promotion markup into separate template file - **modules/promotions/module.php**: Added filter to inject sticky promotion data into editor settings when feature active - **editor-editing-panel components & panel.php**: Integrated React component for sticky promotion; added flex layout adjustments - **assets/dev/scss/editor/panel/panel.scss**: Enhanced sticky positioning styles with flex container support - **packages/types/global.d.ts**: Added TypeScript typing for `editingPanelStickyPromotion` ## 3. How It Works Feature flag gates upsale data flow: when `e_panel_promotions` is active, widget upsale data is nullified (line 383), promotion data instead flows through settings → React component (`EditingPanelStickyPromotion`). Sticky promotion template reused in both legacy Marionette elements view and new editing panel via `#tmpl-elementor-panel-element-sticky-promotion`. Layout stabilized with flex column wrapping panel content, positioning sticky promotion at bottom. ## 4. Risks Dual rendering path (Marionette/React) could cause promotion duplication if feature flag toggled mid-session. CSS `:has()` selector lacks IE11 support but acceptable given target audience. Template extraction assumes `$promotion_data_sticky` available in both scopes—verify template inclusion contexts. _Generated by LinearB AI and added by gitStream._ <sub>AI-generated content may contain inaccuracies. Please verify before using. 💡 **Tip:** You can customize your AI Description using **Guidelines** [Learn how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub> <!--end_gitstream_placeholder--> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: svitlanadykun <svitlanad@elementor.red> |
||
|---|---|---|
| .. | ||
| assets/js/admin | ||
| exceptions | ||
| experiments-reporter.php | ||
| manager.php | ||
| non-existing-dependency.php | ||
| wp-cli.php | ||
| wrap-core-dependency.php | ||