@fileverse-dev/ddoc 4.8.17-xchacha.0 → 5.0.0-unstable-styles-2
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/README.md +36 -8
- package/dist/headless-editor-utils.es.js +1 -1
- package/dist/{index-BXcU4L-P.mjs → index-CVwMVBPt.mjs} +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.es.js +9745 -10227
- package/dist/{markdown-source-pane-NAKSRtR5.mjs → markdown-source-pane-BxY2Qs_P.mjs} +1 -1
- package/dist/package/sync-local/SyncManager.d.ts +2 -10
- package/dist/package/sync-local/crypto/index.d.ts +2 -6
- package/dist/package/sync-local/crypto/room-key.d.ts +1 -3
- package/dist/package/sync-local/floor.d.ts +0 -8
- package/dist/package/sync-local/socketClient.d.ts +1 -4
- package/dist/package/sync-local/types/index.d.ts +1 -30
- package/dist/package/sync-local/utils/createAwarenessUpdateHandler.d.ts +1 -2
- package/dist/{split-view-toolbar-Dj7hev5y.mjs → split-view-toolbar-Gbnjf427.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-headless-editor-LqOgnUoI.mjs → use-headless-editor-C3wFDi0t.mjs} +1 -1
- package/package.json +11 -7
- package/tailwind.preset.cjs +13 -0
|
@@ -3,7 +3,7 @@ var Wr = (t, e, O) => e in t ? Vr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var gt = (t, e, O) => Wr(t, typeof e != "symbol" ? e + "" : e, O);
|
|
4
4
|
import { jsx as Cr } from "react/jsx-runtime";
|
|
5
5
|
import { useRef as pe, useEffect as St } from "react";
|
|
6
|
-
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-
|
|
6
|
+
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-CVwMVBPt.mjs";
|
|
7
7
|
class ua {
|
|
8
8
|
/**
|
|
9
9
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Awareness } from 'y-protocols/awareness.js';
|
|
2
|
-
import { SyncManagerConfig, CollabConnectionConfig, CollabServices, CollabCallbacks, CollabStatus, CollabState
|
|
2
|
+
import { SyncManagerConfig, CollabConnectionConfig, CollabServices, CollabCallbacks, CollabStatus, CollabState } from './types';
|
|
3
3
|
|
|
4
4
|
export declare class SyncManager {
|
|
5
5
|
private onCollabStateChange;
|
|
@@ -26,17 +26,10 @@ export declare class SyncManager {
|
|
|
26
26
|
private isProcessing;
|
|
27
27
|
private syncId;
|
|
28
28
|
private floor;
|
|
29
|
-
private hydrationIncomplete;
|
|
30
|
-
private wireFormat;
|
|
31
|
-
private lastReportedWriteFormat;
|
|
32
|
-
getWireFormat(): WireFormat;
|
|
33
|
-
private encryptForWire;
|
|
34
|
-
private emitWireTelemetry;
|
|
35
|
-
private setWireFormat;
|
|
36
29
|
private updatesSinceSnapshot;
|
|
37
30
|
private isAuthoringSnapshot;
|
|
38
31
|
private readonly SNAPSHOT_THRESHOLD;
|
|
39
|
-
private
|
|
32
|
+
private tailCompactTimer;
|
|
40
33
|
private gapCatchUpTimer;
|
|
41
34
|
private gapCatchUpInFlight;
|
|
42
35
|
private gapCatchUpCooldownUntil;
|
|
@@ -107,7 +100,6 @@ export declare class SyncManager {
|
|
|
107
100
|
private authorSnapshot;
|
|
108
101
|
private hydrate;
|
|
109
102
|
private maybeCompactTail;
|
|
110
|
-
private scheduleDeferredSnapshot;
|
|
111
103
|
private initializeAwareness;
|
|
112
104
|
private cleanupAwareness;
|
|
113
105
|
private broadcastLocalContents;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { WireFormat } from '../types';
|
|
2
|
-
|
|
3
|
-
export declare const WIRE_TAG = "FVXC1";
|
|
4
|
-
export declare const isXChaChaCipher: (message: unknown) => message is string;
|
|
5
1
|
export declare const crypto: {
|
|
6
2
|
generateKeyPair: () => import('@fileverse/crypto/ecies').EciesKeyPairBytes;
|
|
7
|
-
encryptData: (key: Uint8Array, message: Uint8Array
|
|
8
|
-
decryptData: (key: Uint8Array, message: string) => Uint8Array
|
|
3
|
+
encryptData: (key: Uint8Array, message: Uint8Array) => string;
|
|
4
|
+
decryptData: (key: Uint8Array, message: string) => Uint8Array<ArrayBufferLike>;
|
|
9
5
|
generateRandomBytes: <E extends import('@fileverse/crypto/types').EncodingType = "bytes">(length?: number, encoding?: E) => import('@fileverse/crypto/types').EncodedReturnType<E>;
|
|
10
6
|
};
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const encryptForRoomKey: (roomKey: string, bytes: Uint8Array, format?: WireFormat) => string;
|
|
1
|
+
export declare const encryptForRoomKey: (roomKey: string, bytes: Uint8Array) => string;
|
|
4
2
|
export declare const decryptForRoomKey: (roomKey: string, ciphertext: string) => Uint8Array;
|
|
@@ -6,11 +6,3 @@ export declare function shouldAuthorSnapshot(p: {
|
|
|
6
6
|
threshold: number;
|
|
7
7
|
}): boolean;
|
|
8
8
|
export declare function computeLocalOnlyUpdate(ydoc: Y.Doc, serverMerged: Uint8Array | null): Uint8Array | null;
|
|
9
|
-
export declare function floorEligibleSeqs(rows: Array<{
|
|
10
|
-
seq: number | null;
|
|
11
|
-
isTail: boolean;
|
|
12
|
-
decrypted: boolean;
|
|
13
|
-
}>, alreadyIncomplete: boolean): {
|
|
14
|
-
seqs: number[];
|
|
15
|
-
incomplete: boolean;
|
|
16
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISocketInitConfig, SocketStatusEnum, SendUpdateResponse, HydrationResponse, SnapshotResponse, AckResponse
|
|
1
|
+
import { ISocketInitConfig, SocketStatusEnum, SendUpdateResponse, HydrationResponse, SnapshotResponse, AckResponse } from './types';
|
|
2
2
|
import { Awareness } from 'y-protocols/awareness.js';
|
|
3
3
|
|
|
4
4
|
interface ISocketClientConfig {
|
|
@@ -42,7 +42,6 @@ interface ISocketClientConfig {
|
|
|
42
42
|
onHandshakeData?: (response: {
|
|
43
43
|
data: AckResponse;
|
|
44
44
|
roomKey: string;
|
|
45
|
-
wireFormat: WireFormat;
|
|
46
45
|
}) => void;
|
|
47
46
|
roomInfo?: {
|
|
48
47
|
documentTitle: string;
|
|
@@ -81,8 +80,6 @@ export declare class SocketClient {
|
|
|
81
80
|
private actorHandle?;
|
|
82
81
|
private joinOnly?;
|
|
83
82
|
private roomKey;
|
|
84
|
-
private wireFormat;
|
|
85
|
-
getWireFormat(): WireFormat;
|
|
86
83
|
private roomInfo?;
|
|
87
84
|
private awareness;
|
|
88
85
|
private connectionAttemptErrorCount;
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { Data, IDocCollabUsers } from '../../types';
|
|
2
2
|
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
|
-
/** Collab wire cipher. `ecies` is the historical secp256k1 ECIES; `xchacha` is
|
|
5
|
-
* XChaCha20-Poly1305 under an HKDF subkey of the roomKey (FVXC1). */
|
|
6
|
-
export type WireFormat = 'ecies' | 'xchacha';
|
|
7
|
-
/** Host telemetry for the wire migration; the package never imports a reporter. */
|
|
8
|
-
export type WireTelemetryEvent = {
|
|
9
|
-
type: 'announced';
|
|
10
|
-
format: WireFormat;
|
|
11
|
-
} | {
|
|
12
|
-
type: 'write';
|
|
13
|
-
format: WireFormat;
|
|
14
|
-
} | {
|
|
15
|
-
type: 'hydrate';
|
|
16
|
-
eciesRows: number;
|
|
17
|
-
xchachaRows: number;
|
|
18
|
-
snapshotFormat: WireFormat | null;
|
|
19
|
-
incomplete: boolean;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'refused';
|
|
22
|
-
};
|
|
23
4
|
/** Connection identity — changes to these trigger reconnect */
|
|
24
5
|
export interface CollabConnectionConfig {
|
|
25
6
|
roomKey: string;
|
|
@@ -169,11 +150,7 @@ export interface CollabCallbacks {
|
|
|
169
150
|
onHandshakeData?: (data: {
|
|
170
151
|
data: AckResponse;
|
|
171
152
|
roomKey: string;
|
|
172
|
-
wireFormat: WireFormat;
|
|
173
153
|
}) => void;
|
|
174
|
-
/** The write format the server announced for this room (auth ack or live ratchet). */
|
|
175
|
-
onWireFormat?: (format: WireFormat) => void;
|
|
176
|
-
onWireTelemetry?: (event: WireTelemetryEvent) => void;
|
|
177
154
|
/** Live rename from the room owner; title is roomKey-encrypted. */
|
|
178
155
|
onTitleUpdate?: (encryptedTitle: string | null) => void;
|
|
179
156
|
/** Decrypt-miss self-heal: resolves the CURRENT-epoch roomKey (same resolution the host
|
|
@@ -218,8 +195,7 @@ export declare enum ServerErrorCode {
|
|
|
218
195
|
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
219
196
|
JOIN_DISABLED = "JOIN_DISABLED",
|
|
220
197
|
EDIT_REVOKED = "EDIT_REVOKED",
|
|
221
|
-
ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED"
|
|
222
|
-
WIRE_FORMAT_UNSUPPORTED = "WIRE_FORMAT_UNSUPPORTED"
|
|
198
|
+
ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED"
|
|
223
199
|
}
|
|
224
200
|
export interface AckResponse<T = Record<string, any>> {
|
|
225
201
|
status: boolean;
|
|
@@ -284,10 +260,6 @@ export interface ISocketInitConfig {
|
|
|
284
260
|
}) => void;
|
|
285
261
|
onPresenceChange?: (collaborators: IDocCollabUsers[]) => void;
|
|
286
262
|
onTitleUpdate?: (encryptedTitle: string | null) => void;
|
|
287
|
-
onWireFormat?: (data: {
|
|
288
|
-
roomId: string;
|
|
289
|
-
wireFormat: WireFormat;
|
|
290
|
-
}) => void;
|
|
291
263
|
onSessionTerminated: (data: {
|
|
292
264
|
roomId: string;
|
|
293
265
|
}) => void;
|
|
@@ -317,5 +289,4 @@ export interface IAuthArgs {
|
|
|
317
289
|
editUcan?: string;
|
|
318
290
|
actorHandle?: string;
|
|
319
291
|
joinOnly?: boolean;
|
|
320
|
-
wireFormats?: WireFormat[];
|
|
321
292
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Awareness } from 'y-protocols/awareness';
|
|
2
2
|
import { SocketClient } from '../socketClient';
|
|
3
|
-
import { WireFormat } from '../types';
|
|
4
3
|
|
|
5
|
-
export declare const createAwarenessUpdateHandler: (awareness: Awareness, socketClient: SocketClient, roomKey: string
|
|
4
|
+
export declare const createAwarenessUpdateHandler: (awareness: Awareness, socketClient: SocketClient, roomKey: string) => ({ added, updated, removed, }: {
|
|
6
5
|
added: number[];
|
|
7
6
|
updated: number[];
|
|
8
7
|
removed: number[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m, jsxs as L } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as D, useState as E, useEffect as A } from "react";
|
|
3
3
|
import { DynamicDropdown as P, Tooltip as O, IconButton as T } from "@fileverse/ui";
|
|
4
|
-
import { a3 as _, a4 as w, c as R } from "./index-
|
|
4
|
+
import { a3 as _, a4 as w, c as R } from "./index-CVwMVBPt.mjs";
|
|
5
5
|
const p = (e, n, o = n) => {
|
|
6
6
|
const { state: i } = e, l = i.changeByRange((t) => {
|
|
7
7
|
const d = i.sliceDoc(t.from, t.to), r = i.sliceDoc(
|