@fileverse-dev/dsheet 2.0.27 → 2.0.28

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.
@@ -2,8 +2,9 @@ import { Dispatch, SetStateAction } from 'react';
2
2
  import { Sheet, WorkbookInstance } from '../../sheet-engine/react';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const useApplyTemplatesBtn: ({ selectedTemplate, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, setDataBlockCalcFunction, initialiseLiveQueryData, }: {
5
+ export declare const useApplyTemplatesBtn: ({ selectedTemplate, setSelectedTemplate, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, setDataBlockCalcFunction, initialiseLiveQueryData, }: {
6
6
  selectedTemplate: string | undefined;
7
+ setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>> | ((slug: string | null) => void);
7
8
  ydocRef: React.RefObject<Y.Doc | null>;
8
9
  dsheetId: string;
9
10
  currentDataRef: React.MutableRefObject<object | null>;
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { WorkbookInstance } from '../../sheet-engine/react';
3
+
4
+ import * as Y from 'yjs';
5
+ export type XlsxImportRuntimeDeps = {
6
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
7
+ ydocRef: React.RefObject<Y.Doc | null>;
8
+ setForceSheetRender: React.Dispatch<React.SetStateAction<number>>;
9
+ dsheetId: string;
10
+ currentDataRef: React.MutableRefObject<object | null>;
11
+ updateDocumentTitle?: (title: string) => void;
12
+ filterToastShown: boolean;
13
+ setFilterToastShown: React.Dispatch<React.SetStateAction<boolean>>;
14
+ };
15
+ /** Full XLSX import pipeline; loaded only when user imports a file. */
16
+ 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'): Promise<void>;
@@ -1,14 +1,20 @@
1
- import { default as React } from 'react';
1
+ import { ChangeEvent, Dispatch, MutableRefObject, RefObject, SetStateAction } from 'react';
2
2
  import { WorkbookInstance } from '../../sheet-engine/react';
3
3
 
4
- import * as Y from 'yjs';
4
+ import type * as Y from 'yjs';
5
+ type ImportType = 'new-dsheet' | 'merge-current-dsheet' | 'new-current-dsheet';
6
+ /**
7
+ * XLSX import: keeps ~100k+ LOC (SSF, hyperlink helpers, exceljs/luckyexcel orchestration)
8
+ * in a separate chunk until the user actually imports a file.
9
+ */
5
10
  export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, }: {
6
- sheetEditorRef: React.RefObject<WorkbookInstance | null>;
7
- ydocRef: React.RefObject<Y.Doc | null>;
8
- setForceSheetRender: React.Dispatch<React.SetStateAction<number>>;
11
+ sheetEditorRef: RefObject<WorkbookInstance | null>;
12
+ ydocRef: RefObject<Y.Doc | null>;
13
+ setForceSheetRender: Dispatch<SetStateAction<number>>;
9
14
  dsheetId: string;
10
- currentDataRef: React.MutableRefObject<object | null>;
15
+ currentDataRef: MutableRefObject<object | null>;
11
16
  updateDocumentTitle?: (title: string) => void;
12
17
  }) => {
13
- handleXLSXUpload: (event: React.ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: "new-dsheet" | "merge-current-dsheet" | "new-current-dsheet") => Promise<void>;
18
+ handleXLSXUpload: (event: ChangeEvent<HTMLInputElement> | undefined, fileArg: File, importType?: ImportType) => Promise<void>;
14
19
  };
20
+ export {};
@@ -0,0 +1,4 @@
1
+ import { WorkbookInstance } from '../../sheet-engine/react';
2
+ import { MutableRefObject } from 'react';
3
+ import * as Y from 'yjs';
4
+ export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;
@@ -1,4 +1,8 @@
1
1
  import { WorkbookInstance } from '../../sheet-engine/react';
2
2
  import { MutableRefObject } from 'react';
3
3
  import * as Y from 'yjs';
4
+ /**
5
+ * Loads xlsx-js-style + exceljs + export helpers only when the user exports.
6
+ * Keeps the main editor chunk smaller for consuming apps.
7
+ */
4
8
  export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => Promise<void>;