4.9.11-rc10 • Published 5 years ago

@saleswon/sw-editor v4.9.11-rc10

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

sw-editor

A Now Experience TinyMCE editor component

Component Preview

preview

Basic Usage

const testContent = `<span>This is a test</span>`;

<ne-tinymce content={testContent} />

Exposed Parameters

Property NameDescriptionTypeDefault ValueExample Custom Value
componentIdA unique component IDUIDRandom
contentHTML content to be added to rich-text editorStringEmpty String<span>This is a test</span>
placeholderPlaceholder added to elementStringEnter rich-text-herePlace some text here
onInitcallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onSetContentcallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onFocuscallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onChangecallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onClickcallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onExecCommandcallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onSelectioncallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
onBlurcallback functionFunctionnoop(e, editor) => { console.log(e, editor); }
callbacksArray of custom callback functionsArray[]See custom callback section below
buttonsArray of custom buttonsArray[]See custom button section below
pluginsArray of plugins to includeArray | Bool[...]See plugins section below
toolsArray of tool buttons to includeArray | Bool[...]See tools section below
extraToolsArray of extra tool buttons to includeArray[]['bold']
contextsArray of buttons to add to context menuArray | Bool[...]See contexts section below
extraContextsArray of extra context menu buttonsArray[]['link unlink']
menusArray of buttons to add to top menuArray | BoolfalseSee menus section below
extraMenusArray of extra menu buttonsArray[]['file']
readonlyBoolean property to determine read-onlyBoolfalsetrue
readonlyToolsArray of tool buttons to show when readArray | Boolfalse['bold italic', 'link unlink']
readonlyContextsArray of context buttons to show when readArray | Boolfalse['bold italic', 'link unlink']
readonlyMenusArray of menu buttons to show when readArray | Boolfalse['file', 'edit']
customClassesArray of custom classes to add to body elArray[]['custom-1', 'custom-2']
minHeightMinimum height for auto-resize pluginInteger100200
maxHeightMaximum height for auto-resize pluginInteger7001200
paddingToppadding-top for body elInteger6020
paddingBottompadding-bottom for body elInteger6020
paddingSidespadding-left, padding-right for body elInteger2040
browserSpellcheckEnables spellcheck for editorBooltruefalse
relativeUrlsMakes all link urls relative to base urlBooltruefalse
convertUrlsNo clue what this does, but tinymce uses itBoolfalsetrue
autoFocusEnables the editor to be auto-focused on initBoolfalsetrue
removeHostRemoves script hostsBooltruefalse
validElementsString selector of valid elements and attrsString*[*]'span, p, table'
externalPluginsObject with external plugins to be loadedObject{}See tinymce 4 documentation on this property
useBorderEnables the css border around the editorBooltruefalse