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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@texuli/editor

v0.18.0

Published

Rich text editor for Svelte 5 on the @texuli/core editor texels: owned document model, transforms, history, Markdown in and out, and a sink-free rendering.

Readme

@texuli/editor

A rich text editor for Svelte 5: headings, lists, todo lists, quotes, code, dividers, media references, and the strong, em, strike, code and link marks, with undo and redo, input-method composition, Markdown shortcuts, a roving formatting toolbar, a link dialog, safe paste, and Markdown in and out. The document is an owned, closed model (the @texuli/core editor texels), and the rendering is sink-free: no {@html}, no innerHTML, every link through the URL policy. It is part of Texuli, "Small pieces. Infinite possibilities.": an MIT Svelte 5 component library by Dailybot, Inc.

In the stack: layer L4, a domain package on the @texuli/core editor texels, @texuli/primitives, the @texuli/tokens token engine and the texuli components. @texuli/pages builds on it.

Status: in development (pre-1.0). @texuli/editor is published on npm as 0.18.0, with provenance (first published as 0.5.0; the publish workflow publishes it after texuli). Under 0.x a new minor (0.18.0) may contain breaking changes, so pin the exact version or use ^0.18.0, which accepts only 0.18.x. The architecture contract is ADR-003 in DECISIONS and EDITOR_ARCHITECTURE.

Install

npm install @texuli/editor

In the Texuli workspace, depend on it as "@texuli/editor": "workspace:*". It builds on @texuli/core, @texuli/primitives, @texuli/tokens and texuli; svelte (^5.57.2) is a peer dependency. Import the token stylesheet once (@texuli/tokens/base.css); the editor imports its own CSS.

Quick start

<script lang="ts">
  import { RichTextEditor } from '@texuli/editor/editor';
  import { documentToMarkdown, markdownToDocument } from '@texuli/editor/markdown';

  // Untrusted Markdown (agent output, stored text) reads at the untrusted tier.
  const { doc } = markdownToDocument('# Plan\n\n- [ ] Draft the **brief**\n- [x] Book the room');
  let markdown = $state(documentToMarkdown(doc));
</script>

<RichTextEditor value={doc} label="Notes" onChange={(next) => (markdown = documentToMarkdown(next))} />

value is read on mount and whenever a new document arrives from outside (history restarts); the editor's own edits arrive through onChange. Keep a held document in $state.raw, not $state, so it is not deep-proxied.

Subpaths

| Import | What it gives you | Doc | | --- | --- | --- | | @texuli/editor/editor | RichTextEditor (toolbar, link dialog and surface), EditorSurface, the DOM selection mapping | editor-surface | | @texuli/editor/toolbar | EditorToolbar, the roving formatting toolbar | editor-toolbar | | @texuli/editor/block-menu | BlockTypeMenu, the block-type menu button (paragraph, headings, lists, quote, code; one undo step) | editor-block-menu | | @texuli/editor/emoji | EditorEmojiButton, the toolbar emoji button with EmojiPicker in a popover; the :shortcode: rule is the controller's shortcodes lookup | editor-emoji | | @texuli/editor/export | DialectExport, the export-for-chat panel (Slack, Discord, WhatsApp, Telegram, Teams, Google Chat, Mattermost, plain text) with the losses shown | editor-export | | @texuli/editor/link-dialog | LinkDialog, link editing through the URL policy | editor-link-dialog | | @texuli/editor/controller | EditorController, the headless editor (history, commands, composition guard, announcements), and DEFAULT_EDITOR_LABELS | editor-controller | | @texuli/editor/markdown | markdownToDocument and documentToMarkdown: framework-free Markdown in and out; importMarkdown (Paste as Markdown) and documentToDialect (chat formats) | editor-markdown | | @texuli/editor/paste | Framework-free clipboard import: HTML through the shared DOM-free reader (@texuli/core/html), plain text and the editor's JSON format | editor-paste | | @texuli/editor | The editor, toolbar, link dialog, controller and paste in one barrel (not the Markdown codec), plus EDITOR_PACKAGE_VERSION | — |

Each subpath has its own gzip budget in texuli.budgets.json (pnpm size --filter @texuli/editor). The editor surface bundles the core editor texels, so @texuli/editor/editor measures about 34 KiB gzip; @texuli/editor/markdown about 8.5 KiB, and ./paste and ./controller load no UI.

New in 0.6.0

Ships in 0.6.0; the 0.5.0 release predates it: host inline extensions (G48). Mentions and references register a sigil from a closed set (createInlineExtensions in @texuli/core/editor-model) and round-trip through @texuli/editor/markdown as <sigil>{id|label} with an extension mark that keeps their id; the editor renders them as a tx-editor-extension span (editor-markdown).

Key guarantees

  • No HTML sinks. Every node and mark renders through owned Svelte components with text interpolation only. Raw HTML in Markdown stays literal text; pasted HTML goes through an owned tokenizer and an element allowlist; nothing is ever parsed as markup into the page.
  • Links and media pass the URL policy. Links typed in the dialog pass safeHref at the editor's trust (untrusted by default) and are checked again at render; a refused one renders as text. Pasted and Markdown links are checked at the untrusted tier. Links get rel="noopener noreferrer nofollow" and no target. Media blocks are resolved by the host (resolveMedia) and their src passes safeImageSrc.
  • Bounded, linear input. Documents are capped (2,000 blocks, 200,000 characters, depth 4) and Markdown at 100,000 characters; reading and writing Markdown stay linear on hostile input (the tests read and write 18 such inputs at the cap within a bound each).
  • Accessible editing. One contenteditable textbox with a name; Tab indents only inside lists and Escape then Tab leaves the editor; aria-readonly in read-only mode; mark, block, list, undo, paste and refusal changes are announced politely through the core announcer.
  • Input methods. Between compositionstart and compositionend the model is not touched; the composed text is applied as one step.
  • Styles use --tx-* tokens and logical properties only, with forced-colors mappings.

What is not done yet

  • Copy writes no application/x-texuli-editor+json data yet (the native copy runs; paste reads that format when present). Drop is refused.
  • No “Paste as Markdown” command, no block-type menu (the toolbar has heading buttons) and no drag handles.
  • No browser behavior scenario, axe sweep, CSP matrix row or tests/perf limit for the editor yet; the long-document posture is a design budget, not a measured result.
  • Tree adapters to blocks and the catalog are planned in those packages.

Tests: pnpm vitest run packages/editor (the model, hostile paste and link-policy cases, the component, the Markdown codec and the docs coverage). Examples: editor-basic, editor-toolbar and editor-long-document in @texuli/examples, with light and dark visual baselines.

Documentation

Contributing

Contributions are welcome; start at the GitHub repository.

License

MIT © Dailybot, Inc. Powered by Dailybot.