npm.io
1.0.2 • Published 3d ago

@veltdev/spreadjs-velt-comments

Licence
Proprietary
Version
1.0.2
Deps
0
Size
65 kB
Vulns
0
Weekly
260

@veltdev/spreadjs-velt-comments

NPM

Add Google Docs-style collaborative comments to your SpreadJS (MESCIUS) workbook using the Velt Collaboration SDK.

Comment highlights are rendered as view-only overlay elements (<velt-comment-text>) positioned over the commented cell/range — your workbook is never modified. Each comment is anchored by a durable { sheetName, row, col, rowCount, colCount } and re-resolved from the sheet on every render, so highlights stay locked through scroll, zoom, frozen panes, and sheet changes.

Install

npm i @veltdev/spreadjs-velt-comments
npm i @mescius/spread-sheets   # peer dependency (types only; the SDK is loaded at runtime)

Usage

import {
  SpreadJSVeltComments,
  addComment,
  renderComments,
} from '@veltdev/spreadjs-velt-comments';

// after the workbook is constructed and the document imported:
const attached = SpreadJSVeltComments.configure({ editorId: 'spreadjs' }).attach(workbook);

// create a comment for the current cell/range selection:
await addComment({ instance: workbook });

// render existing comments (driven by Velt's useCommentAnnotations):
renderComments({ instance: workbook, commentAnnotations });

// teardown:
attached.detach();

API

Export Purpose
SpreadJSVeltComments.configure(config).attach(instance) Wire the extension to a workbook instance; returns { detach() }.
addComment({ instance }) Create a comment on the current cell/range selection.
renderComments({ instance, commentAnnotations }) Render/refresh comment highlights from Velt.

Config (SpreadJSVeltCommentsConfig): editorId? (default 'spreadjs'), scrollToSelectedComment? (default true).

Source, tests, and demo: snippyly/spreadjs-velt-comments.

About Velt SDK

With Velt SDK you can add powerful collaboration features to your product extremely fast — fully customizable UI on a fully-managed realtime backend. Features include Comments (Figma / Google Docs-style), Recording (Loom-style), Huddle (Slack-style), in-app & off-app notifications, @mentions, Presence, Cursors, Live Selection, and more.

Documentation

Use cases

  • Explore use cases to see what collaboration could look like in your product.

Releases

Security

  • Velt is SOC2 Type 2 and HIPAA compliant. Learn more.

Community

  • X: updates, announcements, and general Velt tips.
  • Discord: ask questions and share tips.

Velt — Proprietary.

Keywords