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.
@cartamd/plugin-attachment
Advanced tools
This plugin adds support for attachments. Install it using:
npm i @cartamd/plugin-attachment
Import the default theme, or create you own:
import '@cartamd/plugin-attachment/default.css';
<script lang="ts">
import { Carta, CartaEditor } from 'carta-md';
import { attachment } from '@cartamd/plugin-attachment';
const carta = new Carta({
extensions: [
attachment({
upload(file) {
/* ... */
}
})
]
});
</script>
<CartaEditor {carta} />
Here are the options you can pass to attachment()
:
export interface AttachmentExtensionOptions {
/**
* Upload a file to the server. Return the url of the uploaded file.
* If an error occurs, return null. This function does **not** handle errors.
* @param file The file to upload
* @returns The uploaded file url, or null if it failed
*/
upload: (file: File) => Promise<string | null>;
/**
* Supported mime types.
*
* @default ['image/png', 'image/jpeg', 'image/gif', 'image/svg+xml'].
*/
supportedMimeTypes?: string[];
/**
* Whether to disable the attach icon.
*
* @default false
*/
disableIcon?: boolean;
/**
* Custom drop overlay component. Use `false` to disable the overlay.
*/
dropOverlay?: false | typeof SvelteComponent;
/**
* Custom loading overlay component. Use `false` to disable the overlay.
*/
loadingOverlay?: false | typeof SvelteComponent<{ uploadingFiles: Writable<File[]> }>;
}
FAQs
This plugin adds support for attachments. Install it using:
The npm package @cartamd/plugin-attachment receives a total of 565 weekly downloads. As such, @cartamd/plugin-attachment popularity was classified as not popular.
We found that @cartamd/plugin-attachment demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.