@fileverse-dev/ddoc 3.0.69-rtc-patch-3 → 3.0.70-patch-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 +4 -1
- package/dist/index.es.js +30697 -28799
- package/dist/package/components/export-modal.d.ts +4 -5
- package/dist/package/hooks/use-ddoc-export.d.ts +6 -1
- package/dist/package/hooks/use-export-headless-editor-content.d.ts +33 -0
- package/dist/package/hooks/use-headless-editor.d.ts +3 -2
- package/dist/package/hooks/use-rtc-websocket-disconnector.d.ts +1 -0
- package/dist/package/hooks/use-tab-editor.d.ts +5 -4
- package/dist/package/hooks/use-tab-manager.d.ts +1 -1
- package/dist/package/hooks/use-yjs-setup.d.ts +11 -6
- package/dist/package/sync-local/actions/index.d.ts +137 -0
- package/dist/package/sync-local/actions/syncMachineActions.d.ts +1 -0
- package/dist/package/sync-local/constants/config.d.ts +7 -0
- package/dist/package/sync-local/constants/index.d.ts +5 -0
- package/dist/package/sync-local/guards/syncMachineGuards.d.ts +10 -0
- package/dist/package/sync-local/index.d.ts +6 -3
- package/dist/package/sync-local/services/syncMachineServices.d.ts +19 -0
- package/dist/package/sync-local/socketClient.d.ts +29 -22
- package/dist/package/sync-local/syncMachine.d.ts +13 -0
- package/dist/package/sync-local/types/index.d.ts +123 -156
- package/dist/package/sync-local/useSyncMachine.d.ts +38 -0
- package/dist/package/sync-local/utils/createAwarenessUpdateHandler.d.ts +3 -3
- package/dist/package/types.d.ts +31 -3
- package/dist/package/use-ddoc-editor.d.ts +3 -4
- package/dist/style.css +1 -1
- package/package.json +7 -3
- package/dist/package/sync-local/SyncManager.d.ts +0 -55
- package/dist/package/sync-local/collabStateMachine.d.ts +0 -23
- package/dist/package/sync-local/useSyncManager.d.ts +0 -11
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.70-patch-1",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -76,6 +76,8 @@
|
|
|
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",
|
|
79
81
|
"base64-js": "^1.5.1",
|
|
80
82
|
"classnames": "^2.5.1",
|
|
81
83
|
"color": "^5.0.3",
|
|
@@ -93,7 +95,7 @@
|
|
|
93
95
|
"mammoth": "^1.10.0",
|
|
94
96
|
"markdown-it-footnote": "^4.0.0",
|
|
95
97
|
"ollama": "^0.5.14",
|
|
96
|
-
"
|
|
98
|
+
"partysocket": "^1.0.2",
|
|
97
99
|
"platform": "^1.3.6",
|
|
98
100
|
"prosemirror-model": "^1.21.0",
|
|
99
101
|
"prosemirror-state": "^1.4.3",
|
|
@@ -109,6 +111,8 @@
|
|
|
109
111
|
"vaul": "^0.9.1",
|
|
110
112
|
"vite-plugin-dts": "^3.6.3",
|
|
111
113
|
"ws": "^8.18.0",
|
|
114
|
+
"xstate": "^4.38.2",
|
|
115
|
+
"xstate-ninja": "^1.3.10",
|
|
112
116
|
"y-indexeddb": "^9.0.12",
|
|
113
117
|
"y-prosemirror": "^1.2.5",
|
|
114
118
|
"y-protocols": "^1.0.6",
|
|
@@ -152,4 +156,4 @@
|
|
|
152
156
|
"typescript": "^5.2.2",
|
|
153
157
|
"vite": "^5.0.0"
|
|
154
158
|
}
|
|
155
|
-
}
|
|
159
|
+
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Awareness } from 'y-protocols/awareness.js';
|
|
2
|
-
import { SyncManagerConfig, CollabConnectionConfig, CollabServices, CollabCallbacks, CollabStatus, CollabState } from './types';
|
|
3
|
-
|
|
4
|
-
export declare class SyncManager {
|
|
5
|
-
private onCollabStateChange;
|
|
6
|
-
private _status;
|
|
7
|
-
private _context;
|
|
8
|
-
private _awareness;
|
|
9
|
-
private socketClient;
|
|
10
|
-
private roomKey;
|
|
11
|
-
private roomKeyBytes;
|
|
12
|
-
private isOwner;
|
|
13
|
-
private updateQueue;
|
|
14
|
-
private uncommittedUpdatesIdList;
|
|
15
|
-
private contentTobeAppliedQueue;
|
|
16
|
-
private isProcessing;
|
|
17
|
-
private _awarenessUpdateHandler;
|
|
18
|
-
private ydoc;
|
|
19
|
-
private servicesRef;
|
|
20
|
-
private callbacksRef;
|
|
21
|
-
private onLocalUpdate?;
|
|
22
|
-
constructor(config: SyncManagerConfig, onCollabStateChange: (state: CollabState) => void);
|
|
23
|
-
/** Called by useSyncManager on every render to keep refs fresh */
|
|
24
|
-
updateRefs(services: CollabServices | undefined, callbacks: CollabCallbacks | undefined, onLocalUpdate?: (updatedDocContent: string, updateChunk: string) => void): void;
|
|
25
|
-
get isConnected(): boolean;
|
|
26
|
-
get isReady(): boolean;
|
|
27
|
-
get awareness(): Awareness | null;
|
|
28
|
-
get status(): CollabStatus;
|
|
29
|
-
get collabState(): CollabState;
|
|
30
|
-
private send;
|
|
31
|
-
private runExitActions;
|
|
32
|
-
private runEntryActions;
|
|
33
|
-
connect(config: CollabConnectionConfig): Promise<void>;
|
|
34
|
-
disconnect(): Promise<void>;
|
|
35
|
-
terminateSession(): Promise<void>;
|
|
36
|
-
enqueueLocalUpdate(update: Uint8Array): void;
|
|
37
|
-
forceCleanup(): void;
|
|
38
|
-
private handleConnectionError;
|
|
39
|
-
private handleReconnection;
|
|
40
|
-
private connectSocket;
|
|
41
|
-
private syncLatestCommit;
|
|
42
|
-
private initializeAwareness;
|
|
43
|
-
private cleanupAwareness;
|
|
44
|
-
private commitLocalContents;
|
|
45
|
-
private broadcastLocalContents;
|
|
46
|
-
private processUpdateQueue;
|
|
47
|
-
private processNextUpdate;
|
|
48
|
-
private processCommit;
|
|
49
|
-
private handleRemoteContentUpdate;
|
|
50
|
-
private applyRemoteYjsUpdate;
|
|
51
|
-
private applyQueuedRemoteContents;
|
|
52
|
-
private withRetry;
|
|
53
|
-
private disconnectInternal;
|
|
54
|
-
private resetInternalState;
|
|
55
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CollabStatus, CollabEvent, CollabContext, CollabState, CollabErrorCode } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const INITIAL_CONTEXT: CollabContext;
|
|
4
|
-
type TransitionResult = {
|
|
5
|
-
status: CollabStatus;
|
|
6
|
-
context: Partial<CollabContext>;
|
|
7
|
-
} | null;
|
|
8
|
-
/**
|
|
9
|
-
* Transition map: (currentStatus, eventType) → nextStatus + context mutations.
|
|
10
|
-
* Returns null if the transition is invalid.
|
|
11
|
-
*/
|
|
12
|
-
export declare function transition(currentStatus: CollabStatus, event: CollabEvent, context: CollabContext): TransitionResult;
|
|
13
|
-
/**
|
|
14
|
-
* Derives the consumer-facing CollabState from internal status + context.
|
|
15
|
-
*/
|
|
16
|
-
export declare function deriveCollabState(status: CollabStatus, context: CollabContext): CollabState;
|
|
17
|
-
/** Helper to create a CollabError */
|
|
18
|
-
export declare function createCollabError(code: CollabErrorCode, message: string, recoverable?: boolean): {
|
|
19
|
-
code: CollabErrorCode;
|
|
20
|
-
message: string;
|
|
21
|
-
recoverable: boolean;
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SyncManagerConfig, CollabConnectionConfig, CollabState } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const useSyncManager: (config: SyncManagerConfig) => {
|
|
4
|
-
state: CollabState;
|
|
5
|
-
connect: (connectConfig: CollabConnectionConfig) => void;
|
|
6
|
-
disconnect: () => void;
|
|
7
|
-
terminateSession: () => void;
|
|
8
|
-
isReady: boolean;
|
|
9
|
-
awareness: import('y-protocols/awareness.js').Awareness | null;
|
|
10
|
-
hasCollabContentInitialised: boolean;
|
|
11
|
-
};
|