1.0.9 • Published 3 years ago

filepond-plugin-fetch-svg-preview v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

SVG Preview plugin for FilePond

This Fetch SVG Preview plugin will kick in automatically when the uploaded file has an SVG extension with incorrect Content-Type e.g. application/octet-stream which is common in S3 bucket.

Quick Start

Install using yarn or npm:

yarn add filepond-plugin-fetch-svg-preview
npm install filepond-plugin-fetch-svg-preview

Then import in your project:

import * as FilePond from 'filepond';
import FilePondPluginFetchSVGPreview from 'filepond-plugin-fetch-svg-preview';

Register the plugin:

FilePond.registerPlugin(FilePondPluginFetchSVGPreview);

Create a new FilePond instance as normal.

const pond = FilePond.create({
    name: 'filepond'
});

// Add it to the DOM
document.body.appendChild(pond.element);

The Fetch SVG preview will become active when loading an SVG file as describe above. It will remove all hyperlinks within the SVG documents itself for security reason.

Filepond options

props namedescription
allowFetchSVGPreviewtrue boolean

Default styles

Be sure to include this lib's styles, by importing the minified css.

import 'filepond-plugin-fetch-svg-preview/dist/filepond-plugin-fetch-svg-preview.min.css';

Demo

Python 2.x

python -m SimpleHTTPServer 8000

Open localhost:8000 in your browser.

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago