Socket
Socket
Sign inDemoInstall

@geekie/geekie-image

Package Overview
Dependencies
63
Maintainers
9
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @geekie/geekie-image

Geekie Image Plugin for DraftJS


Version published
Weekly downloads
411
increased by46.26%
Maintainers
9
Install size
8.51 MB
Created
Weekly downloads
 

Readme

Source

geekie-image

DrafJS Plugin that adds image support. This is a fork of the @draft-js-plugins/image package. It adds features like image loading and resizing.

Basic usage

import React, { ReactElement } from 'react';
import { DraftailEditor as Editor, INLINE_STYLE } from 'draftail';
import createImagePlugin, {
  registerUploadImageTask,
} from '@geekie/geekie-image';
import 'draftail/dist/draftail.css';

const imagePlugin = createImagePlugin();
const plugins = [imagePlugin];

// Register how to upload the selected image
registerUploadImageTask(() =>
  Promise.resolve('https://picsum.photos/1000/700')
);

const SimpleImageEditor = (): ReactElement => (
  <div>
    <Editor
      topTool
      controls={[imagePlugin.control]}
      inlineStyles={[
        { type: INLINE_STYLE.BOLD },
        { type: INLINE_STYLE.ITALIC },
      ]}
      entityTypes={[imagePlugin.entityType]}
      plugins={plugins}
    />
  </div>
);

export default SimpleImageEditor;

Setup

yarn

Running in storybook

yarn storybook

Publishing

Edit the packages/image/package.json by yourself.

yarn build
cd packages/image && npm publish

Keywords

FAQs

Last updated on 27 Sep 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc