Skip to content

Commit

Permalink
Update Gutenberg blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ahegyes committed Mar 29, 2024
1 parent 482e38b commit d65a1cf
Show file tree
Hide file tree
Showing 16 changed files with 2,526 additions and 279 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "build-processes-demo/foobar",
"version": "0.1.0",
"title": "FooBar Block",
Expand All @@ -13,5 +13,6 @@
"textdomain": "build-processes-demo-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'e4f9e5fad1b89bab144d');
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello World! (from foobar block)");
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "build-processes-demo/spamham",
"version": "0.1.0",
"title": "SpamHam Block",
Expand All @@ -13,5 +13,6 @@
"textdomain": "build-processes-demo-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '7f7ecf737046d3460562');
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello World! (from spamham block)");
5 changes: 3 additions & 2 deletions mu-plugins/build-processes-demo-blocks/src/foobar/block.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "build-processes-demo/foobar",
"version": "0.1.0",
"title": "FooBar Block",
Expand All @@ -13,5 +13,6 @@
"textdomain": "build-processes-demo-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
}
2 changes: 1 addition & 1 deletion mu-plugins/build-processes-demo-blocks/src/foobar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import './editor.scss';
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
*
* @return {WPElement} Element to render.
* @return {JSX.Element} Element to render.
*/
export default function Edit() {
return (
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/build-processes-demo-blocks/src/foobar/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useBlockProps } from '@wordpress/block-editor';
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
*
* @return {WPElement} Element to render.
* @return {JSX.Element} Element to render.
*/
export default function save() {
return (
Expand Down
25 changes: 25 additions & 0 deletions mu-plugins/build-processes-demo-blocks/src/foobar/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Use this file for JavaScript code that you want to run in the front-end
* on posts/pages that contain this block.
*
* When this file is defined as the value of the `viewScript` property
* in `block.json` it will be enqueued on the front end of the site.
*
* Example:
*
* ```js
* {
* "viewScript": "file:./view.js"
* }
* ```
*
* If you're not making any changes to this file because your project doesn't need any
* JavaScript running in the front-end, then you should delete this file and remove
* the `viewScript` property from `block.json`.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script
*/

/* eslint-disable no-console */
console.log( 'Hello World! (from foobar block)' );
/* eslint-enable no-console */
5 changes: 3 additions & 2 deletions mu-plugins/build-processes-demo-blocks/src/spamham/block.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"apiVersion": 3,
"name": "build-processes-demo/spamham",
"version": "0.1.0",
"title": "SpamHam Block",
Expand All @@ -13,5 +13,6 @@
"textdomain": "build-processes-demo-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css"
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
}
2 changes: 1 addition & 1 deletion mu-plugins/build-processes-demo-blocks/src/spamham/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import './editor.scss';
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
*
* @return {WPElement} Element to render.
* @return {JSX.Element} Element to render.
*/
export default function Edit() {
return (
Expand Down
2 changes: 1 addition & 1 deletion mu-plugins/build-processes-demo-blocks/src/spamham/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useBlockProps } from '@wordpress/block-editor';
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
*
* @return {WPElement} Element to render.
* @return {JSX.Element} Element to render.
*/
export default function save() {
return (
Expand Down
25 changes: 25 additions & 0 deletions mu-plugins/build-processes-demo-blocks/src/spamham/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Use this file for JavaScript code that you want to run in the front-end
* on posts/pages that contain this block.
*
* When this file is defined as the value of the `viewScript` property
* in `block.json` it will be enqueued on the front end of the site.
*
* Example:
*
* ```js
* {
* "viewScript": "file:./view.js"
* }
* ```
*
* If you're not making any changes to this file because your project doesn't need any
* JavaScript running in the front-end, then you should delete this file and remove
* the `viewScript` property from `block.json`.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script
*/

/* eslint-disable no-console */
console.log( 'Hello World! (from spamham block)' );
/* eslint-enable no-console */
Loading

0 comments on commit d65a1cf

Please sign in to comment.