Socket
Socket
Sign inDemoInstall

@schukai/grapesjs-blocks-bootstrap5

Package Overview
Dependencies
11
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @schukai/grapesjs-blocks-bootstrap5

GrapesJS Bootstrap v5 Blocks Plugin


Version published
Weekly downloads
14
increased by7.69%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

GrapesJS Bootstrap v5 Blocks Plugin

Summary

  • Plugin name: grapesjs-blocks-bootstrap4
  • Components (see Options for list of Blocks)
    • Layout
      • container
      • row
      • column
      • column_break
      • media_object
      • media_body
    • Components
      • alert
      • tabs
      • badge
      • card
      • card_container
      • collapse
      • dropdown
      • dropdown_menu
    • Typography
      • text
      • header
      • paragraph
    • Media
      • image
      • video
    • Forms
      • form
      • button
      • button_group
      • button_toolbar
      • input
      • input_group
      • form_group_input
      • textarea
      • checkbox
      • radio

Options

let opt = {
    blocks: {},
    blockCategories: {},
    labels: {},
    formPredefinedActions: null,
    optionsStringSeparator: '::'
}

Blocks

OptionDescriptionDefault
defaultRebuild default component with utility settingstrue
textRebuild text component to re-inherit from defaulttrue
linkRebuild link component to re-inherit from default and give toggle settingtrue
imageRebuild image component to re-inherit from defaulttrue
videoRebuild video component to re-inherit from defaulttrue
containerContainer (fixed/fluid)true
rowRowtrue
columnColumns of all sizestrue
column_breakColumn-break (div.w-100)true
media_objectMedia objecttrue
alerttrue
tabstrue
badgetrue
cardCard with settings for images, image overlay, header, body, & footer componentstrue
card_containerLayouts: group, deck, columnstrue
collapseCollapse component that can be toggled via link componenttrue
dropdownDropdowntrue
headerH1-H6true
paragraphP tag with "lead" settingtrue
formtrue
buttontrue
button_grouptrue
button_toolbartrue
inputtrue
input_grouptrue
form_group_inputtrue
textareatrue
checkboxtrue
radiotrue

Block Categories

These are the different categories of blocks as they are grouped in the Blocks sidebar panel. Set a value to false exclude entire groups of blocks (as well as the associated components).

OptionDescriptionDefault
layoutContainer, row, col, col-break, media objecttrue
componentsBootstrap's Components--alert, button, card, etc.true
typographyText, header, paragraph, etc.true
basicLink, image, etc.true
formsForm, input, textarea, etc.true

Labels

Same keys as Blocks, but value is the label for the block.

OptionDescriptionDefault
text'Text'
header'Header'

etc.

Other

OptionDescriptionDefault
gridDevicesAdd devices based on BS grid breakpoints true
gridDevicesPanelBuild a panel in the top-left corner with device buttons (use with editorshowDevices=false)false
formPredefinedActionsPass a list of predefined form actions to generate a select menu: [{name: 'Contact', value: '/contact'}, ...], if no list is passed an input box to add the action is shownnull
optionsStringSeparatorPass a string to identify the separator of values and labels of the select options: optionValue::optionLabel. This setting WILL BE overridden by the gjs-preset-webpage plugin if enabled'::'

Download

  • NPM
    • npm i @schukai/grapesjs-blocks-bootstrap5
  • GIT
    • git clone https://gitlab.schukai.com/oss/minerva/grapesjs-blocks-bootstrap.git

Usage


<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="@schukai/grapesjs-blocks-bootstrap5.min.js"></script>

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

<script type="text/javascript">
    var editor = grapesjs.init({
        container: '#gjs',
        plugins:
                ['grapesjs-blocks-bootstrap5'],
        pluginsOpts: {
            'grapesjs-blocks-bootstrap5':
                    {
                        blocks: {
                            // ...
                        },
                        blockCategories: {
                            // ...
                        },
                        labels: {
                            // ...
                        },
                        // ...
                    }
        },
        canvas: {
            styles: [
                'https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css'
            ],
            scripts: [
                'https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js'
            ],
        }
    });
</script>

Development

Clone the repository

$ git clone https://gitlab.schukai.com/oss/minerva/grapesjs-blocks-bootstrap.git
$ cd grapesjs-blocks-bootstrap

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

License

AGPL 3.0

This is a fork from github.com/kaoz70/grapesjs-blocks-bootstrap4 licensed under the BSD 3-Clause License by Miguel Suarez.

Keywords

FAQs

Last updated on 05 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc