@artibox/slate-blockquote
v1.2.0
Published
<div align="center"> <img src="https://raw.githubusercontent.com/ianstormtaylor/slate/master/docs/images/banner.png" height="200" /> </div>
Downloads
31
Readme
Slate blockquote.
Installation
npm install @artibox/slate-blockquote --save
or
$ yarn add @artibox/slate-blockquote
Usage
Editor
import React from 'react';
import { Blockquote as BlockquoteIcon } from '@artibox/icons';
import { createArtiboxEditor } from '@artibox/slate-editor';
import { Toolbar } from '@artibox/slate-toolbar';
import { createBlockquote } from '@artibox/slate-blockquote';
const Blockquote = createBlockquote();
const plugins = [
Blockquote.forPlugin(),
Toolbar.forPlugin({
collapsedTools: [{ icon: BlockquoteIcon, hook: Blockquote.forToolHook() }]
})
];
const Editor = createArtiboxEditor({
plugins
});
export default Editor;
Jsx Serializer
import { createJsxSerializer } from '@artibox/slate-jsx-serializer';
import { createBlockquoteJsxSerializerRule } from '@artibox/slate-blockquote';
const jsxSerializer = createJsxSerializer({
blocks: [
createBlockquoteJsxSerializerRule()
]
});
...
return (
<div>
{jsxSerializer(valueJSON /* from slate */)}
</div>
);
API
- constants
- createBlockquote
- createBlockquoteJsxSerializerRule
- Blockquote.forPlugin
- Blockquote.forToolHook
- BlockquoteController
Hotkey
| OS | Shortcut | | ------------------------ | ------------------------------------------ | | | ctrl+opt</kbd+q | | | ctrl+alt</kbd+q |