| 1 |
/** |
| 2 |
* Block dependencies |
| 3 |
*/ |
| 4 |
import EditorArea from './Editor.js'; |
| 5 |
|
| 6 |
import './style.scss'; |
| 7 |
|
| 8 |
/** |
| 9 |
* Internal block libraries |
| 10 |
*/ |
| 11 |
const { __ } = wp.i18n; |
| 12 |
|
| 13 |
const { registerBlockType } = wp.blocks; |
| 14 |
|
| 15 |
/** |
| 16 |
* Register block |
| 17 |
*/ |
| 18 |
export default registerBlockType( 'visualizer/chart', { |
| 19 |
|
| 20 |
// Block Title |
| 21 |
title: __( 'Visualizer Chart' ), |
| 22 |
|
| 23 |
// Block Description |
| 24 |
description: __( 'A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages.' ), |
| 25 |
|
| 26 |
// Block Category |
| 27 |
category: 'common', |
| 28 |
|
| 29 |
// Block Icon |
| 30 |
icon: 'chart-pie', |
| 31 |
|
| 32 |
// Block Keywords |
| 33 |
keywords: [ |
| 34 |
__( 'Visualizer' ), |
| 35 |
__( 'Chart' ), |
| 36 |
__( 'Google Charts' ) |
| 37 |
], |
| 38 |
attributes: { |
| 39 |
id: { |
| 40 |
type: 'number' |
| 41 |
}, |
| 42 |
lazy: { |
| 43 |
default: '-1', |
| 44 |
type: 'string' |
| 45 |
}, |
| 46 |
route: { |
| 47 |
type: 'string' |
| 48 |
} |
| 49 |
}, |
| 50 |
supports: { |
| 51 |
customClassName: false |
| 52 |
}, |
| 53 |
|
| 54 |
// Defining the edit interface |
| 55 |
edit: EditorArea, |
| 56 |
|
| 57 |
// Defining the front-end interface |
| 58 |
save() { |
| 59 |
|
| 60 |
// Rendering in PHP |
| 61 |
return null; |
| 62 |
} |
| 63 |
}); |
| 64 |
|