@fileverse-dev/ddoc 3.0.92 → 3.0.93-bug-fix-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.
@@ -2,7 +2,6 @@ import { Editor } from '@tiptap/react';
2
2
  import { BubbleMenuProps } from '@tiptap/react/menus';
3
3
  import { SetStateAction } from 'react';
4
4
  import { InlineCommentData, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
5
- import { Reminder } from '../../extensions/reminder-block/types';
6
5
 
7
6
  export interface BubbleMenuItem {
8
7
  name: string;
@@ -31,9 +30,6 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
31
30
  file: File;
32
31
  }>;
33
32
  fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
34
- onReminderCreate?: (reminder: Reminder, type: string) => void;
35
- isConnected?: boolean;
36
- isCollabDocOwner?: boolean;
37
33
  enableCollaboration?: boolean;
38
34
  };
39
35
  export interface NodeSelectorProps {
@@ -0,0 +1,7 @@
1
+ export type EditorChangeSource = 'editor' | 'indexeddb-rehydration';
2
+ export interface EditorChangeMetadata {
3
+ source: EditorChangeSource;
4
+ shouldCreateDoc: boolean;
5
+ }
6
+ export declare const EDITOR_CONTENT_CHANGE: EditorChangeMetadata;
7
+ export declare const INDEXEDDB_REHYDRATION_CHANGE: EditorChangeMetadata;
@@ -1,7 +1,7 @@
1
1
  import { CommandProps } from './types';
2
2
  import { IpfsImageUploadResponse } from '../../types';
3
3
 
4
- export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsImageUploadFn, editor, enableCollaboration, disableInlineComment, }: {
4
+ export declare const getSuggestionItems: ({ query, onError, ipfsImageUploadFn, editor, }: {
5
5
  query: string;
6
6
  onError?: (errorString: string) => void;
7
7
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
@@ -25,13 +25,5 @@ export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsIma
25
25
  image: string;
26
26
  command: ({ editor, range }: CommandProps) => void;
27
27
  isDisabled?: undefined;
28
- } | {
29
- title: string;
30
- description: string;
31
- searchTerms: string[];
32
- icon: import("react/jsx-runtime").JSX.Element;
33
- image: string;
34
- isDisabled: boolean | undefined;
35
- command: ({ editor, range }: CommandProps) => true | undefined;
36
28
  })[];
37
29
  export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
@@ -1,6 +1,7 @@
1
1
  import { Editor } from '@tiptap/react';
2
2
  import { DdocProps } from '../types';
3
3
  import { Tab } from '../components/tabs/utils/tab-utils';
4
+ import { EditorChangeMetadata } from '../editor-change-metadata';
4
5
  import * as Y from 'yjs';
5
6
  interface UseTabManagerArgs {
6
7
  ydoc: Y.Doc;
@@ -12,7 +13,7 @@ interface UseTabManagerArgs {
12
13
  defaultTabId?: string;
13
14
  onVersionHistoryActiveTabChange?: (tabId: string | null) => void;
14
15
  getEditor?: () => Editor | null;
15
- flushPendingUpdate?: () => void;
16
+ flushPendingUpdate?: (changeMeta?: EditorChangeMetadata) => void;
16
17
  }
17
18
  export declare const getNewTabId: () => string;
18
19
  export declare const useTabManager: ({ ydoc, initialContent, enableCollaboration, isDDocOwner, createDefaultTabIfMissing, shouldSyncActiveTab, defaultTabId, onVersionHistoryActiveTabChange, flushPendingUpdate, getEditor, }: UseTabManagerArgs) => {
@@ -1,8 +1,9 @@
1
1
  import { JSONContent } from '@tiptap/react';
2
2
  import { CollaborationProps } from '../sync-local/types';
3
+ import { EditorChangeMetadata } from '../editor-change-metadata';
3
4
  import * as Y from 'yjs';
4
5
  interface UseYjsSetupArgs {
5
- onChange?: (updatedDocContent: string | JSONContent, updateChunk: string) => void;
6
+ onChange?: (updatedDocContent: string | JSONContent, updateChunk: string, meta?: EditorChangeMetadata) => void;
6
7
  enableIndexeddbSync?: boolean;
7
8
  ddocId?: string;
8
9
  collaboration?: CollaborationProps;
@@ -18,7 +19,7 @@ export declare const useYjsSetup: ({ onChange, enableIndexeddbSync, ddocId, coll
18
19
  hasCollabContentInitialised: boolean;
19
20
  initialiseYjsIndexedDbProvider: () => Promise<void>;
20
21
  refreshYjsIndexedDbProvider: () => Promise<void>;
21
- flushPendingUpdate: () => void;
22
+ flushPendingUpdate: (changeMeta?: EditorChangeMetadata) => void;
22
23
  collabState: import('../types').CollabState;
23
24
  };
24
25
  export {};
@@ -26,7 +26,7 @@ export declare const useDdocEditor: ({ isPreviewMode, initialContent, versionHis
26
26
  isSyncing: boolean;
27
27
  hasCollabContentInitialised: boolean;
28
28
  initialiseYjsIndexedDbProvider: () => Promise<void>;
29
- flushPendingUpdate: () => void;
29
+ flushPendingUpdate: (changeMeta?: import('./editor-change-metadata').EditorChangeMetadata) => void;
30
30
  collabState: import('./types').CollabState;
31
31
  editor: Editor | null;
32
32
  ref: import('react').RefObject<HTMLDivElement>;