Skip to content

Latest commit

 

History

History

docs-thread-comment

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@univerjs/docs-thread-comment

npm version license downloads

@univerjs/docs-thread-comment provides model commands and Facade APIs for comments anchored to fixed document text ranges. It has no UI or rendering dependency and can be used in Node environments.

Package Overview

Package UMD global CSS Locales Facade entry Worker entry
@univerjs/docs-thread-comment UniverDocsThreadComment No No Yes No

Installation

pnpm add @univerjs/docs-thread-comment
# or
npm install @univerjs/docs-thread-comment

Usage

Start with the integration setup for your document type, including its required plugins, styles, and locale resources. The snippet below assumes that setup is complete.

import { UniverDocsThreadCommentPlugin } from '@univerjs/docs-thread-comment';
import '@univerjs/docs-thread-comment/facade';

univer.registerPlugin(UniverDocsThreadCommentPlugin);

const range = univerAPI.getActiveDocument()?.getTextRange(0, 12);
await range?.createCommentAsync('Verify this introduction.', { id: 'review-intro' });

Use @univerjs/docs-thread-comment-ui separately when menus, canvas decorations, or the shared side panel are required.

Resources