@artibox/slate-input-block
v1.2.0
Published
<div align="center"> <img src="https://raw.githubusercontent.com/ianstormtaylor/slate/master/docs/images/banner.png" height="200" /> </div>
Downloads
27
Readme
Slate input-block.
Introduction
This package is an util related to input process of editor.
You can use this package to let user input some string and then do something on the string while confirmed.
Like link, image, youtube, ...etc.
Installation
npm install @artibox/slate-input-block --save
or
$ yarn add @artibox/slate-input-block
Usage
import React from 'react';
import { Facebook as FacebookIcon } from '@artibox/icons';
import { createArtiboxEditor } from '@artibox/slate-editor';
import { Toolbar } from '@artibox/slate-toolbar';
import { createFacebook } from '@artibox/slate-facebook';
import { createInputBlock } from '@artibox/slate-input-block';
const Facebook = createFacebook();
const InputBlock = createInputBlock();
const plugins = [
Facebook.forPlugin(),
InputBlock.forPlugin(),
Toolbar.forPlugin({
collapsedTools: [{ icon: FacebookIcon, hook: Facebook.forToolHook({ setInputConfig: InputBlock.start }) }]
})
];
const Editor = createArtiboxEditor({
plugins
});
export default Editor;