Skip to content

Commit

Permalink
Update deps to WP 6.6 including a polyfill for earlier WP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
TorbenLundsgaard committed Sep 3, 2024
1 parent 254c822 commit 5468def
Show file tree
Hide file tree
Showing 13 changed files with 2,047 additions and 1,337 deletions.
2 changes: 1 addition & 1 deletion assets/admin/settings-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/admin/settings.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => 'cbc566dfe02d7fc1c814');
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '5c32fa74c0d2768812b2');
2 changes: 1 addition & 1 deletion assets/admin/settings.css

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions assets/admin/settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/admin/wizard-rtl.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/admin/wizard.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '78fa6d1fd726260bef13');
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'dbee6921bb05359768f5');
2 changes: 1 addition & 1 deletion assets/admin/wizard.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/admin/wizard.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/react-jsx-runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3,299 changes: 1,991 additions & 1,308 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
"textdomain": "gtm-kit"
},
"dependencies": {
"@wordpress/api-fetch": "^6.48.1",
"@wordpress/components": "^26.0.6",
"@wordpress/hooks": "^3.51.1",
"@wordpress/i18n": "^4.51.1",
"@wordpress/url": "^3.52.1"
"@wordpress/api-fetch": "^7.0.1",
"@wordpress/components": "^28.0.3",
"@wordpress/hooks": "^4.0.1",
"@wordpress/i18n": "^5.0.1",
"@wordpress/url": "^4.0.1"
},
"devDependencies": {
"@wordpress/scripts": "^27.2.6",
"autoprefixer": "^10.4.19",
"@wordpress/scripts": "^28.0.2",
"autoprefixer": "^10.4.20",
"cssnano": "^6.1.2",
"del-cli": "^5.1.0",
"mkdirp": "^3.0.1",
"ncp": "^2.0.0",
"postcss-cli": "^10.1.0",
"sass": "^1.76.0",
"tailwindcss": "^3.4.3",
"uglify-js": "^3.17.4"
"postcss-cli": "^11.0.0",
"sass": "^1.77.8",
"tailwindcss": "^3.4.10",
"uglify-js": "^3.19.3"
},
"scripts": {
"build": "wp-scripts build src/js/frontend/woocommerce-blocks.js src/js/frontend/event-inspector.js --output-path=assets/frontend",
Expand Down
11 changes: 11 additions & 0 deletions src/Admin/AssetsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ protected function enqueue_assets( string $page_slug, string $script_handle, str
$version = $deps_data['version'];
}

// Polyfill for WordPress versions earlier than 6.6.
if ( in_array( 'react-jsx-runtime', $dependency, true ) && ! wp_script_is( 'react-jsx-runtime', 'registered' ) ) {
wp_register_script(
'react-jsx-runtime',
GTMKIT_URL . 'assets/react-jsx-runtime.js',
[ 'react' ],
'18.3.1',
true
);
}

if ( $settings_dependency ) {
$dependency[] = 'gtmkit-settings-script';
}
Expand Down
27 changes: 21 additions & 6 deletions src/scss/_tailwind-compiled.scss
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,11 @@ video {
gap: 2rem;
}

.gtmkit-gap-x-16 {
-moz-column-gap: 4rem;
column-gap: 4rem;
}

.gtmkit-space-x-9 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(2.25rem * var(--tw-space-x-reverse));
Expand All @@ -942,18 +947,18 @@ video {
margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}

.gtmkit-space-y-8 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}

.gtmkit-space-y-4 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}

.gtmkit-space-y-8 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));
margin-bottom: calc(2rem * var(--tw-space-y-reverse));
}

.gtmkit-whitespace-nowrap {
white-space: nowrap;
}
Expand Down Expand Up @@ -1174,6 +1179,16 @@ video {
padding-bottom: 1px;
}

.gtmkit-px-1 {
padding-left: 0.25rem;
padding-right: 0.25rem;
}

.gtmkit-px-1\.5 {
padding-left: 0.375rem;
padding-right: 0.375rem;
}

.gtmkit-pb-6 {
padding-bottom: 1.5rem;
}
Expand Down

0 comments on commit 5468def

Please sign in to comment.