@@ -28,19 +28,22 @@ This plugin contains some basic blocks for the GrapesJS editor
2828| ` labelImage ` | Image label | ` Image ` |
2929| ` labelVideo ` | Video label | ` Video ` |
3030| ` labelMap ` | Map label | ` Map ` |
31- | ` rowHeight ` | Initial height | ` 75px ` |
31+ | ` rowHeight ` | Initial height | ` 75 ` |
3232
3333## Download
3434
35- - ` npm i grapesjs-blocks-basic `
35+ * CDN
36+ * ` https://unpkg.com/grapesjs-blocks-basic `
37+ * NPM
38+ * ` npm i grapesjs-blocks-basic `
39+ * GIT
40+ * ` git clone https://github.com/artf/grapesjs-blocks-basic.git `
3641
3742## Usage
3843
44+ Directly in the browser
3945``` html
40- <link
41- href =" https://unpkg.com/grapesjs/dist/css/grapes.min.css"
42- rel =" stylesheet"
43- />
46+ <link href =" https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel =" stylesheet" />
4447<script src =" https://unpkg.com/grapesjs" ></script >
4548<script src =" path/to/grapesjs-blocks-basic.min.js" ></script >
4649
@@ -60,6 +63,25 @@ This plugin contains some basic blocks for the GrapesJS editor
6063 </script >
6164```
6265
66+ Modern javascript
67+ ``` js
68+ import grapesjs from ' grapesjs' ;
69+ import plugin from ' grapesjs-blocks-basic' ;
70+
71+ const editor = grapesjs .init ({
72+ container : ' #gjs' ,
73+ // ...
74+ plugins: [plugin],
75+ pluginsOpts: {
76+ [plugin]: { /* options */ }
77+ }
78+ // or
79+ plugins: [
80+ editor => plugin (editor, { /* options */ }),
81+ ],
82+ });
83+ ```
84+
6385## Development
6486
6587Clone the repository
@@ -75,18 +97,19 @@ Install it
7597$ npm i
7698```
7799
78- The plugin relies on GrapesJS via ` peerDependencies ` so you have to install it manually (without adding it to package.json)
100+ Start the dev server
79101
80102``` sh
81- $ npm i grapesjs --no-save
103+ $ npm start
82104```
83105
84- Start the dev server
106+ Build before the commit. This will also increase the patch level version of the package
85107
86108``` sh
87- $ npm start
109+ $ npm run build
88110```
89111
112+
90113## License
91114
92115BSD 3-Clause
0 commit comments