@fileverse-dev/dsheet 2.1.2 → 2.1.3-package-cleanup-1
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/editor/components/api-key-modal/api-key-input.d.ts +5 -0
- package/dist/editor/components/api-key-modal/api-key-modal.d.ts +7 -0
- package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +4 -0
- package/dist/editor/components/comments/comment-actions-dropdown.d.ts +19 -0
- package/dist/editor/components/comments/comment-cell-popup.d.ts +4 -0
- package/dist/editor/components/comments/comment-input.d.ts +4 -0
- package/dist/editor/components/comments/comment-item.d.ts +4 -0
- package/dist/editor/components/comments/comment-sidebar-empty.d.ts +4 -0
- package/dist/editor/components/comments/comment-sidebar.d.ts +4 -0
- package/dist/editor/components/comments/ens/ens-cache.d.ts +10 -0
- package/dist/editor/components/comments/ens/use-ens-status.d.ts +10 -0
- package/dist/editor/components/comments/use-comment-cell-popup.d.ts +12 -0
- package/dist/editor/components/comments/use-comment-permissions.d.ts +15 -0
- package/dist/editor/components/editor-workbook.d.ts +11 -14
- package/dist/editor/components/sidebar/editor-right-sidebar.d.ts +20 -0
- package/dist/editor/components/sidebar/right-sidebar.d.ts +14 -0
- package/dist/editor/components/sidebar/sidebar-context.d.ts +17 -0
- package/dist/editor/components/sidebar/sidebar-portal-registry.d.ts +20 -0
- package/dist/editor/components/sidebar/use-right-panels.d.ts +12 -0
- package/dist/editor/components/sidebars/conditional-format.d.ts +2 -0
- package/dist/editor/components/sidebars/data-verification.d.ts +2 -0
- package/dist/editor/components/sidebars/function/function-categories-logic.d.ts +11 -0
- package/dist/editor/components/sidebars/function/function-categories.d.ts +6 -0
- package/dist/editor/components/sidebars/function/function-metadata.d.ts +7 -0
- package/dist/editor/components/sidebars/function/functionList.d.ts +8 -0
- package/dist/editor/components/sidebars/function/types.d.ts +24 -0
- package/dist/editor/components/sidebars/function/use-functions.d.ts +20 -0
- package/dist/editor/components/sidebars/function-content.d.ts +8 -0
- package/dist/editor/components/sidebars/template-ui.d.ts +22 -0
- package/dist/editor/components/sidebars/templates.d.ts +9 -0
- package/dist/editor/contexts/editor-context.d.ts +16 -4
- package/dist/editor/dsheet-editor.d.ts +1 -1
- package/dist/editor/hooks/live-query/use-live-query.d.ts +4 -2
- package/dist/editor/hooks/use-editor-data.d.ts +4 -2
- package/dist/editor/types/comments.d.ts +133 -0
- package/dist/editor/types.d.ts +36 -29
- package/dist/editor/utils/after-update-cell.d.ts +13 -8
- package/dist/editor/utils/api-key-storage.d.ts +6 -0
- package/dist/editor/utils/api-keys-local-storage.d.ts +19 -0
- package/dist/editor/utils/cell-comment-marker.d.ts +29 -0
- package/dist/editor/utils/comment-key-utils.d.ts +7 -0
- package/dist/editor/utils/data-block-error-handler.d.ts +21 -0
- package/dist/editor/utils/datablock-error-utils.d.ts +1 -0
- package/dist/editor/utils/sheet-editor-safe.d.ts +26 -0
- package/dist/{executeStringFunction-CGbxAbbw.js → executeStringFunction-C26SXUpc.js} +4741 -4363
- package/dist/formula.js +1 -1
- package/dist/index-DSogq3Tz.js +55498 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.es.js +55 -51
- package/dist/sheet-engine/core/context.d.ts +5 -0
- package/dist/sheet-engine/core/index.d.ts +1 -1
- package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +53 -0
- package/dist/sheet-engine/core/modules/formula-eval.worker.d.ts +1 -0
- package/dist/sheet-engine/core/modules/formula-range-cache.d.ts +20 -0
- package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +40 -0
- package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +7 -0
- package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +16 -0
- package/dist/sheet-engine/core/modules/formula-worker-types.d.ts +24 -0
- package/dist/sheet-engine/core/modules/formula.d.ts +26 -1
- package/dist/sheet-engine/core/modules/index.d.ts +3 -1
- package/dist/sheet-engine/core/theme.d.ts +67 -0
- package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +5 -4
- package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
- package/dist/sheet-engine/react/components/SidebarPanelPortals/index.d.ts +17 -0
- package/dist/sheet-engine/react/components/Workbook/index.d.ts +6 -0
- package/dist/sheet-engine/react/components/index.d.ts +1 -0
- package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-xlsx-import-impl-arHLnoR4.js → use-xlsx-import-impl-C-PHnu49.js} +2 -2
- package/dist/{xlsx-export-impl-t86QBMF3.js → xlsx-export-impl-BAJCFNh6.js} +2 -2
- package/package.json +4 -3
- package/dist/index-DzIdZpns.js +0 -52604
- package/dist/sheet-engine/react/components/Toolbar/conditionalFormatPortal.d.ts +0 -7
- package/dist/sheet-engine/react/components/Toolbar/dataVerificationPortal.d.ts +0 -6
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ApiKeyModalProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
apiKeyName: string;
|
|
4
|
+
onSave: (key: string) => void;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ApiKeyModal: ({ open, apiKeyName, onSave, onClose, }: ApiKeyModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CommentThread, CommentReply, CommentActionParams } from '../../types/comments';
|
|
3
|
+
|
|
4
|
+
interface CommentActionsDropdownProps {
|
|
5
|
+
comment: CommentThread | CommentReply;
|
|
6
|
+
onAction: (action: CommentActionParams) => void;
|
|
7
|
+
isReply?: boolean;
|
|
8
|
+
parentCommentId?: string;
|
|
9
|
+
ownerAddress?: string;
|
|
10
|
+
currentUserName?: string;
|
|
11
|
+
currentUserAddress?: string;
|
|
12
|
+
isOwner?: boolean;
|
|
13
|
+
dsheetId?: string;
|
|
14
|
+
commentKey?: string;
|
|
15
|
+
row: number;
|
|
16
|
+
col: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const CommentActionsDropdown: React.FC<CommentActionsDropdownProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface EnsStatus {
|
|
2
|
+
name: string;
|
|
3
|
+
isEns: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** Push the host-provided RPC URL into the singleton (called from EditorContent). */
|
|
6
|
+
export declare const setEnsResolutionUrl: (url: string | undefined) => void;
|
|
7
|
+
export declare const subscribeEns: (cb: () => void) => () => boolean;
|
|
8
|
+
export declare const getCachedEns: (username: string) => EnsStatus | undefined;
|
|
9
|
+
/** Resolve `username` to an EnsStatus, deduped + cached. No-op if already cached/in-flight. */
|
|
10
|
+
export declare const resolveEns: (username: string) => Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EnsStatus } from './ens-cache';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a comment username to a display name + ENS flag.
|
|
5
|
+
* - Empty → "Anonymous".
|
|
6
|
+
* - Cache hit → returned immediately.
|
|
7
|
+
* - Miss → triggers a deduped resolve; re-renders when it lands.
|
|
8
|
+
* - Plain names short-circuit inside getAddressName (no network).
|
|
9
|
+
*/
|
|
10
|
+
export declare const useEnsStatus: (username?: string) => EnsStatus;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useCommentCell: ({ onSendComment, cellKey, }: {
|
|
2
|
+
onSendComment: (commentKey: string, textareaId: string) => void;
|
|
3
|
+
cellKey: string;
|
|
4
|
+
}) => {
|
|
5
|
+
cellKey: string;
|
|
6
|
+
textareaId: string;
|
|
7
|
+
handleSend: (textareaId: string) => void;
|
|
8
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
9
|
+
handleDoubleClick: (e: React.MouseEvent) => void;
|
|
10
|
+
handleScroll: (e: React.UIEvent) => void;
|
|
11
|
+
handler: (e: WheelEvent) => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const useCommentPermissions: (ownerAddress?: string, currentUserName?: string, currentUserAddress?: string, isOwner?: boolean) => {
|
|
2
|
+
canDeleteComment: (item: {
|
|
3
|
+
username: string;
|
|
4
|
+
}) => boolean;
|
|
5
|
+
canResolveComment: (item: {
|
|
6
|
+
username: string;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
canDeleteReply: (item: {
|
|
9
|
+
username: string;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
canResolveReply: (item: {
|
|
12
|
+
username: string;
|
|
13
|
+
}) => boolean;
|
|
14
|
+
isOwner: boolean;
|
|
15
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { default as React
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SidebarPortalRegistryHandle, SidebarPortalRenderer } from '../../sheet-engine/react';
|
|
3
|
+
import { ThemeKey } from '../../sheet-engine/core/theme';
|
|
3
4
|
import { SmartContractQueryHandler } from '../utils/after-update-cell';
|
|
4
|
-
import { OnboardingHandlerType
|
|
5
|
+
import { OnboardingHandlerType } from '../types';
|
|
6
|
+
import { CommentsConfig } from '../types/comments';
|
|
5
7
|
|
|
6
8
|
type OnboardingHandler = OnboardingHandlerType;
|
|
7
|
-
type DataBlockApiKeyHandler = DataBlockApiKeyHandlerType;
|
|
8
9
|
interface EditorWorkbookProps {
|
|
9
10
|
setShowSmartContractModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
11
|
setShowFetchURLModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -12,25 +13,21 @@ interface EditorWorkbookProps {
|
|
|
12
13
|
setInputFetchURLDataBlock?: React.Dispatch<React.SetStateAction<string>>;
|
|
13
14
|
isReadOnly?: boolean;
|
|
14
15
|
allowSheetDownload?: boolean;
|
|
15
|
-
allowComments?: boolean;
|
|
16
16
|
toggleTemplateSidebar?: () => void;
|
|
17
17
|
onboardingComplete?: boolean;
|
|
18
18
|
onboardingCompleteLocalStorageKey?: string;
|
|
19
19
|
onboardingHandler?: OnboardingHandler;
|
|
20
|
-
dataBlockApiKeyHandler?: DataBlockApiKeyHandler;
|
|
21
20
|
exportDropdownOpen?: boolean;
|
|
22
|
-
|
|
23
|
-
getCommentCellUI?: ComponentProps<typeof Workbook>['getCommentCellUI'];
|
|
21
|
+
commentsConfig?: CommentsConfig;
|
|
24
22
|
setExportDropdownOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
25
23
|
dsheetId: string;
|
|
26
|
-
storeApiKey?: (apiKeyName: string) => void;
|
|
27
|
-
onDataBlockApiResponse?: (dataBlockName: string) => void;
|
|
28
24
|
onDuneChartEmbed?: () => void;
|
|
29
25
|
onSheetCountChange?: (sheetCount: number) => void;
|
|
30
26
|
handleSmartContractQuery?: SmartContractQueryHandler;
|
|
27
|
+
sidebarActivePanel?: string | null;
|
|
28
|
+
sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
|
|
29
|
+
sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
|
|
30
|
+
theme?: ThemeKey;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
* EditorWorkbook component handles rendering the Fortune Workbook with proper configuration
|
|
34
|
-
*/
|
|
35
|
-
export declare const EditorWorkbook: React.FC<EditorWorkbookProps>;
|
|
32
|
+
export declare const EditorWorkbook: React.NamedExoticComponent<EditorWorkbookProps>;
|
|
36
33
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ActivePanelConfig {
|
|
4
|
+
id: string;
|
|
5
|
+
width: string;
|
|
6
|
+
header: {
|
|
7
|
+
title: string;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
};
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
interface EditorRightSidebarProps {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
activePanelConfig: ActivePanelConfig | null;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
/** Read/preview mode hides the toolbar, so the sidebar starts higher. */
|
|
17
|
+
isReadOnly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const EditorRightSidebar: ({ isOpen, activePanelConfig, onClose, isReadOnly, }: EditorRightSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare function RightSidebar({ width, className, children, isOpen, top, height, }: Readonly<{
|
|
4
|
+
width?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
isOpen?: boolean;
|
|
8
|
+
top?: string;
|
|
9
|
+
height?: string;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function RightSidebarHeader({ className, children, }: Readonly<{
|
|
12
|
+
className?: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PanelId } from './use-right-panels';
|
|
3
|
+
|
|
4
|
+
interface SidebarContextType {
|
|
5
|
+
activePanel: PanelId | null;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
openPanel: (panel: PanelId) => void;
|
|
8
|
+
closePanel: () => void;
|
|
9
|
+
togglePanel: (panel: PanelId) => void;
|
|
10
|
+
isActive: (panel: PanelId) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function SidebarProvider({ children, isReadMode, }: Readonly<{
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
isReadMode?: boolean;
|
|
15
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function useSidebar(): SidebarContextType;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type SidebarPortalTargets = Record<string, HTMLElement>;
|
|
4
|
+
export type SidebarPortalRegistryHandle = {
|
|
5
|
+
getTargets: () => SidebarPortalTargets;
|
|
6
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function SidebarPortalRegistryProvider({ children, }: Readonly<{
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useSidebarPortalRegistryHandle(): SidebarPortalRegistryHandle;
|
|
12
|
+
export declare function useSidebarPortalTargets(): SidebarPortalTargets;
|
|
13
|
+
export declare function useSidebarPortalTarget(panelId: string): (node: HTMLElement | null) => void;
|
|
14
|
+
interface SidebarPortalSlotProps {
|
|
15
|
+
panelId: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
export declare function SidebarPortalSlot({ panelId, className, style, }: Readonly<SidebarPortalSlotProps>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type BuiltInPanelType = 'templates' | 'comments' | 'functions' | 'data-verification' | 'conditional-format';
|
|
2
|
+
export type PanelId = BuiltInPanelType | string;
|
|
3
|
+
interface UseRightPanelsReturn {
|
|
4
|
+
activePanel: PanelId | null;
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
openPanel: (panel: PanelId) => void;
|
|
7
|
+
closePanel: () => void;
|
|
8
|
+
togglePanel: (panel: PanelId) => void;
|
|
9
|
+
isActive: (panel: PanelId) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const useRightPanels: (isReadMode?: boolean) => UseRightPanelsReturn;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SpreadsheetFunction } from './types';
|
|
2
|
+
|
|
3
|
+
export declare const PARSER_FUNCTIONS: Set<string>;
|
|
4
|
+
export declare const TYPE_TO_CATEGORY_KEY: Record<number, string>;
|
|
5
|
+
export declare const CATEGORY_ORDER: readonly ["All", "Datablock", "Array", "Database", "Date", "Engineering", "Financial", "Info", "Logical", "Lookup", "Math", "Operator", "Parser", "Statistical", "Text", "Other"];
|
|
6
|
+
export type CategoryKey = (typeof CATEGORY_ORDER)[number];
|
|
7
|
+
export declare function getFunctionCategoryKey(fnName: string, typeId: number): CategoryKey;
|
|
8
|
+
export declare function groupFunctionsByCategory(functionlist: SpreadsheetFunction[]): {
|
|
9
|
+
categories: ("Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info")[];
|
|
10
|
+
byCategory: Map<"Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info", SpreadsheetFunction[]>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const FunctionCategories: ({ onCategorySelection, categories, categoryName, }: {
|
|
2
|
+
onCategorySelection: (value: string) => void;
|
|
3
|
+
categoryName: string;
|
|
4
|
+
categories: string[];
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default FunctionCategories;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SpreadsheetFunction } from './types';
|
|
2
|
+
|
|
3
|
+
declare const FunctionList: ({ list, onFunctionSelection, selectedFunction, }: {
|
|
4
|
+
list: SpreadsheetFunction[];
|
|
5
|
+
onFunctionSelection: (data: SpreadsheetFunction, functionIndex: number) => void;
|
|
6
|
+
selectedFunction: SpreadsheetFunction | null;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default FunctionList;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type FunctionParam = {
|
|
2
|
+
name: string;
|
|
3
|
+
detail: string;
|
|
4
|
+
example: string;
|
|
5
|
+
require: string;
|
|
6
|
+
repeat: string;
|
|
7
|
+
type: string;
|
|
8
|
+
};
|
|
9
|
+
export type SpreadsheetFunction = {
|
|
10
|
+
API_KEY: string;
|
|
11
|
+
LOGO: string;
|
|
12
|
+
BRAND_COLOR: string;
|
|
13
|
+
n: string;
|
|
14
|
+
t: any;
|
|
15
|
+
d: string;
|
|
16
|
+
a: string;
|
|
17
|
+
m?: number[];
|
|
18
|
+
p: FunctionParam[];
|
|
19
|
+
examples: {
|
|
20
|
+
title: string;
|
|
21
|
+
argumentString: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { WorkbookInstance } from '../../../../sheet-engine/react';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { SpreadsheetFunction } from './types';
|
|
4
|
+
|
|
5
|
+
declare const useFunctions: (sheetEditorRef: React.RefObject<WorkbookInstance>, shouldHandleSuggestionFromCell: number) => {
|
|
6
|
+
filteredFunctionList: SpreadsheetFunction[];
|
|
7
|
+
functionIndex: number;
|
|
8
|
+
setFunctionIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
9
|
+
setSearchText: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
selectedFunction: SpreadsheetFunction | null;
|
|
11
|
+
groupedFunctions: {
|
|
12
|
+
categories: ("Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info")[];
|
|
13
|
+
byCategory: Map<"Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info", SpreadsheetFunction[]>;
|
|
14
|
+
};
|
|
15
|
+
setSelectedCategory: React.Dispatch<React.SetStateAction<"Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info">>;
|
|
16
|
+
setSelectedFunction: React.Dispatch<React.SetStateAction<SpreadsheetFunction | null>>;
|
|
17
|
+
searchText: string;
|
|
18
|
+
selectedCategoryName: "Text" | "Date" | "Other" | "Logical" | "All" | "Array" | "Database" | "Engineering" | "Datablock" | "Financial" | "Lookup" | "Math" | "Operator" | "Parser" | "Statistical" | "Info";
|
|
19
|
+
};
|
|
20
|
+
export default useFunctions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WorkbookInstance } from '../../../sheet-engine/react';
|
|
3
|
+
|
|
4
|
+
declare const FunctionContent: ({ sheetEditorRef, shouldHandleSuggestionFromCell, }: {
|
|
5
|
+
sheetEditorRef: React.RefObject<WorkbookInstance>;
|
|
6
|
+
shouldHandleSuggestionFromCell: number;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default FunctionContent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Template {
|
|
2
|
+
slug: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
thumbnail: string;
|
|
6
|
+
fullImage: string;
|
|
7
|
+
category?: string;
|
|
8
|
+
isProTemplate: boolean;
|
|
9
|
+
techStack: {
|
|
10
|
+
name: string;
|
|
11
|
+
image: string;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
export declare const TemplateCard: ({ template, onMouseEnter, onMouseLeave, onSelect, }: {
|
|
15
|
+
template: Template;
|
|
16
|
+
onMouseEnter?: () => void;
|
|
17
|
+
onMouseLeave?: () => void;
|
|
18
|
+
onSelect: () => void;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const TemplatePreview: ({ template }: {
|
|
21
|
+
template: Template;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Template } from './template-ui';
|
|
3
|
+
|
|
4
|
+
interface TemplatesProps {
|
|
5
|
+
setSelectedTemplate: (template: string) => void;
|
|
6
|
+
setHoveredTemplate: React.Dispatch<React.SetStateAction<Template | null>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const Templates: ({ setSelectedTemplate, setHoveredTemplate, }: TemplatesProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { LiveQueryData, Sheet, WorkbookInstance } from '../../sheet-engine/react';
|
|
3
3
|
import { IndexeddbPersistence } from 'y-indexeddb';
|
|
4
|
-
import {
|
|
4
|
+
import { SheetUpdateData, DataBlockEvent } from '../types';
|
|
5
|
+
import { CommentsConfig } from '../types/comments';
|
|
6
|
+
import { ApiKeyStorage } from '../utils/api-key-storage';
|
|
7
|
+
import { OpenApiKeyModalFn } from '../utils/data-block-error-handler';
|
|
5
8
|
import { CollaborationProps, CollabState, CollabUser } from '../../sync-local/types';
|
|
6
9
|
import { Awareness } from 'y-protocols/awareness';
|
|
7
10
|
|
|
@@ -48,9 +51,17 @@ export interface EditorContextType {
|
|
|
48
51
|
terminateSession?: () => void;
|
|
49
52
|
onCollaboratorsChange?: (collaborators: CollabUser[]) => void;
|
|
50
53
|
handleLiveQuery: (subsheetIndex: number, data: LiveQueryData) => void;
|
|
54
|
+
apiKeyStorage: ApiKeyStorage;
|
|
55
|
+
onDataBlockEvent?: (event: DataBlockEvent) => void;
|
|
56
|
+
openApiKeyModal: OpenApiKeyModalFn;
|
|
57
|
+
apiKeyModalState: {
|
|
58
|
+
open: boolean;
|
|
59
|
+
apiKeyName: string;
|
|
60
|
+
onSave: (key: string) => void;
|
|
61
|
+
onClose: () => void;
|
|
62
|
+
} | null;
|
|
51
63
|
}
|
|
52
64
|
interface EditorProviderProps {
|
|
53
|
-
allowComments?: boolean;
|
|
54
65
|
setSelectedTemplate?: React.Dispatch<React.SetStateAction<string>>;
|
|
55
66
|
setShowSmartContractModal?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
56
67
|
getDocumentTitle?: (dsheetId: string) => Promise<string>;
|
|
@@ -65,7 +76,7 @@ interface EditorProviderProps {
|
|
|
65
76
|
onChange?: (data: SheetUpdateData, encodedUpdate?: string) => void;
|
|
66
77
|
collaboration?: CollaborationProps;
|
|
67
78
|
externalEditorRef?: React.MutableRefObject<WorkbookInstance | null>;
|
|
68
|
-
|
|
79
|
+
commentsConfig?: CommentsConfig;
|
|
69
80
|
editorStateRef?: React.MutableRefObject<{
|
|
70
81
|
refreshIndexedDB: () => Promise<void>;
|
|
71
82
|
terminateSession?: () => void;
|
|
@@ -74,7 +85,8 @@ interface EditorProviderProps {
|
|
|
74
85
|
} | null>;
|
|
75
86
|
enableLiveQuery?: boolean;
|
|
76
87
|
liveQueryRefreshRate?: number;
|
|
77
|
-
|
|
88
|
+
apiKeyStorage?: ApiKeyStorage;
|
|
89
|
+
onDataBlockEvent?: (event: DataBlockEvent) => void;
|
|
78
90
|
}
|
|
79
91
|
export declare const EditorProvider: React.FC<EditorProviderProps>;
|
|
80
92
|
export declare const useEditor: () => EditorContextType;
|
|
@@ -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: ({ isReadOnly, allowSheetDownload,
|
|
10
|
+
declare const SpreadsheetEditor: ({ isReadOnly, allowSheetDownload, renderNavbar, enableIndexeddbSync, dsheetId, portalContent, onChange, username, selectedTemplate, toggleTemplateSidebar, isTemplateOpen, onboardingComplete, onboardingCompleteLocalStorageKey, onboardingHandler, commentsConfig, setFetchingURLData, setShowFetchURLModal, setInputFetchURLDataBlock, sheetEditorRef: externalSheetEditorRef, onDuneChartEmbed, onSheetCountChange, isAuthorized, getDocumentTitle, updateDocumentTitle, setShowSmartContractModal, editorStateRef, handleSmartContractQuery, setSelectedTemplate, isNewSheet, liveQueryRefreshRate, enableLiveQuery, collaboration, customPanels, apiKeyStorage, onDataBlockEvent, theme, }: DsheetProps) => JSX.Element;
|
|
11
11
|
export default SpreadsheetEditor;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LiveQueryData, Sheet, WorkbookInstance } from '../../../sheet-engine/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ApiKeyStorage } from '../../utils/api-key-storage';
|
|
3
|
+
import { OpenApiKeyModalFn } from '../../utils/data-block-error-handler';
|
|
4
|
+
import { DataBlockEvent } from '../../types';
|
|
3
5
|
|
|
4
6
|
export declare const LIVE_QUERY_ERROR = "LIVE_QUERY_ERROR";
|
|
5
|
-
export declare const useLiveQuery: (sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>,
|
|
7
|
+
export declare const useLiveQuery: (sheetEditorRef: React.MutableRefObject<WorkbookInstance | null>, apiKeyStorage?: ApiKeyStorage, openApiKeyModal?: OpenApiKeyModalFn, onDataBlockEvent?: (event: DataBlockEvent) => void, enableLiveQuery?: boolean, refreshRate?: number) => {
|
|
6
8
|
handleLiveQuery: (subsheetIndex: number, queryData: LiveQueryData) => void;
|
|
7
9
|
initialiseLiveQueryData: (sheets: Sheet[]) => void;
|
|
8
10
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Sheet, WorkbookInstance } from '../../sheet-engine/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ApiKeyStorage } from '../utils/api-key-storage';
|
|
3
|
+
import { OpenApiKeyModalFn } from '../utils/data-block-error-handler';
|
|
4
|
+
import { DataBlockEvent } from '../types';
|
|
3
5
|
|
|
4
6
|
import * as Y from 'yjs';
|
|
5
7
|
/**
|
|
@@ -14,7 +16,7 @@ export declare const useEditorData: (ydocRef: React.MutableRefObject<Y.Doc | nul
|
|
|
14
16
|
[key: string]: {
|
|
15
17
|
[key: string]: any;
|
|
16
18
|
};
|
|
17
|
-
}>>, enableLiveQuery?: boolean, liveQueryRefreshRate?: number,
|
|
19
|
+
}>>, enableLiveQuery?: boolean, liveQueryRefreshRate?: number, apiKeyStorage?: ApiKeyStorage, openApiKeyModal?: OpenApiKeyModalFn, onDataBlockEvent?: (event: DataBlockEvent) => void, allowComments?: boolean, hasCollabContentInitialised?: boolean, collabEnabled?: boolean) => {
|
|
18
20
|
sheetData: Sheet[];
|
|
19
21
|
setSheetData: import('react').Dispatch<import('react').SetStateAction<Sheet[]>>;
|
|
20
22
|
currentDataRef: import('react').MutableRefObject<Sheet[]>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface CommentThread {
|
|
4
|
+
id: string;
|
|
5
|
+
key: string;
|
|
6
|
+
dsheetId: string;
|
|
7
|
+
username: string;
|
|
8
|
+
content: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
commentIndex: number;
|
|
11
|
+
cellContent?: string;
|
|
12
|
+
replies: CommentReply[];
|
|
13
|
+
isResolved?: boolean;
|
|
14
|
+
isDeleted?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface CommentReply {
|
|
17
|
+
id: string;
|
|
18
|
+
username: string;
|
|
19
|
+
content: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
commentIndex: number;
|
|
22
|
+
isResolved?: boolean;
|
|
23
|
+
isDeleted?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare enum CommentAction {
|
|
26
|
+
RESOLVE = "resolve",
|
|
27
|
+
UNRESOLVE = "unresolve",
|
|
28
|
+
DELETE = "delete"
|
|
29
|
+
}
|
|
30
|
+
export interface CommentActionParams {
|
|
31
|
+
action: CommentAction;
|
|
32
|
+
commentId: string;
|
|
33
|
+
dsheetId: string;
|
|
34
|
+
commentKey: string;
|
|
35
|
+
isReply?: boolean;
|
|
36
|
+
parentCommentId?: string;
|
|
37
|
+
row: number;
|
|
38
|
+
col: number;
|
|
39
|
+
}
|
|
40
|
+
export interface CommentsConfig {
|
|
41
|
+
commentsData: Record<string, CommentThread>;
|
|
42
|
+
onSendComment: (key: string, textareaId: string) => void;
|
|
43
|
+
onCommentAction: (action: CommentActionParams) => void;
|
|
44
|
+
userName?: string;
|
|
45
|
+
ownerAddress?: string;
|
|
46
|
+
currentUserAddress?: string;
|
|
47
|
+
isOwner?: boolean;
|
|
48
|
+
isAuthenticated?: boolean;
|
|
49
|
+
unauthenticatedFallback?: React.ReactNode;
|
|
50
|
+
ensResolutionUrl?: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface CellPosition {
|
|
54
|
+
row: number;
|
|
55
|
+
col: number;
|
|
56
|
+
sheetId?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface SheetEditorRef {
|
|
59
|
+
scroll: (o: {
|
|
60
|
+
scrollLeft?: number;
|
|
61
|
+
scrollTop?: number;
|
|
62
|
+
targetRow?: number;
|
|
63
|
+
targetColumn?: number;
|
|
64
|
+
}) => void;
|
|
65
|
+
setSelection: (s: Array<{
|
|
66
|
+
row: number[];
|
|
67
|
+
column: number[];
|
|
68
|
+
}>) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface CommentInputProps {
|
|
71
|
+
id: string;
|
|
72
|
+
onSend: (textareaId: string) => void;
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
autoFocus?: boolean;
|
|
75
|
+
className?: string;
|
|
76
|
+
backgroundColor?: string;
|
|
77
|
+
inCellComment?: boolean;
|
|
78
|
+
cancelComment?: () => void;
|
|
79
|
+
onBlur?: () => void;
|
|
80
|
+
isStaticButton?: boolean;
|
|
81
|
+
removeCancelButton?: boolean;
|
|
82
|
+
focusTrap?: boolean;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface CommentItemProps {
|
|
86
|
+
comment: CommentThread;
|
|
87
|
+
showAvatar?: boolean;
|
|
88
|
+
avatarSize?: 'sm' | 'md' | 'lg';
|
|
89
|
+
className?: string;
|
|
90
|
+
isHovered?: boolean;
|
|
91
|
+
sheetName?: string;
|
|
92
|
+
cellReference?: string;
|
|
93
|
+
onAction?: (a: CommentActionParams) => void;
|
|
94
|
+
ownerAddress?: string;
|
|
95
|
+
currentUserAddress?: string;
|
|
96
|
+
isOwner?: boolean;
|
|
97
|
+
currentUserName?: string;
|
|
98
|
+
contentClassName?: string;
|
|
99
|
+
isCellPopup?: boolean;
|
|
100
|
+
shouldShowActions?: boolean;
|
|
101
|
+
row?: number;
|
|
102
|
+
col?: number;
|
|
103
|
+
}
|
|
104
|
+
export interface CommentCellUIProps {
|
|
105
|
+
row: number;
|
|
106
|
+
col: number;
|
|
107
|
+
sheetId: string;
|
|
108
|
+
comment?: CommentThread;
|
|
109
|
+
onSendComment: (commentKey: string, textareaId: string) => void;
|
|
110
|
+
onAction?: (a: CommentActionParams) => void;
|
|
111
|
+
ownerAddress?: string;
|
|
112
|
+
currentUserAddress?: string;
|
|
113
|
+
isOwner?: boolean;
|
|
114
|
+
sheetEditorRef?: React.RefObject<SheetEditorRef>;
|
|
115
|
+
currentUserName?: string;
|
|
116
|
+
removeCommentFromCell: (row: number, col: number) => void;
|
|
117
|
+
dragHandler: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
118
|
+
isHover?: boolean;
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export interface CommentsContentProps {
|
|
122
|
+
sheetEditorRef: React.RefObject<SheetEditorRef>;
|
|
123
|
+
userName: string | undefined;
|
|
124
|
+
commentsData: Record<string, CommentThread>;
|
|
125
|
+
onSendComment: (commentKey: string, textareaId: string) => void;
|
|
126
|
+
onCommentAction?: (a: CommentActionParams) => void;
|
|
127
|
+
ownerAddress?: string;
|
|
128
|
+
currentUserAddress?: string;
|
|
129
|
+
isOwner?: boolean;
|
|
130
|
+
disabled?: boolean;
|
|
131
|
+
isAuthenticated?: boolean;
|
|
132
|
+
unauthenticatedFallback?: React.ReactNode;
|
|
133
|
+
}
|