Skip to content

Commit

Permalink
Merge remote-tracking branch 'elementor/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
arielk committed Oct 6, 2024
2 parents a708e21 + 2f90b5d commit dadad10
Show file tree
Hide file tree
Showing 28 changed files with 1,572 additions and 246 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ assets/js/
**/*.min.js
**/node_modules/**
**/vendor/**
**/vendor_prefixed/**
build/**
packages/**/*
tests/qunit/setup/tinymce.js
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php -v
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor --exclude vendor_prefixed .
- name: Setup PHP 8.0 # not included in ubuntu 22.04
uses: shivammathur/setup-php@v2
with:
Expand All @@ -100,7 +100,7 @@ jobs:
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php -v
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor --exclude vendor_prefixed .
- name: Setup PHP 8.1 # not included in ubuntu 22.04
uses: shivammathur/setup-php@v2
with:
Expand All @@ -109,4 +109,4 @@ jobs:
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php -v
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor --exclude vendor_prefixed .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
.sass-cache/
log/
vendor/
/vendor_prefixed
local-site/
tmp/

Expand Down
3 changes: 3 additions & 0 deletions .grunt-config/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ const getBuildFiles = [
'!test-results/',
'!tmp/**',
'!vendor/**',
'!php-scoper/**',
'!yarn.lock',
'!*~',
'!commitlint.config.js',

// Conflict with above rule.
'core/files/assets/**',
'vendor/autoload.php',
'vendor/composer/**',
];
/**
* @type {{main: {src: string[], expand: boolean, dest: string}, secondary: {src: string[], expand: boolean, dest: string}}}
Expand Down
4 changes: 0 additions & 4 deletions assets/dev/js/frontend/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import BaseHandler from './handlers/base';
import SwiperBase from './handlers/base-swiper';
import CarouselBase from './handlers/base-carousel';
import NestedTabs from 'elementor/modules/nested-tabs/assets/js/frontend/handlers/nested-tabs';
import NestedAccordion from 'elementor/modules/nested-accordion/assets/js/frontend/handlers/nested-accordion';
import ContactButtonsHandler from 'elementor/modules/floating-buttons/assets/js/floating-buttons/frontend/handlers/contact-buttons';
import FloatingBarsHandler from 'elementor/modules/floating-buttons/assets/js/floating-bars/frontend/handlers/floating-bars';
import NestedTitleKeyboardHandler from './handlers/accessibility/nested-title-keyboard-handler';

elementorModules.frontend = {
Document,
Expand All @@ -22,8 +20,6 @@ elementorModules.frontend = {
SwiperBase,
CarouselBase,
NestedTabs,
NestedAccordion,
NestedTitleKeyboardHandler,
ContactButtonsHandler,
FloatingBarsHandler,
},
Expand Down
10 changes: 7 additions & 3 deletions assets/dev/js/frontend/utils/anchor-scroll-margin.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ export default class extends elementorModules.ViewModule {
}

getAnchorTarget( element ) {
if ( ! this.isValidSelector( element.hash ) ) {
const hash = element?.hash;

if ( '' === hash ) {
return null;
} else if ( ! this.isValidSelector( hash ) ) {
// eslint-disable-next-line no-console
console.warn( `Invalid selector: '${ element.hash }'` );
console.warn( `Invalid selector: '${ hash }'` );

return null;
}

return document.querySelector( element.hash );
return document.querySelector( hash );
}

getElementSettings( element ) {
Expand Down
34 changes: 27 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"require": {
"php": ">=7.4"
},
"autoload": {
"classmap": [
"vendor_prefixed/"
]
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"elementor/elementor-editor-testing": "0.0.3",
Expand All @@ -16,15 +21,30 @@
"wp-coding-standards/wpcs": "^2.3",
"yoast/phpunit-polyfills": "^1.0",
"thor-juhasz/phpunit-coverage-check": "^0.3.0",
"spatie/phpunit-snapshot-assertions": "^4.2"
"spatie/phpunit-snapshot-assertions": "^4.2",
"humbug/php-scoper": "0.17.5",
"php-di/php-di": "6.4.0"
},
"scripts": {
"lint": "phpcs --standard=ruleset.xml",
"test": "phpunit",
"test:install": "bash ./bin/install-wp-tests-local.sh",
"coverage": "composer run coverage:test && composer run coverage:check",
"coverage:test": "phpdbg -qrr vendor/phpunit/phpunit/phpunit --coverage-clover coverage-report/clover.xml",
"coverage:check": "phpunit-coverage-check -t 65 coverage-report/clover.xml"
"lint": "phpcs --standard=ruleset.xml",
"test": "phpunit",
"test:install": "bash ./bin/install-wp-tests-local.sh",
"coverage": "composer run coverage:test && composer run coverage:check",
"coverage:test": "phpdbg -qrr vendor/phpunit/phpunit/phpunit --coverage-clover coverage-report/clover.xml",
"coverage:check": "phpunit-coverage-check -t 65 coverage-report/clover.xml",
"post-install-cmd": [
"@php -r \"if (!file_exists('vendor_prefixed')) { mkdir('vendor_prefixed', 0755, true); }\"",
"@php ./vendor/bin/php-scoper add-prefix --output-dir=./vendor_prefixed --config=php-scoper/dependency-injection.inc.php --force",
"@php composer dump-autoload"
],
"pre-autoload-dump": [
"@php -r \"if (!file_exists('vendor_prefixed')) { mkdir('vendor_prefixed', 0755, true); }\""
],
"post-update-cmd": [
"@php -r \"if (!file_exists('vendor_prefixed')) { mkdir('vendor_prefixed', 0755, true); }\"",
"@php ./vendor/bin/php-scoper add-prefix --output-dir=./vendor_prefixed --config=php-scoper/dependency-injection.inc.php --force",
"@php composer dump-autoload"
]
},
"config": {
"allow-plugins": {
Expand Down
Loading

0 comments on commit dadad10

Please sign in to comment.