generator-chisel 2.0.0-alpha.1 → 2.0.0-alpha.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/lib/commands/create/creators/app/chisel-starter-theme/.gitignore.chisel-tpl +1 -0
  3. package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_666eb7f38d2ed.json +42 -42
  4. package/lib/commands/create/creators/app/chisel-starter-theme/acf-json/group_66d5a4ebb41cd.json +1 -1
  5. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Acf.php +19 -22
  6. package/lib/commands/create/creators/app/chisel-starter-theme/classes/AcfBlocks.php +1 -1
  7. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Ajax.php +20 -19
  8. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Assets.php +140 -111
  9. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Blocks.php +8 -11
  10. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Comments.php +321 -0
  11. package/lib/commands/create/creators/app/chisel-starter-theme/classes/CustomPostTypes.php +31 -29
  12. package/lib/commands/create/creators/app/chisel-starter-theme/classes/GravityForms.php +109 -0
  13. package/lib/commands/create/creators/app/chisel-starter-theme/classes/RegisterBlocks.php +6 -5
  14. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Theme.php +32 -8
  15. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Twig.php +8 -0
  16. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Woocommerce.php +37 -9
  17. package/lib/commands/create/creators/app/chisel-starter-theme/classes/Yoast.php +61 -0
  18. package/lib/commands/create/creators/app/chisel-starter-theme/functions.php +3 -0
  19. package/lib/commands/create/creators/app/chisel-starter-theme/patterns/comments.php +51 -0
  20. package/lib/commands/create/creators/app/chisel-starter-theme/patterns/cta.php +2 -3
  21. package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/acf-json/group_66462c70b851f.json +1 -1
  22. package/lib/commands/create/creators/app/chisel-starter-theme/src/blocks-acf/slider/block.json +1 -1
  23. package/lib/commands/create/creators/app/chisel-starter-theme/src/scripts/modules/slider.js +6 -2
  24. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/.gitignore.chisel-tpl +1 -0
  25. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_core-comments.scss +16 -0
  26. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/blocks/_index.scss +16 -0
  27. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_index.scss +19 -0
  28. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/components/_slider.scss +5 -6
  29. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/elements/_index.scss +10 -0
  30. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/generic/_index.scss +4 -0
  31. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/{vendor/_gravity-forms.scss → gravity-forms.scss} +5 -1
  32. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/login.scss +1 -0
  33. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/objects/_index.scss +6 -0
  34. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/utilities/_index.scss +4 -0
  35. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/vendor/_index.scss +3 -0
  36. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/widgets/_index.scss +5 -0
  37. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/woo/_index.scss +12 -0
  38. package/lib/commands/create/creators/app/chisel-starter-theme/src/styles/wp-editor/_index.scss +11 -0
  39. package/lib/commands/create/creators/app/chisel-starter-theme/views/base.twig +4 -0
  40. package/lib/commands/create/creators/app/chisel-starter-theme/views/single.twig +2 -0
  41. package/lib/commands/create/packages-versions.js +1 -1
  42. package/package.json +2 -2
  43. package/lib/commands/create/creators/app/chisel-starter-theme/composer.lock +0 -2180
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  <!-- INSERT-NEW-ENTRIES-HERE -->
4
4
 
5
+ ## 2.0.0-alpha.3 (2024-09-13)
6
+
7
+ - refactor, adjustments, css spliting, comments, 3rd party integration classes ([e1fe3cd](https://github.com/xfiveco/generator-chisel/commit/e1fe3cd))
8
+ - update blocks path, add action hooks ([e20d184](https://github.com/xfiveco/generator-chisel/commit/e20d184))
9
+
10
+ ## 2.0.0-alpha.2 (2024-09-10)
11
+
12
+ - correct gitignore ([22542dc](https://github.com/xfiveco/generator-chisel/commit/22542dc))
13
+
5
14
  ## 2.0.0-alpha.1 (2024-09-10)
6
15
 
7
16
  - adjust commands ([b289bd8](https://github.com/xfiveco/generator-chisel/commit/b289bd8))
@@ -2,49 +2,49 @@
2
2
  "key": "group_666eb7f38d2ed",
3
3
  "title": "Page Title",
4
4
  "fields": [
5
- {
6
- "key": "field_666eb7f40c492",
7
- "label": "Page Title",
8
- "name": "page_title_display",
9
- "aria-label": "",
10
- "type": "select",
11
- "instructions": "",
12
- "required": 0,
13
- "conditional_logic": 0,
14
- "wrapper": {
15
- "width": "",
16
- "class": "",
17
- "id": ""
18
- },
19
- "choices": {
20
- "show": "Show",
21
- "hide-visually": "Hide visually",
22
- "hide": "Hide"
23
- },
24
- "default_value": "show",
25
- "return_format": "value",
26
- "multiple": 0,
27
- "allow_null": 0,
28
- "ui": 0,
29
- "ajax": 0,
30
- "placeholder": ""
31
- }
32
- ],
33
- "location": [
34
- [
35
- {
36
- "param": "post_type",
37
- "operator": "==",
38
- "value": "post"
39
- }
40
- ],
41
- [
42
5
  {
43
- "param": "post_type",
44
- "operator": "==",
45
- "value": "page"
6
+ "key": "field_666eb7f40c492",
7
+ "label": "Page Title",
8
+ "name": "page_title_display",
9
+ "aria-label": "",
10
+ "type": "select",
11
+ "instructions": "",
12
+ "required": 0,
13
+ "conditional_logic": 0,
14
+ "wrapper": {
15
+ "width": "",
16
+ "class": "",
17
+ "id": ""
18
+ },
19
+ "choices": {
20
+ "show": "Show",
21
+ "hide-visually": "Hide visually",
22
+ "hide": "Hide"
23
+ },
24
+ "default_value": "show",
25
+ "return_format": "value",
26
+ "multiple": 0,
27
+ "allow_null": 0,
28
+ "ui": 0,
29
+ "ajax": 0,
30
+ "placeholder": ""
46
31
  }
47
- ]
32
+ ],
33
+ "location": [
34
+ [
35
+ {
36
+ "param": "post_type",
37
+ "operator": "==",
38
+ "value": "post"
39
+ }
40
+ ],
41
+ [
42
+ {
43
+ "param": "post_type",
44
+ "operator": "==",
45
+ "value": "page"
46
+ }
47
+ ]
48
48
  ],
49
49
  "menu_order": -10,
50
50
  "position": "side",
@@ -55,5 +55,5 @@
55
55
  "active": true,
56
56
  "description": "",
57
57
  "show_in_rest": 0,
58
- "modified": 1723819074
58
+ "modified": 1725978564
59
59
  }
@@ -144,5 +144,5 @@
144
144
  "active": false,
145
145
  "description": "For cloning only",
146
146
  "show_in_rest": 0,
147
- "modified": 1725978785
147
+ "modified": 1726064786
148
148
  }
@@ -61,16 +61,13 @@ class Acf implements Instance {
61
61
  * Set ACF options pages.
62
62
  */
63
63
  public function set_options_pages() {
64
- $this->acf_options_pages = apply_filters(
65
- 'chisel_acf_options_pages',
66
- array(
67
- // phpcs:disable
68
- // array(
69
- // 'menu_slug' => 'theme-settings',
70
- // 'page_title' => __( 'Theme Settings', 'chisel' ),
71
- // ),
72
- // phpcs:enable
73
- )
64
+ $this->acf_options_pages = array(
65
+ // phpcs:disable
66
+ // array(
67
+ // 'menu_slug' => 'theme-settings',
68
+ // 'page_title' => __( 'Theme Settings', 'chisel' ),
69
+ // ),
70
+ // phpcs:enable
74
71
  );
75
72
  }
76
73
 
@@ -78,18 +75,15 @@ class Acf implements Instance {
78
75
  * Set ACF options sub pages.
79
76
  */
80
77
  public function set_options_sub_pages() {
81
- $this->acf_options_sub_pages = apply_filters(
82
- 'chisel_acf_options_sub_pages',
83
- array(
84
- // phpcs:disable
85
- // array(
86
- // 'menu_slug' => 'theme-sub-settings',
87
- // 'page_title' => __( 'Theme Sub settings', 'chisel' ),
88
- // 'menu_title' => __( 'Theme Sub settings', 'chisel' ),
89
- // 'parent_slug' => 'theme-settings',
90
- // ),
91
- // phpcs:enable
92
- )
78
+ $this->acf_options_sub_pages = array(
79
+ // phpcs:disable
80
+ // array(
81
+ // 'menu_slug' => 'theme-sub-settings',
82
+ // 'page_title' => __( 'Theme Sub settings', 'chisel' ),
83
+ // 'menu_title' => __( 'Theme Sub settings', 'chisel' ),
84
+ // 'parent_slug' => 'theme-settings',
85
+ // ),
86
+ // phpcs:enable
93
87
  );
94
88
  }
95
89
 
@@ -97,6 +91,9 @@ class Acf implements Instance {
97
91
  * Register ACF options pages.
98
92
  */
99
93
  public function options_pages() {
94
+ $this->acf_options_pages = apply_filters( 'chisel_acf_options_pages', $this->acf_options_pages );
95
+ $this->acf_options_sub_pages = apply_filters( 'chisel_acf_options_sub_pages', $this->acf_options_sub_pages );
96
+
100
97
  if ( $this->acf_options_pages && function_exists( 'acf_add_options_page' ) ) {
101
98
  foreach ( $this->acf_options_pages as $data ) {
102
99
  $this->register_options_page( $data, 'page' );
@@ -35,7 +35,7 @@ class AcfBlocks extends RegisterBlocks implements Instance {
35
35
  * Set properties.
36
36
  */
37
37
  public function set_properties() {
38
- $this->blocks_twig_base_path = 'src/blocks-acf/';
38
+ $this->blocks_twig_base_path = 'build/blocks-acf/';
39
39
  }
40
40
 
41
41
  /**
@@ -45,11 +45,8 @@ class Ajax extends \WP_REST_Controller implements Instance {
45
45
  * Set properties.
46
46
  */
47
47
  public function set_properties() {
48
- $this->routes = apply_filters(
49
- 'chisel_ajax_routes',
50
- array(
51
- 'load-more' => array(),
52
- )
48
+ $this->routes = array(
49
+ 'load-more' => array(),
53
50
  );
54
51
  }
55
52
 
@@ -71,20 +68,24 @@ class Ajax extends \WP_REST_Controller implements Instance {
71
68
  * @return void
72
69
  */
73
70
  public function register_endpoints() {
74
- foreach ( $this->routes as $route_name => $route_params ) {
75
- $route = sprintf( self::ROUTE_BASE . '/%s/', $route_name );
76
- $methods = isset( $route_params['methods'] ) ? $route_params['methods'] : array( 'POST' );
77
-
78
- register_rest_route(
79
- self::ROUTE_NAMESPACE,
80
- $route,
81
- array(
82
- 'methods' => $methods,
83
- 'callback' => array( $this, 'callback' ),
84
- 'permission_callback' => array( $this, 'permissions_check' ),
85
- 'args' => $this->get_endpoint_args_for_item_schema( true ),
86
- )
87
- );
71
+ $this->routes = apply_filters( 'chisel_ajax_routes', $this->routes );
72
+
73
+ if ( $this->routes ) {
74
+ foreach ( $this->routes as $route_name => $route_params ) {
75
+ $route = sprintf( self::ROUTE_BASE . '/%s/', $route_name );
76
+ $methods = isset( $route_params['methods'] ) ? $route_params['methods'] : array( 'POST' );
77
+
78
+ register_rest_route(
79
+ self::ROUTE_NAMESPACE,
80
+ $route,
81
+ array(
82
+ 'methods' => $methods,
83
+ 'callback' => array( $this, 'callback' ),
84
+ 'permission_callback' => array( $this, 'permissions_check' ),
85
+ 'args' => $this->get_endpoint_args_for_item_schema( true ),
86
+ )
87
+ );
88
+ }
88
89
  }
89
90
  }
90
91
 
@@ -96,93 +96,66 @@ class Assets implements Instance {
96
96
  );
97
97
 
98
98
  if ( ! is_admin() ) {
99
- $this->frontend_styles = apply_filters(
100
- 'chisel_frontend_styles',
101
- array(
102
- 'main' => array(),
103
- 'woocommerce' => array(
104
- 'condition' => Woocommerce::is_woocommerce_active(),
105
- ),
106
- )
99
+ $this->frontend_styles = array(
100
+ 'main' => array(),
107
101
  );
108
102
 
109
- $this->frontend_scripts = apply_filters(
110
- 'chisel_frontend_scripts',
111
- array(
112
- 'runtime' => $runtime_script,
113
- 'app' => array(
114
- 'deps' => array( 'wp-i18n' ),
115
- 'localize' => array(
116
- 'name' => 'chiselScripts',
117
- 'data' => array(
118
- 'ajax' => array(
119
- 'url' => esc_url( Ajax::get_ajax_endpoint_url() ),
120
- 'nonce' => wp_create_nonce( 'wp_rest' ), // this (wp_rest) authenticates users and allows using get_current_user functions in rest api endpoints.
121
- ),
103
+ $this->frontend_scripts = array(
104
+ 'runtime' => $runtime_script,
105
+ 'app' => array(
106
+ 'deps' => array( 'wp-i18n' ),
107
+ 'localize' => array(
108
+ 'name' => 'chiselScripts',
109
+ 'data' => array(
110
+ 'ajax' => array(
111
+ 'url' => esc_url( Ajax::get_ajax_endpoint_url() ),
112
+ 'nonce' => wp_create_nonce( 'wp_rest' ), // this (wp_rest) authenticates users and allows using get_current_user functions in rest api endpoints.
122
113
  ),
123
114
  ),
124
115
  ),
125
- )
116
+ ),
126
117
  );
127
118
 
128
119
  if ( is_login() ) {
129
- $this->login_styles = apply_filters(
130
- 'chisel_login_styles',
131
- array(
132
- 'login' => array(),
133
- )
120
+ $this->login_styles = array(
121
+ 'login' => array(),
134
122
  );
135
123
 
136
- $this->login_scripts = apply_filters(
137
- 'chisel_login_scripts',
138
- array(
139
- 'runtime' => $runtime_script,
140
- 'login' => array(
141
- 'localize' => array(
142
- 'name' => 'chiselScripts',
143
- 'data' => array(
144
- 'logoUrl' => Helpers::get_login_page_logo_url(),
145
- ),
124
+ $this->login_scripts = array(
125
+ 'runtime' => $runtime_script,
126
+ 'login' => array(
127
+ 'localize' => array(
128
+ 'name' => 'chiselScripts',
129
+ 'data' => array(
130
+ 'logoData' => Helpers::get_login_page_logo_url(),
146
131
  ),
147
132
  ),
148
- )
133
+ ),
149
134
  );
150
135
  }
151
136
  } else {
152
- $this->admin_styles = apply_filters(
153
- 'chisel_admin_styles',
154
- array(
155
- 'admin' => array(),
156
- )
137
+ $this->admin_styles = array(
138
+ 'admin' => array(),
157
139
  );
158
140
 
159
- $this->admin_scripts = apply_filters(
160
- 'chisel_admin_scripts',
161
- array(
162
- 'runtime' => $runtime_script,
163
- 'admin' => array(
164
- 'localize' => array(
165
- 'name' => 'chiselAdminScripts',
166
- 'data' => array(
167
- 'acfColorPickerPalette' => Helpers::get_colors_palette( 'acf' ),
168
- ),
141
+ $this->admin_scripts = array(
142
+ 'runtime' => $runtime_script,
143
+ 'admin' => array(
144
+ 'localize' => array(
145
+ 'name' => 'chiselAdminScripts',
146
+ 'data' => array(
147
+ 'acfColorPickerPalette' => Helpers::get_colors_palette( 'acf' ),
169
148
  ),
170
149
  ),
171
- )
150
+ ),
172
151
  );
173
152
 
174
- $this->editor_styles = apply_filters(
175
- 'chisel_editor_styles',
176
- array(
177
- 'editor' => array(),
178
- )
153
+ $this->editor_styles = array(
154
+ 'editor' => array(),
179
155
  );
180
156
 
181
- $this->editor_scripts = apply_filters(
182
- 'chisel_editor_scripts',
183
- array(
184
- 'editor' => array(),
185
- )
157
+ $this->editor_scripts = array(
158
+ 'editor' => array(),
186
159
  );
187
160
  }
188
161
  }
@@ -212,11 +185,14 @@ class Assets implements Instance {
212
185
  * Register assets.
213
186
  */
214
187
  public function register_assets() {
215
- if ( $this->frontend_scripts ) {
216
- foreach ( $this->frontend_scripts as $file_name => $args ) {
217
- $this->register_script( self::get_final_handle( $file_name ), $file_name, $args );
218
- }
219
- }
188
+ $this->frontend_styles = apply_filters( 'chisel_frontend_styles', $this->frontend_styles );
189
+ $this->frontend_scripts = apply_filters( 'chisel_frontend_scripts', $this->frontend_scripts );
190
+ $this->login_styles = apply_filters( 'chisel_login_styles', $this->login_styles );
191
+ $this->login_scripts = apply_filters( 'chisel_login_scripts', $this->login_scripts );
192
+ $this->admin_styles = apply_filters( 'chisel_admin_styles', $this->admin_styles );
193
+ $this->admin_scripts = apply_filters( 'chisel_admin_scripts', $this->admin_scripts );
194
+ $this->editor_styles = apply_filters( 'chisel_editor_styles', $this->editor_styles );
195
+ $this->editor_scripts = apply_filters( 'chisel_editor_scripts', $this->editor_scripts );
220
196
 
221
197
  if ( $this->frontend_styles ) {
222
198
  foreach ( $this->frontend_styles as $file_name => $args ) {
@@ -224,6 +200,12 @@ class Assets implements Instance {
224
200
  }
225
201
  }
226
202
 
203
+ if ( $this->frontend_scripts ) {
204
+ foreach ( $this->frontend_scripts as $file_name => $args ) {
205
+ $this->register_script( self::get_final_handle( $file_name ), $file_name, $args );
206
+ }
207
+ }
208
+
227
209
  if ( $this->login_styles ) {
228
210
  $login_styles_data = array();
229
211
 
@@ -242,20 +224,14 @@ class Assets implements Instance {
242
224
  }
243
225
  }
244
226
 
245
- if ( $this->admin_scripts ) {
246
- foreach ( $this->admin_scripts as $file_name => $args ) {
247
- $this->register_script( self::get_final_handle( $file_name ), $file_name, $args );
248
- }
249
- }
250
-
251
227
  if ( $this->admin_styles ) {
252
228
  foreach ( $this->admin_styles as $file_name => $args ) {
253
229
  $this->register_style( self::get_final_handle( $file_name ), $file_name, $args );
254
230
  }
255
231
  }
256
232
 
257
- if ( $this->editor_scripts ) {
258
- foreach ( $this->editor_scripts as $file_name => $args ) {
233
+ if ( $this->admin_scripts ) {
234
+ foreach ( $this->admin_scripts as $file_name => $args ) {
259
235
  $this->register_script( self::get_final_handle( $file_name ), $file_name, $args );
260
236
  }
261
237
  }
@@ -265,25 +241,42 @@ class Assets implements Instance {
265
241
  $this->register_style( self::get_final_handle( $file_name ), $file_name, $args );
266
242
  }
267
243
  }
244
+
245
+ if ( $this->editor_scripts ) {
246
+ foreach ( $this->editor_scripts as $file_name => $args ) {
247
+ $this->register_script( self::get_final_handle( $file_name ), $file_name, $args );
248
+ }
249
+ }
268
250
  }
269
251
 
270
252
  /**
271
253
  * Enqueue front-end assets.
272
254
  */
273
255
  public function enqueue_frontend_assets() {
274
- if ( $this->frontend_scripts ) {
275
- foreach ( $this->frontend_scripts as $handle => $args ) {
276
- wp_enqueue_script( self::get_final_handle( $handle ) );
277
- $this->set_script_translations( $handle, $args );
278
- }
279
- }
256
+ $this->frontend_styles = apply_filters( 'chisel_pre_enqueue_frontend_styles', $this->frontend_styles );
257
+ $this->frontend_scripts = apply_filters( 'chisel_pre_enqueue_frontend_scripts', $this->frontend_scripts );
280
258
 
281
259
  if ( $this->frontend_styles ) {
282
260
  foreach ( $this->frontend_styles as $handle => $args ) {
283
- wp_enqueue_style( self::get_final_handle( $handle ) );
261
+ $enqueue_style = apply_filters( 'chisel_enqueue_frontend_style', true, $handle, $args );
262
+
263
+ if ( $enqueue_style ) {
264
+ wp_enqueue_style( self::get_final_handle( $handle ) );
265
+
266
+ // Enqueue js file for fast refresh of the css file.
267
+ $this->enqueue_style_js_for_dev( $handle );
268
+ }
269
+ }
270
+ }
271
+
272
+ if ( $this->frontend_scripts ) {
273
+ foreach ( $this->frontend_scripts as $handle => $args ) {
274
+ $enqueue_script = apply_filters( 'chisel_enqueue_frontend_script', true, $handle, $args );
284
275
 
285
- // Enqueue js file for fast refresh of the css file.
286
- $this->enqueue_style_js_for_dev( $handle );
276
+ if ( $enqueue_script ) {
277
+ wp_enqueue_script( self::get_final_handle( $handle ) );
278
+ $this->set_script_translations( $handle, $args );
279
+ }
287
280
  }
288
281
  }
289
282
  }
@@ -292,19 +285,30 @@ class Assets implements Instance {
292
285
  * Enqueue admin assets.
293
286
  */
294
287
  public function enqueue_admin_assets() {
295
- if ( $this->admin_scripts ) {
296
- foreach ( $this->admin_scripts as $handle => $args ) {
297
- wp_enqueue_script( self::get_final_handle( $handle ) );
298
- $this->set_script_translations( $handle, $args );
299
- }
300
- }
288
+ $this->admin_styles = apply_filters( 'chisel_pre_enqueue_admin_styles', $this->admin_styles );
289
+ $this->admin_scripts = apply_filters( 'chisel_pre_enqueue_admin_scripts', $this->admin_scripts );
301
290
 
302
291
  if ( $this->admin_styles ) {
303
292
  foreach ( $this->admin_styles as $handle => $args ) {
304
- wp_enqueue_style( self::get_final_handle( $handle ) );
293
+ $enqueue_style = apply_filters( 'chisel_enqueue_admin_style', true, $handle, $args );
294
+
295
+ if ( $enqueue_style ) {
296
+ wp_enqueue_style( self::get_final_handle( $handle ) );
297
+
298
+ // Enqueue js file for fast refresh of the css file.
299
+ $this->enqueue_style_js_for_dev( $handle );
300
+ }
301
+ }
302
+ }
303
+
304
+ if ( $this->admin_scripts ) {
305
+ foreach ( $this->admin_scripts as $handle => $args ) {
306
+ $enqueue_script = apply_filters( 'chisel_enqueue_admin_script', true, $handle, $args );
305
307
 
306
- // Enqueue js file for fast refresh of the css file.
307
- $this->enqueue_style_js_for_dev( $handle );
308
+ if ( $enqueue_script ) {
309
+ wp_enqueue_script( self::get_final_handle( $handle ) );
310
+ $this->set_script_translations( $handle, $args );
311
+ }
308
312
  }
309
313
  }
310
314
  }
@@ -313,19 +317,30 @@ class Assets implements Instance {
313
317
  * Enqueue editor scripts.
314
318
  */
315
319
  public function enqueue_editor_scripts() {
316
- if ( $this->editor_scripts ) {
317
- foreach ( $this->editor_scripts as $handle => $args ) {
318
- wp_enqueue_script( self::get_final_handle( $handle ) );
319
- $this->set_script_translations( $handle, $args );
320
- }
321
- }
320
+ $this->editor_styles = apply_filters( 'chisel_pre_enqueue_editor_styles', $this->editor_styles );
321
+ $this->editor_scripts = apply_filters( 'chisel_pre_enqueue_editor_scripts', $this->editor_scripts );
322
322
 
323
323
  if ( $this->editor_styles ) {
324
324
  foreach ( $this->editor_styles as $handle => $args ) {
325
- wp_enqueue_style( self::get_final_handle( $handle ) );
325
+ $enqueue_style = apply_filters( 'chisel_enqueue_editor_style', true, $handle, $args );
326
+
327
+ if ( $enqueue_style ) {
328
+ wp_enqueue_style( self::get_final_handle( $handle ) );
329
+
330
+ // Enqueue js file for fast refresh of the css file.
331
+ $this->enqueue_style_js_for_dev( $handle );
332
+ }
333
+ }
334
+ }
335
+
336
+ if ( $this->editor_scripts ) {
337
+ foreach ( $this->editor_scripts as $handle => $args ) {
338
+ $enqueue_script = apply_filters( 'chisel_enqueue_editor_script', true, $handle, $args );
326
339
 
327
- // Enqueue js file for fast refresh of the css file.
328
- $this->enqueue_style_js_for_dev( $handle );
340
+ if ( $enqueue_script ) {
341
+ wp_enqueue_script( self::get_final_handle( $handle ) );
342
+ $this->set_script_translations( $handle, $args );
343
+ }
329
344
  }
330
345
  }
331
346
  }
@@ -340,19 +355,33 @@ class Assets implements Instance {
340
355
  return;
341
356
  }
342
357
 
358
+ $this->login_styles = apply_filters( 'chisel_pre_enqueue_login_styles', $this->login_styles );
359
+ $this->login_scripts = apply_filters( 'chisel_pre_enqueue_login_scripts', $this->login_scripts );
360
+
343
361
  wp_add_inline_style( 'global-styles', $stylesheet );
344
362
  wp_enqueue_style( 'global-styles' );
345
363
 
346
- if ( $this->login_scripts ) {
347
- foreach ( $this->login_scripts as $handle => $args ) {
348
- wp_enqueue_script( self::get_final_handle( $handle ) );
349
- $this->set_script_translations( $handle, $args );
364
+ if ( $this->login_styles ) {
365
+ foreach ( $this->login_styles as $handle => $args ) {
366
+ $enqueue_style = apply_filters( 'chisel_enqueue_login_style', true, $handle, $args );
367
+
368
+ if ( $enqueue_style ) {
369
+ wp_enqueue_style( self::get_final_handle( $handle ) );
370
+
371
+ // Enqueue js file for fast refresh of the css file.
372
+ $this->enqueue_style_js_for_dev( $handle );
373
+ }
350
374
  }
351
375
  }
352
376
 
353
- if ( $this->login_styles ) {
354
- foreach ( $this->login_styles as $handle => $args ) {
355
- wp_enqueue_style( self::get_final_handle( $handle ) );
377
+ if ( $this->login_scripts ) {
378
+ foreach ( $this->login_scripts as $handle => $args ) {
379
+ $enqueue_script = apply_filters( 'chisel_enqueue_login_script', true, $handle, $args );
380
+
381
+ if ( $enqueue_script ) {
382
+ wp_enqueue_script( self::get_final_handle( $handle ) );
383
+ $this->set_script_translations( $handle, $args );
384
+ }
356
385
  }
357
386
  }
358
387
  }
@@ -31,7 +31,7 @@ class Blocks extends RegisterBlocks implements Instance {
31
31
  *
32
32
  * @var string
33
33
  */
34
- protected $blocks_twig_base_path = 'src/blocks/';
34
+ protected $blocks_twig_base_path = 'build/blocks/';
35
35
 
36
36
  /**
37
37
  * Class constructor.
@@ -49,15 +49,12 @@ class Blocks extends RegisterBlocks implements Instance {
49
49
  * Set properties.
50
50
  */
51
51
  public function set_properties() {
52
- $this->blocks_category = apply_filters( 'chisel_blocks_category', 'chisel-blocks' );
53
- $this->block_patterns_categories = apply_filters(
54
- 'chisel_block_patterns_categories',
55
- array(
56
- 'cta' => array(
57
- 'label' => __( 'Call to Action', 'chisel' ),
58
- 'description' => __( 'Call to Action Sections.', 'chisel' ),
59
- ),
60
- )
52
+ $this->blocks_category = 'chisel-blocks';
53
+ $this->block_patterns_categories = array(
54
+ 'cta' => array(
55
+ 'label' => __( 'Call to Action', 'chisel' ),
56
+ 'description' => __( 'Call to Action Sections.', 'chisel' ),
57
+ ),
61
58
  );
62
59
  }
63
60
 
@@ -142,7 +139,7 @@ class Blocks extends RegisterBlocks implements Instance {
142
139
 
143
140
  foreach ( $this->block_patterns_categories as $slug => $category ) {
144
141
  $category['label'] = '[Chisel] ' . $category['label'];
145
- register_block_pattern_category( 'chisel-block-patterns-' . $slug, $category );
142
+ register_block_pattern_category( 'chisel-patterns/' . $slug, $category );
146
143
  }
147
144
  }
148
145