@fileverse-dev/dsheet 0.0.107 → 0.0.108

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.
@@ -6,6 +6,12 @@ import { SheetUpdateData } from '../types';
6
6
 
7
7
  import * as Y from 'yjs';
8
8
  export interface EditorContextType {
9
+ dataBlockCalcFunction: Array<object>;
10
+ setDataBlockCalcFunction: React.Dispatch<React.SetStateAction<Array<{
11
+ row: number;
12
+ column: number;
13
+ sheetId: string;
14
+ }>>>;
9
15
  sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>;
10
16
  ydocRef: React.MutableRefObject<Y.Doc | null>;
11
17
  persistenceRef: React.MutableRefObject<IndexeddbPersistence | null>;
@@ -6,7 +6,15 @@ import * as Y from 'yjs';
6
6
  * Hook for managing sheet data
7
7
  * Handles initialization, updates, and persistence of sheet data
8
8
  */
9
- export declare const useEditorData: (ydocRef: React.MutableRefObject<Y.Doc | null>, dsheetId: string, sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>, setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>, portalContent?: string, isReadOnly?: boolean, onChange?: (data: Sheet[]) => void, syncStatus?: "initializing" | "syncing" | "synced" | "error", commentData?: object) => {
9
+ export declare const useEditorData: (ydocRef: React.MutableRefObject<Y.Doc | null>, dsheetId: string, sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>, setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>, portalContent?: string, isReadOnly?: boolean, onChange?: (data: Sheet[]) => void, syncStatus?: "initializing" | "syncing" | "synced" | "error", commentData?: object, dataBlockCalcFunction?: Array<{
10
+ row: number;
11
+ column: number;
12
+ sheetId: string;
13
+ }>, setDataBlockCalcFunction?: React.Dispatch<React.SetStateAction<Array<{
14
+ row: number;
15
+ column: number;
16
+ sheetId: string;
17
+ }>>>) => {
10
18
  sheetData: Sheet[];
11
19
  setSheetData: import('react').Dispatch<import('react').SetStateAction<Sheet[]>>;
12
20
  currentDataRef: import('react').MutableRefObject<Sheet[]>;
@@ -17,6 +17,12 @@ interface AfterUpdateCellParams {
17
17
  setInputFetchURLDataBlock: React.Dispatch<React.SetStateAction<string>> | undefined;
18
18
  storeApiKey?: (apiKeyName: string) => void;
19
19
  onDataBlockApiResponse?: (dataBlockName: string) => void;
20
+ setDataBlockCalcFunction?: React.Dispatch<React.SetStateAction<Array<{
21
+ row: number;
22
+ column: number;
23
+ sheetId: string;
24
+ }>>>;
25
+ dataBlockCalcFunction?: Array<object>;
20
26
  }
21
27
  /**
22
28
  * Handles logic after a cell is updated, including processing formula results
@@ -0,0 +1,12 @@
1
+ import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
+
3
+ export declare const dataBlockCalcFunctionHandler: ({ dataBlockCalcFunction, sheetEditorRef, currentRow, currentColumn }: {
4
+ dataBlockCalcFunction: Array<{
5
+ row: number;
6
+ column: number;
7
+ sheetId: string;
8
+ }>;
9
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
10
+ currentRow: number;
11
+ currentColumn: number;
12
+ }) => void;
@@ -1,7 +1,46 @@
1
+ import { WorkbookInstance } from '@fileverse-dev/fortune-react';
2
+
1
3
  /**
2
4
  * Dynamically executes a function from a string representation
3
5
  *
4
6
  * @param functionCallString - String representation of the function call
5
7
  * @returns {Promise<unknown>} - Result of the function execution
6
8
  */
7
- export declare const executeStringFunction: (functionCallString: string) => Promise<unknown>;
9
+ export declare const executeStringFunction: (functionCallString: string, sheetEditorRef?: React.RefObject<WorkbookInstance | null>) => Promise<unknown>;
10
+ /**
11
+ * Parses a complex argument string into an array of properly typed arguments
12
+ *
13
+ * @param argsString - String containing function arguments
14
+ * @returns {any[]} - Array of parsed arguments with appropriate types
15
+ */
16
+ export declare function parseArguments(argsString: string): (string | number | boolean | object | [] | null | undefined)[];
17
+ /**
18
+ * Checks if a string is a valid cell reference (e.g., A1, B2, AA10, etc.)
19
+ * @param {string} str - The string to check
20
+ * @returns {boolean} - True if it's a valid cell reference, false otherwise
21
+ */
22
+ export declare function isCellReference(str: string): boolean;
23
+ /**
24
+ * Checks if a string is a valid cell range reference (e.g., A1:B2, A1:A10, etc.)
25
+ * @param {string} str - The string to check
26
+ * @returns {boolean} - True if it's a valid cell range reference, false otherwise
27
+ */
28
+ export declare function isCellRangeReference(str: string): boolean;
29
+ /**
30
+ * Converts a cell reference (e.g., A1, B2, AA10) to row and column numbers
31
+ * @param {string} cellRef - The cell reference string (e.g., "A1", "B2")
32
+ * @returns {Object|null} - Object with row and column properties, or null if invalid
33
+ */
34
+ export declare function cellReferenceToRowCol(cellRef: string): {
35
+ row: number;
36
+ column: number;
37
+ } | null;
38
+ /**
39
+ * Converts a cell range reference (e.g., A1:B2) to an array of all cells in the range
40
+ * @param {string} rangeRef - The range reference string (e.g., "A1:B2", "A4:B4")
41
+ * @returns {Array|null} - Array of objects with row and column properties, or null if invalid
42
+ */
43
+ export declare function cellRangeToRowCol(rangeRef: string): {
44
+ row: number;
45
+ column: number;
46
+ }[] | null;
@@ -1,5 +1,5 @@
1
1
  import { Sheet } from '@fileverse-dev/fortune-core';
2
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
3
  import * as Y from 'yjs';
4
- export declare const updateSheetData: (ydoc: Y.Doc | null, dsheetId: string, data: Sheet[], sheetEditor: WorkbookInstance | null) => void;
4
+ export declare const updateSheetData: (ydoc: Y.Doc | null, dsheetId: string, data: Sheet[], sheetEditor: WorkbookInstance | null, dataBlockCalcFunction?: Array<object>) => void;
5
5
  export declare const formatSheetData: (data: Sheet[], preSheetArray: Sheet[], sheetEditor: WorkbookInstance) => Sheet[];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "0.0.107",
5
+ "version": "0.0.108",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -37,10 +37,10 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@fileverse-dev/dsheets-templates": "^0.0.7",
40
- "@fileverse-dev/formula-parser": "^0.2.13-mod-25",
41
- "@fileverse-dev/formulajs": "^4.4.11-mod-39",
42
- "@fileverse-dev/fortune-core": "^1.0.2-mod-91",
43
- "@fileverse-dev/fortune-react": "^1.0.2-mod-91",
40
+ "@fileverse-dev/formula-parser": "^0.2.13-mod-24",
41
+ "@fileverse-dev/formulajs": "^4.4.11-mod-38",
42
+ "@fileverse-dev/fortune-core": "^1.0.2-mod-88-patch-4",
43
+ "@fileverse-dev/fortune-react": "^1.0.2-mod-88-patch-4",
44
44
  "@fileverse/ui": "^4.1.7-patch-18",
45
45
  "classnames": "^2.5.1",
46
46
  "exceljs": "^4.4.0",
@@ -83,4 +83,4 @@
83
83
  "typescript": "^5.2.2",
84
84
  "vite": "^5.0.0"
85
85
  }
86
- }
86
+ }