@artibox/slate-facebook
v1.2.0
Published
<div align="center"> <img src="https://raw.githubusercontent.com/ianstormtaylor/slate/master/docs/images/banner.png" height="200" /> </div>
Downloads
22
Readme
Slate facebook.
Installation
npm install @artibox/slate-facebook --save
or
$ yarn add @artibox/slate-facebook
Usage
Editor
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';
const Facebook = createFacebook();
const plugins = [
Facebook.forPlugin(),
Toolbar.forPlugin({
collapsedTools: [{ icon: FacebookIcon, hook: Facebook.forToolHook() }]
})
];
const Editor = createArtiboxEditor({
plugins
});
export default Editor;
Jsx Serializer
import { createJsxSerializer } from '@artibox/slate-jsx-serializer';
import { createFacebookJsxSerializerRule } from '@artibox/slate-facebook';
const jsxSerializer = createJsxSerializer({
blocks: [
createFacebookJsxSerializerRule()
]
});
...
return (
<div>
{jsxSerializer(valueJSON /* from slate */)}
</div>
);
API
- constants
- typings
- createFacebook
- createFacebookJsxSerializerRule
- Facebook.forPlugin
- Facebook.forToolHook
- FacebookController
Utils
- getFacebookEmbedDataFromBlock
- getFacebookEmbedDataFromHtml
- getSrcFromFacebookEmbedData
- createFacebookBlock