IndexedDB storage wrapper for GrapesJS
Requires GrapesJS v0.14.15 or higher
- Plugin name:
grapesjs-indexeddb
- Storage
indexeddb
Option | Description | Default |
---|---|---|
dbName |
DB name | gjs |
objectStoreName |
Collection name | templates |
- CDN
https://unpkg.com/grapesjs-indexeddb
- NPM
npm i grapesjs-indexeddb
- GIT
git clone https://github.com/artf/grapesjs-indexeddb.git
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-indexeddb.min.js"></script>
<div id="gjs"></div>
<script type="text/javascript">
var editor = grapesjs.init({
container : '#gjs',
...
storageManager: {
type: 'indexeddb',
// In case of multiple editors on the same page indicate an id to
// prevent collisions
id: 'some-id',
},
plugins: ['grapesjs-indexeddb'],
pluginsOpts: {
'grapesjs-indexeddb': {
// options
}
}
});
</script>
Clone the repository
$ git clone https://github.com/artf/grapesjs-indexeddb.git
$ cd grapesjs-indexeddb
Install dependencies
$ npm i
The plugin relies on GrapesJS via peerDependencies
so you have to install it manually (without adding it to package.json)
$ npm i grapesjs --no-save
Start the dev server
$ npm start
BSD 3-Clause