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

svelte-mathquill

v0.8.2

Published

A svelte wrapper for MathQuill

Downloads

12

Readme

svelte-mathquill

npm

A wrapper around MathQuill, a very intuitive math typing editor

npm i -D svelte-mathquill

Usage

Add this to your +layout.svelte or any wrapper file where you use MathQuill:

<script>
	import { MathQuillSetup } from 'svelte-mathquill';
</script>

<MathQuillSetup />

This injects jQuery and MathQuill (+ styles) into the head of the document, to begin using MathQuill in your components.

Simple example:

<script lang="ts">
	import { MathQuill } from 'svelte-mathquill';

	let latex = '';
</script>

<MathQuill bind:latex="{latex}" />
<br />
<input bind:value="{latex}" />

Documentation

Properties

autofocus: boolean - if the element should focus on mount

latex: string (bindable & updates) - the content of the element

noBorderOutline: boolean - if styling should be applied to remove borders / outlines. Only use if you have a wrapper that's styled (outlines help accessibility!)

class: string - classes to apply to the math element

config: MathQuillConfig (updateable) - Apply a config to the element.

Events

Triggers when the text is edited: on:edit={latex => ...}

Triggers when the enter key is pressed: on:enter={() => ...}

Direction Events (L(eft) | R(ight) | U(p) | D(own))

Triggers when the up arrow is pressed: on:upOutOf={() => ...}

Triggers when the down arrow is pressed: on:downOutOf={() => ...}

Triggers when the right / left arrows are pressed: on:moveOutOf={("L" | "R") => ...}

Triggers when the content is selected out of: on:selectOutOf={("L" | "R") => ...}

Triggers when the content is deleted: on:deleteOutOf={("L" | "R") => ...}

Triggers when any out of is triggered: on:outOf={("L" | "R" | "U" | "D") => ...}

Triggers when any out of is triggered WITHOUT deleteOutOf: on:outOfOnly={("L" | "R" | "U" | "D") => ...}

Functions

Focus the element: mathQuillElement.focus()

Unfocus the element: mathQuillElement.blur()

Refresh the element: mathQuillElement.reflow()

Select the current element: mathQuillElement.select()

Clear any active selection: mathQuillElement.clearSelection()

Mimic a keystroke (ex Shift-Left): mathQuillElement.keystroke(string)

Type Text: mathQuillElement.typedText(string)