Socket
Socket
Sign inDemoInstall

@rodrigoodhin/editorjs-image-gallery

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rodrigoodhin/editorjs-image-gallery

ImageGallery Tool for Editor.js


Version published
Weekly downloads
85
decreased by-23.42%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

JavaScript CSS3 HTML5

Image Gallery Tool is a plugin for Editor.js that's provides an Image Gallery Block and using the available options, it's possible to adapt the layout as you like.

Works only with image URLs and requires no server-side uploader.

     

Installation

Install via NPM

Get the package

npm i --save-dev @rodrigoodhin/image-gallery

Include module at your application

const ImageGallery = require('@rodrigoodhin/image-gallery');

     

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

     

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/@rodrigoodhin/image-gallery@latest

Then require this script on page with Editor.js.

<script src="..."></script>

     

Usage

Add a new Tool to the tools property of the Editor.js initial config.

var editor = EditorJS({
  ...
  
  tools: {
    ...
    imageGallery: ImageGallery,
  }
  
  ...
});

     

Config Params

This Tool has no config params

     

Tool's settings

  1. Show and hide image urls
  2. Activate/Deactivate dark mode
  3. Set default layout
  4. Set horizontal layout
  5. Set square layout
  6. Set layout with gap
  7. Set layout width fixed size

     

Output data

FieldTypeDescription
urls[]stringimage's url
editImagesbooleanShow and hide image urls
bkgModebooleanActivate/Deactivate dark mode
layoutDefaultbooleanSet default layout
layoutHorizontalbooleanSet horizontal layout
layoutSquarebooleanSet square layout
layoutWithGapbooleanSet layout with gap
layoutWithFixedSizebooleanSet layout width fixed size
{
  "type": "imageGallery",
  "data": {
    "urls": [
      "https://www.nawpic.com/media/2020/ocean-nawpic-15.jpg",
      "https://www.nawpic.com/media/2020/ocean-nawpic-18.jpg",
      "https://wallpapercave.com/wp/6L4TVMP.jpg",
      "https://wallpapercave.com/wp/wp9810772.jpg",
      "https://wallpapercave.com/wp/wp9121482.jpg",
      "https://wallpapercave.com/wp/wp9100484.jpg",
      "https://cdn.wallpapersafari.com/94/22/4H3mFp.jpg"
    ],
    "editImages": true,
    "bkgMode": false,
    "layoutDefault": true,
    "layoutHorizontal": false,
    "layoutSquare": false,
    "layoutWithGap": false,
    "layoutWithFixedSize": false
  }
}

     

Example

JSFiddle with an example

     

LICENSE

MIT License

Keywords

FAQs

Last updated on 26 Sep 2021

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