generator-chisel 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/.nvmrc +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/images/chisel.svg +9 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factories/RegisterBlocks.php +16 -7
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helpers/ThemeHelpers.php +3 -3
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Helpers/WoocommerceHelpers.php +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/Plugins/Woocommerce.php +33 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/AjaxEndpoints.php +12 -6
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Blocks.php +60 -4
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Components.php +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/inc/WP/Site.php +0 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/package.chisel-tpl.json +5 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/patterns/cta.php +3 -5
- package/lib/commands/create/creators/app/chisel-starter-theme/patterns/features.php +42 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/patterns/hero.php +48 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/design/tools/_icon.scss +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/blocks-mods.js +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/editor/mods/core.js +57 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-group.scss +14 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-media-text.scss +6 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/utilities/_spacing.scss +3 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_product-item.scss +4 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/style.chisel-tpl.css +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/components/no-results.twig +1 -0
- package/lib/commands/create/creators/app/chisel-starter-theme/views/index.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig +1 -1
- package/lib/commands/create/creators/app/chisel-starter-theme/webpack.config.js +0 -11
- package/lib/commands/create/packages-versions.js +2 -2
- package/package.json +2 -2
- package/lib/commands/create/creators/app/chisel-starter-theme/assets/images/chisel.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- INSERT-NEW-ENTRIES-HERE -->
|
|
4
4
|
|
|
5
|
+
## 2.3.0 (2025-12-15)
|
|
6
|
+
|
|
7
|
+
- add wp exp-modules support, update wp scripts, build file size limits, auto clear patterns cache, no ([728f566](https://github.com/xfiveco/generator-chisel/commit/728f566))
|
|
8
|
+
- Publish ([0fc6fce](https://github.com/xfiveco/generator-chisel/commit/0fc6fce))
|
|
9
|
+
|
|
10
|
+
## <small>2.2.2 (2025-11-07)</small>
|
|
11
|
+
|
|
12
|
+
- blocks adjustments, new patterns, fixes, block mods ([19f038f](https://github.com/xfiveco/generator-chisel/commit/19f038f))
|
|
13
|
+
|
|
5
14
|
## <small>2.2.1 (2025-11-05)</small>
|
|
6
15
|
|
|
7
16
|
- fixes and defaults adjustments, improvements ([8d0ceca](https://github.com/xfiveco/generator-chisel/commit/8d0ceca))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
20.12.2
|
|
1
|
+
>=20.12.2
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="168" height="48" viewBox="0 0 168 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M38.6943 4.53418C38.2917 4.73999 37.9766 5.04969 37.7646 5.41406C37.1328 6.50071 36.7955 8.05967 35.6777 8.63086L35.0029 8.97559C20.158 16.5585 18.4387 13.1768 3.59375 20.7598L8.06348 29.5537C22.9084 21.9708 21.1892 18.5878 36.0342 11.0049L36.709 10.6602C37.8268 10.0893 39.283 10.733 40.5312 10.8594C40.9501 10.9017 41.3861 10.8279 41.7891 10.6221L47.8799 7.51074V48H0.308594L9.18457 43.4658C9.58753 43.26 9.90321 42.9505 10.1152 42.5859C10.7471 41.4992 11.0842 39.9402 12.2021 39.3691L12.877 39.0244C27.7219 31.4415 29.4412 34.8232 44.2861 27.2402L39.8164 18.4463C24.9715 26.0292 26.6905 29.4122 11.8457 36.9951L11.1709 37.3398C10.0529 37.9109 8.59607 37.2669 7.34766 37.1406C6.92896 37.0983 6.49365 37.1722 6.09082 37.3779L0 40.4883V0H47.5713L38.6943 4.53418ZM7.85254 24.1221L8.72559 27.5107L5.63086 21.4229L7.85254 24.1221ZM42.249 26.5771L40.0264 23.8779L39.1543 20.4893L42.249 26.5771Z" fill="#DD2424"/>
|
|
3
|
+
<path d="M117.469 2.86829C122.503 2.86829 126.584 6.93546 126.584 11.9868V15.5854H120.021V11.9868C120.021 10.5725 118.879 9.42588 117.469 9.42588C116.06 9.42588 114.917 10.5725 114.917 11.9868C114.918 16.4082 116.93 18.8032 119.791 21.6734C122.757 24.6503 126.584 28.7273 126.584 36.016C126.583 41.0666 122.502 45.1317 117.469 45.1317C112.436 45.1317 108.356 41.0666 108.355 36.016V32.4146H114.917V36.016C114.918 37.4296 116.06 38.577 117.469 38.577C118.878 38.577 120.02 37.4296 120.021 36.016C120.021 31.5942 118.008 29.1997 115.148 26.3295C112.182 23.3527 108.355 19.2755 108.355 11.9868C108.355 6.93547 112.435 2.86829 117.469 2.86829Z" fill="#050A18"/>
|
|
4
|
+
<path d="M82.5425 20.7073H87.6466V3.16098H94.209V44.839H87.6466V27.2927H82.5425V44.839H75.9801V3.16098H82.5425V20.7073Z" fill="#050A18"/>
|
|
5
|
+
<path d="M104.563 44.839H98.0007V3.16098H104.563V44.839Z" fill="#050A18"/>
|
|
6
|
+
<path d="M156.333 38.2683H168V44.839H149.771V3.16098H156.333V38.2683Z" fill="#050A18"/>
|
|
7
|
+
<path d="M63.949 2.86801C68.9827 2.86801 73.0634 6.96297 73.0634 12.0144V15.5839H66.501V12.0144C66.501 10.6 65.3584 9.45338 63.949 9.45338C62.5395 9.45338 61.3969 10.6 61.3969 12.0144V35.9856C61.3978 37.3992 62.5401 38.5466 63.949 38.5466C65.3578 38.5466 66.5001 37.3992 66.501 35.9856V32.4132H73.0634V35.9856C73.0625 41.0362 68.9822 45.132 63.949 45.132C58.9157 45.132 54.8354 41.0362 54.8345 35.9856V12.0144C54.8354 6.96376 58.9157 2.86801 63.949 2.86801Z" fill="#050A18"/>
|
|
8
|
+
<path d="M147.729 9.73171H136.063V20.7073H146.271V27.2927H136.063V38.2683H147.729V44.839H129.5V3.16098H147.729V9.73171Z" fill="#050A18"/>
|
|
9
|
+
</svg>
|
package/lib/commands/create/creators/app/chisel-starter-theme/inc/Factories/RegisterBlocks.php
CHANGED
|
@@ -187,13 +187,22 @@ final class RegisterBlocks {
|
|
|
187
187
|
|
|
188
188
|
// Register ignored scripts in dev mode in order to watch changes.
|
|
189
189
|
if ( ThemeHelpers::is_fast_refresh() || ( ! ThemeHelpers::is_fast_refresh() && ! in_array( $script, $ignore_scripts, true ) ) ) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
if ( 'viewscriptmodule' === $script_handle ) {
|
|
191
|
+
wp_register_script_module(
|
|
192
|
+
$block_handle,
|
|
193
|
+
$file_url,
|
|
194
|
+
$script_asset['dependencies'],
|
|
195
|
+
$script_asset['version']
|
|
196
|
+
);
|
|
197
|
+
} else {
|
|
198
|
+
wp_register_script(
|
|
199
|
+
$block_handle,
|
|
200
|
+
$file_url,
|
|
201
|
+
$script_asset['dependencies'],
|
|
202
|
+
$script_asset['version'],
|
|
203
|
+
$register_script_args
|
|
204
|
+
);
|
|
205
|
+
}
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
208
|
}
|
|
@@ -159,9 +159,9 @@ final class ThemeHelpers {
|
|
|
159
159
|
$logo_data = wp_get_attachment_image_src( $logo_id, 'medium' );
|
|
160
160
|
} else {
|
|
161
161
|
$logo_data = array(
|
|
162
|
-
ImageHelpers::get_image_url( 'chisel.
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
ImageHelpers::get_image_url( 'chisel.svg' ),
|
|
163
|
+
200,
|
|
164
|
+
60,
|
|
165
165
|
0,
|
|
166
166
|
);
|
|
167
167
|
}
|
|
@@ -55,12 +55,16 @@ final class Woocommerce implements InstanceInterface, HooksInterface {
|
|
|
55
55
|
public function action_hooks(): void {
|
|
56
56
|
$this->remove_actions();
|
|
57
57
|
|
|
58
|
+
add_action( 'rest_api_init', array( $this, 'register_cart' ) );
|
|
59
|
+
|
|
58
60
|
add_action( 'after_setup_theme', array( $this, 'add_woocommerce_support' ) );
|
|
59
61
|
|
|
60
62
|
add_action( 'woocommerce_before_shop_loop', array( $this, 'before_shop_loop_div_open' ), 19 );
|
|
61
63
|
add_action( 'woocommerce_before_shop_loop', array( $this, 'before_shop_loop_div_close' ), 31 );
|
|
62
64
|
|
|
63
65
|
add_action( 'customize_register', array( $this, 'modify_customizer' ), 20 );
|
|
66
|
+
|
|
67
|
+
add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
/**
|
|
@@ -99,6 +103,22 @@ final class Woocommerce implements InstanceInterface, HooksInterface {
|
|
|
99
103
|
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
|
|
100
104
|
}
|
|
101
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Get access to cart in REST API endpoints.
|
|
108
|
+
*
|
|
109
|
+
* @return void
|
|
110
|
+
*/
|
|
111
|
+
public function register_cart(): void {
|
|
112
|
+
include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
|
|
113
|
+
include_once WC_ABSPATH . 'includes/wc-notice-functions.php';
|
|
114
|
+
|
|
115
|
+
WC()->initialize_session();
|
|
116
|
+
WC()->initialize_cart();
|
|
117
|
+
WC()->session->set_customer_session_cookie( true );
|
|
118
|
+
|
|
119
|
+
WC()->cart->get_cart();
|
|
120
|
+
}
|
|
121
|
+
|
|
102
122
|
/**
|
|
103
123
|
* Add WooCommerce support.
|
|
104
124
|
*/
|
|
@@ -143,6 +163,19 @@ final class Woocommerce implements InstanceInterface, HooksInterface {
|
|
|
143
163
|
}
|
|
144
164
|
}
|
|
145
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Set woocommerce query to get orderby setting from customizer so that is consistent with ajax queries.
|
|
168
|
+
*
|
|
169
|
+
* @param \WP_Query $query
|
|
170
|
+
*
|
|
171
|
+
* @return void
|
|
172
|
+
*/
|
|
173
|
+
public function pre_get_posts( \WP_Query $query ): void {
|
|
174
|
+
if ( ! is_admin() && $query->is_main_query() && ( is_shop() || is_product_category() || is_product_tag() ) ) {
|
|
175
|
+
$query->set( 'orderby', get_option( 'woocommerce_default_catalog_orderby', 'menu_order' ) );
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
146
179
|
/**
|
|
147
180
|
* Register woocommerce sidebars.
|
|
148
181
|
*
|
|
@@ -32,14 +32,18 @@ final class AjaxEndpoints {
|
|
|
32
32
|
|
|
33
33
|
$response = '';
|
|
34
34
|
|
|
35
|
-
$
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'paged' => $page,
|
|
40
|
-
)
|
|
35
|
+
$args = array(
|
|
36
|
+
'post_type' => $post_type,
|
|
37
|
+
'posts_per_page' => $per_page,
|
|
38
|
+
'paged' => $page,
|
|
41
39
|
);
|
|
42
40
|
|
|
41
|
+
$posts = Timber::get_posts( $args )->to_array();
|
|
42
|
+
|
|
43
|
+
if ( $post_type === 'product' ) {
|
|
44
|
+
$args['orderby'] = get_option( 'woocommerce_default_catalog_orderby', 'menu_order' );
|
|
45
|
+
}
|
|
46
|
+
|
|
43
47
|
$templates = array( 'components/' . $post_type . '-item.twig', 'components/post-item.twig' );
|
|
44
48
|
|
|
45
49
|
if ( $post_type === 'product' ) {
|
|
@@ -50,6 +54,8 @@ final class AjaxEndpoints {
|
|
|
50
54
|
foreach ( $posts as $post ) {
|
|
51
55
|
$response .= Timber::compile( $templates, array( 'post' => $post ), CacheHelpers::expiry() );
|
|
52
56
|
}
|
|
57
|
+
} else {
|
|
58
|
+
$response = Timber::compile( 'components/no-results.twig' );
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
return $this->success( $response );
|
|
@@ -29,6 +29,13 @@ final class Blocks implements InstanceInterface, HooksInterface {
|
|
|
29
29
|
*/
|
|
30
30
|
private RegisterBlocks $register_blocks_factory;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Theme.
|
|
34
|
+
*
|
|
35
|
+
* @var \WP_Theme
|
|
36
|
+
*/
|
|
37
|
+
private ?\WP_Theme $theme = null;
|
|
38
|
+
|
|
32
39
|
/**
|
|
33
40
|
* Blocks.
|
|
34
41
|
*
|
|
@@ -51,6 +58,14 @@ final class Blocks implements InstanceInterface, HooksInterface {
|
|
|
51
58
|
*/
|
|
52
59
|
private array $block_patterns_categories = array();
|
|
53
60
|
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Blocks patterns categories namespace.
|
|
64
|
+
*
|
|
65
|
+
* @var string
|
|
66
|
+
*/
|
|
67
|
+
private string $block_patterns_categories_namespace = '';
|
|
68
|
+
|
|
54
69
|
/**
|
|
55
70
|
* Blocks twig file base path.
|
|
56
71
|
*
|
|
@@ -75,12 +90,22 @@ final class Blocks implements InstanceInterface, HooksInterface {
|
|
|
75
90
|
* Set properties.
|
|
76
91
|
*/
|
|
77
92
|
public function set_properties(): void {
|
|
78
|
-
$this->
|
|
79
|
-
$this->
|
|
80
|
-
|
|
93
|
+
$this->theme = wp_get_theme();
|
|
94
|
+
$this->blocks_category = 'chisel-blocks';
|
|
95
|
+
$this->block_patterns_categories_namespace = 'chisel-patterns';
|
|
96
|
+
$this->block_patterns_categories = array(
|
|
97
|
+
'cta' => array(
|
|
81
98
|
'label' => __( 'Call to Action', 'chisel' ),
|
|
82
99
|
'description' => __( 'Call to Action Sections.', 'chisel' ),
|
|
83
100
|
),
|
|
101
|
+
'features' => array(
|
|
102
|
+
'label' => __( 'Features', 'chisel' ),
|
|
103
|
+
'description' => __( 'Features Sections.', 'chisel' ),
|
|
104
|
+
),
|
|
105
|
+
'hero' => array(
|
|
106
|
+
'label' => __( 'Hero', 'chisel' ),
|
|
107
|
+
'description' => __( 'Hero Sections.', 'chisel' ),
|
|
108
|
+
),
|
|
84
109
|
);
|
|
85
110
|
}
|
|
86
111
|
|
|
@@ -165,9 +190,11 @@ final class Blocks implements InstanceInterface, HooksInterface {
|
|
|
165
190
|
return;
|
|
166
191
|
}
|
|
167
192
|
|
|
193
|
+
$this->maybe_clear_patterns_cache();
|
|
194
|
+
|
|
168
195
|
foreach ( $this->block_patterns_categories as $slug => $category ) {
|
|
169
196
|
$category['label'] = sprintf( '[%s] %s', ThemeHelpers::get_theme_name(), esc_attr( $category['label'] ) );
|
|
170
|
-
register_block_pattern_category( '
|
|
197
|
+
register_block_pattern_category( $this->block_patterns_categories_namespace . '/' . $slug, $category );
|
|
171
198
|
}
|
|
172
199
|
}
|
|
173
200
|
|
|
@@ -305,4 +332,33 @@ final class Blocks implements InstanceInterface, HooksInterface {
|
|
|
305
332
|
}
|
|
306
333
|
}
|
|
307
334
|
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Maybe clear patterns cache. Clear patterns cache if block patterns categories are changed / added.
|
|
338
|
+
*
|
|
339
|
+
* @return void
|
|
340
|
+
*/
|
|
341
|
+
protected function maybe_clear_patterns_cache() {
|
|
342
|
+
if ( ! $this->block_patterns_categories ) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
$theme_patterns = $this->block_patterns_categories;
|
|
347
|
+
$cached_patterns = $this->theme->get_block_patterns();
|
|
348
|
+
$patterns_categories = array();
|
|
349
|
+
|
|
350
|
+
foreach ( $cached_patterns as $pattern ) {
|
|
351
|
+
foreach ( $pattern['categories'] ?? array() as $category ) {
|
|
352
|
+
$category = str_replace( $this->block_patterns_categories_namespace . '/', '', $category );
|
|
353
|
+
|
|
354
|
+
if ( isset( $theme_patterns[ $category ] ) ) {
|
|
355
|
+
unset( $theme_patterns[ $category ] );
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if ( ! empty( $theme_patterns ) ) {
|
|
361
|
+
$this->theme->delete_pattern_cache();
|
|
362
|
+
}
|
|
363
|
+
}
|
|
308
364
|
}
|
|
@@ -111,7 +111,7 @@ final class Components {
|
|
|
111
111
|
$sidebar_name = 'chisel-sidebar-' . $sidebar_id;
|
|
112
112
|
} elseif ( is_singular( 'post' ) ) {
|
|
113
113
|
$sidebar_name = 'chisel-sidebar-blog';
|
|
114
|
-
} elseif ( function_exists( 'is_shop' ) && is_shop() ) {
|
|
114
|
+
} elseif ( function_exists( 'is_shop' ) && ( is_shop() || is_product_category() || is_product_tag() ) ) {
|
|
115
115
|
$sidebar_name = 'chisel-sidebar-woocommerce';
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -123,7 +123,7 @@ final class Components {
|
|
|
123
123
|
return self::$sidebar[ $sidebar_name ];
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
$sidebar_content = Timber::get_widgets( $sidebar_name );
|
|
126
|
+
$sidebar_content = apply_filters( 'chisel_sidebar_content', Timber::get_widgets( $sidebar_name ), $sidebar_name );
|
|
127
127
|
|
|
128
128
|
self::$sidebar[ $sidebar_name ] = array(
|
|
129
129
|
'id' => $sidebar_id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= app.nameSlug %>",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "<%= app.author %>",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"devcontainer:up": "npm run --silent devcontainer -- up --workspace-folder ../../..",
|
|
11
11
|
"devcontainer:enter": "/usr/bin/env bash ../../../.devcontainer/exec bash",
|
|
12
12
|
"devcontainer:start": "/usr/bin/env bash ../../../.devcontainer/exec npm run --silent start",
|
|
13
|
-
"start": "chisel-scripts start",
|
|
13
|
+
"start": "chisel-scripts start --experimental-modules",
|
|
14
14
|
"dev": "npm run --silent start",
|
|
15
|
-
"build": "chisel-scripts build
|
|
16
|
-
"build
|
|
15
|
+
"build-scripts": "chisel-scripts build --experimental-modules",
|
|
16
|
+
"build": "npm run build-scripts && npm run lint && npm run phpcs && npm run twigcs",
|
|
17
17
|
"add-page": "chisel-scripts add-page",
|
|
18
18
|
"create-block": "chisel-scripts create-block --category=chisel-blocks --namespace=chisel",
|
|
19
19
|
"create-dynamic-block": "npm run create-block --variant=dynamic",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"swiper": "^11.1.10"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@wordpress/scripts": "^
|
|
30
|
+
"@wordpress/scripts": "^31.1.0",
|
|
31
31
|
"chisel-scripts": "*",
|
|
32
32
|
"cross-env": "^7.0.3"
|
|
33
33
|
},
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
/**
|
|
3
|
-
* Title: Call to Action
|
|
4
|
-
* Slug: chisel/cta
|
|
3
|
+
* Title: Call to Action 01
|
|
4
|
+
* Slug: chisel/cta-01
|
|
5
5
|
* Categories: chisel-patterns/cta
|
|
6
|
-
* Description: A CTA section pattern
|
|
6
|
+
* Description: A CTA section pattern 01
|
|
7
7
|
* Keywords: cta
|
|
8
|
-
* Post Types: post, page
|
|
9
|
-
* Template Types: post, page
|
|
10
8
|
*
|
|
11
9
|
* @package Chisel
|
|
12
10
|
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Title: Features 01
|
|
4
|
+
* Slug: chisel/features-01
|
|
5
|
+
* Categories: chisel-patterns/features
|
|
6
|
+
* Description: Features pattern 01
|
|
7
|
+
* Keywords: features
|
|
8
|
+
*
|
|
9
|
+
* @package Chisel
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
?>
|
|
13
|
+
|
|
14
|
+
<!-- wp:media-text {"mediaSizeSlug":"large","className":"u-no-margin-bottom","backgroundColor":"grey-100","disableBottomMargin":true} -->
|
|
15
|
+
<div class="wp-block-media-text is-stacked-on-mobile u-no-margin-bottom has-grey-100-background-color has-background"><figure class="wp-block-media-text__media"></figure><div class="wp-block-media-text__content"><!-- wp:heading {"level":3} -->
|
|
16
|
+
<h3 class="wp-block-heading">Feature 1</h3>
|
|
17
|
+
<!-- /wp:heading -->
|
|
18
|
+
|
|
19
|
+
<!-- wp:paragraph -->
|
|
20
|
+
<p>Feature description</p>
|
|
21
|
+
<!-- /wp:paragraph --></div></div>
|
|
22
|
+
<!-- /wp:media-text -->
|
|
23
|
+
|
|
24
|
+
<!-- wp:media-text {"mediaPosition":"right","mediaSizeSlug":"large","className":"u-no-margin-bottom","backgroundColor":"grey-100","disableBottomMargin":true} -->
|
|
25
|
+
<div class="wp-block-media-text has-media-on-the-right is-stacked-on-mobile u-no-margin-bottom has-grey-100-background-color has-background"><div class="wp-block-media-text__content"><!-- wp:heading {"level":3} -->
|
|
26
|
+
<h3 class="wp-block-heading">Feature 2</h3>
|
|
27
|
+
<!-- /wp:heading -->
|
|
28
|
+
|
|
29
|
+
<!-- wp:paragraph -->
|
|
30
|
+
<p>Feature description</p>
|
|
31
|
+
<!-- /wp:paragraph --></div><figure class="wp-block-media-text__media"></figure></div>
|
|
32
|
+
<!-- /wp:media-text -->
|
|
33
|
+
|
|
34
|
+
<!-- wp:media-text {"mediaSizeSlug":"large","backgroundColor":"grey-100"} -->
|
|
35
|
+
<div class="wp-block-media-text is-stacked-on-mobile has-grey-100-background-color has-background"><figure class="wp-block-media-text__media"></figure><div class="wp-block-media-text__content"><!-- wp:heading {"level":3} -->
|
|
36
|
+
<h3 class="wp-block-heading">Feature 3</h3>
|
|
37
|
+
<!-- /wp:heading -->
|
|
38
|
+
|
|
39
|
+
<!-- wp:paragraph -->
|
|
40
|
+
<p>Feature description</p>
|
|
41
|
+
<!-- /wp:paragraph --></div></div>
|
|
42
|
+
<!-- /wp:media-text -->
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Title: Hero 01
|
|
4
|
+
* Slug: chisel/hero-01
|
|
5
|
+
* Categories: chisel-patterns/hero
|
|
6
|
+
* Description: A hero section pattern 01
|
|
7
|
+
* Keywords: hero, banner
|
|
8
|
+
*
|
|
9
|
+
* @package Chisel
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
?>
|
|
13
|
+
|
|
14
|
+
<!-- wp:cover {"overlayColor":"foreground","isUserOverlayColor":true,"align":"full","layout":{"type":"constrained","contentSize":"848px","wideSize":"1072px"}} -->
|
|
15
|
+
<div class="wp-block-cover alignfull"><span aria-hidden="true" class="wp-block-cover__background has-foreground-background-color has-background-dim-100 has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":"auto","className":"is-style-big"} -->
|
|
16
|
+
<div style="height:auto" aria-hidden="true" class="wp-block-spacer is-style-big"></div>
|
|
17
|
+
<!-- /wp:spacer -->
|
|
18
|
+
|
|
19
|
+
<!-- wp:spacer {"height":"auto","className":"is-style-large"} -->
|
|
20
|
+
<div style="height:auto" aria-hidden="true" class="wp-block-spacer is-style-large"></div>
|
|
21
|
+
<!-- /wp:spacer -->
|
|
22
|
+
|
|
23
|
+
<!-- wp:heading {"textAlign":"center","level":1} -->
|
|
24
|
+
<h1 class="wp-block-heading has-text-align-center">A modern development framework for WordPress</h1>
|
|
25
|
+
<!-- /wp:heading -->
|
|
26
|
+
|
|
27
|
+
<!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
|
|
28
|
+
<p class="has-text-align-center has-large-font-size">Craft <strong>fast</strong> and <strong>easy to maintain</strong> WordPress websites. Use the <strong>power</strong> and <strong>simplicity</strong> of Timber and Twig. Make your CSS <strong>scalable</strong> and <strong>maintainable</strong> with ITCSS. Get rid of tedious manual tasks with Chisel's <strong>modern development workflow</strong>.</p>
|
|
29
|
+
<!-- /wp:paragraph -->
|
|
30
|
+
|
|
31
|
+
<!-- wp:spacer {"height":"auto","className":"is-style-large"} -->
|
|
32
|
+
<div style="height:auto" aria-hidden="true" class="wp-block-spacer is-style-large"></div>
|
|
33
|
+
<!-- /wp:spacer -->
|
|
34
|
+
|
|
35
|
+
<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
|
|
36
|
+
<div class="wp-block-buttons"><!-- wp:button {"className":"is-style-primary has-icon has-icon-arrow-right","buttonIcon":"arrow-right"} -->
|
|
37
|
+
<div class="wp-block-button is-style-primary has-icon has-icon-arrow-right"><a class="wp-block-button__link wp-element-button" href="#">Get started</a></div>
|
|
38
|
+
<!-- /wp:button -->
|
|
39
|
+
|
|
40
|
+
<!-- wp:button {"className":"-right is-style-primary-outline"} -->
|
|
41
|
+
<div class="wp-block-button -right is-style-primary-outline"><a class="wp-block-button__link wp-element-button">Learn more</a></div>
|
|
42
|
+
<!-- /wp:button --></div>
|
|
43
|
+
<!-- /wp:buttons -->
|
|
44
|
+
|
|
45
|
+
<!-- wp:spacer {"height":"auto","className":"is-style-big"} -->
|
|
46
|
+
<div style="height:auto" aria-hidden="true" class="wp-block-spacer is-style-big"></div>
|
|
47
|
+
<!-- /wp:spacer --></div></div>
|
|
48
|
+
<!-- /wp:cover -->
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __ } from '@wordpress/i18n';
|
|
2
|
+
import { addFilter } from '@wordpress/hooks';
|
|
3
|
+
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
4
|
+
import { InspectorControls } from '@wordpress/blockEditor';
|
|
5
|
+
import { PanelBody, ToggleControl } from '@wordpress/components';
|
|
6
|
+
import { Fragment } from '@wordpress/element';
|
|
7
|
+
|
|
8
|
+
addFilter('blocks.registerBlockType', 'chisel/add-no-margin-attribute', (settings) => {
|
|
9
|
+
if (typeof settings.attributes !== 'undefined') {
|
|
10
|
+
settings.attributes = {
|
|
11
|
+
...settings.attributes,
|
|
12
|
+
disableBottomMargin: {
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return settings;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const addNoMarginToggle = createHigherOrderComponent((BlockEdit) => {
|
|
22
|
+
return (props) => {
|
|
23
|
+
const { attributes, setAttributes, isSelected } = props;
|
|
24
|
+
const { disableBottomMargin = false, className = '' } = attributes;
|
|
25
|
+
|
|
26
|
+
const onToggle = (checked) => {
|
|
27
|
+
let newClassName = className.replace(/\bu-no-margin-bottom\b/, '').trim();
|
|
28
|
+
if (checked) {
|
|
29
|
+
newClassName = `${newClassName} u-no-margin-bottom`.trim();
|
|
30
|
+
}
|
|
31
|
+
setAttributes({
|
|
32
|
+
disableBottomMargin: checked,
|
|
33
|
+
className: newClassName,
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Fragment>
|
|
39
|
+
<BlockEdit {...props} />
|
|
40
|
+
{isSelected && (
|
|
41
|
+
<InspectorControls>
|
|
42
|
+
<PanelBody title={__('Spacing', 'chisel')}>
|
|
43
|
+
<ToggleControl
|
|
44
|
+
label={__('Disable bottom spacing', 'chisel')}
|
|
45
|
+
help={__('Removes the bottom spacing', 'chisel')}
|
|
46
|
+
checked={!!disableBottomMargin}
|
|
47
|
+
onChange={onToggle}
|
|
48
|
+
/>
|
|
49
|
+
</PanelBody>
|
|
50
|
+
</InspectorControls>
|
|
51
|
+
)}
|
|
52
|
+
</Fragment>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
}, 'addNoMarginToggle');
|
|
56
|
+
|
|
57
|
+
addFilter('editor.BlockEdit', 'chisel/add-no-margin-toggle', addNoMarginToggle);
|
package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-group.scss
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use '~design' as *;
|
|
2
|
+
|
|
3
|
+
.wp-block-group-is-layout-constrained {
|
|
4
|
+
> :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
|
|
5
|
+
max-width: get-layout-size('content');
|
|
6
|
+
margin-left: auto !important;
|
|
7
|
+
margin-right: auto !important;
|
|
8
|
+
padding-inline: get-padding('normal');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where(.wp-block-group.has-background.alignfull) {
|
|
13
|
+
padding: get-padding('small') 0;
|
|
14
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Theme URI: https://www.getchisel.co/
|
|
4
4
|
* Author: <%= app.author %>
|
|
5
5
|
* Description: Chisel Wordpress Starter Theme based on Timber library.
|
|
6
|
-
* Version: 2.2.
|
|
6
|
+
* Version: 2.2.2
|
|
7
7
|
* License: GNU General Public License v2 or later
|
|
8
8
|
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
9
9
|
* Tags: chisel, custom, starter, theme, WordPress
|
package/lib/commands/create/creators/app/chisel-starter-theme/views/components/no-results.twig
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<h2>{{ __('No posts found', 'chisel') }}</h2>
|
|
@@ -20,7 +20,7 @@ In order to covert back to a grid, add the following classes to the c-posts-item
|
|
|
20
20
|
{% include ['components/' ~ post.post_type ~ '-item.twig', 'components/post-item.twig'] with {post: post} only %}
|
|
21
21
|
{% endfor %}
|
|
22
22
|
{% else %}
|
|
23
|
-
|
|
23
|
+
{% include 'components/no-results.twig' %}
|
|
24
24
|
{% endif %}
|
|
25
25
|
</div>
|
|
26
26
|
|
package/lib/commands/create/creators/app/chisel-starter-theme/views/woocommerce/linked-products.twig
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
{% endif %}
|
|
7
7
|
|
|
8
8
|
<div class="{{ bem('o-layout__item', (sidebar.content ? '8' : '12') ~ '-large') }}">
|
|
9
|
-
<div class="c-product-linked__items {{ grid_classnames }}">
|
|
9
|
+
<div class="c-product-linked__items {{ grid_classnames|default(bem('o-grid', 'cols-1', 'cols-2-small', 'cols-3-medium')) }}">
|
|
10
10
|
{% for post in linked_products %}
|
|
11
11
|
{% include "woocommerce/content-product.twig" with {post: post} %}
|
|
12
12
|
{% endfor %}
|
|
@@ -3,15 +3,4 @@ const { adjustWebpackConfig } = require('chisel-scripts');
|
|
|
3
3
|
|
|
4
4
|
const updatedConfig = adjustWebpackConfig(defaultConfig, __dirname);
|
|
5
5
|
|
|
6
|
-
updatedConfig.devServer = {
|
|
7
|
-
...updatedConfig.devServer,
|
|
8
|
-
client: {
|
|
9
|
-
overlay: {
|
|
10
|
-
errors: true,
|
|
11
|
-
warnings: false,
|
|
12
|
-
runtimeErrors: false,
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
6
|
module.exports = updatedConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-chisel",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "A generator for scaffolding front-end and WordPress projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"chisel": "bin/chisel.js"
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"tinyqueue": "^2.0.3",
|
|
38
38
|
"update-notifier": "^4.1.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f5cb01894754a85b6842fa10412986bb745ea43a"
|
|
41
41
|
}
|