This repository was archived by the owner on May 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Feature/203 gutenberg block structure #204
Open
ryanwelcher
wants to merge
19
commits into
master
Choose a base branch
from
feature/203-gutenberg-block-structure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
42cce76
Merge branch 'master' of github.com:10up/theme-scaffold
e59fe35
Setup for blocks.
e37c22e
Create example block.
3594aad
Clean up enqueues.
88b2ee4
Simplify the example block.
3ab97be
Cleaned for prettier. Added blocks path to css test
jaredrethman 9482468
Renamed register.js to index.js. Destructed name from block.json
jaredrethman 63aa061
Added index.css for component completeness
jaredrethman c6cfe10
Moved registration to init hook to fix enqueue _doing_it_wrong
jaredrethman 564a0dd
Destruct props vs const. Update markup to sync between block & markup…
jaredrethman 859c927
Cleanup
jaredrethman 069e2af
Merge pull request #205 from jaredrethman/feature/203-gutenberg-block…
5ed9cc9
Merge branch 'feature/203-gutenberg-block-structure' of github.com:10…
6d41b0e
Clean up block registration.
130e9c6
Adding some docs to markup.php
284bf86
Complie all block items into a dist/blocks/{block-name} dir.
9d8c1d1
Final tweaks based on zoom call.
796dc67
Adding README section for custom blocks.
4dbaca8
Add Block library example for registering blocks.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ release | |
| vendor | ||
| phpunit.xml | ||
| .idea | ||
| .vscode | ||
|
|
||
| # Project Files | ||
| dist | ||
|
|
||
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,19 @@ | ||
| { | ||
| "title": "Example Block", | ||
| "description": "An Example Block", | ||
| "text-domain": "tenup-scaffold", | ||
| "name": "tenup/example", | ||
| "icon": "feedback", | ||
| "attributes":{ | ||
| "customTitle": { | ||
| "type" : "string" | ||
| } | ||
| }, | ||
| "example": { | ||
| "attributes":{ | ||
| "customTitle": "Example Block" | ||
| } | ||
| }, | ||
| "editorScript": "file:../../../dist/blocks/example-block/editor.js", | ||
| "editorStyle": "file:../../../dist/blocks/example-block/editor.css" | ||
| } | ||
This file contains hidden or 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,38 @@ | ||
| /** | ||
| * WordPress dependencies | ||
| */ | ||
| import { __ } from '@wordpress/i18n'; | ||
| import { RichText } from '@wordpress/block-editor'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { editPropsShape } from './props-shape'; | ||
|
|
||
| /** | ||
| * Edit component. | ||
| * See https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-edit-save/#edit | ||
| * | ||
| * @param {Object} props The block props | ||
| * @return {Function} Render the edit screen | ||
| */ | ||
| const ExampleBockEdit = ({ | ||
| attributes: { customTitle: currentTitle }, | ||
| className, | ||
| setAttributes, | ||
| }) => { | ||
| return ( | ||
| <div className={`${className}`}> | ||
| <RichText | ||
| className="wp-block-example-block__title" | ||
| tagName="h2" | ||
| placeholder={__('Custom Title')} | ||
| value={currentTitle} | ||
| onChange={(customTitle) => setAttributes({ customTitle })} | ||
| /> | ||
| </div> | ||
| ); | ||
| }; | ||
| // Set the propTypes | ||
| ExampleBockEdit.propTypes = editPropsShape; | ||
| export default ExampleBockEdit; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.