From dbce6ab23c756fa582abd95d8aeb8ba4711a9b43 Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+cbravobernal@users.noreply.github.com> Date: Thu, 6 Feb 2025 10:31:12 +0100 Subject: [PATCH] =?UTF-8?q?iAPI=20Router:=20Fix=20CSS=20rule=20order=20in?= =?UTF-8?q?=20some=20constructed=20style=20sheets=20(#68=E2=80=A6=20(#6905?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * iAPI Router: Fix CSS rule order in some constructed style sheets (#68923) * Add failing test * Place CSS rules in order Co-authored-by: DAreRodz Co-authored-by: luisherranz Co-authored-by: Mamaduka Co-authored-by: SainathPoojary Co-authored-by: sethrubenstein * Plugin: Remove ESLint rule for deprecated functions (#68590) Co-authored-by: Mamaduka Co-authored-by: fabiankaegy * e2e:fix WP Editor Meta Boxes test (#68872) Co-authored-by: t-hamano --------- Co-authored-by: David Arenas Co-authored-by: DAreRodz Co-authored-by: luisherranz Co-authored-by: Mamaduka Co-authored-by: SainathPoojary Co-authored-by: sethrubenstein Co-authored-by: George Mamadashvili Co-authored-by: fabiankaegy Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Co-authored-by: t-hamano --- .eslintrc.js | 23 --------------- .../router-styles-wrapper/render.php | 17 +++++++++++ .../router-styles-wrapper/style-from-link.css | 7 +++++ .../interactivity-router/src/assets/styles.ts | 5 ++-- .../editor/plugins/wp-editor-meta-box.spec.js | 2 +- .../specs/interactivity/router-styles.spec.ts | 29 +++++++++++++++++++ 6 files changed, 57 insertions(+), 26 deletions(-) create mode 100644 packages/e2e-tests/plugins/interactive-blocks/router-styles-wrapper/style-from-link.css diff --git a/.eslintrc.js b/.eslintrc.js index e5f42eea656b9..6626a55a762d1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,21 +4,6 @@ const glob = require( 'glob' ).sync; const { join } = require( 'path' ); -/** - * Internal dependencies - */ -const { version } = require( './package' ); - -/** - * Regular expression string matching a SemVer string with equal major/minor to - * the current package version. Used in identifying deprecations. - * - * @type {string} - */ -const majorMinorRegExp = - version.replace( /\.\d+$/, '' ).replace( /[\\^$.*+?()[\]{}|]/g, '\\$&' ) + - '(\\.\\d+)?'; - /** * The list of patterns matching files used only for development purposes. * @@ -92,14 +77,6 @@ const restrictedSyntax = [ 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]', message: 'Path access on WordPress dependencies is not allowed.', }, - { - selector: - 'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' + - majorMinorRegExp + - '/]', - message: - 'Deprecated functions must be removed before releasing this version.', - }, { selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]', diff --git a/packages/e2e-tests/plugins/interactive-blocks/router-styles-wrapper/render.php b/packages/e2e-tests/plugins/interactive-blocks/router-styles-wrapper/render.php index 6373e8e9bc235..683db9eea5c4c 100644 --- a/packages/e2e-tests/plugins/interactive-blocks/router-styles-wrapper/render.php +++ b/packages/e2e-tests/plugins/interactive-blocks/router-styles-wrapper/render.php @@ -7,6 +7,17 @@ * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable */ +add_action( + 'wp_enqueue_scripts', + function () { + wp_enqueue_style( + 'wrapper-styles-from-link', + plugin_dir_url( __FILE__ ) . 'style-from-link.css', + array() + ); + } +); + $wrapper_attributes = get_block_wrapper_attributes(); ?>
> @@ -38,6 +49,12 @@

All

+ +
+ Rule order checker +

I should remain green

+
+