carta/packages/plugin-emoji
2023-11-14 22:28:16 +01:00
..
src refactor: remove unused vars 2023-11-14 22:28:16 +01:00
static convert plugins vite packages to sveltekit 2023-05-26 20:03:53 +02:00
.gitignore convert plugins vite packages to sveltekit 2023-05-26 20:03:53 +02:00
package.json feat: better caret-bounded components positioning 2023-11-14 18:44:18 +01:00
README.md refactor: use consistent file name for default styles 2023-11-11 11:19:52 +01:00
svelte.config.js convert plugins vite packages to sveltekit 2023-05-26 20:03:53 +02:00
tsconfig.json convert plugins vite packages to sveltekit 2023-05-26 20:03:53 +02:00
vite.config.ts convert plugins vite packages to sveltekit 2023-05-26 20:03:53 +02:00

Carta Emoji Plugin

This plugin adds support for Emojis. Install it using:

npm i @cartamd/plugin-emoji

Setup

Styles

Import the default theme, or create you own:

import '@cartamd/plugin-emoji/default.css';

Extension

<script lang="ts">
	import { Carta, CartaEditor } from 'carta-md';
	import { emoji } from '@cartamd/plugin-emoji';

	const carta = new Carta({
		extensions: [emoji()]
	});
</script>

<CartaEditor {carta} />

Options

Here are the options you can pass to emoji():

export interface EmojiExtensionOptions {
	/**
	 * Custom in transition. See https://svelte.dev/docs#run-time-svelte-transition.
	 */
	inTransition?: (node: Element) => TransitionConfig;
	/**
	 * Custom out transition. See https://svelte.dev/docs#run-time-svelte-transition.
	 */
	outTransition?: (node: Element) => TransitionConfig;
}