@fileverse-dev/ddoc 4.2.0-durability-3 → 4.2.0-durability-5

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.
Files changed (21) hide show
  1. package/dist/{index-B1YYH48o.mjs → index-Cj6IqS3E.mjs} +1 -1
  2. package/dist/{index-Cf6WSYX5.mjs → index-DyCMrsW4.mjs} +13347 -13378
  3. package/dist/index.es.js +1 -1
  4. package/dist/{markdown-source-pane-BSZ4KkCo.mjs → markdown-source-pane-aEnkDOx7.mjs} +2 -2
  5. package/dist/package/components/editor-bubble-menu/types.d.ts +0 -1
  6. package/dist/package/components/inline-comment/comment-drawer-desktop.d.ts +1 -2
  7. package/dist/package/components/inline-comment/comment-drawer-mobile.d.ts +1 -2
  8. package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
  9. package/dist/package/components/inline-comment/comment-input-field.d.ts +1 -2
  10. package/dist/package/components/inline-comment/comment-reply-input.d.ts +1 -2
  11. package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
  12. package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +1 -1
  13. package/dist/package/components/inline-comment/floating-comment/suggestion-thread-floating-card.d.ts +1 -1
  14. package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +1 -1
  15. package/dist/package/components/inline-comment/floating-comment/types.d.ts +0 -2
  16. package/dist/package/components/inline-comment/types.d.ts +0 -2
  17. package/dist/package/sync-local/SyncManager.d.ts +2 -0
  18. package/dist/package/sync-local/socketClient.d.ts +10 -1
  19. package/dist/package/sync-local/types/index.d.ts +11 -4
  20. package/dist/{split-view-toolbar-DZPQZsFn.mjs → split-view-toolbar-Y4c84oHs.mjs} +2 -2
  21. package/package.json +1 -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-Cf6WSYX5.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-DyCMrsW4.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-Cf6WSYX5.mjs";
4
+ import { j as Cr } from "./index-DyCMrsW4.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-B1YYH48o.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-Cj6IqS3E.mjs";
7
7
  class ua {
8
8
  /**
9
9
  Create a new completion context. (Mostly useful for testing
@@ -30,7 +30,6 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
30
30
  file: File;
31
31
  }>;
32
32
  fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
33
- enableCollaboration?: boolean;
34
33
  isCollabDocOwner?: boolean;
35
34
  };
36
35
  export interface NodeSelectorProps {
@@ -9,7 +9,6 @@ interface CommentDrawerDesktopProps {
9
9
  commentType: string;
10
10
  commentTypeOptions: DrawerSelectOption[];
11
11
  filteredComments: IComment[];
12
- isCollaborationEnabled: boolean;
13
12
  isCommentTypeSelectOpen: boolean;
14
13
  isConnected: boolean;
15
14
  isNavbarVisible: boolean;
@@ -31,5 +30,5 @@ interface CommentDrawerDesktopProps {
31
30
  tabList: DrawerSelectOption[];
32
31
  tabNameById: Record<string, string>;
33
32
  }
34
- export declare const CommentDrawerDesktop: ({ activeCommentId, commentType, commentTypeOptions, filteredComments, isCollaborationEnabled, isCommentTypeSelectOpen, isConnected, isNavbarVisible, isOpen, isPresentationMode, isPreviewMode, isTabSelectOpen, newCommentTabId, onClose, onCommentFocus, onCommentTypeChange, onCommentTypeSelectOpenChange, onReset, onTabChange, onTabSelectOpenChange, sectionLabel, selectedTab, selectedTabLabel, tabList, tabNameById, }: CommentDrawerDesktopProps) => import("react/jsx-runtime").JSX.Element;
33
+ export declare const CommentDrawerDesktop: ({ activeCommentId, commentType, commentTypeOptions, filteredComments, isCommentTypeSelectOpen, isConnected, isNavbarVisible, isOpen, isPresentationMode, isPreviewMode, isTabSelectOpen, newCommentTabId, onClose, onCommentFocus, onCommentTypeChange, onCommentTypeSelectOpenChange, onReset, onTabChange, onTabSelectOpenChange, sectionLabel, selectedTab, selectedTabLabel, tabList, tabNameById, }: CommentDrawerDesktopProps) => import("react/jsx-runtime").JSX.Element;
35
34
  export {};
@@ -9,7 +9,6 @@ interface CommentDrawerMobileProps {
9
9
  canGoToNextMobileComment: boolean;
10
10
  canGoToPreviousMobileComment: boolean;
11
11
  comments: IComment[];
12
- isCollaborationEnabled: boolean;
13
12
  isCommentMobileFocused: boolean;
14
13
  isConnected: boolean;
15
14
  isDiscardCommentOverlayVisible: boolean;
@@ -39,5 +38,5 @@ interface CommentDrawerMobileProps {
39
38
  tabNameById: Record<string, string>;
40
39
  username: string | null;
41
40
  }
42
- export declare const CommentDrawerMobile: ({ activeCommentId, activeDraft, activeDraftId, activeSuggestionDraftCard, canGoToNextMobileComment, canGoToPreviousMobileComment, comments, isCollaborationEnabled, isCommentMobileFocused, isConnected, isDiscardCommentOverlayVisible, isDiscardSuggestionOverlayVisible, isInlineDraftOpen, isMobileDrawerVisible, isNavbarVisible, isPresentationMode, mobileActiveCommentsCount, mobileDraftRef, mobileFocusedCommentIndex, onAttemptCloseNewComment, onAttemptCloseSuggestionDraft, onCancelDiscardComment, onCancelDiscardSuggestion, onCloseDrawer, onCommentFocus, onCreateComment, onDiscardSuggestionDraft, onFocusSuggestionDraft, onNextMobileComment, onPreviousMobileComment, onStartNewMobileComment, onSubmitSuggestionDraft, onUpdateInlineDraftText, onViewAllComments, tabNameById, username, }: CommentDrawerMobileProps) => import("react/jsx-runtime").JSX.Element;
41
+ export declare const CommentDrawerMobile: ({ activeCommentId, activeDraft, activeDraftId, activeSuggestionDraftCard, canGoToNextMobileComment, canGoToPreviousMobileComment, comments, isCommentMobileFocused, isConnected, isDiscardCommentOverlayVisible, isDiscardSuggestionOverlayVisible, isInlineDraftOpen, isMobileDrawerVisible, isNavbarVisible, isPresentationMode, mobileActiveCommentsCount, mobileDraftRef, mobileFocusedCommentIndex, onAttemptCloseNewComment, onAttemptCloseSuggestionDraft, onCancelDiscardComment, onCancelDiscardSuggestion, onCloseDrawer, onCommentFocus, onCreateComment, onDiscardSuggestionDraft, onFocusSuggestionDraft, onNextMobileComment, onPreviousMobileComment, onStartNewMobileComment, onSubmitSuggestionDraft, onUpdateInlineDraftText, onViewAllComments, tabNameById, username, }: CommentDrawerMobileProps) => import("react/jsx-runtime").JSX.Element;
43
42
  export {};
@@ -1,3 +1,3 @@
1
1
  import { CommentDrawerProps } from './types';
2
2
 
3
- export declare const CommentDrawer: ({ isOpen, onClose, isNavbarVisible, isPresentationMode, activeCommentId, activeTabId, onTabChange, isPreviewMode, tabs, isCollaborationEnabled, }: CommentDrawerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CommentDrawer: ({ isOpen, onClose, isNavbarVisible, isPresentationMode, activeCommentId, activeTabId, onTabChange, isPreviewMode, tabs, }: CommentDrawerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- export declare const CommentInputField: ({ tabId, isCollaborationEnabled, }: {
1
+ export declare const CommentInputField: ({ tabId }: {
2
2
  tabId?: string;
3
- isCollaborationEnabled: boolean;
4
3
  }) => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,6 @@ interface CommentReplyInputProps {
2
2
  commentId: string;
3
3
  commentUsername?: string;
4
4
  replyCount: number;
5
- isCollaborationEnabled: boolean;
6
5
  }
7
- export declare const CommentReplyInput: ({ commentId, replyCount, isCollaborationEnabled, commentUsername, }: CommentReplyInputProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const CommentReplyInput: ({ commentId, replyCount, commentUsername, }: CommentReplyInputProps) => import("react/jsx-runtime").JSX.Element;
8
7
  export {};
@@ -1,3 +1,3 @@
1
1
  import { CommentSectionProps } from './types';
2
2
 
3
- export declare const CommentSection: ({ activeCommentId, isNavbarVisible, isPresentationMode, isMobile, comments: commentsProp, commentType, tabNameById, selectedTabLabel, newCommentTabId, showNewCommentInput, onCommentFocus, onReset, isCollaborationEnabled, }: CommentSectionProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CommentSection: ({ activeCommentId, isNavbarVisible, isPresentationMode, isMobile, comments: commentsProp, commentType, tabNameById, selectedTabLabel, newCommentTabId, showNewCommentInput, onCommentFocus, onReset, }: CommentSectionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { CommentFloatingContainerProps } from './types';
2
2
 
3
- export declare const CommentFloatingContainer: ({ editor, editorWrapperRef, scrollContainerRef, tabName, isHidden, isCollaborationEnabled, }: CommentFloatingContainerProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ export declare const CommentFloatingContainer: ({ editor, editorWrapperRef, scrollContainerRef, tabName, isHidden, }: CommentFloatingContainerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -12,4 +12,4 @@ import { ThreadFloatingCardProps } from './types';
12
12
  * uses — so once a draft is submitted, nothing else in the pipeline needs
13
13
  * to change to show the suggestion here.
14
14
  */
15
- export declare const SuggestionThreadFloatingCard: ({ thread, comment, isHidden, registerCardNode, isCollaborationEnabled, }: ThreadFloatingCardProps) => import("react/jsx-runtime").JSX.Element | null;
15
+ export declare const SuggestionThreadFloatingCard: ({ thread, comment, isHidden, registerCardNode, }: ThreadFloatingCardProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +1,3 @@
1
1
  import { ThreadFloatingCardProps } from './types';
2
2
 
3
- export declare const ThreadFloatingCard: ({ thread, comment, tabName, isHidden, registerCardNode, isCollaborationEnabled, }: ThreadFloatingCardProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ThreadFloatingCard: ({ thread, comment, tabName, isHidden, registerCardNode, }: ThreadFloatingCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -10,7 +10,6 @@ export interface CommentFloatingContainerProps {
10
10
  scrollContainerRef: RefObject<HTMLDivElement>;
11
11
  tabName: string;
12
12
  isHidden: boolean;
13
- isCollaborationEnabled?: boolean;
14
13
  }
15
14
  export interface FloatingCardShellProps {
16
15
  floatingCardId: string;
@@ -30,7 +29,6 @@ export interface ThreadFloatingCardProps {
30
29
  tabName: string;
31
30
  isHidden: boolean;
32
31
  registerCardNode: RegisterCardNode;
33
- isCollaborationEnabled?: boolean;
34
32
  }
35
33
  export interface SuggestionDraftFloatingCardProps {
36
34
  card: SuggestionFloatingDraftCard;
@@ -36,7 +36,6 @@ export interface CommentDrawerProps {
36
36
  onTabChange?: (tabId: string) => void;
37
37
  isPreviewMode: boolean;
38
38
  tabs: Tab[];
39
- isCollaborationEnabled: boolean;
40
39
  }
41
40
  export interface CommentCardProps extends IComment {
42
41
  comment?: string;
@@ -87,7 +86,6 @@ export interface CommentSectionProps {
87
86
  showNewCommentInput?: boolean;
88
87
  onCommentFocus?: (commentId: string, tabId?: string) => void;
89
88
  onReset?: () => void;
90
- isCollaborationEnabled: boolean;
91
89
  }
92
90
  export interface UserDisplayProps {
93
91
  username: string;
@@ -55,6 +55,8 @@ export declare class SyncManager {
55
55
  */
56
56
  private sendUpdateBatch;
57
57
  private isRevocationResponse;
58
+ private classifyRevocation;
59
+ private handleWriteRevocation;
58
60
  private maybeAuthorSnapshotAfterSend;
59
61
  private scheduleMirror;
60
62
  private authorMirror;
@@ -14,7 +14,14 @@ interface ISocketClientConfig {
14
14
  identityToken?: string;
15
15
  identityContractAddress?: string;
16
16
  editUcan?: string;
17
- refreshEditClaim?: () => Promise<string | undefined>;
17
+ refreshEditClaim?: () => Promise<{
18
+ status: 'ok';
19
+ token: string;
20
+ } | {
21
+ status: 'demoted';
22
+ } | {
23
+ status: 'unavailable';
24
+ }>;
18
25
  actorHandle?: string;
19
26
  onHandshakeData?: (response: {
20
27
  data: AckResponse;
@@ -53,6 +60,7 @@ export declare class SocketClient {
53
60
  private identityContractAddress?;
54
61
  private editUcan?;
55
62
  private refreshEditClaim?;
63
+ private lastGoodEditUcan?;
56
64
  private actorHandle?;
57
65
  private roomKey;
58
66
  private roomInfo?;
@@ -80,6 +88,7 @@ export declare class SocketClient {
80
88
  setDocumentMeta(): Promise<void>;
81
89
  broadcastAwareness(awarenessUpdate: string): Promise<void>;
82
90
  disconnect: () => void;
91
+ reauth: () => void;
83
92
  terminateSession: () => Promise<void>;
84
93
  flushBeacon(mergedUpdate: string): void;
85
94
  private getCollaborationKeyPair;
@@ -25,10 +25,17 @@ export interface CollabConnectionConfig {
25
25
  * server admits this connection as a GP-rail editor. Opaque to the package. */
26
26
  editUcan?: string;
27
27
  /** Host signal (non-owner editor): re-mints a CURRENT-epoch editUcan. Called at every /auth
28
- * (incl. reconnect after a force-drop), so an editor whose epoch was bumped re-admits with a
29
- * fresh claim and a demoted member resolves to undefined (dropped to viewer). If present it
30
- * overrides `editUcan`; if absent, the static `editUcan` is used. Opaque to the package. */
31
- refreshEditClaim?: () => Promise<string | undefined>;
28
+ * (incl. reconnect after a force-drop). Tri-state: `ok` (fresh token; overrides the static
29
+ * `editUcan`), `demoted` (no longer an editorterminal, 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
+ }>;
32
39
  /** Host signal: an anonymous per-connection actor handle (public rail). Record-only; opaque. */
33
40
  actorHandle?: string;
34
41
  /** Host signal (editor): produces the view-plane mirror ciphertext from the live Yjs state. The app
@@ -1,7 +1,7 @@
1
- import { j as d } from "./index-Cf6WSYX5.mjs";
1
+ import { j as d } from "./index-DyCMrsW4.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-B1YYH48o.mjs";
4
+ import { a3 as A, a4 as P, c as y } from "./index-Cj6IqS3E.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-3",
5
+ "version": "4.2.0-durability-5",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {