@fileverse-dev/dsheet 1.3.9 → 1.3.10-mixed

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,8 @@ import { ChangeEventHandler } from 'react';
2
2
 
3
3
  export declare const CustomButton: ({ setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: {
4
4
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
- handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void;
6
- handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void;
5
+ handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void | Promise<void>;
6
+ handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file: any, importType: string) => void | Promise<void>;
7
7
  handleExportToXLSX: () => void;
8
8
  handleExportToCSV: () => void;
9
9
  handleExportToJSON: () => void;
@@ -5,6 +5,7 @@ import { DataBlockApiKeyHandlerType, SheetUpdateData } from '../types';
5
5
 
6
6
  import * as Y from 'yjs';
7
7
  export interface EditorContextType {
8
+ setIsDataLoaded: React.Dispatch<React.SetStateAction<boolean>>;
8
9
  handleOnChangePortalUpdate: () => void;
9
10
  setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>>;
10
11
  setShowSmartContractModal?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -20,6 +20,7 @@ export declare const useEditorData: (ydocRef: React.MutableRefObject<Y.Doc | nul
20
20
  currentDataRef: import('react').MutableRefObject<Sheet[]>;
21
21
  remoteUpdateRef: import('react').MutableRefObject<boolean>;
22
22
  isDataLoaded: boolean;
23
+ setIsDataLoaded: import('react').Dispatch<import('react').SetStateAction<boolean>>;
23
24
  handleChange: (_data: Sheet[]) => void;
24
25
  handleLiveQuery: (subsheetIndex: number, queryData: import('@fileverse-dev/fortune-core').LiveQueryData) => void;
25
26
  initialiseLiveQueryData: (sheets: Sheet[]) => void;
@@ -1,7 +1,8 @@
1
1
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
2
 
3
3
  import * as Y from 'yjs';
4
- export declare const usehandleHomepageRedirect: ({ setSelectedTemplate, handleXLSXUpload, handleCSVUpload, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, updateDocumentTitle }: {
4
+ export declare const usehandleHomepageRedirect: ({ setIsDataLoaded, setSelectedTemplate, handleXLSXUpload, handleCSVUpload, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, updateDocumentTitle, }: {
5
+ setIsDataLoaded: React.Dispatch<React.SetStateAction<boolean>>;
5
6
  setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>>;
6
7
  handleXLSXUpload: any;
7
8
  handleCSVUpload: any;
@@ -1,4 +1,6 @@
1
+ import { default as React } from 'react';
1
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
+
2
4
  import * as Y from 'yjs';
3
5
  export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, updateDocumentTitle, }: {
4
6
  sheetEditorRef: React.RefObject<WorkbookInstance | null>;
@@ -1,4 +1,4 @@
1
1
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
2
  import { MutableRefObject } from 'react';
3
3
  import * as Y from 'yjs';
4
- export declare const handleExportToCSV: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>) => void;
4
+ export declare const handleExportToCSV: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, _dsheetId?: string, getDocumentTitle?: () => string) => void;
@@ -2,4 +2,4 @@ import { default as React } from 'react';
2
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const handleCSVUpload: (event: React.ChangeEventHandler<HTMLInputElement> | undefined, ydoc: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, fileArg?: File, importType?: string, handleContentPortal?: any) => void;
5
+ export declare const handleCSVUpload: (event: React.ChangeEventHandler<HTMLInputElement> | undefined, ydoc: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, fileArg?: File, importType?: string, handleContentPortal?: any) => Promise<void>;
@@ -8,10 +8,10 @@ export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmart
8
8
  getDocumentTitle?: () => string;
9
9
  updateDocumentTitle?: (title: string) => void;
10
10
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
11
- handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, ydocRef: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, file?: File, importType?: string, handleContentPortal?: any) => void;
12
- handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file?: File, importType?: string) => void;
11
+ handleCSVUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, ydocRef: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, file?: File, importType?: string, handleContentPortal?: any) => void | Promise<void>;
12
+ handleXLSXUpload: (event: ChangeEventHandler<HTMLInputElement> | undefined, file?: File, importType?: string) => void | Promise<void>;
13
13
  handleExportToXLSX: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: () => string) => void;
14
- handleExportToCSV: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string) => void;
14
+ handleExportToCSV: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: () => string) => void;
15
15
  handleExportToJSON: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string) => void;
16
16
  sheetEditorRef: React.RefObject<WorkbookInstance | null>;
17
17
  ydocRef: React.RefObject<Y.Doc | null>;
@@ -0,0 +1,7 @@
1
+ export declare const sanitizeFilenameBase: (value: string) => string;
2
+ export declare const getExportFilenameBase: ({ getDocumentTitle, documentTitleFallback, sheetNameFallback, defaultBase, }: {
3
+ getDocumentTitle?: () => string;
4
+ documentTitleFallback?: string;
5
+ sheetNameFallback?: string;
6
+ defaultBase?: string;
7
+ }) => string;
@@ -1,4 +1,4 @@
1
1
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
2
  import { MutableRefObject } from 'react';
3
- import * as Y from "yjs";
3
+ import * as Y from 'yjs';
4
4
  export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: () => string) => Promise<void>;
@@ -0,0 +1,25 @@
1
+ import { Workbook, Worksheet } from 'exceljs';
2
+ import { Sheet } from '@fileverse-dev/fortune-react';
3
+
4
+ export interface RawSheetImage {
5
+ src: string;
6
+ nativeCol: number;
7
+ nativeColOff: number;
8
+ nativeRow: number;
9
+ nativeRowOff: number;
10
+ width: number;
11
+ height: number;
12
+ brNativeCol?: number;
13
+ brNativeColOff?: number;
14
+ brNativeRow?: number;
15
+ brNativeRowOff?: number;
16
+ }
17
+ export declare function extractImagesFromWorksheet(ws: Worksheet, workbook: Workbook): RawSheetImage[];
18
+ export declare function convertRawImagesToFortuneSheet(rawImages: RawSheetImage[], sheet: Sheet, defaultColPx: number, defaultRowPx: number): {
19
+ id: string;
20
+ src: string;
21
+ left: number;
22
+ top: number;
23
+ width: number;
24
+ height: number;
25
+ }[];