@fileverse-dev/ddoc 3.0.92-remove-reminders-1 → 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.
@@ -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,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>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.92-remove-reminders-1",
5
+ "version": "3.0.93-bug-fix-1",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {