@fileverse-dev/dsheet 3.0.1-yjs-15 → 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.
Files changed (37) hide show
  1. package/dist/{constants-Cdz6oSCq.js → constants-Q8nzbvQO.js} +5 -3
  2. package/dist/constants.js +1 -1
  3. package/dist/editor/components/editor-workbook-sync.d.ts +1 -1
  4. package/dist/editor/constants/shared-constants.d.ts +2 -0
  5. package/dist/editor/hooks/use-xlsx-import-impl.d.ts +1 -2
  6. package/dist/editor/hooks/use-xlsx-import.d.ts +1 -2
  7. package/dist/editor/utils/apply-comment-markers.d.ts +22 -0
  8. package/dist/editor/utils/update-ydoc.d.ts +2 -2
  9. package/dist/{executeStringFunction-BHy-_q3d.js → executeStringFunction-C5hEkx9z.js} +9240 -14112
  10. package/dist/formula.js +1 -1
  11. package/dist/{index-OL2_pnvq.js → index-B5OjJYA0.js} +25764 -22624
  12. package/dist/index.es.js +39 -39
  13. package/dist/sheet-engine/core/api/cell.d.ts +20 -0
  14. package/dist/sheet-engine/core/api/common.d.ts +1 -2
  15. package/dist/sheet-engine/core/api/index.d.ts +0 -1
  16. package/dist/sheet-engine/core/api/sheet.d.ts +0 -5
  17. package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +0 -1
  18. package/dist/sheet-engine/core/modules/sheet-metadata-hooks.d.ts +0 -4
  19. package/dist/sheet-engine/core/modules/sheet.d.ts +1 -17
  20. package/dist/sheet-engine/core/settings.d.ts +1 -1
  21. package/dist/sheet-engine/core/types.d.ts +0 -3
  22. package/dist/sheet-engine/react/components/Workbook/api.d.ts +1 -8
  23. package/dist/sheet-engine/react/components/Workbook/index.d.ts +1 -5
  24. package/dist/use-xlsx-import-impl-CevfOsNi.js +1556 -0
  25. package/dist/xlsx-export-impl-CiWHN8hx.js +3138 -0
  26. package/package.json +2 -2
  27. package/dist/editor/hooks/use-celldata-compaction.d.ts +0 -23
  28. package/dist/editor/utils/compact-committed-celldata.d.ts +0 -28
  29. package/dist/editor/utils/config-ydoc-update.d.ts +0 -20
  30. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +0 -17
  31. package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +0 -23
  32. package/dist/sheet-engine/core/utils/border-config-utils.d.ts +0 -16
  33. package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +0 -10
  34. package/dist/sheet-engine/core/utils/range-format.d.ts +0 -71
  35. package/dist/sheet-engine/core/utils/ydoc-celldata-changes.d.ts +0 -40
  36. package/dist/use-xlsx-import-impl-Bvgo-6F2.js +0 -1554
  37. package/dist/xlsx-export-impl-CxyAa2j_.js +0 -3126
@@ -1,11 +1,13 @@
1
- import { E as a, S as n } from "./crypto-constants-CqpCRs86.js";
2
- const E = a, d = n, f = [
1
+ import { E as n, S as a } from "./crypto-constants-CqpCRs86.js";
2
+ const E = n, d = a, f = [
3
3
  {
4
4
  id: "0",
5
5
  name: "Sheet1",
6
6
  celldata: [],
7
7
  config: {},
8
- order: 0
8
+ order: 0,
9
+ row: 500,
10
+ column: 26
9
11
  }
10
12
  ], m = [
11
13
  "undo",
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as R, c as _, E as C, S as a, p as s } from "./constants-Cdz6oSCq.js";
1
+ import { a as R, c as _, E as C, S as a, p as s } from "./constants-Q8nzbvQO.js";
2
2
  export {
3
3
  R as COLLAB_PRESENCE_COLORS,
4
4
  _ as ENS_PRESENCE_COLOR,
@@ -19,5 +19,5 @@ export declare const createAfterOrderChangesHandler: ({ sheetEditorRef, ydocRef,
19
19
  export declare const createAfterColorChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
20
20
  export declare const createAfterHideChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
21
21
  export declare const createAfterColRowChangesHandler: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext) => () => void;
22
- export declare const updateAllCell: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext, subSheetId: string, caller?: string) => void;
22
+ export declare const updateAllCell: ({ sheetEditorRef, ydocRef, dsheetId, handleOnChangePortalUpdate, }: SyncContext, subSheetId: string) => void;
23
23
  export {};
@@ -8,6 +8,8 @@ export declare const DEFAULT_SHEET_DATA: {
8
8
  celldata: never[];
9
9
  config: {};
10
10
  order: number;
11
+ row: number;
12
+ column: number;
11
13
  }[];
12
14
  export declare const TOOL_BAR_ITEMS: string[];
13
15
  export declare const CELL_CONTEXT_MENU_ITEMS: string[];
@@ -11,7 +11,6 @@ export type XlsxImportRuntimeDeps = {
11
11
  updateDocumentTitle?: (title: string) => void;
12
12
  filterToastShown: boolean;
13
13
  setFilterToastShown: React.Dispatch<React.SetStateAction<boolean>>;
14
- handleContentPortal?: () => void;
15
14
  };
16
15
  export type XlsxImportOptions = {
17
16
  headless?: boolean;
@@ -20,4 +19,4 @@ export type XlsxImportOptions = {
20
19
  generateSheetId?: () => string;
21
20
  };
22
21
  /** Full XLSX import pipeline; loaded only when user imports a file. */
23
- export declare function runXlsxFileUpload({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, filterToastShown, setFilterToastShown, handleContentPortal, }: XlsxImportRuntimeDeps, event: React.ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet', options?: XlsxImportOptions): Promise<void>;
22
+ export declare function runXlsxFileUpload({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, filterToastShown, setFilterToastShown, }: XlsxImportRuntimeDeps, event: React.ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet', options?: XlsxImportOptions): Promise<void>;
@@ -7,14 +7,13 @@ type ImportType = 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet';
7
7
  * XLSX import: keeps ~100k+ LOC (SSF, hyperlink helpers, exceljs/luckyexcel orchestration)
8
8
  * in a separate chunk until the user actually imports a file.
9
9
  */
10
- export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, handleContentPortal, }: {
10
+ export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, }: {
11
11
  sheetEditorRef: RefObject<WorkbookInstance | null>;
12
12
  ydocRef: RefObject<Y.Doc | null>;
13
13
  setForceSheetRender: Dispatch<SetStateAction<number>>;
14
14
  dsheetId: string;
15
15
  currentDataRef: MutableRefObject<object | null>;
16
16
  updateDocumentTitle?: (title: string) => void;
17
- handleContentPortal?: () => void;
18
17
  }) => {
19
18
  handleXLSXUpload: (event: ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: ImportType) => Promise<void>;
20
19
  };
@@ -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 {};
@@ -1,11 +1,11 @@
1
1
  import { Sheet } from '../../sheet-engine/react';
2
- import * as Y from "yjs";
2
+ import * as Y from 'yjs';
3
3
  export type SheetChangePath = {
4
4
  sheetId: string;
5
5
  path: string[];
6
6
  key?: string;
7
7
  value: any;
8
- type?: "update" | "delete";
8
+ type?: 'update' | 'delete';
9
9
  };
10
10
  export declare const updateYdocSheetData: (ydoc: Y.Doc | null, dsheetId: string, changes: SheetChangePath[], handleContentPortal: any) => void;
11
11
  export declare function ySheetArrayToPlain(sheetArray: Y.Array<Y.Map>): Sheet[];