@fileverse-dev/ddoc 3.0.71 → 3.0.72-footer-count-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/index.d.ts +1 -1
- package/dist/index.es.js +28280 -29962
- package/dist/package/hooks/use-tab-editor.d.ts +4 -5
- package/dist/package/hooks/use-tab-manager.d.ts +1 -1
- package/dist/package/hooks/use-yjs-setup.d.ts +6 -11
- package/dist/package/sync-local/SyncManager.d.ts +55 -0
- package/dist/package/sync-local/collabStateMachine.d.ts +23 -0
- package/dist/package/sync-local/index.d.ts +3 -6
- package/dist/package/sync-local/socketClient.d.ts +22 -29
- package/dist/package/sync-local/types/index.d.ts +156 -123
- package/dist/package/sync-local/useSyncManager.d.ts +11 -0
- package/dist/package/sync-local/utils/createAwarenessUpdateHandler.d.ts +3 -3
- package/dist/package/types.d.ts +3 -31
- package/dist/package/use-ddoc-editor.d.ts +4 -3
- package/package.json +2 -6
- package/dist/package/hooks/use-rtc-websocket-disconnector.d.ts +0 -1
- package/dist/package/sync-local/actions/index.d.ts +0 -137
- package/dist/package/sync-local/actions/syncMachineActions.d.ts +0 -1
- package/dist/package/sync-local/constants/config.d.ts +0 -7
- package/dist/package/sync-local/constants/index.d.ts +0 -5
- package/dist/package/sync-local/guards/syncMachineGuards.d.ts +0 -10
- package/dist/package/sync-local/services/syncMachineServices.d.ts +0 -19
- package/dist/package/sync-local/syncMachine.d.ts +0 -13
- package/dist/package/sync-local/useSyncMachine.d.ts +0 -38
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DdocProps } from './types';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
|
|
4
|
-
export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHistoryState,
|
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, ...rest }: Partial<DdocProps>) => {
|
|
5
5
|
ydoc: import('yjs').Doc;
|
|
6
|
-
awareness:
|
|
6
|
+
awareness: import('y-protocols/awareness.js').Awareness | null;
|
|
7
7
|
refreshYjsIndexedDbProvider: () => Promise<void>;
|
|
8
8
|
terminateSession: () => void;
|
|
9
9
|
isContentLoading: boolean;
|
|
@@ -21,10 +21,11 @@ export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHis
|
|
|
21
21
|
}) => void;
|
|
22
22
|
duplicateTab: (tabId: string) => string | undefined;
|
|
23
23
|
orderTab: (destinationTabId: string, movedTabId: string) => void;
|
|
24
|
-
onConnect: (connectConfig: import('./
|
|
24
|
+
onConnect: (connectConfig: import('./types').CollabConnectionConfig) => void;
|
|
25
25
|
isReady: boolean;
|
|
26
26
|
hasCollabContentInitialised: boolean;
|
|
27
27
|
initialiseYjsIndexedDbProvider: () => Promise<void>;
|
|
28
|
+
collabState: import('./types').CollabState;
|
|
28
29
|
editor: Editor | null;
|
|
29
30
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
30
31
|
slides: string[];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.72-footer-count-1",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -76,8 +76,6 @@
|
|
|
76
76
|
"@tiptap/suggestion": "^3.11.0",
|
|
77
77
|
"@types/uuid": "^10.0.0",
|
|
78
78
|
"@ucans/ucans": "^0.12.0",
|
|
79
|
-
"@xstate-ninja/react": "^1.1.3",
|
|
80
|
-
"@xstate/react": "^3.2.2",
|
|
81
79
|
"base64-js": "^1.5.1",
|
|
82
80
|
"classnames": "^2.5.1",
|
|
83
81
|
"color": "^5.0.3",
|
|
@@ -95,7 +93,7 @@
|
|
|
95
93
|
"mammoth": "^1.10.0",
|
|
96
94
|
"markdown-it-footnote": "^4.0.0",
|
|
97
95
|
"ollama": "^0.5.14",
|
|
98
|
-
"
|
|
96
|
+
"socket.io-client": "^4.7.5",
|
|
99
97
|
"platform": "^1.3.6",
|
|
100
98
|
"prosemirror-model": "^1.21.0",
|
|
101
99
|
"prosemirror-state": "^1.4.3",
|
|
@@ -111,8 +109,6 @@
|
|
|
111
109
|
"vaul": "^0.9.1",
|
|
112
110
|
"vite-plugin-dts": "^3.6.3",
|
|
113
111
|
"ws": "^8.18.0",
|
|
114
|
-
"xstate": "^4.38.2",
|
|
115
|
-
"xstate-ninja": "^1.3.10",
|
|
116
112
|
"y-indexeddb": "^9.0.12",
|
|
117
113
|
"y-prosemirror": "^1.2.5",
|
|
118
114
|
"y-protocols": "^1.0.6",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useRtcWebsocketDisconnector: (syncState: any, enableCollaboration: boolean | undefined) => void;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { SyncMachineContext, SyncMachinEvent } from '../types';
|
|
2
|
-
import { SocketClient } from '../socketClient';
|
|
3
|
-
|
|
4
|
-
import * as awarenessProtocol from 'y-protocols/awareness';
|
|
5
|
-
export declare const initAwarenessHandler: (context: SyncMachineContext) => {
|
|
6
|
-
awareness: awarenessProtocol.Awareness;
|
|
7
|
-
_awarenessUpdateHandler: ({ added, updated, removed, }: {
|
|
8
|
-
added: number[];
|
|
9
|
-
updated: number[];
|
|
10
|
-
removed: number[];
|
|
11
|
-
}) => void;
|
|
12
|
-
};
|
|
13
|
-
export declare const updateConnectionStateHandler: (context: SyncMachineContext) => {
|
|
14
|
-
isConnected: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare const websocketInitializer: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
17
|
-
socketClient: SocketClient;
|
|
18
|
-
initialUpdate: any;
|
|
19
|
-
roomKey: any;
|
|
20
|
-
roomId: any;
|
|
21
|
-
isOwner: any;
|
|
22
|
-
isEns: any;
|
|
23
|
-
wsUrl: any;
|
|
24
|
-
onCollaborationCommit: (file: File) => Promise<string>;
|
|
25
|
-
onFetchCommitContent: (cid: string) => Promise<any>;
|
|
26
|
-
onSessionTerminated: () => void;
|
|
27
|
-
onUnMergedUpdates: (state: boolean) => void;
|
|
28
|
-
onLocalUpdate: ((updatedDocContent: import('../../types').Data["editorJSONData"], updateChunk: string) => void) | undefined;
|
|
29
|
-
};
|
|
30
|
-
export declare const yjsUpdateHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
31
|
-
uncommittedUpdatesIdList?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
uncommittedUpdatesIdList: any[];
|
|
34
|
-
};
|
|
35
|
-
export declare const roomMemberUpdateHandler: (context: SyncMachineContext) => {
|
|
36
|
-
roomMembers: import('../types').RoomMember[];
|
|
37
|
-
};
|
|
38
|
-
export declare const stateResetHandler: () => {
|
|
39
|
-
roomMembers: never[];
|
|
40
|
-
isConnected: boolean;
|
|
41
|
-
awareness: null;
|
|
42
|
-
_awarenessUpdateHandler: null;
|
|
43
|
-
socketClient: null;
|
|
44
|
-
};
|
|
45
|
-
export declare const registerUpdateHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
46
|
-
uncommittedUpdatesIdList?: undefined;
|
|
47
|
-
} | {
|
|
48
|
-
uncommittedUpdatesIdList: any[];
|
|
49
|
-
};
|
|
50
|
-
export declare const removeLastProcessedUpdate: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
51
|
-
updateQueue: Uint8Array<ArrayBufferLike>[];
|
|
52
|
-
};
|
|
53
|
-
export declare const clearUncommitedUpdatesHandler: () => {
|
|
54
|
-
uncommittedUpdatesIdList: never[];
|
|
55
|
-
};
|
|
56
|
-
export declare const addUpdateToQueueHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
57
|
-
updateQueue: any[];
|
|
58
|
-
};
|
|
59
|
-
export declare const updateConnectionReadyStateHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
60
|
-
isReady: any;
|
|
61
|
-
};
|
|
62
|
-
export declare const setNewDocFlagHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
63
|
-
isNewDoc: any;
|
|
64
|
-
};
|
|
65
|
-
export declare const commitUncommittedIdsHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
66
|
-
uncommittedUpdatesIdList: any;
|
|
67
|
-
};
|
|
68
|
-
export declare const setConnectionActiveStateHandler: (context: SyncMachineContext) => {
|
|
69
|
-
isConnected: boolean;
|
|
70
|
-
};
|
|
71
|
-
export declare const setMachineReadyStateHandler: () => {
|
|
72
|
-
isReady: boolean;
|
|
73
|
-
};
|
|
74
|
-
export declare const addRemoteContentToQueueHandler: (context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
75
|
-
contentTobeAppliedQueue: any[];
|
|
76
|
-
};
|
|
77
|
-
export declare const applyContentsFromRemote: (context: SyncMachineContext) => {
|
|
78
|
-
contentTobeAppliedQueue?: undefined;
|
|
79
|
-
} | {
|
|
80
|
-
contentTobeAppliedQueue: never[];
|
|
81
|
-
};
|
|
82
|
-
export declare const clearErrorCountHandler: () => {
|
|
83
|
-
errorCount: number;
|
|
84
|
-
errorMessage: string;
|
|
85
|
-
};
|
|
86
|
-
export declare const updateErrorCountHandler: (context: SyncMachineContext) => {
|
|
87
|
-
errorCount: number;
|
|
88
|
-
};
|
|
89
|
-
export declare const setCommitMessageErrorHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
90
|
-
errorMessage: string;
|
|
91
|
-
};
|
|
92
|
-
export declare const setUpdateErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
93
|
-
errorMessage: string;
|
|
94
|
-
};
|
|
95
|
-
export declare const setConnectionErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
96
|
-
errorMessage: string;
|
|
97
|
-
};
|
|
98
|
-
export declare const setIpfsQueryErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
99
|
-
errorMessage: string;
|
|
100
|
-
};
|
|
101
|
-
export declare const setInitialCommitErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
102
|
-
errorMessage: string;
|
|
103
|
-
};
|
|
104
|
-
export declare const setInitialUpdateErrorMessageHandler: (_context: SyncMachineContext, event: SyncMachinEvent) => {
|
|
105
|
-
errorMessage: string;
|
|
106
|
-
};
|
|
107
|
-
export declare const disconnectedStateHandler: () => {
|
|
108
|
-
socketClient: null;
|
|
109
|
-
roomMembers: never[];
|
|
110
|
-
isConnected: boolean;
|
|
111
|
-
awareness: null;
|
|
112
|
-
_awarenessUpdateHandler: null;
|
|
113
|
-
uncommittedUpdatesIdList: never[];
|
|
114
|
-
updateQueue: never[];
|
|
115
|
-
};
|
|
116
|
-
export declare const terminateSessionHandler: (context: SyncMachineContext) => {
|
|
117
|
-
socketClient: null;
|
|
118
|
-
roomId: string;
|
|
119
|
-
roomMembers: never[];
|
|
120
|
-
isConnected: boolean;
|
|
121
|
-
awareness: null;
|
|
122
|
-
_awarenessUpdateHandler: null;
|
|
123
|
-
roomKey: string;
|
|
124
|
-
wsUrl: string;
|
|
125
|
-
uncommittedUpdatesIdList: never[];
|
|
126
|
-
updateQueue: never[];
|
|
127
|
-
isOwner: boolean;
|
|
128
|
-
isReady: boolean;
|
|
129
|
-
isNewDoc: boolean;
|
|
130
|
-
contentTobeAppliedQueue: never[];
|
|
131
|
-
initialUpdate: null;
|
|
132
|
-
errorCount: number;
|
|
133
|
-
errorMessage: string;
|
|
134
|
-
};
|
|
135
|
-
export declare const setDocumentDecryptionStateHandler: (_: SyncMachineContext, event: SyncMachinEvent) => {
|
|
136
|
-
initalDocumentDecryptionState: any;
|
|
137
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const syncMachineActions: Record<any, any>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SyncMachineContext } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare const syncMachineGuards: {
|
|
4
|
-
isUserConnected: (context: SyncMachineContext) => boolean;
|
|
5
|
-
hasMoreUpdates: (context: SyncMachineContext) => boolean;
|
|
6
|
-
isOwner: (context: SyncMachineContext) => boolean;
|
|
7
|
-
errorIsLessThanRetryCount: (context: SyncMachineContext) => boolean;
|
|
8
|
-
shouldRetryConnection: (context: SyncMachineContext) => boolean;
|
|
9
|
-
shouldRefetchCommit: (context: SyncMachineContext) => boolean;
|
|
10
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Sender } from 'xstate';
|
|
2
|
-
import { SyncMachineContext, SyncMachinEvent } from '../types';
|
|
3
|
-
|
|
4
|
-
export declare const syncMachineServices: {
|
|
5
|
-
connectSocket: (context: SyncMachineContext) => (send: Sender<SyncMachinEvent>) => Promise<void>;
|
|
6
|
-
disconnectSocket: (context: SyncMachineContext) => () => Promise<void>;
|
|
7
|
-
processNextUpdate: (context: SyncMachineContext) => () => Promise<{
|
|
8
|
-
updateId: string | undefined;
|
|
9
|
-
queueOffset: number;
|
|
10
|
-
} | undefined>;
|
|
11
|
-
processCommit: (context: SyncMachineContext) => (send: Sender<SyncMachinEvent>) => Promise<void>;
|
|
12
|
-
syncLatestCommitFromIpfs: (context: SyncMachineContext) => (send: Sender<SyncMachinEvent>) => Promise<{
|
|
13
|
-
ids: string[];
|
|
14
|
-
unbroadcastedUpdate: string | null;
|
|
15
|
-
}>;
|
|
16
|
-
broadcastLocalContents: (context: SyncMachineContext, event: SyncMachinEvent) => () => Promise<boolean>;
|
|
17
|
-
commitLocalContents: (context: SyncMachineContext, event: SyncMachinEvent) => (send: Sender<SyncMachinEvent>) => Promise<string | undefined>;
|
|
18
|
-
verifyConnectionState: (context: SyncMachineContext) => (send: Sender<SyncMachinEvent>) => Promise<void>;
|
|
19
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SyncMachineContext } from './types';
|
|
2
|
-
|
|
3
|
-
declare const syncMachine: import('xstate').StateMachine<SyncMachineContext, any, {
|
|
4
|
-
type: string;
|
|
5
|
-
data: any;
|
|
6
|
-
}, {
|
|
7
|
-
value: any;
|
|
8
|
-
context: SyncMachineContext;
|
|
9
|
-
}, import('xstate').BaseActionObject, import('xstate').ServiceMap, import('xstate').ResolveTypegenMeta<import('xstate').TypegenDisabled, {
|
|
10
|
-
type: string;
|
|
11
|
-
data: any;
|
|
12
|
-
}, import('xstate').BaseActionObject, import('xstate').ServiceMap>>;
|
|
13
|
-
export default syncMachine;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { SyncMachineContext } from '.';
|
|
2
|
-
|
|
3
|
-
export interface IConnectConf {
|
|
4
|
-
username?: string;
|
|
5
|
-
roomKey: string;
|
|
6
|
-
roomId: string;
|
|
7
|
-
isOwner: boolean;
|
|
8
|
-
ownerEdSecret?: string;
|
|
9
|
-
contractAddress?: string;
|
|
10
|
-
ownerAddress?: string;
|
|
11
|
-
isEns?: boolean;
|
|
12
|
-
wsUrl: string;
|
|
13
|
-
roomInfo?: {
|
|
14
|
-
documentTitle: string;
|
|
15
|
-
portalAddress: string;
|
|
16
|
-
commentKey: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export declare const useSyncMachine: (config: Partial<SyncMachineContext>) => {
|
|
20
|
-
connect: (connectConfig: IConnectConf) => void;
|
|
21
|
-
disconnect: () => void;
|
|
22
|
-
isConnected: any;
|
|
23
|
-
isReady: boolean;
|
|
24
|
-
error: any;
|
|
25
|
-
terminateSession: () => void;
|
|
26
|
-
awareness: any;
|
|
27
|
-
hasCollabContentInitialised: boolean;
|
|
28
|
-
state: import('xstate').State<SyncMachineContext, {
|
|
29
|
-
type: string;
|
|
30
|
-
data: any;
|
|
31
|
-
}, any, {
|
|
32
|
-
value: any;
|
|
33
|
-
context: SyncMachineContext;
|
|
34
|
-
}, import('xstate').ResolveTypegenMeta<import('xstate').TypegenDisabled, {
|
|
35
|
-
type: string;
|
|
36
|
-
data: any;
|
|
37
|
-
}, import('xstate').BaseActionObject, import('xstate').ServiceMap>>;
|
|
38
|
-
};
|