Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arielk authored Jan 7, 2024
2 parents f3d2269 + 09d922e commit a0eef6d
Show file tree
Hide file tree
Showing 27 changed files with 32 additions and 481 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
npx wp-env run cli wp --info
- name: Activate performance experiments
run: |
npx wp-env run cli wp elementor experiments activate e_font_icon_svg,e_lazyload,e_dom_optimization,e_optimized_assets_loading,e_optimized_css_loading,additional_custom_breakpoints,e_image_loading_optimization
npx wp-env run cli wp elementor experiments activate e_font_icon_svg,e_lazyload,e_optimized_assets_loading,e_optimized_css_loading,additional_custom_breakpoints,e_image_loading_optimization
- name: Install playwright/test
run: |
npx playwright install chromium
Expand Down
22 changes: 5 additions & 17 deletions assets/dev/js/editor/elements/views/column.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ColumnView = BaseElementView.extend( {

emptyView: ColumnEmptyView,

childViewContainer: elementorCommon.config.experimentalFeatures.e_dom_optimization ? '> .elementor-widget-wrap' : '> .elementor-column-wrap > .elementor-widget-wrap',
childViewContainer: '> .elementor-widget-wrap',

toggleEditTools: true,

Expand Down Expand Up @@ -43,7 +43,7 @@ ColumnView = BaseElementView.extend( {
ui() {
var ui = BaseElementView.prototype.ui.apply( this, arguments );

ui.columnInner = elementorCommon.config.experimentalFeatures.e_dom_optimization ? '> .elementor-widget-wrap' : '> .elementor-column-wrap';
ui.columnInner = '> .elementor-widget-wrap';

ui.percentsTooltip = '> .elementor-element-overlay .elementor-column-percents-tooltip';

Expand Down Expand Up @@ -197,36 +197,24 @@ ColumnView = BaseElementView.extend( {
},

onRender() {
const isDomOptimizationActive = elementorCommon.config.experimentalFeatures.e_dom_optimization,
getDropIndex = ( side, event ) => {
const getDropIndex = ( side, event ) => {
let newIndex = jQuery( event.currentTarget ).index();

// Since 3.0.0, the `.elementor-background-overlay` element sit at the same level as widgets
if ( 'bottom' === side && ! isDomOptimizationActive ) {
newIndex++;
} else if ( 'top' === side && isDomOptimizationActive ) {
if ( 'top' === side ) {
newIndex--;
}

return newIndex;
};

let itemsClasses = '';

if ( isDomOptimizationActive ) {
itemsClasses = ' > .elementor-widget-wrap > .elementor-element, >.elementor-widget-wrap > .elementor-empty-view > .elementor-first-add';
} else {
itemsClasses = ' > .elementor-column-wrap > .elementor-widget-wrap > .elementor-element, >.elementor-column-wrap > .elementor-widget-wrap > .elementor-empty-view > .elementor-first-add';
}

BaseElementView.prototype.onRender.apply( this, arguments );

this.changeChildContainerClasses();

this.changeSizeUI();

this.$el.html5Droppable( {
items: itemsClasses,
items: ' > .elementor-widget-wrap > .elementor-element, >.elementor-widget-wrap > .elementor-empty-view > .elementor-first-add',
axis: [ 'vertical' ],
groups: [ 'elementor-element' ],
isDroppingAllowed: this.isDroppingAllowed.bind( this ),
Expand Down
8 changes: 1 addition & 7 deletions assets/dev/js/editor/elements/views/section.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ const DEFAULT_INNER_SECTION_COLUMNS = 2,

const SectionView = BaseElementView.extend( {
childViewContainer() {
let containerSelector = '> .elementor-container';

if ( ! elementorCommon.config.experimentalFeatures.e_dom_optimization ) {
containerSelector += ' > .elementor-row';
}

return containerSelector;
return '> .elementor-container';
},

template: Marionette.TemplateCache.get( '#tmpl-elementor-section-content' ),
Expand Down
16 changes: 2 additions & 14 deletions assets/dev/js/editor/views/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,14 @@ const Preview = BaseSectionsContainerView.extend( {
},

onRender() {
let $contentContainer;

if ( elementorCommon.config.experimentalFeatures.e_dom_optimization ) {
$contentContainer = this.$el;
} else {
const $inner = jQuery( '<div>', { class: 'elementor-inner' } );

this.$el.html( $inner );

$contentContainer = $inner;
}

$contentContainer.html( this.$childViewContainer );
this.$el.html( this.$childViewContainer );

if ( elementor.userCan( 'design' ) ) {
const addNewSectionView = new AddSectionView();

addNewSectionView.render();

$contentContainer.append( addNewSectionView.$el );
this.$el.append( addNewSectionView.$el );
}
},
} );
Expand Down
6 changes: 3 additions & 3 deletions assets/dev/js/frontend/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export default class Frontend extends elementorModules.ViewModule {

this.config.legacyMode = {
/**
* @deprecated since 3.1.0, use `elementorFrontend.config.experimentalFeatures.e_dom_optimization` instead.
* @deprecated since 3.1.0
*/
get elementWrappers() {
if ( elementorFrontend.isEditMode() ) {
window.top.elementorDevTools.deprecation.deprecated( 'elementorFrontend.config.legacyMode.elementWrappers', '3.1.0', 'elementorFrontend.config.experimentalFeatures.e_dom_optimization' );
window.top.elementorDevTools.deprecation.deprecated( 'elementorFrontend.config.legacyMode.elementWrappers', '3.1.0' );
}

return ! elementorFrontend.config.experimentalFeatures.e_dom_optimization;
return false;
},
};

Expand Down
5 changes: 0 additions & 5 deletions assets/dev/scss/direction/editor-preview-legacy-rtl.scss

This file was deleted.

5 changes: 0 additions & 5 deletions assets/dev/scss/direction/editor-preview-legacy.scss

This file was deleted.

5 changes: 0 additions & 5 deletions assets/dev/scss/direction/frontend-legacy-rtl.scss

This file was deleted.

5 changes: 0 additions & 5 deletions assets/dev/scss/direction/frontend-legacy.scss

This file was deleted.

45 changes: 0 additions & 45 deletions assets/dev/scss/editor/preview/legacy.scss

This file was deleted.

145 changes: 0 additions & 145 deletions assets/dev/scss/frontend/legacy.scss

This file was deleted.

1 change: 0 additions & 1 deletion core/admin/admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ private function notice_experiment_promotion() {

$experiments = Plugin::$instance->experiments;
$is_all_performance_features_active = (
$experiments->is_feature_active( 'e_dom_optimization' ) &&
$experiments->is_feature_active( 'additional_custom_breakpoints' ) &&
$experiments->is_feature_active( 'e_optimized_css_loading' ) &&
$experiments->is_feature_active( 'e_optimized_assets_loading' )
Expand Down
9 changes: 0 additions & 9 deletions core/base/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -1134,18 +1134,9 @@ public function print_elements_with_wrapper( $elements_data = null ) {
$elements_data = $this->get_elements_data();
}

$is_dom_optimization_active = Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' );
?>
<div <?php Utils::print_html_attributes( $this->get_container_attributes() ); ?>>
<?php if ( ! $is_dom_optimization_active ) : ?>
<div class="elementor-inner">
<div class="elementor-section-wrap">
<?php endif; ?>
<?php $this->print_elements( $elements_data ); ?>
<?php if ( ! $is_dom_optimization_active ) : ?>
</div>
</div>
<?php endif; ?>
</div>
<?php
}
Expand Down
12 changes: 0 additions & 12 deletions core/experiments/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,6 @@ public function get_feature_option_key( $feature_name ) {
}

private function add_default_features() {
$this->add_feature( [
'name' => 'e_dom_optimization',
'title' => esc_html__( 'Optimized DOM Output', 'elementor' ),
'tag' => esc_html__( 'Performance', 'elementor' ),
'description' => esc_html__( 'Developers, Please Note! This experiment includes some markup changes. If you\'ve used custom code in Elementor, you might have experienced a snippet of code not running. Turning this experiment off allows you to keep prior Elementor markup output settings, and have that lovely code running again.', 'elementor' )
. ' <a href="https://go.elementor.com/wp-dash-legacy-optimized-dom/" target="_blank">'
. esc_html__( 'Learn More', 'elementor' ) . '</a>',
'release_status' => self::RELEASE_STATUS_STABLE,
'default' => self::STATE_ACTIVE,
'generator_tag' => true,
] );

$this->add_feature( [
'name' => 'e_optimized_assets_loading',
'title' => esc_html__( 'Improved Asset Loading', 'elementor' ),
Expand Down
Loading

0 comments on commit a0eef6d

Please sign in to comment.