npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@friendofsvelte/tipex

v0.0.7-up-5

Published

Tipex stands as an advanced rich text editor tailored for Svelte, meticulously engineered with the robust frameworks [Tiptap](https://tiptap.dev/) and [Prosemirror](https://prosemirror.net/). It empowers developers to effortlessly craft rich text editors,

Downloads

1,188

Readme

Tipex

Tipex stands as an advanced rich text editor tailored for Svelte, meticulously engineered with the robust frameworks Tiptap and Prosemirror. It empowers developers to effortlessly craft rich text editors, liberating them from the intricacies of underlying technologies, style management, and related complexities.

Svelte5 and runes mode activated! ✨🔮

Key Features

  • 🚀 Svelte 5 Ready: Built with Svelte 5's latest features including runes and snippets
  • 🎨 Customizable Controls: Flexible control system with both default and custom options
  • 🔌 Plugin Architecture: Extensible through Tiptap extensions
  • 📱 Responsive: Works great on both desktop and mobile devices
  • 🎯 Floating Menu: Context-aware floating toolbar for enhanced editing experience
  • 🔗 Link Management: Built-in link handling with preview and editing capabilities
  • 🎭 Theming Support: Easy styling with CSS variables and utility classes
  • Performance Optimized: Leverages Svelte's reactivity for smooth editing
  • 💼 TypeScript Support: Full TypeScript support for better development experience

Installation

Install the package from NPM:

npm install "@friendofsvelte/tipex"

Basic Usage

Import the component and use it in your component:

<script lang="ts">
    import {Tipex} from "@friendofsvelte/tipex";
    
    let body = `<p>This <a target="_blank" rel="noopener noreferrer" href="">content</a> is written by <a target="_blank" rel="noopener noreferrer" href="http://bishwas.net/">Bishwas</a> in 2023.</p>`;
</script>

<Tipex 
    {body} 
    controls 
    floating
    style="margin-top: 1rem; margin-bottom: 0;"
    class="h-[70vh] border border-neutral-200"
/>

Core Concepts

Control Modes

Tipex offers two control modes:

  1. Default Controls (controls={true}):

    • Pre-built formatting toolbar
    • Customizable through the utilities prop
    • Perfect for quick implementation
  2. Custom Controls (controls={false}):

    • Full control over the editor interface
    • Use controlComponent for custom implementations
    • Ideal for specialized use cases

Extension System

Tipex leverages Tiptap's extension system for enhanced functionality:

import { Tipex } from "@friendofsvelte/tipex";
import { TextAlign } from '@tiptap/extension-text-align';

const extensions = [
    TextAlign.configure({
        types: ['heading', 'paragraph'],
    }),
];

// Use in component
<Tipex {extensions} />

Floating Menu

The floating menu provides context-aware formatting options:

<Tipex floating /> // Enables the floating menu

Advanced Usage

Custom Head and Foot Sections

Add custom components above or below the editor using Svelte 5 snippets:

<script lang="ts">
    import {Tipex} from "@friendofsvelte/tipex";
    
    let body = "";
</script>

<Tipex {body}>
    {#snippet head(editor)}
        <CustomHeader {editor} />
    {/snippet}
    
    {#snippet foot(editor)}
        <CustomFooter {editor} />
    {/snippet}
</Tipex>

Custom Utilities

Add custom controls while keeping the default toolbar:

<script lang="ts">
    import {Tipex} from "@friendofsvelte/tipex";
    
    let body = "";
</script>

<Tipex {body} controls>
    {#snippet utilities(editor)}
        <CustomFormatting {editor} />
    {/snippet}
</Tipex>

Custom Control Component

Create a completely custom control interface:

<script lang="ts">
    import {Tipex} from "@friendofsvelte/tipex";
    
    let body = "";
</script>

<Tipex {body} controls={false}>
    {#snippet controlComponent(editor)}
        <MyCustomControls {editor} />
    {/snippet}
</Tipex>

Documentation

For comprehensive documentation, visit tipex.pages.dev.

About Friend Of Svelte

Friend Of Svelte Logo

Friend Of Svelte is a community-driven project to help Svelte developers find and develop awesome Svelte resources. Our mission is to create high-quality, maintainable, and accessible tools for the Svelte ecosystem.

Join the Community

  • 🌟 Star our repositories
  • 🤝 Contribute to projects
  • 📢 Share your ideas
  • 👥 Open memberships for everyone

If you like this project, you can be one of the friends by contributing to the project. Memberships are open for everyone.

License

MIT Licensed. Copyright (c) 2023-2024 Friend of Svelte.