@fileverse-dev/dsheet 0.0.35 → 0.0.36

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.
@@ -4,6 +4,9 @@ import { OnboardingHandlerType, DataBlockApiKeyHandlerType } from '../types';
4
4
  type OnboardingHandler = OnboardingHandlerType;
5
5
  type DataBlockApiKeyHandler = DataBlockApiKeyHandlerType;
6
6
  interface EditorWorkbookProps {
7
+ setShowFetchURLModal?: React.Dispatch<React.SetStateAction<boolean>>;
8
+ setFetching?: (fetching: boolean) => void;
9
+ setInputFetchURLDataBlock?: React.Dispatch<React.SetStateAction<string>>;
7
10
  isReadOnly?: boolean;
8
11
  toggleTemplateSidebar?: () => void;
9
12
  onboardingComplete?: boolean;
@@ -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, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, sheetEditorRef: externalSheetEditorRef, }: DsheetProps) => JSX.Element;
10
+ declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, setFetching, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, }: DsheetProps) => JSX.Element;
11
11
  export default SpreadsheetEditor;
@@ -35,6 +35,9 @@ export type DataBlockApiKeyHandlerType = (params: {
35
35
  }) => void;
36
36
  }) => void;
37
37
  export interface DsheetProps {
38
+ setShowFetchURLModal?: React.Dispatch<React.SetStateAction<boolean>>;
39
+ setFetching?: (fetching: boolean) => void;
40
+ setInputFetchURLDataBlock: React.Dispatch<React.SetStateAction<string>>;
38
41
  renderNavbar?: (editorValues?: EditorValues) => JSX.Element;
39
42
  enableIndexeddbSync?: boolean;
40
43
  dsheetId: string;
@@ -2,31 +2,25 @@ import { Cell } from '@fileverse-dev/fortune-core';
2
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
3
  import { OnboardingHandlerType, DataBlockApiKeyHandlerType } from '../types';
4
4
 
5
- export type FormulaSyncType = {
6
- row: number;
7
- column: number;
8
- newValue: Record<string, string>;
9
- apiData: Array<Record<string, object>>;
10
- sheetEditorRef: React.RefObject<WorkbookInstance | null>;
11
- };
12
- export declare const formulaResponseUiSync: ({ row, column, newValue, apiData, sheetEditorRef, }: FormulaSyncType) => void;
13
5
  /**
14
- * Handles logic after a cell is updated, including processing formula results
15
- *
16
- * @param row - The row index of the updated cell
17
- * @param column - The column index of the updated cell
18
- * @param oldValue - The previous value of the cell
19
- * @param newValue - The new value of the cell
20
- * @param sheetEditorRef - Reference to the workbook instance
21
- * @param onboardingHandler - Function to handle onboarding from consumer side
22
- * @returns {Promise<void>}
6
+ * Parameters for the afterUpdateCell function
23
7
  */
24
- export declare const afterUpdateCell: ({ row, column, newValue, sheetEditorRef, onboardingComplete, onboardingHandler, dataBlockApiKeyHandler, }: {
8
+ interface AfterUpdateCellParams {
25
9
  row: number;
26
10
  column: number;
27
11
  newValue: Cell;
28
12
  sheetEditorRef: React.RefObject<WorkbookInstance | null>;
29
13
  onboardingComplete: boolean | undefined;
14
+ setFetching: (fetching: boolean) => void;
30
15
  onboardingHandler: OnboardingHandlerType | undefined;
31
16
  dataBlockApiKeyHandler: DataBlockApiKeyHandlerType | undefined;
32
- }) => Promise<void>;
17
+ setInputFetchURLDataBlock: React.Dispatch<React.SetStateAction<string>> | undefined;
18
+ }
19
+ /**
20
+ * Handles logic after a cell is updated, including processing formula results
21
+ *
22
+ * @param params - Object containing all required parameters
23
+ * @returns Promise that resolves when processing is complete
24
+ */
25
+ export declare const afterUpdateCell: (params: AfterUpdateCellParams) => Promise<void>;
26
+ export {};
@@ -2,7 +2,7 @@ import { default as React, ChangeEvent } from 'react';
2
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const getCustomToolbarItems: ({ setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, currentDataRef, setForceSheetRender, toggleTemplateSidebar, }: {
5
+ export declare const getCustomToolbarItems: ({ setExportDropdownOpen, handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, sheetEditorRef, ydocRef, dsheetId, currentDataRef, setForceSheetRender, toggleTemplateSidebar, setShowFetchURLModal, }: {
6
6
  setExportDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
7
7
  handleCSVUpload: (event: ChangeEvent<HTMLInputElement>, ydocRef: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>) => void;
8
8
  handleXLSXUpload: React.ChangeEventHandler<HTMLInputElement>;
@@ -15,6 +15,7 @@ export declare const getCustomToolbarItems: ({ setExportDropdownOpen, handleCSVU
15
15
  currentDataRef: React.MutableRefObject<object | null>;
16
16
  setForceSheetRender: React.Dispatch<React.SetStateAction<number>>;
17
17
  toggleTemplateSidebar: (() => void) | undefined;
18
+ setShowFetchURLModal: React.Dispatch<React.SetStateAction<boolean>> | undefined;
18
19
  }) => {
19
20
  key: string;
20
21
  tooltip: string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Dynamically executes a function from a string representation
3
+ *
4
+ * @param functionCallString - String representation of the function call
5
+ * @returns {Promise<unknown>} - Result of the function execution
6
+ */
7
+ export declare const executeStringFunction: (functionCallString: string) => Promise<unknown>;
@@ -0,0 +1,10 @@
1
+ import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
+
3
+ export type FormulaSyncType = {
4
+ row: number;
5
+ column: number;
6
+ newValue: Record<string, string>;
7
+ apiData: Array<Record<string, object>>;
8
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
9
+ };
10
+ export declare const formulaResponseUiSync: ({ row, column, newValue, apiData, sheetEditorRef, }: FormulaSyncType) => void;