@fileverse-dev/dsheet 4.0.5-edit-mode-5 → 4.0.5-edit-mode-7
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/editor-workbook.d.ts +1 -0
- package/dist/editor/components/permission-chip-model.d.ts +4 -0
- package/dist/editor/components/permission-chip.d.ts +1 -0
- package/dist/editor/contexts/editor-context.d.ts +4 -3
- package/dist/editor/hooks/collaboration-lifecycle.d.ts +5 -0
- package/dist/editor/hooks/use-editor-sync.d.ts +1 -1
- package/dist/editor/types.d.ts +10 -4
- package/dist/{index-BR3VdNFx.js → index-BK9lc9z6.js} +9794 -9733
- package/dist/index.es.js +1 -1
- package/dist/persistence-utils.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/{use-xlsx-import-impl-Be3CMDU1.js → use-xlsx-import-impl-CRNz7Q-6.js} +3 -3
- package/dist/{xlsx-defined-names-DX2FgJ3g.js → xlsx-defined-names-ePgSJMyE.js} +1 -1
- package/dist/{xlsx-export-impl-BQ3y4PZ4.js → xlsx-export-impl-BHyMCQhr.js} +3 -3
- package/dist/{xlsx-hyperlink-inline-BcIXXwpZ.js → xlsx-hyperlink-inline-BOyfzj2W.js} +1 -1
- package/package.json +2 -2
|
@@ -25,6 +25,7 @@ interface EditorWorkbookProps {
|
|
|
25
25
|
sidebarPortalRegistry?: SidebarPortalRegistryHandle | null;
|
|
26
26
|
sidebarPortalRenderers?: Record<string, SidebarPortalRenderer>;
|
|
27
27
|
permissionMode?: DSheetPermissionMode | null;
|
|
28
|
+
onEnterEdit?: () => void;
|
|
28
29
|
theme?: ThemeKey;
|
|
29
30
|
}
|
|
30
31
|
export declare const EditorWorkbook: React.NamedExoticComponent<EditorWorkbookProps>;
|
|
@@ -13,6 +13,10 @@ export declare const getPermissionChipConfig: (mode: DSheetPermissionMode) => {
|
|
|
13
13
|
readonly label: "Edit";
|
|
14
14
|
readonly modifier: "edit";
|
|
15
15
|
};
|
|
16
|
+
export declare const canShowEditElevation: ({ mode, onEnterEdit, }: {
|
|
17
|
+
mode: DSheetPermissionMode;
|
|
18
|
+
onEnterEdit?: () => void;
|
|
19
|
+
}) => boolean;
|
|
16
20
|
export declare const resolvePermissionChipMode: ({ allowComments, isReadOnly, permissionMode, }: {
|
|
17
21
|
allowComments: boolean;
|
|
18
22
|
isReadOnly: boolean;
|
|
@@ -11,7 +11,7 @@ import { CollaborationProps, CollabState, CollabUser } from '../../sync-local/ty
|
|
|
11
11
|
import { Awareness } from 'y-protocols/awareness';
|
|
12
12
|
import { DSheetContentSnapshot } from '../../persistence';
|
|
13
13
|
|
|
14
|
-
import * as Y from
|
|
14
|
+
import * as Y from 'yjs';
|
|
15
15
|
export interface EditorContextType {
|
|
16
16
|
setIsDataLoaded: React.Dispatch<React.SetStateAction<boolean>>;
|
|
17
17
|
handleOnChangePortalUpdate: () => void;
|
|
@@ -44,7 +44,7 @@ export interface EditorContextType {
|
|
|
44
44
|
loading: boolean;
|
|
45
45
|
forceSheetRender: number;
|
|
46
46
|
setForceSheetRender: React.Dispatch<React.SetStateAction<number>>;
|
|
47
|
-
syncStatus:
|
|
47
|
+
syncStatus: 'initializing' | 'syncing' | 'synced' | 'error';
|
|
48
48
|
collabEnabled?: boolean;
|
|
49
49
|
isLiveCollabSession: boolean;
|
|
50
50
|
collabIsOwner?: boolean;
|
|
@@ -101,7 +101,8 @@ interface EditorProviderProps {
|
|
|
101
101
|
apiKeyStorage?: ApiKeyStorage;
|
|
102
102
|
onDataBlockEvent?: (event: DataBlockEvent) => void;
|
|
103
103
|
smartContracts?: SmartContractConfig;
|
|
104
|
-
onContentSyncStatusChange?: (status:
|
|
104
|
+
onContentSyncStatusChange?: (status: 'initializing' | 'syncing' | 'synced' | 'error') => void;
|
|
105
|
+
onCollaborationInitializationComplete?: (result: 'ready' | 'error') => void;
|
|
105
106
|
onIndexedDbError?: (error: Error) => void;
|
|
106
107
|
}
|
|
107
108
|
export declare const EditorProvider: React.FC<EditorProviderProps>;
|
|
@@ -7,6 +7,11 @@ export declare const isQualifyingCollaborationEdit: (origin: unknown, indexeddbO
|
|
|
7
7
|
export declare const shouldRenderBootstrappedWorkbook: (collabEnabled: boolean, sheetCount: number) => boolean;
|
|
8
8
|
export declare const shouldInitializeDefaultWorkbook: (syncStatus: string | undefined, collabEnabled: boolean, collabStatus: string | undefined) => boolean;
|
|
9
9
|
export declare const getWorkbookHydrationReason: (status: string | undefined, previousStatus: string | undefined, hasHydratedReadyState: boolean) => "initial" | "reconnect" | null;
|
|
10
|
+
export declare const shouldRehydrateWorkbookOnReady: ({ reason, isOwner, hasUnmergedPeerUpdates, }: {
|
|
11
|
+
reason: "initial" | "reconnect";
|
|
12
|
+
isOwner: boolean;
|
|
13
|
+
hasUnmergedPeerUpdates: boolean;
|
|
14
|
+
}) => boolean;
|
|
10
15
|
export interface CollaborationConnectionController {
|
|
11
16
|
onYdocUpdate: (update: Uint8Array, origin: unknown) => void;
|
|
12
17
|
dispose: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IndexeddbPersistence } from 'y-indexeddb';
|
|
2
2
|
import { CollaborationProps } from '../../sync-local/types';
|
|
3
|
-
import * as Y from
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
4
|
export declare const useEditorSync: (dsheetId: string, enableIndexeddbSync?: boolean, isReadOnly?: boolean, portalContent?: string, collaboration?: CollaborationProps, onCollabUpdate?: (fullState: string, updateChunk: string) => void, onIndexedDbError?: (error: Error) => void) => {
|
|
5
5
|
ydocRef: import('react').MutableRefObject<Y.Doc | null>;
|
|
6
6
|
persistenceRef: import('react').MutableRefObject<IndexeddbPersistence | null>;
|
package/dist/editor/types.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { ApiKeyStorage } from './utils/api-key-storage';
|
|
|
8
8
|
import { ThemeKey } from '../sheet-engine/core/theme';
|
|
9
9
|
import { DSheetContentSnapshot } from '../persistence';
|
|
10
10
|
|
|
11
|
-
import * as Y from
|
|
11
|
+
import * as Y from 'yjs';
|
|
12
12
|
export type { ThemeKey } from '../sheet-engine/core/theme';
|
|
13
|
-
export type DSheetPermissionMode =
|
|
13
|
+
export type DSheetPermissionMode = 'view' | 'comment' | 'edit';
|
|
14
14
|
export type { CommentThread, CommentReply, CommentActionParams, CommentsConfig, } from './types/comments';
|
|
15
15
|
export { CommentAction } from './types/comments';
|
|
16
16
|
export interface SheetUpdateData {
|
|
@@ -50,7 +50,7 @@ export type OnboardingHandlerType = (params: {
|
|
|
50
50
|
row: number;
|
|
51
51
|
column: number;
|
|
52
52
|
};
|
|
53
|
-
export type DataBlockEventType =
|
|
53
|
+
export type DataBlockEventType = 'success' | 'error' | 'api-key-required' | 'api-key-saved' | 'retry';
|
|
54
54
|
export interface DataBlockEvent {
|
|
55
55
|
type: DataBlockEventType;
|
|
56
56
|
functionName?: string;
|
|
@@ -86,6 +86,9 @@ export interface DsheetProps {
|
|
|
86
86
|
/** Permission status displayed above the toolbar. When omitted, read-only
|
|
87
87
|
* sheets retain the existing View/View-and-comment behavior. */
|
|
88
88
|
permissionMode?: DSheetPermissionMode;
|
|
89
|
+
/** Called when a read-only consumer asks to elevate to edit mode. The host
|
|
90
|
+
* owns access proof, loading, errors, and the resulting mode transition. */
|
|
91
|
+
onEnterEdit?: () => void;
|
|
89
92
|
allowSheetDownload?: boolean;
|
|
90
93
|
isTemplateOpen?: boolean;
|
|
91
94
|
selectedTemplate?: string;
|
|
@@ -107,7 +110,10 @@ export interface DsheetProps {
|
|
|
107
110
|
/** Fires whenever local content-sync status changes. Host apps should gate
|
|
108
111
|
* collab start/resume on 'synced' — starting before local content is fully
|
|
109
112
|
* synced is what let the RTC layer bind to a stale doc in the past. */
|
|
110
|
-
onContentSyncStatusChange?: (status:
|
|
113
|
+
onContentSyncStatusChange?: (status: 'initializing' | 'syncing' | 'synced' | 'error') => void;
|
|
114
|
+
/** Fires once the first collaboration sync has been reconciled with the
|
|
115
|
+
* workbook, or when that reconciliation fails. */
|
|
116
|
+
onCollaborationInitializationComplete?: (result: 'ready' | 'error') => void;
|
|
111
117
|
editorStateRef?: React.MutableRefObject<{
|
|
112
118
|
refreshIndexedDB: () => Promise<void>;
|
|
113
119
|
getContentSnapshot: () => DSheetContentSnapshot;
|