Skip to content

Commit ba9d094

Browse files
Merge pull request #94 from bigboxwc/release/2.0.0
release/2.0.0
2 parents ed10519 + 6642b98 commit ba9d094

File tree

149 files changed

+3190
-1902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3190
-1902
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
vendor
3-
public
3+
public
4+
resources/assets/js/app/skip-link-focus-fix.js

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
## [2.0.0] - 2018-11-06
2+
3+
### Breaking
4+
5+
- Base stylesheet enqueued with wp_enqueue_script priority 20 (was 10).
6+
- Base stylesheet renamed to app.scss (was style.scss) -- child themes referencing this need to update.
7+
8+
### New
9+
10+
- Gutenberg 4.2 compatibility.
11+
- WooCommerce 3.5.1 compatibility.
12+
- WooCommerce Bookings custom styles support.
13+
- Keyboard accessibility improvements for desktop and mobile menus.
14+
15+
### Fix
16+
17+
- Do not output inline CSS for values that have not been customized.
18+
- Stripe gateway checkout styles.
19+
- More precise `em` to `px` conversions for better font smoothing.
20+
- Icon menu alignment for icons of all sizes.
21+
- WooCommerce message button alignment.
22+
- Ensure external WooCommerce products are purchaseable.
23+
- Ensure blockUI library uses accurate background color.
24+
25+
### Tweaks
26+
27+
- Default grid to be 80% page width at extra large device size.
28+
- Better separation of integration CSS.
29+
- Move integration views to main views directory.
30+
- Remove fitvids in favor of Gutenberg responsive embeds.
31+
- Remove offcanvas drawer cache for better dynamic content support.
32+
- More consistent dynamic widget area names ("Page Name Sidebar (Left)")
33+
- Adjust shop sidebar widths to be smaller.
34+
- Grouped product purchase form appearance.
35+
136
## [1.15.2] - 2018-10-12
237

338
### Fix

app/class-integration.php

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,21 @@
2222
*/
2323
abstract class Integration {
2424

25+
/**
26+
* Track slug name.
27+
*
28+
* @var string $slug
29+
* @since 1.16.0
30+
*/
31+
protected $slug;
32+
2533
/**
2634
* Current working directory.
2735
*
2836
* @var string $dir
2937
* @since 1.0.0
3038
*/
31-
protected $dir = null;
39+
protected $dir;
3240

3341
/**
3442
* Current working path.
@@ -38,15 +46,23 @@ abstract class Integration {
3846
* @var string $dir
3947
* @since 1.0.0
4048
*/
41-
protected $local_path = null;
49+
protected $local_path;
4250

4351
/**
4452
* List of required dependencies.
4553
*
4654
* @var array $active
4755
* @since 1.0.0
4856
*/
49-
protected $dependencies = [];
57+
protected $dependencies;
58+
59+
/**
60+
* Additional inline CSS configuration items.
61+
*
62+
* @var array $inline_css_configs
63+
* @since 1.16.0
64+
*/
65+
protected $inline_css_configs = [];
5066

5167
/**
5268
* Setup integration.
@@ -57,6 +73,7 @@ abstract class Integration {
5773
* @param array $dependencies List of required dependencies.
5874
*/
5975
public function __construct( $slug, $dependencies ) {
76+
$this->slug = $slug;
6077
$this->dependencies = $dependencies;
6178
$this->local_path = trailingslashit( '/app/integrations' ) . $slug;
6279
$this->dir = get_template_directory() . $this->get_local_path();
@@ -104,4 +121,21 @@ public function is_active() {
104121
return ! in_array( false, $this->dependencies, true );
105122
}
106123

124+
/**
125+
* Load inline CSS if any output controls are defined.
126+
*
127+
* @since 1.16.0
128+
*/
129+
public function inline_css_configs( $configs ) {
130+
if ( empty( $this->inline_css_configs ) ) {
131+
return $configs;
132+
}
133+
134+
foreach ( $this->inline_css_configs as $key ) {
135+
$configs[ $this->slug . '-' . $key ] = include $this->get_dir() . '/customize/output/' . $key . '.php';
136+
}
137+
138+
return $configs;
139+
}
140+
107141
}

app/class-integrations.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ public function get_integrations() {
119119
defined( 'WC_PRODUCT_VENDORS_VERSION' ) && WC_PRODUCT_VENDORS_VERSION,
120120
],
121121
],
122+
'woocommerce-bookings' => [
123+
'slug' => 'woocommerce-bookings',
124+
'class' => Integration\WooCommerce_Bookings::class,
125+
'dependencies' => [
126+
defined( 'WC_PLUGIN_FILE' ) && WC_PLUGIN_FILE,
127+
defined( 'WC_BOOKINGS_VERSION' ) && WC_BOOKINGS_VERSION,
128+
],
129+
],
122130
'facetwp' => [
123131
'slug' => 'facetwp',
124132
'class' => Integration\FacetWP::class,
@@ -131,7 +139,7 @@ public function get_integrations() {
131139
'slug' => 'gutenberg',
132140
'class' => Integration\Gutenberg::class,
133141
'dependencies' => [
134-
function_exists( 'the_gutenberg_project' ),
142+
function_exists( 'the_gutenberg_project' ) || version_compare( $GLOBALS['wp_version'], '4.9.9999', '>=' ),
135143
],
136144
],
137145
];

app/customize/customize.php

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,38 +32,57 @@
3232
function bigbox_customize_inline_css() {
3333
$css = new \BigBox\Customize\Build_Inline_CSS();
3434

35-
// Sub in a `gutenberg` and `type` to fetch output.
36-
$controls = array_merge(
37-
bigbox_get_theme_colors(),
38-
[
39-
'gutenberg' => [],
40-
'type' => [],
41-
]
42-
);
43-
44-
foreach ( $controls as $key => $data ) {
45-
$file = get_template_directory() . '/app/customize/output/' . $key . '.php';
35+
/**
36+
* Output custom colors.
37+
*
38+
* Only outputs colors that have changed from their defaults.
39+
*/
40+
$colors = array_keys( bigbox_get_theme_colors() );
41+
42+
foreach ( $colors as $key ) {
43+
$file = get_template_directory() . '/app/customize/output/color-' . $key . '.php';
4644

4745
if ( ! file_exists( $file ) ) {
4846
continue;
4947
}
5048

51-
$config = include $file;
49+
// Don't output non-customized colors.
50+
$color = bigbox_get_theme_color( $key );
51+
$default = bigbox_get_theme_default_color( $key );
5252

53-
/**
54-
* Filter the inline CSS configuration for each control.
55-
*
56-
* @since 1.11.0
57-
*
58-
* @param array $data CSS configuration data.
59-
*/
60-
$config = apply_filters( 'bigbox_customize_inline_css_' . $key, $config );
53+
if ( $color !== $default ) {
54+
$config = include $file;
6155

62-
foreach ( $config as $data ) {
63-
$css->add( $data );
56+
bigbox_customize_add_inline_css_by_config( $css, $key, $config );
6457
}
6558
}
6659

60+
/**
61+
* Sub in additional output items.
62+
*
63+
* Separated from colors because they aren't easily as checked against default values.
64+
*/
65+
$extras = [
66+
'type' => include get_template_directory() . '/app/customize/output/type.php',
67+
];
68+
69+
/**
70+
* Filters extra configurations to be loaded.
71+
*
72+
* Use this to include straight configuration files. If logic is needed to
73+
* determine if items should be loaded, use the `bigbox_customize_inline_css`
74+
* hook below.
75+
*
76+
* @since 1.16.0
77+
*
78+
* @param array $extras
79+
*/
80+
$extras = apply_filters( 'bigbox_customize_inline_css_configs', $extras );
81+
82+
foreach ( $extras as $key => $config ) {
83+
bigbox_customize_add_inline_css_by_config( $css, $key, $config );
84+
}
85+
6786
/**
6887
* Allow appending more CSS to the inline output.
6988
*
@@ -75,3 +94,27 @@ function bigbox_customize_inline_css() {
7594

7695
return $css->build();
7796
}
97+
98+
/**
99+
* Add inline CSS based on configuration data.
100+
*
101+
* @since 1.16.0
102+
*
103+
* @param BigBox\Customize\Build_Inline_CSS $css CSS object to handle building inline output.
104+
* @param string $key Configuration key.
105+
* @param array $config Configuration data.
106+
*/
107+
function bigbox_customize_add_inline_css_by_config( $css, $key, $config ) {
108+
/**
109+
* Filter the inline CSS configuration for each control.
110+
*
111+
* @since 1.11.0
112+
*
113+
* @param array $data CSS configuration data.
114+
*/
115+
$config = apply_filters( 'bigbox_customize_inline_css_' . $key, $config );
116+
117+
foreach ( $config as $data ) {
118+
$css->add( $data );
119+
}
120+
}

app/customize/output/danger.php renamed to app/customize/output/color-danger.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* @author Spencer Finnell
1010
*/
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit; // Exit if accessed directly.
14+
}
15+
1216
$danger = bigbox_get_theme_color( 'danger' );
1317
$rgba10 = bigbox_hex_to_rgba( $danger, 0.10 );
1418
$rgba30 = bigbox_hex_to_rgba( $danger, 0.30 );

app/customize/output/gray-100.php renamed to app/customize/output/color-gray-100.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* @author Spencer Finnell
1010
*/
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit; // Exit if accessed directly.
14+
}
15+
1216
$gray100 = bigbox_get_theme_color( 'gray-100' );
1317

1418
return [

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* @author Spencer Finnell
1010
*/
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit; // Exit if accessed directly.
14+
}
15+
1216
$gray200 = bigbox_get_theme_color( 'gray-200' );
1317

1418
return [

app/customize/output/gray-300.php renamed to app/customize/output/color-gray-300.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* @author Spencer Finnell
1010
*/
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit; // Exit if accessed directly.
14+
}
15+
1216
$gray300 = bigbox_get_theme_color( 'gray-300' );
1317
$rgba50 = bigbox_hex_to_rgba( $gray300, 0.50 );
1418
$rgba75 = bigbox_hex_to_rgba( $gray300, 0.75 );
@@ -106,7 +110,6 @@
106110
[
107111
'selectors' => [
108112
'.card',
109-
'table',
110113
'.woocommerce-Message',
111114
],
112115
'declarations' => [

app/customize/output/gray-400.php renamed to app/customize/output/color-gray-400.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* @author Spencer Finnell
1010
*/
1111

12+
if ( ! defined( 'ABSPATH' ) ) {
13+
exit; // Exit if accessed directly.
14+
}
15+
1216
$gray400 = bigbox_get_theme_color( 'gray-400' );
1317

1418
return [

0 commit comments

Comments
 (0)