Skip to content

Commit aeb62b4

Browse files
Merge pull request #237 from bigboxwc/release/3.4.0
release/3.4.0
2 parents 5dc592a + fa740f8 commit aeb62b4

23 files changed

+266
-19
lines changed

app/customize/output/color-gray-200.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'.offcanvas-drawer__close',
2727
'.page-title',
2828
'.product__inner',
29+
'.wc-block-grid__product',
2930
'.widget',
3031
'.woocommerce-MyAccount-navigation:after',
3132
'.woocommerce-single-product-data__section',

app/customize/output/type.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
'.action-list__item-label',
100100
'.widget-title',
101101
'.product-title',
102+
'.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-title',
102103
'.woocommerce-terms-and-conditions-text',
103104
'.product-category-more__inner',
104105
'.woocommerce-loop-category__title',

app/customize/selector-functions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ function( $selector ) use ( $state ) {
4141
function bigbox_customize_get_button_selectors() {
4242
return [
4343
'.button',
44-
'button',
4544
'.widget_layered_nav_filters a',
4645
'.woocommerce-notice-list__item .woocommerce-Button',
4746
'.woocommerce-notice-list__item .wc-forward',
@@ -52,6 +51,7 @@ function bigbox_customize_get_button_selectors() {
5251
'.facetwp-facet .facetwp-autocomplete-update',
5352
'.facetwp-facet .facetwp-slider-reset',
5453
'.comment-form [type="submit"]',
54+
'.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-add-to-cart a:not(.added_to_cart)',
5555
];
5656
}
5757

@@ -71,6 +71,7 @@ function bigbox_customize_get_button_success_selectors() {
7171
'.woocommerce-Button.button',
7272
'.woocommerce-form-coupon [name="apply_coupon"]',
7373
'.woocommerce-notice-list__item .wc-forward',
74+
'.wc-block-grid .wc-block-grid__products .wc-block-grid__product .wc-block-grid__product-add-to-cart .added_to_cart',
7475
];
7576
}
7677

app/integrations/facetwp/template-functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function bigbox_facetwp_wp_enqueue_scripts() {
2424

2525
$deps = [
2626
$stylesheet,
27+
( $stylesheet . '-simplebar' ),
2728
'jquery',
2829
];
2930

app/integrations/gutenberg/class-gutenberg.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,17 @@ public function inline_editor_css( $settings ) {
252252
$css->add( $config[ $x ] );
253253
}
254254

255+
$css = $css->build();
256+
257+
/** */
258+
$inline_css = apply_filters( 'bigbox_customize_css_inline', true );
259+
260+
if ( $inline_css ) {
261+
$css .= bigbox_customize_inline_css();
262+
}
263+
255264
$settings['styles'][] = [
256-
'css' => $css->build(),
265+
'css' => $css,
257266
];
258267

259268
return $settings;

app/integrations/woocommerce/template-functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function bigbox_woocommerce_wp_enqueue_scripts() {
4040

4141
$deps = [
4242
$stylesheet,
43+
( $stylesheet . '-simplebar' ),
4344
'wp-util',
4445
'woocommerce',
4546
];

app/integrations/woocommerce/wc-template-functions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ function woocommerce_output_product_categories( $args = [] ) {
7878
if ( $total > 5 ) {
7979
$product_categories = array_slice( $product_categories, 0, 5 );
8080
}
81+
8182
// End modification.
8283
if ( ! $product_categories ) {
8384
return false;

app/theme/assets.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,21 @@ function bigbox_enqueue_scripts() {
7373
$version = bigbox_get_theme_version();
7474
$stylesheet = bigbox_get_theme_name();
7575

76+
// SimpleBar.
77+
wp_enqueue_script(
78+
$stylesheet . '-simplebar',
79+
get_template_directory_uri() . '/public/js/simplebar.min.js',
80+
array(),
81+
'4.1.0',
82+
true
83+
);
84+
7685
$deps = [
7786
'hoverIntent',
87+
( $stylesheet . '-simplebar' ),
7888
];
7989

80-
// Combined application scripts.
90+
// Application script.
8191
wp_enqueue_script(
8292
$stylesheet,
8393
get_template_directory_uri() . '/public/js/app.min.js',

package-lock.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "BigBox",
44
"author": "Spencer Finnell",
55
"description": "Easily manage and scale WooCommerce product catalogs.",
6-
"version": "3.3.0",
6+
"version": "3.4.0",
77
"license": "GPL-2.0-or-later",
88
"main": "webpack.config.js",
99
"engines": {
@@ -36,6 +36,7 @@
3636
"postcss-loader": "3.0.0",
3737
"raw-loader": "3.1.0",
3838
"sass-loader": "7.2.0",
39+
"simplebar": "4.1.0",
3940
"stylelint": "10.1.0",
4041
"stylelint-config-wordpress": "14.0.0",
4142
"svg-sprite-loader": "4.1.6",

resources/assets/js/app/horizontal-menu.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global SimpleBar */
2+
13
/**
24
* Scroll a horizontal menu to the active item.
35
*
@@ -11,6 +13,8 @@ const horizontalMenu = ( menuClass, activeClass ) => {
1113
return;
1214
}
1315

16+
// Custom scrolling.
17+
const simpleBar = new SimpleBar( menu );
1418
const activeLink = document.querySelector( `${ menuClass } ${ activeClass }` );
1519

1620
if ( ! activeLink ) {
@@ -20,7 +24,7 @@ const horizontalMenu = ( menuClass, activeClass ) => {
2024
const activeOffset = activeLink.getBoundingClientRect();
2125
const menuOffset = menu.getBoundingClientRect();
2226

23-
menu.scrollLeft = activeOffset.x + ( activeOffset.width / 2 ) + menu.scrollLeft - ( menuOffset.width / 2 );
27+
simpleBar.getScrollElement().scrollLeft = activeOffset.x + ( activeOffset.width / 2 ) + menu.scrollLeft - ( menuOffset.width / 2 );
2428
};
2529

2630
export default horizontalMenu;

resources/assets/js/woocommerce/account-menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import domReady from '@wordpress/dom-ready';
88
*/
99
import horizontalMenu from './../app/horizontal-menu.js';
1010

11-
domReady( horizontalMenu( '.woocommerce-MyAccount-navigation ul', '.is-active' ) );
11+
domReady( horizontalMenu( '.woocommerce-MyAccount-navigation', '.is-active' ) );
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* External dependencies.
3+
*/
4+
import domReady from '@wordpress/dom-ready';
5+
6+
/**
7+
* Internal dependencies.
8+
*/
9+
import horizontalMenu from './../app/horizontal-menu.js';
10+
11+
domReady( horizontalMenu( '.woocommerce-product-categories-wrapper' ) );

resources/assets/js/woocommerce/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ import './checkout.js';
1717
import './products.js';
1818
import './lazyload.js';
1919
import './account-menu.js';
20+
import './category-menu.js';

resources/assets/scss/_config.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
@import "~bootstrap/scss/mixins/grid";
2121
@import "~bootstrap/scss/grid";
2222

23+
// SimpleBar
24+
@import "~simplebar/src/simplebar.css";
25+
2326
/**
2427
* Internal dependencies
2528
*/

resources/assets/scss/gutenberg.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ $use-margins: false;
2020
@import "elements/mark";
2121

2222
// Styles shared on the frontend.
23+
@import "modules/star-rating";
24+
@import "modules/price";
25+
@import "modules/product";
2326
@import "modules/gutenberg";
2427
@import "modules/woocommerce-blocks";
2528

resources/assets/scss/modules/products-categories.scss

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
// [1] Give any potential scrollbar more room so it does not overlap.
1+
.woocommerce-product-categories-wrapper {
2+
-webkit-overflow-scrolling: touch;
3+
margin-bottom: $spacer;
4+
}
5+
26
.woocommerce-page ul.products-categories,
37
.woocommerce ul.products-categories {
48
display: flex;
5-
overflow-x: scroll;
6-
-webkit-overflow-scrolling: touch;
79
position: relative;
8-
padding-bottom: $spacer; // [1]
10+
11+
@include reset-list();
12+
913
padding-left: 2px;
1014
padding-right: 2px;
1115

@@ -17,10 +21,7 @@
1721
border-radius: $border-radius;
1822
}
1923

20-
2124
@include gray("background", "200");
22-
bottom: $spacer;
23-
height: calc(100% - #{$spacer});
2425
}
2526

2627
@include vertical-spacing("margin", "down", (

resources/assets/scss/modules/woocommerce-account.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// [1] Give any potential scrollbar more room so it does not overlap.
21
.woocommerce-MyAccount-navigation {
32
margin: -($spacer) 0 $spacer;
3+
padding: 0 0 $spacer;
44
position: relative;
5+
-webkit-overflow-scrolling: touch;
56

67
&::after {
78
content: "";
@@ -21,11 +22,9 @@
2122

2223
@include reset-list();
2324

24-
padding: 0 0 $spacer; // [1]
25+
margin: 0;
26+
padding: 0;
2527
display: flex;
26-
overflow-x: scroll;
27-
overflow-y: hidden;
28-
-webkit-overflow-scrolling: touch;
2928

3029
li {
3130
flex: 1 0 auto;

0 commit comments

Comments
 (0)