1.0.0 • Published 2 years ago

@ct-note/simple-image v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm.io

Simple Image Tool

Provides Image Blocks for the Editor.js.

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

npm.io

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

  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/@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

npm.io

  1. Add border

  2. Stretch to full-width

  3. Add background

Output data

FieldTypeDescription
urlstringimage's url
captionstringimage's caption
withBorderbooleanadd border to image
withBackgroundbooleanneed to add background
stretchedbooleanstretch 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
    }
}
ajvacorn-dynamic-importacornansi-stylesajv-errorsajv-keywordsansi-regexanymatchaprobaarr-diffarr-unionarray-uniquearr-flattenassertasn1.jsassign-symbolsatobasync-eachbabel-code-framebalanced-matchbasebase64-jsbig.jsbluebirdbn.jsbrace-expansionbinary-extensionsbracesbrowserify-aesbrorandbrowserify-cipherbrowserify-desbrowserify-rsabrowserslistbrowserify-zlibbrowserify-signbuffer-frombufferbuffer-xorcacachebuiltin-status-codescaniuse-litecache-basecamelcasechalkchownrchokidarchrome-trace-eventcipher-basecliuiclass-utilscollection-visitcode-point-atcolor-convertcolorettecolor-namecommondircommandercomponent-emitterconcat-mapconcat-streamconsole-browserifyconstants-browserifyconvert-source-mapcopy-concurrentlycopy-descriptorcreate-hmaccreate-ecdhcreate-hashcrypto-browserifycore-util-iscyclistcss-selector-tokenizercssesccross-spawndate-nowdecode-uri-componentdecamelizedebugdefine-propertydes.jsdefine-propertiesdetect-filediffie-hellmandomain-browserduplexifyelectron-to-chromiumellipticend-of-streamemojis-listerrnoenhanced-resolvees-abstractes-to-primitiveeslint-scopeesrecurseestraverseesutilsescape-string-regexpeventsevp_bytestokeyexpand-bracketsexecaescaladeextend-shallowfast-deep-equalexpand-tildeextglobfastparsefiggy-puddingfast-json-stable-stringifyfill-rangefind-upfind-cache-dirfindup-syncflush-write-streamfor-infrom2fs.realpathfragment-cachefs-write-stream-atomicfunction-bindget-caller-fileget-streamget-valueglobglob-parentglobal-modulesglobal-prefixhashas-ansihas-flaghas-symbolshas-valuehas-valuesgraceful-fshash-basehash.jsglobalshomedir-polyfillhmac-drbghttps-browserifyicss-utilsieee754icss-replace-symbolsiferrimurmurhashinflightimport-localinheritsindexofinterpretiniinvert-kvinvariantis-binary-pathis-accessor-descriptoris-bufferis-callableis-data-descriptoris-date-objectis-descriptoris-extglobis-extendableis-fullwidth-code-pointis-globis-plain-objectis-numberis-regexis-streamis-symbolis-windowsisarrayisexeisobjectjs-levenshteinjs-tokensjsescjson5json-parse-better-errorsjson-schema-traversekind-ofloader-utilsloader-runnerlcidlodashloose-envifylocate-pathmamacrolru-cachemake-dirmap-age-cleanermap-visitmd5.jsmap-cachememmiller-rabinmemory-fsmicromatchmimic-fnminimalistic-assertminimalistic-crypto-utilsminimatchminimistmississippimixin-deepmove-concurrentlymkdirpmsnanomatchneo-asyncnice-trynode-libs-browsernode-releasesnpm-run-pathnormalize-pathnumber-is-nanobject-copyobject-keysobject.getownpropertydescriptorsobject-visitobject.pickonceos-browserifyos-localep-finallyp-deferp-is-promisep-limitpakop-locatep-tryparallel-transformparse-passwdparse-asn1pascalcasepath-browserifypath-dirnamepath-existspath-parsepath-keypath-is-absolutepifypbkdf2posix-character-classespkg-dirpostcsspostcss-modules-extract-importspostcss-modules-scopepostcss-modules-local-by-defaultpostcss-modules-valuespostcss-value-parserprivateprocess-nextick-argspublic-encryptprocesspromise-inflightprrpumpquerystringpumpifypunycoderandomfillrandombytesquerystring-es3readable-streamreaddirpregenerate-unicode-propertiesregenerateregexp-treeregenerator-transformregex-notregexpu-coreregjsgenregjsparserremove-trailing-separatorrepeat-elementrequire-directoryrepeat-stringrequire-main-filenameresolve-cwdresolve-dirresolveresolve-fromresolve-urlretrun-queueripemd160rimrafsafe-regexschema-utilssemverserialize-javascriptsafe-bufferset-blockingset-valuesha.jssetimmediateshebang-commandshebang-regexsignal-exitsnapdragon-utilsnapdragonsnapdragon-nodesource-list-mapsource-map-supportsource-mapsource-map-resolvesource-map-urlsplit-stringssristream-browserifystatic-extendstream-eachstream-httpstream-shiftstring_decoderstrip-ansistring-widthstrip-eofsupports-colortapableterser-webpack-pluginterserthrough2to-arraybuffertimers-browserifyto-object-pathto-regexto-fast-propertiesto-regex-rangetslibunicode-canonical-property-names-ecmascripttty-browserifytypedarrayunicode-match-property-ecmascripttrim-rightunicode-property-aliases-ecmascriptunicode-match-property-value-ecmascriptunion-valueunique-slugunique-filenameunset-valueupathuri-jsurluseurixutilutil-deprecateutil.promisifywatchpackv8-compile-cachevm-browserifywebpack-sourceswhich-modulewhichwrap-ansiworker-farmwrappyy18nyallistxtendyargsyargs-parser
1.0.0

2 years ago