1.0.0 • Published 2 years ago

@ct-note/warning v1.0.0

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

npm.io

Warning Tool

Provides Warning Block for the CodeX Editor. Block has title and message. It can be used, for example, for editorials notifications or appeals.

npm.io

Installation

Install via NPM

Get the package

npm i --save-dev @editorjs/warning

Include module at your application

const Warning = require('@editorjs/warning');

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

Then require this script on page with CodeX Editor.

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

Usage

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

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    warning: Warning,
  },
  
  ...
});

Or init Warning Tool with additional settings

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    warning: {
      class: Warning,
      inlineToolbar: true,
      shortcut: 'CMD+SHIFT+W',
      config: {
        titlePlaceholder: 'Title',
        messagePlaceholder: 'Message',
      },
    },
  },
  
  ...
});

Config Params

FieldTypeDescription
titlePlaceholderstringWarning Tool's title placeholder
messagePlaceholderstringWarning Tool's message placeholder

Output data

FieldTypeDescription
titlestringwarning's title
messagestringwarning's message
{
    "type" : "warning",
    "data" : {
        "title" : "Note:",
        "message" : "Avoid using this method just for lulz. It can be very dangerous opposite your daily fun stuff."
    }
}
acorn-dynamic-importacornajv-errorsajv-keywordsanymatchansi-regexajvansi-stylesaprobaarr-diffarr-flattenarray-uniqueasn1.jsarr-unionassign-symbolsassertasync-eachatobbase64-jsbasebalanced-matchbig.jsbinary-extensionsbn.jsbluebirdbrace-expansionbrorandbrowserify-aesbracesbrowserify-cipherbrowserify-desbrowserify-rsabrowserify-signbrowserify-zlibbufferbrowserslistbuffer-frombuiltin-status-codesbuffer-xorcacachecamelcasecache-basecaniuse-litechalkchrome-trace-eventcipher-basechownrchokidarcode-point-atclass-utilscliuicollection-visitcommandercolor-convertcolor-namecolorettecommondircomponent-emitterconcat-mapconcat-streamconsole-browserifycopy-concurrentlyconstants-browserifyconvert-source-mapcreate-ecdhcreate-hashcopy-descriptorcore-util-iscreate-hmacdate-nowcross-spawncrypto-browserifycssesccyclistdecamelizedebugdecode-uri-componentdefine-propertiesdes.jsdefine-propertydiffie-hellmandetect-filedomain-browserellipticduplexifyelectron-to-chromiumemojis-listend-of-streamenhanced-resolveerrnoes-abstractes-to-primitiveeslint-scopeescape-string-regexpescaladeesrecurseestraverseesutilsevp_bytestokeyeventsexecaexpand-bracketsexpand-tildeextglobextend-shallowfast-deep-equalfast-json-stable-stringifyfiggy-puddingfind-cache-dirfill-rangefind-upflush-write-streamfragment-cachefindup-syncfor-infrom2fs-write-stream-atomicget-caller-filefs.realpathfunction-bindget-streamglob-parentget-valueglobglobal-modulesglobal-prefixglobalsgraceful-fshashas-valuehas-flaghash-basehas-valueshash.jshmac-drbghas-symbolshttps-browserifyhomedir-polyfillicss-replace-symbolsieee754icss-utilsiferrimport-localimurmurhashindexes-ofindexofinflightinheritsiniinterpretinvariantinvert-kvis-binary-pathis-accessor-descriptoris-bufferis-callableis-date-objectis-data-descriptoris-extendableis-descriptoris-extglobis-fullwidth-code-pointis-globis-plain-objectis-numberis-regexis-streamis-symbolis-windowsisarrayisexejs-levenshteinjs-tokensisobjectjson-parse-better-errorsjson-schema-traversejsescjson5kind-oflcidloader-runnerloader-utilslocate-pathlodashloose-envifylodash.debouncemake-dirmamacrolru-cachemap-age-cleanermd5.jsmap-cachemap-visitmemmemory-fsmicromatchmiller-rabinminimalistic-assertmimic-fnminimalistic-crypto-utilsminimatchminimistmississippimixin-deepmove-concurrentlymkdirpmsnanomatchneo-asyncnice-trynormalize-pathnode-libs-browsernode-releasesnpm-run-pathnumber-is-nanobject-assignobject-copyobject-keysobject-visitobject.pickobject.getownpropertydescriptorsoncep-deferos-browserifyos-localep-finallyp-is-promisep-limitp-locatep-trypakoparallel-transformpath-browserifyparse-asn1pascalcasepath-dirnamepath-existspath-is-absoluteparse-passwdpath-parsepbkdf2path-keypifypkg-dirposix-character-classespostcsspostcss-modules-local-by-defaultpostcss-modules-extract-importspostcss-modules-scopepostcss-modules-valuespostcss-selector-parserprocesspostcss-value-parserprivateprocess-nextick-argspublic-encryptprrpromise-inflightpumppumpifypunycodequerystringrandombytesquerystring-es3randomfillreadable-streamreaddirpregenerateregenerate-unicode-propertiesregenerator-transformregexp-treeregexpu-coreregex-notregjsgenremove-trailing-separatorregjsparserrepeat-elementrequire-directoryrepeat-stringrequire-main-filenameresolveresolve-dirresolve-cwdresolve-urlresolve-fromretripemd160run-queuerimrafsafe-buffersafe-regexschema-utilssemverserialize-javascriptsetimmediateset-blockingset-valuesha.jsshebang-commandshebang-regexsignal-exitsimple-html-tokenizersnapdragon-nodesnapdragonsnapdragon-utilsource-list-mapsource-map-supportsource-map-resolvesource-mapsplit-stringssrisource-map-urlstatic-extendstream-eachstream-httpstream-browserifystream-shiftstring-widthstring_decoderstrip-ansistrip-eofsupports-colortapableterserterser-webpack-pluginthrough2to-arraybuffertimers-browserifyto-fast-propertiesto-object-pathto-regexto-regex-rangetslibtrim-righttty-browserifyunicode-canonical-property-names-ecmascripttypedarrayunicode-match-property-ecmascriptunicode-property-aliases-ecmascriptunicode-match-property-value-ecmascriptunion-valueuniqunique-filenameunique-slugupathunset-valueuri-jsurixurlutilutil-deprecateutil.promisifyusev8-compile-cachevm-browserifywatchpackwebpack-sourceswhich-modulewhichwrap-ansiworker-farmwrappyxtendyallistyargsyargs-parsery18n
1.0.0

2 years ago