2.2.4 • Published 3 years ago
@winton/simple-image v2.2.4
Simple Image Tool
Provides Image Blocks for the Editor.js.
Works only with pasted image URLs and requires no server-side uploader.
Installation
Install via NPM
Get the package
npm i --save-dev @editorjs/simple-image
Include module at your application
const SimpleImage = require('@editorjs/simple-image');
Download to your project's source dir
- Upload folder
dist
from repository - 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/@editorjs/simple-image@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: {
...
image: SimpleImage,
}
...
});
Config Params
This Tool has no config params
Tool's settings
Add border
Stretch to full-width
Add background
Output data
Field | Type | Description |
---|---|---|
url | string | image's url |
caption | string | image's caption |
withBorder | boolean | add border to image |
withBackground | boolean | need to add background |
stretched | boolean | stretch image to screen's width |
{
"type" : "image",
"data" : {
"url" : "https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg",
"caption" : "Roadster // tesla.com",
"withBorder" : false,
"withBackground" : false,
"stretched" : true
}
}
1.6.2
3 years ago
1.7.0
3 years ago
1.6.1
3 years ago
1.5.2
3 years ago
1.6.0
3 years ago
1.5.1
3 years ago
1.5.0
3 years ago
2.2.1
3 years ago
2.2.0
3 years ago
2.1.1
3 years ago
2.2.3
3 years ago
2.2.2
3 years ago
2.2.4
3 years ago
2.1.0
3 years ago
2.0.0
3 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
4 years ago
1.4.0
4 years ago