![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
draft-js-aws-amplify-s3-plugin
Advanced tools
This is a plugin for use with [draft-js-plugins-editor](https://github.com/draft-js-plugins/draft-js-plugins)
This is a plugin for use with draft-js-plugins-editor
It is heavily inspired by the draft-js-image-plugin.
Please note that using this plugin requires your project has aws-amplify
(not @aws-amplify/storage
), react
and react-dom
packages installed.
DraftJS has peer dependencies on react
and react-dom
. Additionally, to successfully use hooks, the react
import from your application code needs to resolve to the same module as the react import from inside the react-dom
package.
Since the Amplify
module installed in your node_modules
is correctly configured (using Amplify.configure()
), this library hooks directly into that configuration via the peerDependency
.
This plugin assumes you've successfully configured AWS Amplify
with an awsconfig
.
import { EditorState } from 'draft-js';
import Editor from 'draft-js-plugins-editor';
import createImagePlugin from 'draft-js-aws-amplify-s3-plugin';
import React from 'react';
const s3Plugin = createS3Plugin();
const plugins = [s3Plugin];
// The Editor accepts an array of plugins. In this case, only the s3Plugin
// is passed in, although it is possible to pass in multiple plugins.
const MyEditor = ({ editorState }: { editorState: EditorState }) => {
const onImageChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
const { files } = e.target;
const [file] = Array.from(files);
const { key: s3Key } = (await Storage.put(file.name, file)) as {
key: string;
};
const newEditorState = s3Plugin.addS3Image(editorState, s3Key);
setEditorState(newEditorState);
};
return (
<>
<Editor editorState={editorState} onChange={onChange} plugins={plugins} />
<input type="file" onChange={onImageChange} />
</>
);
};
export default MyEditor;
FAQs
This is a plugin for use with [draft-js-plugins-editor](https://github.com/draft-js-plugins/draft-js-plugins)
The npm package draft-js-aws-amplify-s3-plugin receives a total of 0 weekly downloads. As such, draft-js-aws-amplify-s3-plugin popularity was classified as not popular.
We found that draft-js-aws-amplify-s3-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.