1.0.0 • Published 5 years ago

hb-gjs-plugin v1.0.0

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
5 years ago

GrapesJS Plugin for Internal tool

Summary

  • Plugin name: hb-gjs-plugin
  • Components
    • template-part
  • Blocks
    • template-part
  • Commands
    • prepare-preview
    • edit-mjml
    • save-mjml

Options

OptionDescriptionDefault
option1Description optiondefault value

Download

  • CDN
    • https://unpkg.com/hb-gjs-plugin
  • NPM
    • npm i hb-gjs-plugin
  • GIT
    • git clone https://github.com/reachsampath/hb-gjs-plugin.git

Usage

Directly in the browser

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="hb-gjs-plugin.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container : '#gjs',
      // ...
      plugins: ['hb-gjs-plugin'],
      pluginsOpts: {
        'hb-gjs-plugin': { /* options */ }
      }
  });
</script>

Modern javascript

import grapesjs from 'grapesjs';
import HbGjsPlugin from 'hb-gjs-plugin';

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [HbGjsPlugin],
  pluginsOpts: {
    [HbGjsPlugin]: { /* options */ }
  }
  // or
  plugins: [
    editor => HbGjsPlugin(editor, { /* options */ }),
  ],
});

Development

Clone the repository

$ git clone https://github.com/reachsampath/hb-gjs-plugin.git
$ cd hb-gjs-plugin

Install dependencies

$ npm i

Start the dev server

$ npm start

License

BSD 3-Clause