1.0.9 • Published 7 years ago

streetbees-ory-editor-lib v1.0.9

Weekly downloads
40
License
MIT
Repository
-
Last release
7 years ago

streetbees-ory-editor-lib

Custom lib for ORY Editor

Table of Contents

Dependencies

  • node (developed on v7.9.0)
  • watchman (jest dependency)
  • yarn

Development Setup

  • Install watchman
$ brew install watchman
  • Run sample app
$ yarn start:sample
  • Run test watcher
$ yarn watch:test

Plugins

uploadableImage

  • Plugin that allows to drop or select a file to upload
// Import plugin and style
import { uploadableImage } from 'streetbees-ory-editor-lib';
import 'ory-editor-plugins-image/lib/index.css';

function uploadFile(file) {
  // fictional function that uploads the file and returns promise
}

// The function to handle the upload. Will be called with args:
//  - file: instance of File to upload
//  - onSuccess: callback on success, call with the url for the uploaded file
//  - onError: callback on error
function onUpload(file, onSuccess, onError) {
  uploadFile(file).then(url => onSuccess(url)).catch(error => onError(error));
}

const plugin = uploadableImage({ onUpload });
1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago