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

@univerjs-pro/docs-reference

v1.1.0

Published

Document references commands and Facade integration.

Downloads

1,566

Readme

@univerjs-pro/docs-reference

npm version license downloads

Document reference commands and Facade APIs for Univer Pro. Register this plugin for traditional-document footnote and endnote creation, deletion and settings. It has no browser UI and can be used with the Docs runtime on Node.js.

Package Overview

| Package | UMD global | CSS | Locales | Facade entry | | --- | --- | :---: | :---: | :---: | | @univerjs-pro/docs-reference | UniverProDocsReference | No | No | Yes |

Installation

pnpm add @univerjs-pro/docs-reference
# or
npm install @univerjs-pro/docs-reference

Keep all @univerjs/* and @univerjs-pro/* packages on the same version.

Usage

Keep all Univer packages on the same version and configure UniverLicensePlugin with your application license.

import { UniverDocsReferencePlugin } from '@univerjs-pro/docs-reference';
import '@univerjs-pro/docs-reference/facade';

univer.registerPlugin(UniverDocsReferencePlugin);

const document = univerAPI.getActiveDocument();
const id = document?.insertFootnote(5, {
    body: { dataStream: 'Source details\r\n', paragraphs: [{ startIndex: 14 }] },
});
if (id) {
    document.getTextRange(0, 6, id).setText('Citation');
}
document?.setFootnoteSettings({ numberFormat: 'decimal', restart: 'eachSect' });

getFootnotes() returns detached note data in reference order. deleteFootnote(id) removes both the reference and content. getFootnoteSettings(sectionId?) reads explicit settings; setFootnoteSettings(settings, sectionId?) replaces them, and null restores inheritance.

Data and editing

References use stable IDs and the core document note segments. Commands use the existing rich-text editing mutation, permissions, undo/redo and collaboration channels. No additional collaboration mutation or resource is required. Text offsets are UTF-16 offsets in the document body, including structural tokens.

Footnotes and endnotes are available only in traditional documents. Modern-mode DOCX import removes references and note content before calculating text offsets. Note bodies support paragraphs, inline images and ordinary tables; document and section settings control numbering, placement and columns. Separator, continuation separator and continuation notice bodies belong to document settings.

Install @univerjs-pro/docs-reference-ui for the References ribbon, settings and navigation.

Endnotes use insertEndnote(offset, content?), getEndnotes(), and deleteEndnote(id). Their content is edited with the same segment text-range APIs as footnotes. setEndnoteSettings({ position: 'docEnd', numberFormat: 'lowerRoman' }) configures document defaults; pass a section ID to configure sectEnd placement or numbering restart for that section. getEndnoteSettings(sectionId?) reads explicit settings and passing null to the setter restores inheritance. Footnotes and endnotes count independently.

Snapshots store both kinds in notes: Record<string, IDocumentNote>, identified by stable noteId and a type of footnote or endnote. Document defaults live in noteSettings.footnote and noteSettings.endnote; section overrides live in sectionBreaks[].noteProperties. References, content and settings use the existing rich-text mutation and undo/collaboration path. All collaborating clients must understand the new snapshot fields and ENDNOTE range type.

Integration Notes

  • Keep all @univerjs/* and @univerjs-pro/* packages on the same version.
  • Import @univerjs-pro/docs-reference/facade when using the package through Univer Facade APIs.

Resources