Skip to content

Commit

Permalink
update block example to use new asset syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiankaegy committed May 10, 2022
1 parent 6bcbd9d commit e2c4bb8
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
41 changes: 22 additions & 19 deletions projects/10up-theme/includes/blocks/example-block/block.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"title": "Example Block",
"description": "An Example Block",
"text-domain": "tenup-scaffold",
"textdomain": "tenup-scaffold",
"name": "tenup/example",
"icon": "feedback",
"category": "tenup-scaffold-blocks",
"attributes":{
"icon": "feedback",
"category": "tenup-scaffold-blocks",
"attributes": {
"customTitle": {
"type" : "string"
"type": "string"
}
},
"example": {
"attributes":{
"customTitle": "Example Block"
}
},
"supports": {
},
"example": {
"attributes": {
"customTitle": "Example Block"
}
},
"supports": {
"align": false,
"alignWide": false,
"anchor": false,
"color":{
"color": {
"gradients": false,
"background": false,
"text": false
},
"customClassName": false,
"defaultStylePicker": false,
"typography": {
"fontSize": false,
"lineHeight": true
},
"typography": {
"fontSize": false,
"lineHeight": true
},
"html": false,
"inserter": true,
"multiple": true,
Expand All @@ -38,6 +38,9 @@
"padding": false
}
},
"editorScript": "file:../../../dist/blocks/example-block/editor.js",
"editorStyle": "file:../../../dist/blocks/example-block/editor.css"
"editorScript": "file:./index.js",
"editorStyle": "file:./editor.css",
"style": "file:./style.css",
"viewScript": "file:./view.js",
"script": "file:./script.js"
}
Empty file.
3 changes: 0 additions & 3 deletions projects/10up-theme/includes/blocks/example-block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import edit from './edit';
import save from './save';
import block from './block.json';

/* Uncomment for CSS overrides in the admin */
import './index.css';

/**
* Register block
*/
Expand Down
5 changes: 5 additions & 0 deletions projects/10up-theme/includes/blocks/example-block/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import domReady from '@wordpress/dom-ready';

domReady(() => {
console.log('DOM ready!');
});
5 changes: 5 additions & 0 deletions projects/10up-theme/includes/blocks/example-block/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import domReady from '@wordpress/dom-ready';

domReady(() => {
console.log('DOM ready!');
});
1 change: 0 additions & 1 deletion projects/10up-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"shared-style": "./assets/css/shared/shared-style.css",
"styleguide-style": "./assets/css/styleguide/styleguide.css",
"core-block-overrides": "./includes/core-block-overrides.js",
"example-block": "./includes/blocks/example-block/index.js",
"test-style": "./assets/css/frontend/testing.scss"
}
}
Expand Down

0 comments on commit e2c4bb8

Please sign in to comment.