@artibox/slate-instagram
v1.2.0
Published
<div align="center"> <img src="https://raw.githubusercontent.com/ianstormtaylor/slate/master/docs/images/banner.png" height="200" /> </div>
Downloads
18
Readme
Slate instagram.
Installation
npm install @artibox/slate-instagram --save
or
$ yarn add @artibox/slate-instagram
Usage
Editor
import React from 'react';
import { Instagram as InstagramIcon } from '@artibox/icons';
import { createArtiboxEditor } from '@artibox/slate-editor';
import { Toolbar } from '@artibox/slate-toolbar';
import { createInstagram } from '@artibox/slate-instagram';
const Instagram = createInstagram();
const plugins = [
Instagram.forPlugin(),
Toolbar.forPlugin({
collapsedTools: [{ icon: InstagramIcon, hook: Instagram.forToolHook() }]
})
];
const Editor = createArtiboxEditor({
plugins
});
export default Editor;
Jsx Serializer
import { createJsxSerializer } from '@artibox/slate-jsx-serializer';
import { createInstagramJsxSerializerRule } from '@artibox/slate-instagram';
const jsxSerializer = createJsxSerializer({
blocks: [
createInstagramJsxSerializerRule()
]
});
...
return (
<div>
{jsxSerializer(valueJSON /* from slate */)}
</div>
);
API
- constants
- typings
- createInstagram
- createInstagramJsxSerializerRule
- Instagram.forPlugin
- Instagram.forToolHook
- InstagramController