Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#64 gutenberg 3.9.0 fixes #72

Merged
merged 22 commits into from
Oct 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
20fa2e5
replaces withAPIData with withSelect from wp.data for API request/call
jomurgel Sep 21, 2018
9970bc3
fixes output renderer
jomurgel Sep 21, 2018
c102e41
replaces withAPIData with withSelect for API request/call
jomurgel Sep 21, 2018
fa110b8
imports lodash and reworks withSelect query
jomurgel Sep 21, 2018
3a080eb
reworks data checks with new data structure
jomurgel Sep 21, 2018
12f0e93
import lodash
jomurgel Sep 21, 2018
f682d41
removes stringify
jomurgel Sep 21, 2018
688eac8
removes .data from latestPosts in props — no longer includes data object
jomurgel Sep 21, 2018
a725934
reworks withSelect to output latestPosts array
jomurgel Sep 21, 2018
849d2d0
adds function/filter to add custom block category — WDS Blocks
jomurgel Sep 21, 2018
3e60aff
adds all blocks to new wds-blocks category
jomurgel Sep 21, 2018
0e55260
updates data check
jomurgel Sep 21, 2018
2ebd648
adds data check for select
jomurgel Sep 21, 2018
efc0709
builds
jomurgel Sep 21, 2018
b88d5b5
Merge branch 'hotfix/#63-replace-withapidata' into feature/#64-gutenb…
jomurgel Oct 4, 2018
e6b81ce
Merge branch 'master' into feature/#64-gutenberg-3.9.0-fixes
jomurgel Oct 4, 2018
95f66ae
version bump
jomurgel Oct 4, 2018
15e581e
adds vscode files to gitignore
jomurgel Oct 4, 2018
834b331
Replaces p tags with div tags in text options panel
coreymcollins Oct 5, 2018
586119c
Replaces p tags with div tags in other options panel
coreymcollins Oct 5, 2018
78013af
Adjusts z-indexes on video and adjacent elements for better backend d…
coreymcollins Oct 5, 2018
3d1f239
Replaces componentWillReceiveProps with getDerivedStateFromProps in d…
coreymcollins Oct 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.DS_Store
.DS_Store
/.vscode/launch.json
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WDS Blocks v1.0.6
# WDS Blocks v1.0.7

WebDevStudios library of Gutenberg blocks.

Expand All @@ -17,8 +17,8 @@ WebDevStudios library of Gutenberg blocks.
WDS Blocks also come with a robust set of options: background image, video, and color support. Plus, text color, custom CSS classes, and [Animate.css](https://daneden.github.io/animate.css/) support. These blocks have been tested with our starter theme, [wd_s](https://github.com/WebDevStudios/wd_s).

## Tested Up To
- [WordPress](https://wordpress.org/) v4.9.7
- [Gutenberg](https://wordpress.org/plugins/gutenberg/) v3.4.0
- [WordPress](https://wordpress.org/) v4.9.8
- [Gutenberg](https://wordpress.org/plugins/gutenberg/) v3.9.0

## Usage

Expand Down
1,955 changes: 965 additions & 990 deletions dist/blocks.build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wds-blocks-cgb-guten-block",
"version": "1.0.6",
"version": "1.0.7",
"private": true,
"scripts": {
"start": "cgb-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/call-to-action/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default registerBlockType(
// Description: Write a quick description.
description: __( 'A block to display a call to action area which will encourage a user to take action.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'common',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'admin-comments',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default registerBlockType( 'wds/default', { // Namespaced with 'wds/', lo
// Description: Write a quick description.
description: __( 'Optional description.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'common',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'sos',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/github-gist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ registerBlockType( 'wds/gihub-gist', {
title: __( 'GitHub Gist Block (WDS)' ),
description: __( 'A block to embed a Gist via URL.' ),
icon,
category: 'embed',
category: 'wds-blocks',
supportHTML: false,
attributes: {
url: {
Expand All @@ -53,7 +53,7 @@ registerBlockType( 'wds/gihub-gist', {
};
}

componentWillMount() {
componentDidMount() {
if ( this.props.attributes.url ) {
this.fetchGistAndSetState();
}
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default registerBlockType(
// Description: Write a quick description.
description: __( 'A block to display a full-width hero with a video, image, or color background.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'common',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'format-image',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/recent-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default registerBlockType( 'wds/recent-posts', { // Namespaced with 'wds/
description: __( 'A block to display your site\'s most recent posts.' ),

// Category options: common, formatting, layout, widgets, embed.
category: 'widgets',
category: 'wds-blocks',

// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'clock',
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/recent-posts/recent-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,4 @@ export default withSelect( ( select, props ) => {
return {
latestPosts: getEntityRecords( 'postType', 'post', latestPostsQuery ),
};
} )( RecentPostsBlock );
} )( RecentPostsBlock );
2 changes: 1 addition & 1 deletion src/blocks/related-posts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default registerBlockType( 'wds/related-posts', { // Namespaced with 'wds
// Description: Write a quick description.
description: __( 'A block to display manually selected related posts.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'widgets',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'admin-post',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/two-column-block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default registerBlockType( 'wds/two-column', { // Namespaced with 'wds/',
// Description: Write a quick description.
description: __( 'A block to display two equal-width columns containing a combination of text and/or an image.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'layout',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'grid-view',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/users-grid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default registerBlockType( 'wds/users-grid', { // Namespaced with 'wds/',
// Description: Write a quick description.
description: __( 'A block to display users in a grid. Note: Only users with published posts will be displayed.' ),
// Category options: common, formatting, layout, widgets, embed.
category: 'common',
category: 'wds-blocks',
// Can use a Dashicon (see https://developer.wordpress.org/resource/dashicons/) or an imported SVG.
icon: 'admin-users',
// Limit to 3 keywords/phrases. Users will see your block when they search using these keywords.
Expand Down
9 changes: 7 additions & 2 deletions src/components/multiselect/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ class DropDown extends Component {
};
}

componentWillReceiveProps( nextProps ) {
static getDerivedStateFromProps( nextProps, prevState ) {

if ( nextProps.selectedItems !== undefined ) {
this.setState( { selectedItems: nextProps.selectedItems } );
return {
selectedItems: nextProps.selectedItems
};
}

return null;
}

render() {
Expand Down
8 changes: 4 additions & 4 deletions src/components/other-options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function OtherOptions( props ) {
>
<PanelRow>
<div className="wds-animation-type">
<p>
<div>
<SelectControl
key="animation-type"
label={ __( 'Animation Type' ) }
Expand Down Expand Up @@ -351,10 +351,10 @@ function OtherOptions( props ) {
] }
onChange={ setAnimationType }
/>
</p>
<p>
</div>
<div>
{ __( 'Select the animation for this block. Animations can only be applied to the entire block, not to individual elements.' ) }
</p>
</div>
</div>
</PanelRow>

Expand Down
8 changes: 4 additions & 4 deletions src/components/text-options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function TextOptions( props ) {
>
<PanelRow>
<div className="wds-text-option">
<p>
<div>
<PanelColor
title={ __( 'Text Color' ) }
colorValue={ props.attributes.textColor }
Expand All @@ -45,10 +45,10 @@ function TextOptions( props ) {
onChange={ setTextColor }
/>
</PanelColor>
</p>
<p>
</div>
<div>
{ __( 'Change the text color of this block.' ) }
</p>
</div>
</div>
</PanelRow>
</PanelBody>
Expand Down
25 changes: 25 additions & 0 deletions src/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,28 @@ function enqueue_block_editor_assets() {
// Recursively load all PHP files within the /src/ directory.
require_once plugin_dir_path( __DIR__ ) . 'vendor/autoload/autoload.php';
\AaronHolbrook\Autoload\autoload( plugin_dir_path( __DIR__ ) . 'src' );

/**
* Adds custom category for use in block
*
* @url https://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/#managing-block-categories
*
* @param [array] $categories block categories.
* @param [string] $post post type.
* @return void updated array of $categories.
*/
function add_block_categories( $categories, $post ) {

// Otherwise update list of categories.
return array_merge(
$categories,
array(
array(
'slug' => 'wds-blocks',
'title' => __( 'WDS Blocks', 'wds-blocks' ),
),
)
);
}
add_filter( 'block_categories', __NAMESPACE__ . '\\add_block_categories', 10, 2 );

7 changes: 6 additions & 1 deletion src/sass/_global-blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
z-index: -1;
z-index: 1;

~ * {
position: relative;
z-index: 2;
}
} // .video-container
} // .has-video-background

Expand Down
2 changes: 1 addition & 1 deletion wds-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: WebDevStudios library of Gutenberg blocks.
* Author: WebDevStudios
* Author URI: https://webdevstudios.com/
* Version: 1.0.6
* Version: 1.0.7
* License: GPL3+
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down