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

@formulaxjs/editor

v0.4.1

Published

Modern formula editor foundation for FormulaX.

Readme

@formulaxjs/editor

English | 简体中文

面向弹窗的 FormulaX 编辑器 UI 辅助层。

@formulaxjs/editor 提供宿主集成使用的浏览器端弹窗样式和内嵌编辑辅助逻辑。它不再承担共享 markup 层或只读 renderer 层职责。

状态:实验阶段。在首个稳定版本发布前,公共 API 仍可能调整。

安装

npm install @formulaxjs/editor

功能概览

  • ensureFormulaXModalStyles
  • formulaXModalStyles
  • mountFormulaXEditor
  • preloadFormulaXEditorscheduleFormulaXEditorPreload
  • 挂载后 editor handle 上的 getLatex()getState()getRenderHtml()

示例

import {
  ensureFormulaXModalStyles,
  mountFormulaXEditor,
} from '@formulaxjs/editor';

ensureFormulaXModalStyles(document);

const mounted = mountFormulaXEditor(document.querySelector('#host') as HTMLElement, {
  initialLatex: '\\sqrt{x}',
  locale: 'zh_CN', // 可选,默认 en_US
  autofocus: true,
});

const latex = await mounted.getLatex();
const html = await mounted.getRenderHtml();

预加载

如果你希望在用户打开弹窗前就开始加载 FormulaX runtime,可以使用预加载 helper:

import { scheduleFormulaXEditorPreload } from '@formulaxjs/editor';

const cleanup = scheduleFormulaXEditorPreload('hover', document.querySelector('#open-formula'));

// 如果宿主 UI 在预加载触发前被卸载,请调用 cleanup()。

支持的预加载模式:

  • idle:在浏览器空闲时调度 runtime 加载
  • hover:等待传入目标上的 pointerenterfocusin
  • false:禁用预加载

包职责

当你需要基于弹窗的编辑流程和内嵌 FormulaX 编辑器 UI 时,请使用这个包。

  • 如果需要共享 markup 或基础公式样式,请使用 @formulaxjs/renderer
  • 如果需要基于 Kity 的只读渲染,请使用 @formulaxjs/renderer-kity
  • 如果需要低层旧版 runtime 入口,请使用 @formulaxjs/kity-runtime