@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.
- package/dist/index.es.js +28984 -27948
- package/dist/package/components/api-key-modal.d.ts +13 -0
- package/dist/package/components/onboarding.d.ts +3 -2
- package/dist/package/dsheet-editor.d.ts +8 -1
- package/dist/package/hooks/use-yjs-document.d.ts +1 -1
- package/dist/package/types.d.ts +7 -7
- package/dist/package/use-dsheet-editor.d.ts +1 -3
- package/dist/package/utils/after-update-cell.d.ts +14 -1
- package/dist/style.css +1 -1
- package/package.json +5 -4
|
@@ -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<
|
|
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
|
-
|
|
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
|
};
|
package/dist/package/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
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?: (
|
|
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,
|
|
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
|
-
|
|
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>;
|