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

whimsy-editor-vue

v0.0.16

Published

A Rich Editor component built using Vue 3, Tiptap with AI integration using Vercel AI SDK & OpenAI

Downloads

57

Readme

Whimsy Editor Vue

Whimsy Editor is a WYSIWYG editor component built on top of Tiptap and Open AI.

Introduction

Whimsy Editor is a simple WYSIWYG editor designed for Vue.js applications.

Installation

To use Whimsy Editor in your Vue project, simply install the whimsy-editor-vue NPM package:

npm install whimsy-editor-vue

Usage Example

Then, integrate it into your Vue components as follows:

<template>
  <Editor v-model="editorContent" :completionApi="yourCompletionApiEndpoint" />
</template>

<script setup>
import { ref } from "vue";
import { Editor } from "whimsy-editor-vue";
import "whimsy-editor-vue/dist/style.css";

const editorContent = ref("");
</script>

Features

  • WYSIWYG Editing: Whimsy Editor offers an intuitive What-You-See-Is-What-You-Get interface, ensuring that content creation is effortless and visually consistent.

  • Customizable: Customize the editor according to your unique requirements with a comprehensive range of extensions and styling options.

  • Slash Commands: Seamlessly integrate custom slash commands into the editor, enabling users to execute predefined actions or commands directly within the interface.

  • Bubble Menu: Utilize the built-in bubble menu or effortlessly integrate your own customized version, providing users with an intuitive interface for accessing essential editing tools and functionalities with ease.

  • AI-Powered Autocompletions: Elevate your writing process with AI-powered autocompletion suggestions that anticipate your next words or phrases based on context and language patterns, fostering productivity and enhancing the quality of your content.

Configuration Options

| Prop | Type | Description | Default | | ----------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------ | | completionApi | String | The API route to use for the OpenAI completion API. | "/api/generate" | | className | String | Additional classes to add to the editor container. | "whimsy-editor" | | defaultValue | JSONContent | The default value to use for the editor. | defaultEditorContent | | format | String | Supported formats json & html | "json" | | extensions | Extension[] | A list of extensions to use for the editor, in addition to the default whimsy extensions. | [] | | editorProps | EditorProps | Props to pass to the underlying Tiptap editor, in addition to the default Whimsy editor props. | {} | | onUpdate | Function | A callback function that is called whenever the editor is updated. | () => {} | | onDebouncedUpdate | Function | A callback function that is called whenever the editor is updated, but only after the defined debounce duration. | () => {} | | debounceDuration | Number | The duration (in milliseconds) to debounce the onDebouncedUpdate callback. | 750 | | storageKey | String | Null | The key to use for storing the editor's value in local storage. For value null it doesn't save in local storage. | null | | placeholder | String | Placeholder text for the editor. | "Type something here... or ++" | | slashCommands | SlashCommandItem[] | List of commands that can be accessed using the slash(/). | [] | | lines | Number | Determines the default height of the input element. | 3 | | maxLines | Number | Determines the max height of the input element after which the content overflows and appears with the scroll. | 3 | | styleVars | StyleVariables | Determines the styling variables for the editor. | See below |

Default Style Variables:

{
  "mainBg": "#FFFFFF",
  "textColor": "#333333",
  "primaryAccent": "#FFB38B",
  "secondaryAccent": "#8FC1E3",
  "mutedBg": "#F5F5F5",
  "mutedText": "#757575",
  "mutedAccent": "#FFC107",
  "mutedBorder": "#E0E0E0",
  "borderColor": "#BDBDBD",
  "boxShadow": "0 0.125em 0.25em rgba(0, 0, 0, 0.2)",
  "codeBg": "#F9F9F9",
  "codeText": "#212121",
  "codeBorder": "#CCCCCC",
  "quoteBg": "#EEEEEE",
  "quoteText": "#616161",
  "quoteBorder": "#BDBDBD",
  "linkColor": "#6A89CC",
  "generalSpacing": "1em",
  "borderRadius": "0.25em",
  "baseFont": "1em"
}

Note: Ensure to define an API endpoint that matches the completionApi prop (default is /api/generate). This is needed for the AI autocompletions to work.

Contribution Guidelines

We welcome contributions from the community! To contribute to Whimsy Editor Vue, please follow these guidelines:

  1. Check the issue tracker for existing issues or open a new one to discuss proposed changes.
  2. Fork the repository and create a new branch for your feature or bug fix.
  3. Make your changes, ensuring they adhere to the coding standards and test them thoroughly.
  4. Submit a pull request, explaining the changes you've made and any considerations for reviewers.

License

Whimsy Editor Vue is licensed under the MIT License.

Credits

Whimsy Editor Vue was inspired by Tiptap and uses the OpenAI API for autocompletions.