@fileverse-dev/ddoc 4.2.0-durability-5 → 4.2.0-durability-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.
@@ -1,4 +1,4 @@
1
- import { k as Ql, b as Zl, s as eh } from "./index-DyCMrsW4.mjs";
1
+ import { k as Ql, b as Zl, s as eh } from "./index-BM0vGxD5.mjs";
2
2
  let An = [], Xr = [];
3
3
  (() => {
4
4
  let s = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e) => e ? parseInt(e, 36) : 1);
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as e, a as o, E as t, P as d, f as r, h as i, m as n, e as E, c as m, d as u, u as C, v as l } from "./index-DyCMrsW4.mjs";
1
+ import { D as e, a as o, E as t, P as d, f as r, h as i, m as n, e as E, c as m, d as u, u as C, v as l } from "./index-BM0vGxD5.mjs";
2
2
  export {
3
3
  e as DdocEditor,
4
4
  o as DdocExportModal,
@@ -1,9 +1,9 @@
1
1
  var Vr = Object.defineProperty;
2
2
  var Wr = (t, e, O) => e in t ? Vr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: O }) : t[e] = O;
3
3
  var gt = (t, e, O) => Wr(t, typeof e != "symbol" ? e + "" : e, O);
4
- import { j as Cr } from "./index-DyCMrsW4.mjs";
4
+ import { j as Cr } from "./index-BM0vGxD5.mjs";
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-Cj6IqS3E.mjs";
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-Cmue3Umx.mjs";
7
7
  class ua {
8
8
  /**
9
9
  Create a new completion context. (Mostly useful for testing
@@ -16,6 +16,10 @@ export declare const useYjsSetup: ({ onChange, enableIndexeddbSync, ddocId, coll
16
16
  isReady: boolean;
17
17
  isSyncing: boolean;
18
18
  terminateSession: () => void;
19
+ updateTitle: (args: {
20
+ encryptedTitle: string;
21
+ documentTitle: string;
22
+ }) => void;
19
23
  awareness: import('y-protocols/awareness.js').Awareness | null;
20
24
  hasCollabContentInitialised: boolean;
21
25
  isIndexeddbSynced: boolean;
@@ -14,6 +14,7 @@ export declare class SyncManager {
14
14
  private mirrorIdleTimer;
15
15
  private readonly MIRROR_IDLE_MS;
16
16
  private isOwner;
17
+ private joinOnly;
17
18
  private updateQueue;
18
19
  private contentTobeAppliedQueue;
19
20
  private isProcessing;
@@ -44,6 +45,11 @@ export declare class SyncManager {
44
45
  private runEntryActions;
45
46
  connect(config: CollabConnectionConfig): Promise<void>;
46
47
  disconnect(): Promise<void>;
48
+ /** Owner rename mid-session — see SocketClient.updateDocumentMeta. */
49
+ updateTitle(args: {
50
+ encryptedTitle: string;
51
+ documentTitle: string;
52
+ }): Promise<void>;
47
53
  terminateSession(): Promise<void>;
48
54
  enqueueLocalUpdate(update: Uint8Array): void;
49
55
  private flushUpdates;
@@ -23,6 +23,7 @@ interface ISocketClientConfig {
23
23
  status: 'unavailable';
24
24
  }>;
25
25
  actorHandle?: string;
26
+ joinOnly?: boolean;
26
27
  onHandshakeData?: (response: {
27
28
  data: AckResponse;
28
29
  roomKey: string;
@@ -47,6 +48,7 @@ export declare class SocketClient {
47
48
  roomMembers: string[];
48
49
  private _lastPresenceSignature;
49
50
  private _onPresenceChange?;
51
+ private _pendingAwarenessUpdates;
50
52
  private collaborationKeyPair;
51
53
  private ownerKeyPair?;
52
54
  private contractAddress?;
@@ -62,6 +64,7 @@ export declare class SocketClient {
62
64
  private refreshEditClaim?;
63
65
  private lastGoodEditUcan?;
64
66
  private actorHandle?;
67
+ private joinOnly?;
65
68
  private roomKey;
66
69
  private roomInfo?;
67
70
  private awareness;
@@ -69,6 +72,7 @@ export declare class SocketClient {
69
72
  private _onHandshakeData;
70
73
  constructor(config: ISocketClientConfig);
71
74
  registerAwareness(awareness: Awareness): void;
75
+ private _stampSocketId;
72
76
  private _emitWithAck;
73
77
  private _fetchRoomMembers;
74
78
  private _recomputePresence;
@@ -86,6 +90,13 @@ export declare class SocketClient {
86
90
  fileKeyEpoch: number;
87
91
  }): Promise<AckResponse<any>>;
88
92
  setDocumentMeta(): Promise<void>;
93
+ /** Owner rename mid-session: refresh the connect-frozen title artifacts (so
94
+ * every later /auth re-sends current values), persist server-side, and let
95
+ * the server broadcast /document/meta_update to room peers. */
96
+ updateDocumentMeta(args: {
97
+ encryptedTitle: string;
98
+ documentTitle: string;
99
+ }): Promise<void>;
89
100
  broadcastAwareness(awarenessUpdate: string): Promise<void>;
90
101
  disconnect: () => void;
91
102
  reauth: () => void;
@@ -38,6 +38,11 @@ export interface CollabConnectionConfig {
38
38
  }>;
39
39
  /** Host signal: an anonymous per-connection actor handle (public rail). Record-only; opaque. */
40
40
  actorHandle?: string;
41
+ /** Host signal (non-creator workspace member): join-only. The server never creates or
42
+ * binds a session for this connection and caps the role at editor; every handshake
43
+ * rejection resolves to a quiet terminated state ('ROOM_NOT_ESTABLISHED' when the room
44
+ * was never established, 'JOIN_REJECTED' otherwise) instead of an error. */
45
+ joinOnly?: boolean;
41
46
  /** Host signal (editor): produces the view-plane mirror ciphertext from the live Yjs state. The app
42
47
  * AES-GCM-encrypts `{ file: base64(yjsUpdate), source }` under the fileKey in the publish wire
43
48
  * format. Absent ⇒ the mirror is not written. The package never sees the fileKey or the crypto. */
@@ -127,6 +132,8 @@ export interface CollabCallbacks {
127
132
  data: AckResponse;
128
133
  roomKey: string;
129
134
  }) => void;
135
+ /** Live rename from the room owner; title is roomKey-encrypted. */
136
+ onTitleUpdate?: (encryptedTitle: string | null) => void;
130
137
  }
131
138
  /** Discriminated union — TypeScript enforces config+services only when enabled */
132
139
  export type CollaborationProps = {
@@ -163,7 +170,8 @@ export declare enum ServerErrorCode {
163
170
  DB_ERROR = "DB_ERROR",
164
171
  INTERNAL_ERROR = "INTERNAL_ERROR",
165
172
  JOIN_DISABLED = "JOIN_DISABLED",
166
- EDIT_REVOKED = "EDIT_REVOKED"
173
+ EDIT_REVOKED = "EDIT_REVOKED",
174
+ ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED"
167
175
  }
168
176
  export interface AckResponse<T = Record<string, any>> {
169
177
  status: boolean;
@@ -227,6 +235,7 @@ export interface ISocketInitConfig {
227
235
  roomId: string;
228
236
  }) => void;
229
237
  onPresenceChange?: (collaborators: IDocCollabUsers[]) => void;
238
+ onTitleUpdate?: (encryptedTitle: string | null) => void;
230
239
  onSessionTerminated: (data: {
231
240
  roomId: string;
232
241
  }) => void;
@@ -257,4 +266,5 @@ export interface IAuthArgs {
257
266
  identityContractAddress?: string;
258
267
  editUcan?: string;
259
268
  actorHandle?: string;
269
+ joinOnly?: boolean;
260
270
  }
@@ -5,6 +5,10 @@ export declare const useSyncManager: (config: SyncManagerConfig) => {
5
5
  connect: (connectConfig: CollabConnectionConfig) => void;
6
6
  disconnect: () => void;
7
7
  terminateSession: () => void;
8
+ updateTitle: (args: {
9
+ encryptedTitle: string;
10
+ documentTitle: string;
11
+ }) => void;
8
12
  isReady: boolean;
9
13
  isSyncing: boolean;
10
14
  awareness: import('y-protocols/awareness.js').Awareness | null;
@@ -31,6 +31,10 @@ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent
31
31
  onDisconnect: () => void;
32
32
  isReady: boolean;
33
33
  isSyncing: boolean;
34
+ updateTitle: (args: {
35
+ encryptedTitle: string;
36
+ documentTitle: string;
37
+ }) => void;
34
38
  hasCollabContentInitialised: boolean;
35
39
  isIndexeddbSynced: boolean;
36
40
  initialiseYjsIndexedDbProvider: () => Promise<void>;
@@ -1,7 +1,7 @@
1
- import { j as d } from "./index-DyCMrsW4.mjs";
1
+ import { j as d } from "./index-BM0vGxD5.mjs";
2
2
  import { useRef as I, useState as N, useEffect as D } from "react";
3
3
  import { DynamicDropdown as E, Tooltip as R, IconButton as O } from "@fileverse/ui";
4
- import { a3 as A, a4 as P, c as y } from "./index-Cj6IqS3E.mjs";
4
+ import { a3 as A, a4 as P, c as y } from "./index-Cmue3Umx.mjs";
5
5
  const p = (e, t, o = t) => {
6
6
  const { state: s } = e, l = s.changeByRange((n) => {
7
7
  const u = s.sliceDoc(n.from, n.to), r = s.sliceDoc(
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "4.2.0-durability-5",
5
+ "version": "4.2.0-durability-7",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {