# grapesjs-plugin-toolbox

> Grapesjs Plugin Toolbox

Latest version **1.0.15** (published 2023-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install grapesjs-plugin-toolbox
pnpm add grapesjs-plugin-toolbox
yarn add grapesjs-plugin-toolbox
bun add grapesjs-plugin-toolbox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.15 |
| Published | 2023-01-16 |
| First published | 2020-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 235.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 41 |
| Author | Brendon Ngirazi |
| Maintainers | ju99ernaut |
| Keywords | grapesjs, plugin, tools |

## Links

- npm: https://www.npmjs.com/package/grapesjs-plugin-toolbox
- Repository: https://github.com/Ju99ernaut/grapesjs-plugin-toolbox
- Homepage: https://github.com/Ju99ernaut/grapesjs-plugin-toolbox#readme
- Issues: https://github.com/Ju99ernaut/grapesjs-plugin-toolbox/issues
- npm.io page: https://npm.io/package/grapesjs-plugin-toolbox

## Dependencies (1)

- [colorthief](https://npm.io/package/colorthief.md) ^2.3.2

## Recent versions

- 1.0.15 (latest) — 2023-01-16
- 1.0.14 — 2023-01-16
- 1.0.13 — 2022-07-17
- 1.0.12 — 2022-02-07
- 1.0.11 — 2022-02-07
- 1.0.10 — 2021-11-17
- 1.0.9 — 2021-10-07
- 1.0.8 — 2021-09-18
- 1.0.7 — 2021-07-03
- 1.0.5 — 2021-05-21
- 1.0.4 — 2020-11-13
- 1.0.3 — 2020-10-31
- 1.0.2 — 2020-10-07

## README

# Grapesjs Plugin Toolbox

Tools for `grapesjs`

[DEMO](https://codepen.io/ju99ernaut/pen/Vwaqdpw)

### HTML
```html
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<link href="https://unpkg.com/grapesjs-plugin-toolbox/dist/grapesjs-plugin-toolbox.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-plugin-toolbox"></script>

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

### JS
```js
const editor = grapesjs.init({
	container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['grapesjs-plugin-toolbox'],
});
```

### CSS
```css
body, html {
  margin: 0;
  height: 100%;
}
```


## Summary

* Tool in this plugin are 
  * [Css grid layout tool](https://i.imgur.com/jwXI0MS.mp4)
  * [Canvas resizer](https://i.imgur.com/GWBJsmI.mp4)
  * [Palette from image generator](https://i.imgur.com/eeIqyHO.png)
  * Breadcrumbs
  * Layer icon mapper

* Plugin name: `grapesjs-plugin-toolbox`
* Components
    * `css-grid`
    * `grid-cell`
* Blocks
    * `css-grid`
* Commands
    * `add-palette`

## Grid Component

>Here `template guides` referes to the dotted lines and colored template areas whereas `grid cells` referes to the actual divs generated from the `template guide`.

If the grid component is not empty the update button will only update the css to avoid overwriting any content. Check [here](https://i.imgur.com/jwXI0MS.mp4) to see usage example.

* Traits
    * `auto-fill` - generate grid automatically(disables guides)
    * `min` - min cell width in px if auto-fill is used
    * `columns`
    * `rows`
    * `columngap`
    * `rowgap`
    * `toggle` - show/hide template guides if not auto-fill(same function as toolbar icon)
    * `reset` - reset colored template areas used to generate grid
    * `clear` - remove grid cells
    * `update` - generates grid cells or updates css if grid component isn't empty 

## Options

| Option | Description | Default |
|-|-|-
| `panels` | use plugin panels | `false` |'
| `traitsInSm` | move traits/settings to styles panel | `true` |
| `resizer` | include canvas resizer | `true` |
| `hideOnZoom` | hide resizer if zoom is not 100 | `true` |
| `breadcrumbs` | include breadcrumbs | `true` |
| `labelGrid` | label for grid block  | `Grid` |
| `categoryGrid` | category for grid block | `Basic` |
| `gridBlock` | options to extend grid block | `{}` |
| `gridComponent` | options to extend grid component model | `{}` |
| `gridClass` | class for grid block | `grid` |
| `gridCellClass` | class for grid cell block | `grid-cell` |
| `cellItemClass` | class for cell item block | `cell-item` |
| `labelColors` | label for color palette modal | `Image palette` |
| `labelApply` | label for apply button | `Add` |
| `palleteIcon` | toolbar icon to open palette modal | `<i class="fa fa-paint-brush"></i>` |
| `onAdd` | custom logic when palette is added | `0` |
| `refreshPalette` | color pickers to refresh color palettes | `[{sector: 'typography',name: 'Color',property: 'color',type: 'color',defaults: 'black'},...]` |
| `minScreenSize` | minimum value the screen can be resized | `250` |
| `icons` | icons to map to components | `[{type: 'default', icon:'<i class="fa fa-cube"></i>'},...]` |


## Download

* CDN
  * `https://unpkg.com/grapesjs-plugin-toolbox`
* NPM
  * `npm i grapesjs-plugin-toolbox`
* GIT
  * `git clone https://github.com/Ju99ernaut/grapesjs-plugin-toolbox.git`



## Usage

Directly in the browser
```html
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<link href="https://unpkg.com/grapesjs-plugin-toolbox/dist/grapesjs-plugin-toolbox.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-plugin-toolbox.min.js"></script>

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

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

Modern javascript
```js
import grapesjs from 'grapesjs';
import plugin from 'grapesjs-plugin-toolbox';
import 'grapesjs/dist/css/grapes.min.css';
import 'grapesjs-plugin-toolbox/dist/grapesjs-plugin-toolbox.min.css';

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



## Development

Clone the repository

```sh
$ git clone https://github.com/Ju99ernaut/grapesjs-plugin-toolbox.git
$ cd grapesjs-plugin-toolbox
```

Install dependencies

```sh
$ npm i
```

Build css

```sh
$ npm run build:css
```

Start the dev server

```sh
$ npm start
```

Build the source

```sh
$ npm run build
```



## License

MIT

---
_Source: https://npm.io/package/grapesjs-plugin-toolbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
