@caweb/cli 1.3.14 → 1.3.15
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/package.json
CHANGED
|
@@ -16,6 +16,14 @@ import { __ } from '@wordpress/i18n';
|
|
|
16
16
|
*/
|
|
17
17
|
import { useBlockProps, RichText, InnerBlocks } from '@wordpress/block-editor';
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* This package includes a library of generic WordPress components to be used for creating
|
|
21
|
+
* common UI elements shared between screens and features of the WordPress dashboard.
|
|
22
|
+
*
|
|
23
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-components/
|
|
24
|
+
*/
|
|
25
|
+
import { Button } from '@wordpress/components';
|
|
26
|
+
|
|
19
27
|
/**
|
|
20
28
|
* Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
|
|
21
29
|
* Those files can contain any CSS code that gets applied to the editor.
|
|
@@ -11,7 +11,6 @@ $cagov_design_system_is_under_5_8 = version_compare( $wp_version, '5.8', '<' ) ?
|
|
|
11
11
|
|
|
12
12
|
add_filter( "block_categories$cagov_design_system_is_under_5_8", 'cagov_design_system_block_categories', 10, 2 );
|
|
13
13
|
add_filter( 'script_loader_tag', 'cagov_design_system_{{slugSnakeCase}}_script_loader_tag', 10, 3 );
|
|
14
|
-
add_filter( "allowed_block_types$cagov_design_system_is_under_5_8", 'cagov_design_system_allowed_block_types' );
|
|
15
14
|
|
|
16
15
|
if ( ! function_exists( 'cagov_design_system_block_categories' ) ) {
|
|
17
16
|
/**
|
|
@@ -31,65 +30,11 @@ if ( ! function_exists( 'cagov_design_system_block_categories' ) ) {
|
|
|
31
30
|
'title' => 'CA Design System',
|
|
32
31
|
),
|
|
33
32
|
),
|
|
34
|
-
array(
|
|
35
|
-
array(
|
|
36
|
-
'slug' => 'cagov-data-viz',
|
|
37
|
-
'title' => 'CA Data Visualization',
|
|
38
|
-
),
|
|
39
|
-
),
|
|
40
33
|
$categories
|
|
41
34
|
);
|
|
42
35
|
}
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
if ( ! function_exists( 'cagov_design_system_allowed_block_types' ) ) {
|
|
46
|
-
/**
|
|
47
|
-
* {{title}} Allowed Block Types
|
|
48
|
-
*
|
|
49
|
-
* Removes all blocks or patterns from Gutenberg and returns {{title}} Blocks.
|
|
50
|
-
*
|
|
51
|
-
* @link https://developer.wordpress.org/reference/hooks/allowed_block_types_all/
|
|
52
|
-
*
|
|
53
|
-
* @param bool|array $allowed_blocks Array of block type slugs, or boolean to enable/disable all. Default true (all registered block types supported).
|
|
54
|
-
* @return array
|
|
55
|
-
*/
|
|
56
|
-
function cagov_design_system_allowed_block_types( $allowed_blocks ) {
|
|
57
|
-
|
|
58
|
-
// if not debugging, return all blocks.
|
|
59
|
-
if ( ! CAGOV_DESIGN_SYSTEM_DEBUG ) {
|
|
60
|
-
return $allowed_blocks;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
remove_theme_support( 'core-block-patterns' );
|
|
64
|
-
|
|
65
|
-
// Core Components.
|
|
66
|
-
$core = array(
|
|
67
|
-
'core/image',
|
|
68
|
-
'core/paragraph',
|
|
69
|
-
'core/button',
|
|
70
|
-
'core/table',
|
|
71
|
-
'core/heading',
|
|
72
|
-
'core/list',
|
|
73
|
-
'core/custom-html',
|
|
74
|
-
'core/classic',
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
// Dynamically get a list of the cagov-design-system blocks.
|
|
78
|
-
$cagov_blocks = array();
|
|
79
|
-
/*
|
|
80
|
-
array_map(
|
|
81
|
-
function( $b ) {
|
|
82
|
-
return 'cagov-design-system/' . basename( $b );
|
|
83
|
-
},
|
|
84
|
-
glob( '/blocks/*' )
|
|
85
|
-
);
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
// Return the desired components.
|
|
89
|
-
return array_merge( $core, $cagov_blocks );
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
38
|
if ( ! function_exists( 'cagov_design_system_{{slugSnakeCase}}_script_loader_tag' ) ) {
|
|
94
39
|
/**
|
|
95
40
|
* Filters the HTML script tag of an enqueued script.
|