@fileverse-dev/dsheet 1.1.6 → 1.1.7-patch-2

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.
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { SmartContractQueryHandler } from '../utils/after-update-cell';
2
+ import { LiveQueryData, SmartContractQueryHandler } from '../utils/after-update-cell';
3
3
  import { OnboardingHandlerType, DataBlockApiKeyHandlerType } from '../types';
4
4
 
5
5
  type OnboardingHandler = OnboardingHandlerType;
@@ -25,6 +25,7 @@ interface EditorWorkbookProps {
25
25
  onDuneChartEmbed?: () => void;
26
26
  onSheetCountChange?: (sheetCount: number) => void;
27
27
  handleSmartContractQuery?: SmartContractQueryHandler;
28
+ handleLiveQueryData?: (subsheetIndex: number, data: LiveQueryData) => void;
28
29
  }
29
30
  /**
30
31
  * EditorWorkbook component handles rendering the Fortune Workbook with proper configuration
@@ -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, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, onDuneChartEmbed, onSheetCountChange, onDataBlockApiResponse, isAuthorized, getDocumentTitle, updateDocumentTitle, setShowSmartContractModal, editorStateRef, handleSmartContractQuery, setSelectedTemplate, isNewSheet, }: DsheetProps) => JSX.Element;
10
+ declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, allowComments, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, onboardingComplete, onboardingHandler, commentData, getCommentCellUI, dataBlockApiKeyHandler, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, storeApiKey, onDuneChartEmbed, onSheetCountChange, onDataBlockApiResponse, isAuthorized, getDocumentTitle, updateDocumentTitle, setShowSmartContractModal, editorStateRef, handleSmartContractQuery, handleLiveQueryData, setSelectedTemplate, isNewSheet, }: DsheetProps) => JSX.Element;
11
11
  export default SpreadsheetEditor;
@@ -1,7 +1,7 @@
1
1
  import { Sheet, WorkbookInstance, Cell } from '@fileverse-dev/fortune-react';
2
2
  import { RefObject } from 'react';
3
3
  import { ERROR_MESSAGES_FLAG } from './constants/shared-constants';
4
- import { SmartContractQueryHandler } from './utils/after-update-cell';
4
+ import { LiveQueryData, SmartContractQueryHandler } from './utils/after-update-cell';
5
5
 
6
6
  import * as Y from 'yjs';
7
7
  export interface SheetUpdateData {
@@ -75,6 +75,7 @@ export interface DsheetProps {
75
75
  refreshIndexedDB: () => Promise<void>;
76
76
  } | null>;
77
77
  handleSmartContractQuery?: SmartContractQueryHandler;
78
+ handleLiveQueryData?: (subsheetIndex: number, data: LiveQueryData) => void;
78
79
  }
79
80
  export type BaseError = {
80
81
  message: string;
@@ -12,6 +12,17 @@ export type SheetSmartContractApi = {
12
12
  newValue: Cell;
13
13
  };
14
14
  export type SmartContractQueryHandler = (sheetApi: SheetSmartContractApi) => (callSignature: unknown[]) => Promise<void>;
15
+ export type LiveQueryData = {
16
+ data: {
17
+ row: number;
18
+ column: number;
19
+ function: string;
20
+ value: string;
21
+ id: string;
22
+ name: string;
23
+ };
24
+ cellData: Cell;
25
+ };
15
26
  /**
16
27
  * Parameters for the afterUpdateCell function
17
28
  */
@@ -25,7 +36,8 @@ interface AfterUpdateCellParams {
25
36
  setFetchingURLData: (fetching: boolean) => void;
26
37
  onboardingHandler: OnboardingHandlerType | undefined;
27
38
  dataBlockApiKeyHandler: DataBlockApiKeyHandlerType | undefined;
28
- handleSmartContractQuery: SmartContractQueryHandler | undefined;
39
+ handleSmartContractQuery?: SmartContractQueryHandler | undefined;
40
+ handleLiveQueryData?: (subsheetIndex: number, queryData: LiveQueryData) => void;
29
41
  setInputFetchURLDataBlock: React.Dispatch<React.SetStateAction<string>> | undefined;
30
42
  storeApiKey?: (apiKeyName: string) => void;
31
43
  onDataBlockApiResponse?: (dataBlockName: string) => void;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/dsheet",
3
3
  "private": false,
4
4
  "description": "DSheet",
5
- "version": "1.1.6",
5
+ "version": "1.1.7-patch-2",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@fileverse-dev/dsheets-templates": "^0.0.18",
37
- "@fileverse-dev/formulajs": "^4.4.12-mod-2",
38
- "@fileverse-dev/fortune-react": "^1.1.4",
37
+ "@fileverse-dev/formulajs": "^4.4.12-mod-3",
38
+ "@fileverse-dev/fortune-react": "^1.1.5-patch.2",
39
39
  "@fileverse/ui": "^4.1.7-patch-21",
40
40
  "classnames": "^2.5.1",
41
41
  "exceljs": "^4.4.0",
@@ -78,4 +78,4 @@
78
78
  "typescript": "^5.2.2",
79
79
  "vite": "^5.0.0"
80
80
  }
81
- }
81
+ }