@fileverse-dev/dsheet 3.0.1 → 3.0.2-29July-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editor/utils/apply-comment-markers.d.ts +22 -0
- package/dist/{index-Enuo_ZOm.js → index-B5OjJYA0.js} +10817 -10772
- package/dist/index.es.js +1 -1
- package/dist/{use-xlsx-import-impl-CyZXfYLs.js → use-xlsx-import-impl-CevfOsNi.js} +297 -278
- package/dist/xlsx-export-impl-CiWHN8hx.js +3138 -0
- package/package.json +2 -2
- package/dist/xlsx-export-impl-wtT-xTA3.js +0 -3126
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type CommentData = object | null | undefined;
|
|
2
|
+
/**
|
|
3
|
+
* Stamps the in-cell comment marker (`cell.ps`) onto sheet data, derived from
|
|
4
|
+
* the consumer-provided `commentData`.
|
|
5
|
+
*
|
|
6
|
+
* `ps` is a per-client, permission-gated *view overlay* — it is NOT persisted in
|
|
7
|
+
* ydoc. Every path that rebuilds sheet data from ydoc (portal load, collab sync
|
|
8
|
+
* remount, remote cell edits) produces cells WITHOUT `ps`, so this must run on
|
|
9
|
+
* each such snapshot or the red-triangle indicator vanishes. Because it is
|
|
10
|
+
* gated on the local `allowComments` permission, it must never be written back
|
|
11
|
+
* to shared ydoc state — doing so would let one viewer wipe markers for all.
|
|
12
|
+
*
|
|
13
|
+
* Handles both shapes:
|
|
14
|
+
* - Dense `sheet.data` (the live active sheet in `luckysheetfile`).
|
|
15
|
+
* - Sparse `sheet.celldata` (plain snapshots from `ySheetArrayToPlain`, and
|
|
16
|
+
* inactive sheets). `initSheetData()` converts celldata → data on activation,
|
|
17
|
+
* so `ps` set on celldata carries through.
|
|
18
|
+
*
|
|
19
|
+
* Mutates in place and returns the same array.
|
|
20
|
+
*/
|
|
21
|
+
export declare const applyCommentMarkers: <T>(sheets: T | null | undefined, commentData: CommentData, allowComments: boolean | undefined) => T | null | undefined;
|
|
22
|
+
export {};
|