| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | use Elementor\App\Modules\KitLibrary\Module as KitLibraryModule; |
| 23 | 23 | use Elementor\App\Modules\ImportExportCustomization\Module as ImportExportCustomizationModule; |
| 24 | 24 | use Elementor\App\Modules\SiteEditor\Module as SiteEditorModule; |
| 25 | 25 | use Elementor\App\Modules\Onboarding\Module as OnboardingModule; |
| 26 | -use Elementor\App\Modules\SiteBuilder\Module as SiteBuilderModule; | |
| 26 | +use Elementor\App\Modules\OnboardingNew\Module as OnboardingNewModule; | |
| 27 | 27 | |
| 28 | 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | 29 | exit; // Exit if accessed directly. |
| 30 | 30 | } |
| @@ -169,9 +169,9 @@ | ||
| 169 | 169 | ->set_path_resolver( function ( $name ) { |
| 170 | 170 | return ELEMENTOR_ASSETS_PATH . "js/packages/{$name}/{$name}.asset.php"; |
| 171 | 171 | } ); |
| 172 | 172 | |
| 173 | - Collection::make( [ 'ui', 'icons', 'store', 'query', 'utils', 'events', 'onboarding', 'schema', 'site-builder' ] ) | |
| 173 | + Collection::make( [ 'ui', 'icons', 'store', 'query', 'utils', 'events', 'onboarding', 'schema' ] ) | |
| 174 | 174 | ->each( function( $package ) use ( $assets_config_provider ) { |
| 175 | 175 | $suffix = Utils::is_script_debug() ? '' : '.min'; |
| 176 | 176 | $config = $assets_config_provider->load( $package )->get( $package ); |
| 177 | 177 | |
| @@ -257,9 +257,8 @@ | ||
| 257 | 257 | 'wp-i18n', |
| 258 | 258 | 'elementor-v2-ui', |
| 259 | 259 | 'elementor-v2-icons', |
| 260 | 260 | 'elementor-v2-onboarding', |
| 261 | - 'elementor-v2-site-builder', | |
| 262 | 261 | 'react', |
| 263 | 262 | 'react-dom', |
| 264 | 263 | 'select2', |
| 265 | 264 | ], |
| @@ -299,13 +298,26 @@ | ||
| 299 | 298 | 'mutable' => false, |
| 300 | 299 | ] ); |
| 301 | 300 | } |
| 302 | 301 | |
| 302 | + private function register_e_onboarding_experiment() { | |
| 303 | + Plugin::$instance->experiments->add_feature( [ | |
| 304 | + 'name' => 'e_onboarding', | |
| 305 | + 'title' => esc_html__( 'New Onboarding', 'elementor' ), | |
| 306 | + 'hidden' => true, | |
| 307 | + 'default' => ExperimentsManager::STATE_INACTIVE, | |
| 308 | + 'release_status' => ExperimentsManager::RELEASE_STATUS_DEV, | |
| 309 | + ] ); | |
| 310 | + } | |
| 311 | + | |
| 312 | + private function is_e_onboarding_active(): bool { | |
| 313 | + return Plugin::$instance->experiments->is_feature_active( 'e_onboarding' ); | |
| 314 | + } | |
| 315 | + | |
| 303 | 316 | public function __construct() { |
| 304 | 317 | $this->register_import_export_customization_experiment(); |
| 305 | 318 | |
| 306 | 319 | $this->add_component( 'site-editor', new SiteEditorModule() ); |
| 307 | - $this->add_component( 'site-builder', new SiteBuilderModule() ); | |
| 308 | 320 | |
| 309 | 321 | if ( current_user_can( 'manage_options' ) || Utils::is_wp_cli() ) { |
| 310 | 322 | $this->add_component( 'import-export', new ImportExportModule() ); |
| 311 | 323 | |
| @@ -316,9 +328,15 @@ | ||
| 316 | 328 | // Kit library is depended on import-export |
| 317 | 329 | $this->add_component( 'kit-library', new KitLibraryModule() ); |
| 318 | 330 | } |
| 319 | 331 | |
| 320 | - $this->add_component( 'onboarding', new OnboardingModule() ); | |
| 332 | + $this->register_e_onboarding_experiment(); | |
| 333 | + | |
| 334 | + if ( $this->is_e_onboarding_active() ) { | |
| 335 | + $this->add_component( 'onboarding', new OnboardingNewModule() ); | |
| 336 | + } else { | |
| 337 | + $this->add_component( 'onboarding', new OnboardingModule() ); | |
| 338 | + } | |
| 321 | 339 | |
| 322 | 340 | add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { |
| 323 | 341 | $this->register_editor_one_menu( $menu_data_provider ); |
| 324 | 342 | } ); |