Socket
Book a DemoInstallSign in
Socket

@artibox/slate-image

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@artibox/slate-image

latest
Source
npmnpm
Version
1.2.2
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@artibox/slate-image

Slate image.

npm package npm downloads

Installation

npm install @artibox/slate-image --save

or

$ yarn add @artibox/slate-image

Usage

Editor

import React from 'react';
import { Image as ImageIcon } from '@artibox/icons';
import { createArtiboxEditor } from '@artibox/slate-editor';
import { createImage } from '@artibox/slate-image';
import { Toolbar } from '@artibox/slate-toolbar';

const Image = createImage();

const plugins = [
  Image.forPlugin(),
  Toolbar.forPlugin({
    collapsedTools: [{ icon: Image, hook: Image.forToolHook() }]
  })
];

const Editor = createArtiboxEditor({
  plugins
});

export default Editor;

Jsx Serializer

import { createJsxSerializer } from '@artibox/slate-jsx-serializer';
import { createImageJsxSerializerRule } from '@artibox/slate-image';

const jsxSerializer = createJsxSerializer({
  blocks: [
    createImageJsxSerializerRule()
  ]
});

...

return (
  <div>
    {jsxSerializer(valueJSON /* from slate */)}
  </div>
);

API

Utils

Components

  • Image - Default component only for renderer of editor since it provide resizer.

FAQs

Package last updated on 26 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts