@fileverse-dev/ddoc 4.2.0-yjs-dedupe-1 → 4.2.0-yjs-dedupe-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.
Files changed (45) hide show
  1. package/dist/{index-DYlSDaET.mjs → index-CM9WymRI.mjs} +46065 -50973
  2. package/dist/{index-BfVM4ukb.mjs → index-QQcgsp20.mjs} +1 -1
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.es.js +8 -5
  5. package/dist/{markdown-source-pane-ve9MJKFE.mjs → markdown-source-pane-PIk1fw5v.mjs} +2 -2
  6. package/dist/package/components/editor-bubble-menu/types.d.ts +0 -1
  7. package/dist/package/components/editor-utils.d.ts +1 -25
  8. package/dist/package/components/inline-comment/comment-drawer-desktop.d.ts +1 -2
  9. package/dist/package/components/inline-comment/comment-drawer-mobile.d.ts +1 -2
  10. package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
  11. package/dist/package/components/inline-comment/comment-input-field.d.ts +1 -2
  12. package/dist/package/components/inline-comment/comment-reply-input.d.ts +1 -2
  13. package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
  14. package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +1 -1
  15. package/dist/package/components/inline-comment/floating-comment/suggestion-thread-floating-card.d.ts +1 -1
  16. package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +1 -1
  17. package/dist/package/components/inline-comment/floating-comment/types.d.ts +0 -2
  18. package/dist/package/components/inline-comment/types.d.ts +0 -2
  19. package/dist/package/components/split-view/split-view-css-accordion.d.ts +13 -0
  20. package/dist/package/components/split-view/split-view-markdown-pane.d.ts +3 -1
  21. package/dist/package/extensions/mardown-paste-handler/index.d.ts +6 -0
  22. package/dist/package/hooks/use-editor-commands.d.ts +20 -0
  23. package/dist/package/hooks/use-focus-mode.d.ts +6 -1
  24. package/dist/package/hooks/use-headless-editor.d.ts +9 -1
  25. package/dist/package/hooks/use-tab-editor.d.ts +3 -3
  26. package/dist/package/hooks/use-yjs-setup.d.ts +7 -1
  27. package/dist/package/stores/comment-store-provider.d.ts +3 -1
  28. package/dist/package/stores/comment-store.d.ts +15 -0
  29. package/dist/package/sync-local/SyncManager.d.ts +30 -7
  30. package/dist/package/sync-local/floor.d.ts +6 -0
  31. package/dist/package/sync-local/presence.d.ts +11 -0
  32. package/dist/package/sync-local/socketClient.d.ts +55 -8
  33. package/dist/package/sync-local/types/index.d.ts +82 -11
  34. package/dist/package/sync-local/useSyncManager.d.ts +4 -0
  35. package/dist/package/types.d.ts +20 -2
  36. package/dist/package/use-ddoc-editor.d.ts +5 -0
  37. package/dist/package/utils/colors.d.ts +1 -0
  38. package/dist/package/utils/insert-commands.d.ts +20 -0
  39. package/dist/package/utils/make-editor.d.ts +9 -0
  40. package/dist/package/utils/sanitize-css.d.ts +45 -0
  41. package/dist/package/utils/selection-utils.d.ts +35 -0
  42. package/dist/package/utils/typography.d.ts +26 -0
  43. package/dist/{split-view-toolbar-8avjvjIR.mjs → split-view-toolbar-B7EkoqMb.mjs} +2 -2
  44. package/dist/style.css +1 -1
  45. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { k as Ql, b as Zl, s as eh } from "./index-DYlSDaET.mjs";
1
+ import { k as Ql, b as Zl, s as eh } from "./index-CM9WymRI.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.d.ts CHANGED
@@ -3,8 +3,12 @@ export { PreviewDdocEditor } from './package/preview-ddoc-editor';
3
3
  export { handleContentPrint } from './package/utils/handle-print';
4
4
  export { DdocExportModal } from './package/components/export-modal';
5
5
  export { useHeadlessEditor } from './package/hooks/use-headless-editor';
6
+ export { useEditorCommands } from './package/hooks/use-editor-commands';
7
+ export type { EditorCommand, EditorCommandId, UseEditorCommandsOptions, } from './package/hooks/use-editor-commands';
6
8
  export { useExportHeadlessEditorContent } from './package/hooks/use-export-headless-editor-content';
7
9
  export { mergeTabAwareYjsUpdates } from './package/components/tabs/utils/tab-utils';
10
+ export { validateCustomCss, sanitizeCustomCss, } from './package/utils/sanitize-css';
11
+ export type { CssDiagnostic, CssValidationResult, } from './package/utils/sanitize-css';
8
12
  export { buildVersionDiffSnapshot } from './package/components/tabs/utils/version-diff-snapshot';
9
13
  export type { DdocExportModalProps, ExportFormatOption, ExportTabOption, } from './package/components/export-modal';
10
14
  export type { VersionTabSnapshot } from './package/components/tabs/utils/version-diff-snapshot';
package/dist/index.es.js CHANGED
@@ -1,12 +1,15 @@
1
- import { D as e, a as o, E as d, P as t, d as r, h as i, m as n, c as E, u as l } from "./index-DYlSDaET.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-CM9WymRI.mjs";
2
2
  export {
3
3
  e as DdocEditor,
4
4
  o as DdocExportModal,
5
- d as Editor,
6
- t as PreviewDdocEditor,
5
+ t as Editor,
6
+ d as PreviewDdocEditor,
7
7
  r as buildVersionDiffSnapshot,
8
8
  i as handleContentPrint,
9
9
  n as mergeTabAwareYjsUpdates,
10
- E as useExportHeadlessEditorContent,
11
- l as useHeadlessEditor
10
+ E as sanitizeCustomCss,
11
+ m as useEditorCommands,
12
+ u as useExportHeadlessEditorContent,
13
+ C as useHeadlessEditor,
14
+ l as validateCustomCss
12
15
  };
@@ -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-DYlSDaET.mjs";
4
+ import { j as Cr } from "./index-CM9WymRI.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-BfVM4ukb.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-QQcgsp20.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 {
@@ -22,30 +22,7 @@ type PickerEntry = {
22
22
  };
23
23
  export declare const baselineFonts: PickerEntry[];
24
24
  export declare function buildPickerEntries(consumerFonts: FontDescriptor[]): PickerEntry[];
25
- export declare const FONT_SIZES: readonly [8, 9, 10, 11, 12, 14, 16, 18, 24, 30, 32, 36, 48, 60, 72, 96];
26
- export declare const getFontSizeOptions: (editor?: Editor) => {
27
- title: string;
28
- value: string;
29
- label: string;
30
- command: (editor: Editor) => void;
31
- isActive: () => boolean | undefined;
32
- }[];
33
- export declare const getCurrentFontSize: (editor: Editor | null, currentSize: string) => string;
34
- export declare const uiValueToPercentage: (uiValue: string) => string;
35
- export declare const percentageToUiValue: (percentage: string) => string;
36
- export declare const LINE_HEIGHT_OPTIONS: {
37
- value: string;
38
- label: string;
39
- uiValue: string;
40
- description: string;
41
- }[];
42
- export declare const getLineHeightOptions: () => {
43
- value: string;
44
- label: string;
45
- uiValue: string;
46
- description: string;
47
- }[];
48
- export declare const getCurrentLineHeight: (editor: Editor | null, currentLineHeight?: string) => string;
25
+ export * from '../utils/typography';
49
26
  export declare const ERR_MSG_MAP: {
50
27
  IMAGE_SIZE: string;
51
28
  };
@@ -184,4 +161,3 @@ export declare const checkActiveListsAndDBlocks: (editor: Editor) => {
184
161
  state: import('prosemirror-state').EditorState;
185
162
  hasMultipleLists: boolean;
186
163
  };
187
- export {};
@@ -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;
@@ -0,0 +1,13 @@
1
+ interface SplitViewCssAccordionProps {
2
+ /** The document's custom CSS (raw author selectors). */
3
+ customCSS?: string;
4
+ }
5
+ /**
6
+ * Split View LEFT pane: a collapsible, READ-ONLY view of the document's custom
7
+ * CSS, shown above the markdown source. Custom CSS is edited in the styling
8
+ * palette (the single source of truth), not in the markdown pane — this is a
9
+ * transparency affordance so the author can see what CSS is applied while in
10
+ * markdown mode. Renders nothing when there is no custom CSS.
11
+ */
12
+ export declare const SplitViewCssAccordion: ({ customCSS, }: SplitViewCssAccordionProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export {};
@@ -6,6 +6,8 @@ interface SplitViewMarkdownPaneProps {
6
6
  /** Same uploader the editor uses — for the markdown toolbar's Image button. */
7
7
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
8
8
  onError?: (error: string) => void;
9
+ /** Document custom CSS — shown read-only in a collapsible accordion. */
10
+ customCSS?: string;
9
11
  /** Sizing for the resizable split (flex-grow set by the draggable splitter). */
10
12
  style?: React.CSSProperties;
11
13
  }
@@ -15,5 +17,5 @@ interface SplitViewMarkdownPaneProps {
15
17
  * real ddoc editor itself — see ddoc-editor.tsx, which keeps that editor mounted
16
18
  * in place (never a second <EditorContent>) so its React node views survive.
17
19
  */
18
- export declare const SplitViewMarkdownPane: ({ markdown, onMarkdownChange, ipfsImageUploadFn, onError, style, }: SplitViewMarkdownPaneProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const SplitViewMarkdownPane: ({ markdown, onMarkdownChange, ipfsImageUploadFn, onError, customCSS, style, }: SplitViewMarkdownPaneProps) => import("react/jsx-runtime").JSX.Element;
19
21
  export {};
@@ -5,7 +5,13 @@ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
5
5
 
6
6
  export declare const turndownService: TurndownService;
7
7
  export declare const setMarkdownInlineStyles: (enabled: boolean) => void;
8
+ export declare const setResolveColorVars: (enabled: boolean) => void;
8
9
  declare module '@tiptap/core' {
10
+ interface Storage {
11
+ markdownPasteHandler: {
12
+ customCSS: string;
13
+ };
14
+ }
9
15
  interface Commands {
10
16
  uploadMarkdownFile: {
11
17
  uploadMarkdownFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, onError?: (error: string) => void) => any;
@@ -0,0 +1,20 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { UploadImageOptions } from '../utils/insert-commands';
3
+
4
+ export type EditorCommand = {
5
+ run: (arg?: string) => void;
6
+ isActive?: boolean;
7
+ isEnabled: boolean;
8
+ current?: string | null;
9
+ };
10
+ export type EditorCommandId = 'edit.undo' | 'edit.redo' | 'edit.selectAll' | 'edit.cut' | 'edit.copy' | 'edit.paste' | 'edit.pasteWithoutFormatting' | 'edit.delete' | 'edit.findReplace' | 'insert.image' | 'insert.table' | 'insert.link' | 'insert.comment' | 'insert.callout' | 'insert.quote' | 'insert.code' | 'insert.codeBlock' | 'insert.video' | 'insert.mermaid' | 'insert.plainText' | 'insert.tweet' | 'insert.soundcloud' | 'insert.divider' | 'insert.pageBreak' | 'insert.columns2' | 'insert.columns3' | 'format.bold' | 'format.italic' | 'format.underline' | 'format.strike' | 'format.superscript' | 'format.subscript' | 'format.heading' | 'format.align' | 'format.direction' | 'format.lineHeight' | 'format.fontFamily' | 'format.fontSize.increase' | 'format.fontSize.decrease' | 'format.list.bullet' | 'format.list.numbered' | 'format.list.check' | 'format.clearFormatting' | 'table.addRowAbove' | 'table.addRowBelow' | 'table.mergeCells' | 'table.deleteRow' | 'table.addColumnLeft' | 'table.addColumnRight' | 'table.deleteColumn' | 'table.toggleHeaderRow' | 'table.toggleHeaderColumn' | 'table.toggleHeaderCell' | 'table.deleteTable';
11
+ export type UseEditorCommandsOptions = UploadImageOptions;
12
+ /**
13
+ * Reactive, editor-derived command registry (architecture doc §2 bucket 1).
14
+ * INVARIANT: all isActive/current/isEnabled values are derived from the
15
+ * editor via `useEditorState` (Tiptap's useSyncExternalStore wrapper) — the
16
+ * hook holds no authoritative state of its own, so any number of instances
17
+ * stay in sync, and consumers only re-render when a derived value changes
18
+ * (deep-equality gated), not on every transaction.
19
+ */
20
+ export declare const useEditorCommands: (editor: Editor | null, options?: UseEditorCommandsOptions) => Record<EditorCommandId, EditorCommand>;
@@ -1,7 +1,12 @@
1
1
  type UseFocusModeOptions = {
2
+ /** Notify callback — fires on every toggle in both modes (existing API). */
2
3
  onFocusMode?: (isFocusMode: boolean) => void;
4
+ /** Controlled value (D6). Omit for the legacy internal-state behavior. */
5
+ isFocusMode?: boolean;
6
+ /** Controlled setter — receives the next value instead of internal mutation. */
7
+ onFocusModeChange?: (isFocusMode: boolean) => void;
3
8
  };
4
- export declare const useFocusMode: ({ onFocusMode }?: UseFocusModeOptions) => {
9
+ export declare const useFocusMode: ({ onFocusMode, isFocusMode: controlledValue, onFocusModeChange, }?: UseFocusModeOptions) => {
5
10
  isFocusMode: boolean;
6
11
  toggleFocusMode: () => Promise<void>;
7
12
  };
@@ -1,4 +1,4 @@
1
- import { Editor, JSONContent } from '@tiptap/react';
1
+ import { AnyExtension, Editor, JSONContent } from '@tiptap/react';
2
2
  import { handleMarkdownContent } from '../extensions/mardown-paste-handler';
3
3
  import { IpfsImageUploadResponse } from '../types';
4
4
 
@@ -6,6 +6,14 @@ import * as Y from 'yjs';
6
6
  export interface UseHeadlessEditorProps {
7
7
  optionalExtensions?: string[];
8
8
  }
9
+ /**
10
+ * The exact extension set the headless editor runs with. Exported so tests
11
+ * can build an equivalent editor without the hook.
12
+ */
13
+ export declare const getHeadlessExtensions: (options?: {
14
+ ydoc?: Y.Doc;
15
+ optionalExtensions?: string[];
16
+ }) => AnyExtension[];
9
17
  export declare const useHeadlessEditor: (props?: UseHeadlessEditorProps) => {
10
18
  setContent: (initialContent: string | string[] | JSONContent, editor: Editor, ydoc: Y.Doc) => void;
11
19
  getEditor: () => {
@@ -17,7 +17,6 @@ interface UseTabEditorArgs {
17
17
  initialContent: DdocProps['initialContent'];
18
18
  collaboration?: CollaborationProps;
19
19
  isReady?: boolean;
20
- isSyncing?: boolean;
21
20
  awareness?: any;
22
21
  disableInlineComment?: boolean;
23
22
  isFocusMode?: boolean;
@@ -43,8 +42,9 @@ interface UseTabEditorArgs {
43
42
  isPresentationMode?: boolean;
44
43
  onInvalidContentError?: DdocProps['onInvalidContentError'];
45
44
  ignoreCorruptedData?: boolean;
46
- onCollaboratorChange?: DdocProps['onCollaboratorChange'];
47
45
  onConnect: (connectConfig: CollabConnectionConfig) => void;
46
+ onDisconnect: () => void;
47
+ isIndexeddbSynced: boolean;
48
48
  hasCollabContentInitialised?: boolean;
49
49
  initialiseYjsIndexedDbProvider: () => Promise<void>;
50
50
  externalExtensions?: Record<string, AnyExtension>;
@@ -56,7 +56,7 @@ interface UseTabEditorArgs {
56
56
  initialCommentAnchors?: SerializedCommentAnchor[];
57
57
  dBlockRuntimeStateRef?: DBlockRuntimeStateRef;
58
58
  }
59
- export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, viewerMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setSelectedWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, tabIds, theme, editorRef, initialCommentAnchors, dBlockRuntimeStateRef, }: UseTabEditorArgs) => {
59
+ export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, viewerMode, initialContent, collaboration, isReady, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setSelectedWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onConnect, onDisconnect, isIndexeddbSynced, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, tabIds, theme, editorRef, initialCommentAnchors, dBlockRuntimeStateRef, }: UseTabEditorArgs) => {
60
60
  editor: Editor | null;
61
61
  cachedEditorEntries: import('./use-tab-editor-cache').CachedTabEditorRenderEntry[];
62
62
  ref: import('react').RefObject<HTMLDivElement>;
@@ -6,14 +6,20 @@ interface UseYjsSetupArgs {
6
6
  enableIndexeddbSync?: boolean;
7
7
  ddocId?: string;
8
8
  collaboration?: CollaborationProps;
9
+ onCollaboratorChange?: DdocProps['onCollaboratorChange'];
9
10
  onIndexedDbError?: (error: Error) => void;
10
11
  }
11
- export declare const useYjsSetup: ({ onChange, enableIndexeddbSync, ddocId, collaboration, onIndexedDbError, }: UseYjsSetupArgs) => {
12
+ export declare const useYjsSetup: ({ onChange, enableIndexeddbSync, ddocId, collaboration, onCollaboratorChange, onIndexedDbError, }: UseYjsSetupArgs) => {
12
13
  ydoc: Y.Doc;
13
14
  onConnect: (connectConfig: import('../types').CollabConnectionConfig) => void;
15
+ onDisconnect: () => void;
14
16
  isReady: boolean;
15
17
  isSyncing: boolean;
16
18
  terminateSession: () => void;
19
+ updateTitle: (args: {
20
+ encryptedTitle: string;
21
+ documentTitle: string;
22
+ }) => void;
17
23
  awareness: import('y-protocols/awareness.js').Awareness | null;
18
24
  hasCollabContentInitialised: boolean;
19
25
  isIndexeddbSynced: boolean;
@@ -44,9 +44,11 @@ export interface CommentStoreProviderProps {
44
44
  isConnected?: boolean;
45
45
  isLoading?: boolean;
46
46
  isDDocOwner?: boolean;
47
+ /** Inline comments usable — see ddoc-editor.tsx's derivation. */
48
+ isInlineCommentAvailable?: boolean;
47
49
  setUsername?: React.Dispatch<React.SetStateAction<string>>;
48
50
  }
49
- export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onDeleteReply, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, draftAnchorsRef, storeApiRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
51
+ export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onDeleteReply, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, draftAnchorsRef, storeApiRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, isInlineCommentAvailable, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
50
52
  interface CommentRefsContextType {
51
53
  commentsSectionRef: React.RefObject<HTMLDivElement>;
52
54
  replySectionRef: React.RefObject<HTMLDivElement>;
@@ -108,6 +108,10 @@ export interface CommentStoreState {
108
108
  isConnected: boolean;
109
109
  isLoading: boolean;
110
110
  isDDocOwner: boolean;
111
+ /** Inline comments usable at all (not RTC, published, not disabled) —
112
+ * synced from CommentStoreProvider's prop; drives insert.comment
113
+ * enablement in useEditorCommands. */
114
+ isInlineCommentAvailable: boolean;
111
115
  onComment: (() => void) | null;
112
116
  setCommentDrawerOpen: ((open: boolean) => void) | null;
113
117
  connectViaWallet: (() => Promise<void>) | null;
@@ -146,6 +150,7 @@ export interface CommentStoreState {
146
150
  setIsConnected: (connected: boolean) => void;
147
151
  setIsLoading: (loading: boolean) => void;
148
152
  setIsDDocOwner: (isOwner: boolean) => void;
153
+ setIsInlineCommentAvailable: (value: boolean) => void;
149
154
  setOnComment: (fn: (() => void) | null) => void;
150
155
  setCommentDrawerOpenFn: (fn: ((open: boolean) => void) | null) => void;
151
156
  setConnectViaWallet: (fn: (() => Promise<void>) | null) => void;
@@ -284,4 +289,14 @@ export interface CommentStoreState {
284
289
  export declare const createCommentStore: () => import('zustand').StoreApi<CommentStoreState>;
285
290
  export declare const CommentStoreContext: React.Context<import('zustand').StoreApi<CommentStoreState> | null>;
286
291
  export declare function useCommentStore<T>(selector: (state: CommentStoreState) => T): T;
292
+ /**
293
+ * Non-throwing variant of useCommentStore: returns undefined when no
294
+ * CommentStoreProvider is above the caller (e.g. useEditorCommands used
295
+ * outside DdocEditor). The selector's RETURN VALUE must be Object.is-stable
296
+ * for unchanged state (primitives or refs already held by the store) —
297
+ * useSyncExternalStore compares snapshots with Object.is, so a selector
298
+ * that constructs a fresh object/array per call would re-render forever.
299
+ * Selector function identity itself doesn't matter.
300
+ */
301
+ export declare function useCommentStoreOptional<T>(selector: (state: CommentStoreState) => T): T | undefined;
287
302
  export {};
@@ -9,32 +9,47 @@ export declare class SyncManager {
9
9
  private socketClient;
10
10
  private roomKey;
11
11
  private roomKeyBytes;
12
+ private encryptMirror;
13
+ private fileKeyEpoch;
14
+ private mirrorIdleTimer;
15
+ private readonly MIRROR_IDLE_MS;
12
16
  private isOwner;
17
+ private joinOnly;
13
18
  private updateQueue;
14
- private uncommittedUpdatesIdList;
15
19
  private contentTobeAppliedQueue;
16
20
  private isProcessing;
21
+ private syncId;
22
+ private floor;
23
+ private updatesSinceSnapshot;
24
+ private isAuthoringSnapshot;
25
+ private readonly SNAPSHOT_THRESHOLD;
17
26
  private flushTimer;
18
27
  private readonly FLUSH_INTERVAL_MS;
19
28
  private readonly MAX_QUEUE_SIZE;
20
29
  private _awarenessUpdateHandler;
21
30
  private ydoc;
22
- private servicesRef;
23
31
  private callbacksRef;
24
32
  private onLocalUpdate?;
25
33
  constructor(config: SyncManagerConfig, onCollabStateChange: (state: CollabState) => void);
26
34
  /** Called by useSyncManager on every render to keep refs fresh */
27
- updateRefs(services: CollabServices | undefined, callbacks: CollabCallbacks | undefined, onLocalUpdate?: (updatedDocContent: string, updateChunk: string) => void): void;
35
+ updateRefs(_services: CollabServices | undefined, callbacks: CollabCallbacks | undefined, onLocalUpdate?: (updatedDocContent: string, updateChunk: string) => void): void;
28
36
  get isConnected(): boolean;
29
37
  get isReady(): boolean;
30
38
  get awareness(): Awareness | null;
31
39
  get status(): CollabStatus;
32
40
  get collabState(): CollabState;
41
+ private beginSyncAttempt;
42
+ private isCurrentSyncAttempt;
33
43
  private send;
34
44
  private runExitActions;
35
45
  private runEntryActions;
36
46
  connect(config: CollabConnectionConfig): Promise<void>;
37
47
  disconnect(): Promise<void>;
48
+ /** Owner rename mid-session — see SocketClient.updateDocumentMeta. */
49
+ updateTitle(args: {
50
+ encryptedTitle: string;
51
+ documentTitle: string;
52
+ }): Promise<void>;
38
53
  terminateSession(): Promise<void>;
39
54
  enqueueLocalUpdate(update: Uint8Array): void;
40
55
  private flushUpdates;
@@ -43,21 +58,29 @@ export declare class SyncManager {
43
58
  * Fire-and-forget: merge all queued updates, encrypt, and emit via Socket.IO
44
59
  * without awaiting the server ACK. The server broadcasts to peers immediately
45
60
  * (before MongoDB write), so content reaches observers in near-real-time.
46
- * ACK callback handles updateId tracking and auto-commit asynchronously.
47
61
  */
48
62
  private sendUpdateBatch;
63
+ private isRevocationResponse;
64
+ private classifyRevocation;
65
+ private handleWriteRevocation;
66
+ private maybeAuthorSnapshotAfterSend;
67
+ private scheduleMirror;
68
+ private authorMirror;
69
+ buildPendingBeaconPayload(): string | null;
70
+ fireBeacon(): void;
49
71
  forceCleanup(): void;
50
72
  private handleConnectionError;
51
73
  private handleReconnection;
52
74
  private connectSocket;
53
- private syncLatestCommit;
75
+ private decodeInto;
76
+ private catchUpFloor;
77
+ private authorSnapshot;
78
+ private hydrate;
54
79
  private initializeAwareness;
55
80
  private cleanupAwareness;
56
- private commitLocalContents;
57
81
  private broadcastLocalContents;
58
82
  private processUpdateQueue;
59
83
  private processNextUpdate;
60
- private processCommit;
61
84
  private handleRemoteContentUpdate;
62
85
  private applyRemoteYjsUpdate;
63
86
  private applyQueuedRemoteContents;
@@ -0,0 +1,6 @@
1
+ export declare function advanceFloor(floor: number, pageSeqsAscending: number[]): number;
2
+ export declare function shouldAuthorSnapshot(p: {
3
+ isOwner: boolean;
4
+ updatesSinceLastSnapshot: number;
5
+ threshold: number;
6
+ }): boolean;
@@ -0,0 +1,11 @@
1
+ import { IDocCollabUsers } from '../types';
2
+
3
+ export interface AwarenessIdentity {
4
+ name: string;
5
+ color: string;
6
+ isEns: string | boolean;
7
+ }
8
+ export declare const PLACEHOLDER_COLOR = "#9CA3AF";
9
+ export declare function buildIdentityMap(states: Map<number, Record<string, unknown>>): Map<string, AwarenessIdentity>;
10
+ export declare function mergePresence(roomMembers: string[], identityBySocketId: Map<string, AwarenessIdentity>): IDocCollabUsers[];
11
+ export declare function identitySignature(roomMembers: string[], identityBySocketId: Map<string, AwarenessIdentity>): string;