@fileverse-dev/dsheet 2.0.29 → 2.0.31-a

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.
@@ -11,6 +11,7 @@ interface EditorWorkbookProps {
11
11
  setFetchingURLData?: (fetching: boolean) => void;
12
12
  setInputFetchURLDataBlock?: React.Dispatch<React.SetStateAction<string>>;
13
13
  isReadOnly?: boolean;
14
+ allowSheetDownload?: boolean;
14
15
  allowComments?: boolean;
15
16
  toggleTemplateSidebar?: () => void;
16
17
  onboardingComplete?: boolean;
@@ -0,0 +1,11 @@
1
+ export type ExportHandlers = {
2
+ handleExportToXLSX: () => void;
3
+ handleExportToCSV: () => void;
4
+ handleExportToJSON: () => void;
5
+ };
6
+ type ExportMenuSectionProps = ExportHandlers & {
7
+ onItemClick?: () => void;
8
+ testIdPrefix?: string;
9
+ };
10
+ export declare const ExportMenuSection: ({ handleExportToJSON, handleExportToXLSX, handleExportToCSV, onItemClick, testIdPrefix, }: ExportMenuSectionProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ExportHandlers } from './export-menu-section';
2
+
3
+ type ReadOnlyExportButtonProps = ExportHandlers & {
4
+ setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
5
+ };
6
+ export declare const ReadOnlyExportButton: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: ReadOnlyExportButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -7,5 +7,5 @@ import { DsheetProps } from './types';
7
7
  * @param props - Component properties
8
8
  * @returns The SpreadsheetEditor component
9
9
  */
10
- declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, allowComments, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingCompleteLocalStorageKey, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, onDuneChartEmbed, onSheetCountChange, onDataBlockApiResponse, isAuthorized, getDocumentTitle, updateDocumentTitle, setShowSmartContractModal, editorStateRef, handleSmartContractQuery, setSelectedTemplate, isNewSheet, liveQueryRefreshRate, enableLiveQuery, }: DsheetProps) => JSX.Element;
10
+ declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, allowSheetDownload, allowComments, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingCompleteLocalStorageKey, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, onDuneChartEmbed, onSheetCountChange, onDataBlockApiResponse, isAuthorized, getDocumentTitle, updateDocumentTitle, setShowSmartContractModal, editorStateRef, handleSmartContractQuery, setSelectedTemplate, isNewSheet, liveQueryRefreshRate, enableLiveQuery, }: DsheetProps) => JSX.Element;
11
11
  export default SpreadsheetEditor;
@@ -59,6 +59,7 @@ export interface DsheetProps {
59
59
  enableWebrtc?: boolean;
60
60
  portalContent?: string;
61
61
  isReadOnly?: boolean;
62
+ allowSheetDownload?: boolean;
62
63
  isTemplateOpen?: boolean;
63
64
  isCollaborative?: boolean;
64
65
  selectedTemplate?: string;
@@ -31,3 +31,20 @@ export declare const getCustomToolbarItems: ({ handleContentPortal, setShowSmart
31
31
  icon: import("react/jsx-runtime").JSX.Element;
32
32
  onClick: (() => void) | undefined;
33
33
  })[];
34
+ type ReadOnlyExportDeps = {
35
+ setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
36
+ handleExportToXLSX: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
37
+ handleExportToCSV: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string, getDocumentTitle?: (dsheetId: string) => Promise<string>) => void;
38
+ handleExportToJSON: (sheetEditorRef: React.RefObject<WorkbookInstance | null>, ydocRef: React.RefObject<Y.Doc | null>, dsheetId: string) => void;
39
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
40
+ ydocRef: React.RefObject<Y.Doc | null>;
41
+ dsheetId: string;
42
+ getDocumentTitle?: (dsheetId: string) => Promise<string>;
43
+ };
44
+ export declare const getReadOnlyCustomToolbarItems: ({ setExportDropdownOpen, handleExportToXLSX, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, getDocumentTitle, }: ReadOnlyExportDeps) => {
45
+ key: string;
46
+ tooltip: string;
47
+ onClick: () => void;
48
+ icon: import("react/jsx-runtime").JSX.Element;
49
+ }[];
50
+ export {};