Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@univerjs/sheets-thread-comment

Package Overview
Dependencies
Maintainers
5
Versions
643
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@univerjs/sheets-thread-comment

Univer thread comment plugin

Source
npmnpm
Version
0.1.13
Version published
Weekly downloads
105K
-6.94%
Maintainers
5
Weekly downloads
 
Created
Source

@univerjs/sheets-thread-comment

npm version [license](https://img.shields.io/npm/l/@univerjs/sheets- thread-comment)

Introduction

@univerjs/sheets-thread-comment provides the comment/annotation function of Univer Sheets.

Usage

Install

# Use npm
npm install @univerjs/sheets-thread-comment

# Use pnpm
pnpm add @univerjs/sheets-thread-comment

use

import { UniverSheetsThreadCommentPlugin, IThreadCommentMentionDataService} from '@univerjs/sheets-thread-comment';

const mockUser = {
    userID: 'mockId',
    name: 'MockUser',
    avatar: 'icon-url',
    anonymous: false,
    canBindAnonymous: false,
};

class CustomMentionDataService implements IThreadCommentMentionDataService {
    trigger: string = '@';

     // Get the common interface implementation of the mentioned user
    async getMentions(search: string) {
        return [
            {
                id: mockUser.userID,
                label: mockUser.name,
                type: 'user',
                icon: mockUser.avatar,
            },
            {
                id: '2',
                label: 'User2',
                type: 'user',
                icon: mockUser.avatar,
            },
        ];
    }
}

univer.registerPlugin(UniverSheetsThreadCommentPlugin, {
    overrides: [[IThreadCommentMentionDataService, { useClass: CustomMentionDataService }]],
});

FAQs

Package last updated on 03 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts