@fileverse-dev/ddoc 4.2.0-durability-8 → 4.2.0-yjs-dedupe-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-DU1L3PC_.mjs → index-BfVM4ukb.mjs} +1 -1
- package/dist/{index-BSWmSm-6.mjs → index-DYlSDaET.mjs} +49123 -49943
- package/dist/index.d.ts +0 -4
- package/dist/index.es.js +5 -8
- package/dist/{markdown-source-pane-BscaPxrM.mjs → markdown-source-pane-ve9MJKFE.mjs} +2 -2
- package/dist/package/components/editor-bubble-menu/types.d.ts +1 -0
- package/dist/package/components/editor-utils.d.ts +25 -1
- package/dist/package/components/inline-comment/comment-drawer-desktop.d.ts +2 -1
- package/dist/package/components/inline-comment/comment-drawer-mobile.d.ts +2 -1
- package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-input-field.d.ts +2 -1
- package/dist/package/components/inline-comment/comment-reply-input.d.ts +2 -1
- package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
- package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +1 -1
- package/dist/package/components/inline-comment/floating-comment/suggestion-thread-floating-card.d.ts +1 -1
- package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +1 -1
- package/dist/package/components/inline-comment/floating-comment/types.d.ts +2 -0
- package/dist/package/components/inline-comment/types.d.ts +2 -0
- package/dist/package/components/split-view/split-view-markdown-pane.d.ts +1 -3
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +0 -6
- package/dist/package/hooks/use-focus-mode.d.ts +1 -6
- package/dist/package/hooks/use-headless-editor.d.ts +1 -9
- package/dist/package/hooks/use-tab-editor.d.ts +3 -3
- package/dist/package/hooks/use-yjs-setup.d.ts +1 -7
- package/dist/package/stores/comment-store-provider.d.ts +1 -3
- package/dist/package/stores/comment-store.d.ts +0 -15
- package/dist/package/sync-local/SyncManager.d.ts +7 -30
- package/dist/package/sync-local/socketClient.d.ts +8 -55
- package/dist/package/sync-local/types/index.d.ts +11 -82
- package/dist/package/sync-local/useSyncManager.d.ts +0 -4
- package/dist/package/types.d.ts +2 -20
- package/dist/package/use-ddoc-editor.d.ts +0 -5
- package/dist/package/utils/colors.d.ts +0 -1
- package/dist/{split-view-toolbar-PQWTjOnQ.mjs → split-view-toolbar-8avjvjIR.mjs} +2 -2
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/dist/package/components/split-view/split-view-css-accordion.d.ts +0 -13
- package/dist/package/hooks/use-editor-commands.d.ts +0 -20
- package/dist/package/sync-local/floor.d.ts +0 -6
- package/dist/package/sync-local/presence.d.ts +0 -11
- package/dist/package/utils/insert-commands.d.ts +0 -20
- package/dist/package/utils/make-editor.d.ts +0 -9
- package/dist/package/utils/sanitize-css.d.ts +0 -45
- package/dist/package/utils/selection-utils.d.ts +0 -35
- package/dist/package/utils/typography.d.ts +0 -26
|
@@ -7,49 +7,6 @@ export interface CollabConnectionConfig {
|
|
|
7
7
|
roomId: string;
|
|
8
8
|
wsUrl: string;
|
|
9
9
|
isOwner: boolean;
|
|
10
|
-
/** Host signal: doc is in an active live-collaboration context (shared / peers present). Keeps the socket connected. */
|
|
11
|
-
livePresence?: boolean;
|
|
12
|
-
/** Host signal: connect once on open to initialise durability even without an edit. */
|
|
13
|
-
connectOnOpen?: boolean;
|
|
14
|
-
/** Host signal (owner-only): the owner identity signingKey DID. Recorded by the durable server on the first owner /auth as the R3 owner binding. */
|
|
15
|
-
ownerIdentityDid?: string;
|
|
16
|
-
/** Host signal (owner-only): wrapped roomKey bytes (owner-lock construction), uploaded as the server editLock recovery artifact. Opaque to the package. */
|
|
17
|
-
editLock?: string;
|
|
18
|
-
/** Host signal (owner-only): the document title encrypted with the roomKey, uploaded as the server title recovery artifact. Opaque to the package. */
|
|
19
|
-
encryptedTitle?: string;
|
|
20
|
-
/** Host signal (owner-only): Ed25519 UCAN proving the owner identity, sent on /auth so the server binds the CRYPTOGRAPHICALLY PROVEN owner DID (not a bare asserted string). Opaque to the package. */
|
|
21
|
-
identityToken?: string;
|
|
22
|
-
/** Host signal (owner-only): the identity contract address the server reads to resolve the on-chain signingDid that verifies identityToken. */
|
|
23
|
-
identityContractAddress?: string;
|
|
24
|
-
/** Host signal (non-owner editor): the gate-minted edit-admission UCAN, forwarded on /auth so the
|
|
25
|
-
* server admits this connection as a GP-rail editor. Opaque to the package. */
|
|
26
|
-
editUcan?: string;
|
|
27
|
-
/** Host signal (non-owner editor): re-mints a CURRENT-epoch editUcan. Called at every /auth
|
|
28
|
-
* (incl. reconnect after a force-drop). Tri-state: `ok` (fresh token; overrides the static
|
|
29
|
-
* `editUcan`), `demoted` (no longer an editor → terminal, drop to viewer), or `unavailable`
|
|
30
|
-
* (transient/network → retry on the last-good claim). Opaque to the package. */
|
|
31
|
-
refreshEditClaim?: () => Promise<{
|
|
32
|
-
status: 'ok';
|
|
33
|
-
token: string;
|
|
34
|
-
} | {
|
|
35
|
-
status: 'demoted';
|
|
36
|
-
} | {
|
|
37
|
-
status: 'unavailable';
|
|
38
|
-
}>;
|
|
39
|
-
/** Host signal: an anonymous per-connection actor handle (public rail). Record-only; opaque. */
|
|
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;
|
|
46
|
-
/** Host signal (editor): produces the view-plane mirror ciphertext from the live Yjs state. The app
|
|
47
|
-
* AES-GCM-encrypts `{ file: base64(yjsUpdate), source }` under the fileKey in the publish wire
|
|
48
|
-
* format. Absent ⇒ the mirror is not written. The package never sees the fileKey or the crypto. */
|
|
49
|
-
encryptMirror?: (yjsUpdate: Uint8Array) => Promise<string>;
|
|
50
|
-
/** Host signal: the fileKey's rotation epoch (the gate `currentEpoch` / fileKey version — NOT
|
|
51
|
-
* `editGrantEpoch`; default 0 for non-rotating plain-public docs). */
|
|
52
|
-
fileKeyEpoch?: number;
|
|
53
10
|
ownerEdSecret?: string;
|
|
54
11
|
contractAddress?: string;
|
|
55
12
|
ownerAddress?: string;
|
|
@@ -64,7 +21,11 @@ export interface CollabSessionMeta {
|
|
|
64
21
|
username: string;
|
|
65
22
|
isEns?: boolean;
|
|
66
23
|
}
|
|
67
|
-
|
|
24
|
+
/** Storage integrations the sync engine depends on */
|
|
25
|
+
export interface CollabServices {
|
|
26
|
+
commitToStorage?: (file: File) => Promise<string>;
|
|
27
|
+
fetchFromStorage?: (cid: string) => Promise<any>;
|
|
28
|
+
}
|
|
68
29
|
export type CollabErrorCode = 'CONNECTION_FAILED' | 'AUTH_FAILED' | 'SYNC_FAILED' | 'TIMEOUT' | 'UNKNOWN';
|
|
69
30
|
export type CollabError = {
|
|
70
31
|
code: CollabErrorCode;
|
|
@@ -132,8 +93,6 @@ export interface CollabCallbacks {
|
|
|
132
93
|
data: AckResponse;
|
|
133
94
|
roomKey: string;
|
|
134
95
|
}) => void;
|
|
135
|
-
/** Live rename from the room owner; title is roomKey-encrypted. */
|
|
136
|
-
onTitleUpdate?: (encryptedTitle: string | null) => void;
|
|
137
96
|
}
|
|
138
97
|
/** Discriminated union — TypeScript enforces config+services only when enabled */
|
|
139
98
|
export type CollaborationProps = {
|
|
@@ -168,10 +127,7 @@ export declare enum ServerErrorCode {
|
|
|
168
127
|
INVALID_ADDRESS = "INVALID_ADDRESS",
|
|
169
128
|
NOT_AUTHENTICATED = "NOT_AUTHENTICATED",
|
|
170
129
|
DB_ERROR = "DB_ERROR",
|
|
171
|
-
INTERNAL_ERROR = "INTERNAL_ERROR"
|
|
172
|
-
JOIN_DISABLED = "JOIN_DISABLED",
|
|
173
|
-
EDIT_REVOKED = "EDIT_REVOKED",
|
|
174
|
-
ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED"
|
|
130
|
+
INTERNAL_ERROR = "INTERNAL_ERROR"
|
|
175
131
|
}
|
|
176
132
|
export interface AckResponse<T = Record<string, any>> {
|
|
177
133
|
status: boolean;
|
|
@@ -189,30 +145,11 @@ export interface SendUpdateResponse extends AckResponse<{
|
|
|
189
145
|
createdAt: number;
|
|
190
146
|
}> {
|
|
191
147
|
}
|
|
192
|
-
export interface
|
|
193
|
-
|
|
148
|
+
export interface CommitResponse extends AckResponse<{
|
|
149
|
+
cid: string;
|
|
150
|
+
createdAt: number;
|
|
194
151
|
documentId: string;
|
|
195
|
-
|
|
196
|
-
data: string;
|
|
197
|
-
updateType: string;
|
|
198
|
-
committed?: boolean;
|
|
199
|
-
commitCid?: string | null;
|
|
200
|
-
createdAt?: number;
|
|
201
|
-
sessionDid?: string;
|
|
202
|
-
publishedMarker?: string | null;
|
|
203
|
-
floorSeq?: number | null;
|
|
204
|
-
}
|
|
205
|
-
export interface HydrationResponse extends AckResponse<{
|
|
206
|
-
history: HydrationRow[];
|
|
207
|
-
total: number;
|
|
208
|
-
snapshot: HydrationRow | null;
|
|
209
|
-
nextSeq: number | null;
|
|
210
|
-
hasMore: boolean;
|
|
211
|
-
}> {
|
|
212
|
-
}
|
|
213
|
-
export interface SnapshotResponse extends AckResponse<{
|
|
214
|
-
id: string;
|
|
215
|
-
seq: number;
|
|
152
|
+
updates: string[];
|
|
216
153
|
}> {
|
|
217
154
|
}
|
|
218
155
|
export interface ISocketInitConfig {
|
|
@@ -220,7 +157,7 @@ export interface ISocketInitConfig {
|
|
|
220
157
|
onDisconnect: () => void;
|
|
221
158
|
onSocketDropped: () => void;
|
|
222
159
|
onError: (err: Error) => void;
|
|
223
|
-
onHandShakeError: (err: Error, statusCode?: number
|
|
160
|
+
onHandShakeError: (err: Error, statusCode?: number) => void;
|
|
224
161
|
onContentUpdate: (data: {
|
|
225
162
|
id: string;
|
|
226
163
|
data: string;
|
|
@@ -234,8 +171,6 @@ export interface ISocketInitConfig {
|
|
|
234
171
|
};
|
|
235
172
|
roomId: string;
|
|
236
173
|
}) => void;
|
|
237
|
-
onPresenceChange?: (collaborators: IDocCollabUsers[]) => void;
|
|
238
|
-
onTitleUpdate?: (encryptedTitle: string | null) => void;
|
|
239
174
|
onSessionTerminated: (data: {
|
|
240
175
|
roomId: string;
|
|
241
176
|
}) => void;
|
|
@@ -261,10 +196,4 @@ export interface IAuthArgs {
|
|
|
261
196
|
contractAddress?: string;
|
|
262
197
|
sessionDid?: string;
|
|
263
198
|
roomInfo?: string;
|
|
264
|
-
ownerIdentityDid?: string;
|
|
265
|
-
identityToken?: string;
|
|
266
|
-
identityContractAddress?: string;
|
|
267
|
-
editUcan?: string;
|
|
268
|
-
actorHandle?: string;
|
|
269
|
-
joinOnly?: boolean;
|
|
270
199
|
}
|
|
@@ -5,10 +5,6 @@ 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;
|
|
12
8
|
isReady: boolean;
|
|
13
9
|
isSyncing: boolean;
|
|
14
10
|
awareness: import('y-protocols/awareness.js').Awareness | null;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -9,11 +9,10 @@ import { CollaborationProps } from './sync-local/types';
|
|
|
9
9
|
export type { CollaborationProps, CollabConnectionConfig, CollabSessionMeta, CollabServices, CollabCallbacks, CollabState, CollabError, CollabErrorCode, CollabStatus, } from './sync-local/types';
|
|
10
10
|
export declare const DdocEditorProps: EditorProps;
|
|
11
11
|
export interface IDocCollabUsers {
|
|
12
|
-
clientId:
|
|
12
|
+
clientId: number;
|
|
13
13
|
name: string;
|
|
14
14
|
isEns: string;
|
|
15
15
|
color: string;
|
|
16
|
-
isPlaceholder?: boolean;
|
|
17
16
|
}
|
|
18
17
|
export type InlineCommentData = {
|
|
19
18
|
inlineCommentText: string;
|
|
@@ -104,17 +103,6 @@ export interface DocumentStyling {
|
|
|
104
103
|
* @example "portrait" | "landscape"
|
|
105
104
|
*/
|
|
106
105
|
orientation?: 'portrait' | 'landscape';
|
|
107
|
-
/**
|
|
108
|
-
* Custom CSS
|
|
109
|
-
* @description The author's escape hatch for styling the document beyond the
|
|
110
|
-
* structured options above. Write BARE selectors (`h1 { … }`, `p { … }`,
|
|
111
|
-
* `blockquote { … }`) — they are auto-scoped to the document content, so rules
|
|
112
|
-
* can't leak into the toolbar or the host app. Bare top-level declarations
|
|
113
|
-
* (e.g. `background`, `font-family`) style the document surface itself.
|
|
114
|
-
* Applies live in the editor, in preview, and in exports (Markdown/HTML).
|
|
115
|
-
* @example "h1 { letter-spacing: -0.02em } p { line-height: 1.8 }"
|
|
116
|
-
*/
|
|
117
|
-
customCSS?: string;
|
|
118
106
|
}
|
|
119
107
|
export interface DdocProps extends CommentAccountProps {
|
|
120
108
|
/**
|
|
@@ -181,11 +169,8 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
181
169
|
walletAddress?: string | null;
|
|
182
170
|
username?: string | null;
|
|
183
171
|
setUsername?: React.Dispatch<SetStateAction<string>>;
|
|
184
|
-
renderNavbar?: ({ editor
|
|
185
|
-
/** JSON snapshot — legacy field, unchanged. */
|
|
172
|
+
renderNavbar?: ({ editor }: {
|
|
186
173
|
editor: JSONContent;
|
|
187
|
-
/** Live Tiptap editor instance (D8) — null until the editor is ready. */
|
|
188
|
-
liveEditor: Editor | null;
|
|
189
174
|
}) => JSX.Element;
|
|
190
175
|
onChange?: (updatedDocContent: string | JSONContent, updateChunk: string) => void;
|
|
191
176
|
onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
|
|
@@ -213,9 +198,6 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
213
198
|
onComment?: () => void;
|
|
214
199
|
onInlineComment?: () => void;
|
|
215
200
|
onFocusMode?: (isFocusMode: boolean) => void;
|
|
216
|
-
/** Controlled focus mode (D6). Omit for the legacy internal-state behavior. */
|
|
217
|
-
isFocusMode?: boolean;
|
|
218
|
-
onFocusModeChange?: (isFocusMode: boolean) => void;
|
|
219
201
|
onMarkdownExport?: () => void;
|
|
220
202
|
onMarkdownImport?: () => void;
|
|
221
203
|
onPdfExport?: () => void;
|
|
@@ -28,13 +28,8 @@ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent
|
|
|
28
28
|
duplicateTab: (tabId: string) => string | undefined;
|
|
29
29
|
orderTab: (destinationTabId: string, movedTabId: string) => void;
|
|
30
30
|
onConnect: (connectConfig: import('./types').CollabConnectionConfig) => void;
|
|
31
|
-
onDisconnect: () => void;
|
|
32
31
|
isReady: boolean;
|
|
33
32
|
isSyncing: boolean;
|
|
34
|
-
updateTitle: (args: {
|
|
35
|
-
encryptedTitle: string;
|
|
36
|
-
documentTitle: string;
|
|
37
|
-
}) => void;
|
|
38
33
|
hasCollabContentInitialised: boolean;
|
|
39
34
|
isIndexeddbSynced: boolean;
|
|
40
35
|
initialiseYjsIndexedDbProvider: () => Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as d } from "./index-
|
|
1
|
+
import { j as d } from "./index-DYlSDaET.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-
|
|
4
|
+
import { a3 as A, a4 as P, c as y } from "./index-BfVM4ukb.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(
|