@fileverse-dev/dsheet 0.0.15 → 0.0.16

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.
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+
3
+ /**
4
+ * ApiKeyModal component
5
+ *
6
+ * A modal dialog that prompts users to name their document before sharing it
7
+ */
8
+ export declare const ApiKeyModal: ({ openApiKeyModal, setOpenApiKeyModal, openApiKeyModalRef, contextApiKeyName, }: {
9
+ openApiKeyModal: boolean;
10
+ setOpenApiKeyModal: React.Dispatch<React.SetStateAction<boolean>>;
11
+ openApiKeyModalRef: React.MutableRefObject<boolean>;
12
+ contextApiKeyName: React.MutableRefObject<string | null>;
13
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
+ import { WorkbookInstance } from '@fileverse-dev/fortune-react';
1
2
 
2
- export declare const OnboardingUI: ({ sheetEditorRef }: {
3
- sheetEditorRef: React.RefObject<any>;
3
+ export declare const OnboardingUI: ({ sheetEditorRef, }: {
4
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
4
5
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,11 @@
1
1
  import { DsheetProps } from './types';
2
2
 
3
- declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, renderNavbar, initialSheetData, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, initialTitle, onTitleChange, enableWebrtc, sheetEditorRef: externalSheetEditorRef, }: DsheetProps) => import("react/jsx-runtime").JSX.Element;
3
+ /**
4
+ * SpreadsheetEditor component that provides a collaborative spreadsheet interface
5
+ * with various import/export capabilities and template support.
6
+ *
7
+ * @param props - Component properties
8
+ * @returns The SpreadsheetEditor component
9
+ */
10
+ declare const SpreadsheetEditor: ({ isCollaborative, isReadOnly, renderNavbar, initialSheetData, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, enableWebrtc, sheetEditorRef: externalSheetEditorRef, }: DsheetProps) => JSX.Element;
4
11
  export default SpreadsheetEditor;
@@ -1,6 +1,6 @@
1
1
  import { IndexeddbPersistence } from 'y-indexeddb';
2
2
  import * as Y from 'yjs';
3
- export declare const useYjsDocument: (dsheetId: string, enableIndexeddbSync: boolean) => {
3
+ export declare const useYjsDocument: (dsheetId: string, enableIndexeddbSync: boolean, isReadOnly?: boolean) => {
4
4
  ydocRef: import('react').MutableRefObject<Y.Doc | null>;
5
5
  persistenceRef: import('react').MutableRefObject<IndexeddbPersistence | null>;
6
6
  };
@@ -2,15 +2,17 @@ import { Sheet } from '@fileverse-dev/fortune-core';
2
2
  import { RefObject } from 'react';
3
3
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
4
4
 
5
+ import * as Y from 'yjs';
5
6
  export interface SheetUpdateData {
6
7
  data: Sheet[];
7
- title?: string;
8
+ }
9
+ export interface EditorValues {
10
+ sheetEditorRef: RefObject<WorkbookInstance>;
11
+ currentDataRef: React.MutableRefObject<Sheet[] | null>;
12
+ ydocRef: React.RefObject<Y.Doc | null>;
8
13
  }
9
14
  export interface DsheetProps {
10
- renderNavbar?: (props?: {
11
- title: string;
12
- onTitleChange: (title: string) => void;
13
- }) => JSX.Element;
15
+ renderNavbar?: (editorValues?: EditorValues) => JSX.Element;
14
16
  initialSheetData?: Sheet[];
15
17
  enableIndexeddbSync?: boolean;
16
18
  dsheetId: string;
@@ -24,7 +26,5 @@ export interface DsheetProps {
24
26
  selectedTemplate?: string;
25
27
  setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>;
26
28
  toggleTemplateSidebar?: () => void;
27
- initialTitle?: string;
28
- onTitleChange?: (title: string) => void;
29
29
  sheetEditorRef?: RefObject<WorkbookInstance>;
30
30
  }
@@ -2,7 +2,7 @@ import { Sheet } from '@fileverse-dev/fortune-core';
2
2
  import { DsheetProps } from './types';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const useDsheetEditor: ({ enableIndexeddbSync, dsheetId, onChange, username, enableWebrtc, portalContent, initialTitle, sheetEditorRef: externalSheetEditorRef, initialSheetData, setForceSheetRender, }: Partial<DsheetProps>) => {
5
+ export declare const useDsheetEditor: ({ enableIndexeddbSync, dsheetId, onChange, username, enableWebrtc, portalContent, sheetEditorRef: externalSheetEditorRef, initialSheetData, setForceSheetRender, isReadOnly, }: Partial<DsheetProps>) => {
6
6
  sheetEditorRef: import('react').RefObject<{
7
7
  applyOp: (ops: import('@fileverse-dev/fortune-core').Op[]) => void;
8
8
  getCellValue: (row: number, column: number, options?: import('@fileverse-dev/fortune-core/dist/api').CommonOptions & {
@@ -124,6 +124,4 @@ export declare const useDsheetEditor: ({ enableIndexeddbSync, dsheetId, onChange
124
124
  loading: boolean;
125
125
  ydocRef: import('react').MutableRefObject<Y.Doc | null>;
126
126
  setSheetData: import('react').Dispatch<import('react').SetStateAction<Sheet[] | null>>;
127
- title: string;
128
- handleTitleChange: (newTitle: string) => void;
129
127
  };
@@ -1,4 +1,17 @@
1
1
  import { Cell } from '@fileverse-dev/fortune-core';
2
2
  import { WorkbookInstance } from '@fileverse-dev/fortune-react';
3
3
 
4
- export declare const afterUpdateCell: (row: number, column: number, oldValue: Cell, newValue: Cell, sheetEditorRef: React.RefObject<WorkbookInstance | null>) => void;
4
+ /**
5
+ * Handles logic after a cell is updated, including processing formula results
6
+ *
7
+ * @param row - The row index of the updated cell
8
+ * @param column - The column index of the updated cell
9
+ * @param oldValue - The previous value of the cell
10
+ * @param newValue - The new value of the cell
11
+ * @param sheetEditorRef - Reference to the workbook instance
12
+ * @param setOpenApiKeyModal - Function to set the API key modal open state
13
+ * @param openApiKeyModalRef - Ref object tracking if the API key modal is open
14
+ * @param contextApiKeyName - Ref object for the current API key name context
15
+ * @returns {Promise<void>}
16
+ */
17
+ export declare const afterUpdateCell: (row: number, column: number, oldValue: Cell, newValue: Cell, sheetEditorRef: React.RefObject<WorkbookInstance | null>, setOpenApiKeyModal: React.Dispatch<React.SetStateAction<boolean>>, openApiKeyModalRef: React.MutableRefObject<boolean>, contextApiKeyName: React.MutableRefObject<string | null>) => Promise<void>;