-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from moderntribe/release/0.14.0
Package version 0.14.0
- Loading branch information
Showing
57 changed files
with
5,728 additions
and
1,517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* @module Gutenberg | ||
* @description Register the Cart Gutenberg block | ||
*/ | ||
|
||
import { GUTENBERG_CHECKOUT as BLOCK } from '../../config/gutenberg-settings'; | ||
import editBlock from './edit'; | ||
import saveBlock from './save'; | ||
|
||
/** | ||
* @function registerBlock | ||
* @description register the block | ||
*/ | ||
|
||
export default { | ||
id: BLOCK.name, | ||
title: BLOCK.title, | ||
|
||
/** | ||
* An icon property should be specified to make it easier to identify a block. | ||
* These can be any of WordPress’ Dashicons, or a custom svg element. | ||
* @see https://developer.wordpress.org/resource/dashicons/ | ||
*/ | ||
icon: 'money', | ||
|
||
/** | ||
* Blocks are grouped into categories to help with browsing and discovery. | ||
* The categories provided by core are common, embed, formatting, layout, and widgets. | ||
*/ | ||
category: BLOCK.category, | ||
|
||
/** | ||
* Additional keywords to surface this block via search input. Limited to 3. | ||
*/ | ||
keywords: BLOCK.keywords, | ||
|
||
/** | ||
* Optional block extended support features. | ||
*/ | ||
supports: { | ||
// Removes support for an HTML mode. | ||
html: false, | ||
}, | ||
|
||
/** | ||
* Attributes used to save and edit our block. | ||
*/ | ||
attributes: { | ||
shortcode: { | ||
type: 'string', | ||
default: '', | ||
}, | ||
}, | ||
|
||
/** | ||
* The edit function describes the structure of the block in the context of the editor. | ||
* This represents what the editor will render when the block is used. | ||
* @see https://wordpress.org/gutenberg/handbook/block-edit-save/#edit | ||
* | ||
* @param {Object} [props] Properties passed from the editor. | ||
* @return {Element} Element to render. | ||
*/ | ||
edit: editBlock, | ||
|
||
/** | ||
* The save function defines the way in which the different attributes should be combined | ||
* into the final markup, which is then serialized by Gutenberg into `post_content`. | ||
* @see https://wordpress.org/gutenberg/handbook/block-edit-save/#save | ||
* | ||
* @param {Object} [props] Properties passed from the editor. | ||
* @return {Element} Element to render. | ||
*/ | ||
save: saveBlock, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @module Edit | ||
* @description Checkout block edit method. | ||
*/ | ||
|
||
|
||
import { ADMIN_IMAGES } from '../../../config/wp-settings'; | ||
import { GUTENBERG_CHECKOUT as BLOCK } from '../../config/gutenberg-settings'; | ||
|
||
const editBlock = (props) => { | ||
const { setAttributes } = props; | ||
const blockImage = `${ADMIN_IMAGES}Gutenberg-Block_Checkout.png`; | ||
|
||
setAttributes({ | ||
shortcode: BLOCK.shortcode, | ||
}); | ||
|
||
return [ | ||
<h2 | ||
className={props.className} | ||
key="checkout-shortcode-title" | ||
> | ||
{ BLOCK.block_html.title } | ||
</h2>, | ||
<img | ||
src={blockImage} | ||
alt={BLOCK.title} | ||
className={props.className} | ||
key="checkout-shortcode-preview" | ||
/>, | ||
]; | ||
}; | ||
|
||
export default editBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* @module Save | ||
* @description Checkout block save method. | ||
*/ | ||
|
||
const saveBlock = props => props.attributes.shortcode; | ||
|
||
export default saveBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.