1.0.0 • Published 2 years ago

@ct-note/quote v1.0.0

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

npm.io

Quote Tool

Provides Quote Blocks for the Editor.js.

npm.io

Installation

Install via NPM

Get the package

npm i --save-dev @editorjs/quote

Include module at your application

const Quote = require('@editorjs/quote');

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/quote@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: {
    ...
    quote: Quote,
  },
  
  ...
});

Or init Quote Tool with additional settings

var editor = EditorJS({
  ...
  
  tools: {
    ...
    quote: {
      class: Quote,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+O',
      config: {
        quotePlaceholder: 'Enter a quote',
        captionPlaceholder: 'Quote\'s author',
      },
    },
  },
  
  ...
});

Config Params

FieldTypeDescription
quotePlaceholderstringquote's placeholder string
captionPlaceholderstringcaption's placeholder string

Tool's settings

npm.io

You can choose alignment for the quote. It takes no effect while editing, but saved the «alignment» param.

Output data

FieldTypeDescription
textstringquote's text
captionstringcaption or an author
alignmentstringleft or center
{
    "type" : "quote",
    "data" : {
        "text" : "The unexamined life is not worth living.",
        "caption" : "Socrates",
        "alignment" : "left"
    }
}
ajvacornajv-errorsajv-keywordsansi-regexacorn-dynamic-importansi-stylesanymatchaprobaarr-diffarr-flattenarr-unionarray-uniqueasn1.jsassign-symbolsassertatobasync-eachbabel-code-framebasebase64-jsbig.jsbalanced-matchbinary-extensionsbluebirdbn.jsbrace-expansionbracesbrowserify-aesbrorandbrowserify-desbrowserify-cipherbrowserify-rsabrowserify-signbrowserify-zlibbrowserslistbufferbuffer-frombuffer-xorbuiltin-status-codescacachecamelcasecaniuse-litecache-basechalkchokidarchownrchrome-trace-eventcipher-basecode-point-atcliuiclass-utilscollection-visitcolor-convertcolor-namecolorettecommandercommondirconcat-mapconcat-streamconsole-browserifyconvert-source-mapconstants-browserifycopy-concurrentlycopy-descriptorcore-util-iscomponent-emittercreate-hashcreate-hmaccrypto-browserifycssesccreate-ecdhdate-nowcss-selector-tokenizercyclistdebugcross-spawndecode-uri-componentdefine-propertiesdes.jsdefine-propertydecamelizediffie-hellmandetect-filedomain-browserellipticelectron-to-chromiumend-of-streamemojis-listenhanced-resolveduplexifyerrnoes-abstractes-to-primitiveescape-string-regexpeslint-scopeesrecurseestraverseescaladeesutilseventsevp_bytestokeyexpand-bracketsexpand-tildeextend-shallowexecaextglobfast-deep-equalfast-json-stable-stringifyfiggy-puddingfill-rangefind-cache-dirfindup-syncfind-upfastparseflush-write-streamfor-infragment-cachefs-write-stream-atomicfs.realpathget-caller-fileget-streamfrom2globget-valueglob-parentglobal-prefixglobalsglobal-modulesgraceful-fsfunction-bindhashas-ansihas-flaghas-valuehas-symbolshash-basehash.jshas-valueshmac-drbghomedir-polyfillhttps-browserifyicss-utilsieee754iferrimport-localicss-replace-symbolsindexofinflightinheritsiniimurmurhashinvariantinterpretis-binary-pathinvert-kvis-accessor-descriptoris-callableis-date-objectis-bufferis-data-descriptoris-descriptoris-extendableis-extglobis-globis-fullwidth-code-pointis-numberis-regexis-plain-objectis-streamis-symbolis-windowsisarrayisobjectjs-levenshteinisexejsescjs-tokensjson-parse-better-errorsjson5json-schema-traverseloader-utilskind-oflcidlodashloader-runnerlocate-pathlodash.debounceloose-envifylru-cachemake-dirmamacromap-age-cleanermap-cachemd5.jsmemmap-visitmiller-rabinmemory-fsmicromatchminimalistic-assertmimic-fnminimalistic-crypto-utilsminimatchminimistmississippimixin-deepmkdirpmove-concurrentlymsnanomatchnice-tryneo-asyncnode-libs-browsernode-releasesnormalize-pathnumber-is-nannpm-run-pathobject-keysobject-copyobject.getownpropertydescriptorsobject-visitobject.pickonceos-localeos-browserifyp-deferp-finallyp-is-promisep-limitp-tryp-locatepakoparallel-transformparse-asn1parse-passwdpath-browserifypath-dirnamepascalcasepath-is-absolutepath-existspath-keypath-parsepbkdf2pifypostcsspkg-dirpostcss-modules-extract-importsposix-character-classespostcss-modules-local-by-defaultpostcss-modules-scopepostcss-modules-valuespostcss-value-parserprivateprocesspromise-inflightprrpseudomappublic-encryptprocess-nextick-argspumppumpifyquerystringpunycoderandombytesrandomfillquerystring-es3readable-streamreaddirpregenerate-unicode-propertiesregenerateregenerator-transformregexp-treeregex-notregexpu-coreregjsgenregjsparserremove-trailing-separatorrepeat-elementrequire-directoryrepeat-stringrequire-main-filenameresolveresolve-cwdresolve-dirresolve-urlresolve-fromretrimrafripemd160safe-bufferrun-queuesafe-regexschema-utilssemverserialize-javascriptsetimmediateset-blockingset-valuesha.jsshebang-commandshebang-regexsignal-exitsnapdragonsnapdragon-nodesnapdragon-utilsource-list-mapsource-mapsource-map-supportsource-map-resolvesource-map-urlsplit-stringssristatic-extendstream-browserifystream-eachstream-httpstream-shiftstring-widthstring_decoderstrip-ansistrip-eofsupports-colortapableterserterser-webpack-pluginto-arraybufferthrough2timers-browserifyto-fast-propertiesto-object-pathto-regexto-regex-rangetslibtrim-righttypedarraytty-browserifyunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunion-valueunicode-property-aliases-ecmascriptunique-slugunique-filenameupathunset-valueuri-jsurixurluseutilutil-deprecateutil.promisifyv8-compile-cachevm-browserifywatchpackwhichwebpack-sourceswhich-modulewrap-ansiworker-farmwrappyxtendy18nyargsyargs-parser
1.0.0

2 years ago