@fileverse-dev/ddoc 3.0.97-patch.1 → 3.0.97-sepia-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.es.js +6162 -6263
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
- package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
- package/dist/package/context/editor-context.d.ts +3 -3
- package/dist/package/hooks/use-tab-editor.d.ts +3 -3
- package/dist/package/sync-local/SyncManager.d.ts +0 -12
- package/dist/package/types.d.ts +4 -1
- package/dist/package/utils/colors.d.ts +3 -1
- package/dist/package/utils/document-styling.d.ts +3 -3
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { IpfsImageFetchPayload, DdocProps } from '../../types';
|
|
2
|
+
import { IpfsImageFetchPayload, DdocProps, ThemeKey } from '../../types';
|
|
3
3
|
|
|
4
4
|
interface PresentationModeProps {
|
|
5
5
|
editor: Editor;
|
|
@@ -22,7 +22,7 @@ interface PresentationModeProps {
|
|
|
22
22
|
}>;
|
|
23
23
|
documentStyling?: DdocProps['documentStyling'];
|
|
24
24
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
25
|
-
theme?:
|
|
25
|
+
theme?: ThemeKey;
|
|
26
26
|
}
|
|
27
27
|
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, ipfsImageFetchFn, documentStyling, fetchV1ImageFn, theme, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DdocProps } from '../../types';
|
|
1
|
+
import { DdocProps, ThemeKey } from '../../types';
|
|
2
2
|
|
|
3
3
|
interface PreviewPanelProps {
|
|
4
4
|
slides: string[];
|
|
5
5
|
currentSlide: number;
|
|
6
6
|
setCurrentSlide: (index: number) => void;
|
|
7
7
|
documentStyling?: DdocProps['documentStyling'];
|
|
8
|
-
theme?:
|
|
8
|
+
theme?: ThemeKey;
|
|
9
9
|
}
|
|
10
10
|
export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, documentStyling, theme, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { DocumentStyling } from '../types';
|
|
2
|
+
import { DocumentStyling, ThemeKey } from '../types';
|
|
3
3
|
|
|
4
4
|
interface EditorContextType {
|
|
5
5
|
documentStyling?: DocumentStyling;
|
|
6
|
-
theme:
|
|
6
|
+
theme: ThemeKey;
|
|
7
7
|
isFocusMode: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const EditorContext: React.Context<EditorContextType | null>;
|
|
@@ -11,7 +11,7 @@ export declare const useEditorContext: () => EditorContextType;
|
|
|
11
11
|
export declare const EditorProvider: React.FC<{
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
documentStyling?: DocumentStyling;
|
|
14
|
-
theme?:
|
|
14
|
+
theme?: ThemeKey;
|
|
15
15
|
isFocusMode?: boolean;
|
|
16
16
|
}>;
|
|
17
17
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
-
import { DdocProps } from '../types';
|
|
2
|
+
import { DdocProps, ThemeKey } from '../types';
|
|
3
3
|
import { AnyExtension, Editor } from '@tiptap/react';
|
|
4
4
|
import { ToCItemType } from '../components/toc/types';
|
|
5
5
|
import { CollabConnectionConfig, CollaborationProps } from '../sync-local/types';
|
|
@@ -45,10 +45,10 @@ interface UseTabEditorArgs {
|
|
|
45
45
|
externalExtensions?: Record<string, AnyExtension>;
|
|
46
46
|
isContentLoading?: boolean;
|
|
47
47
|
activeTabId: string;
|
|
48
|
-
theme?:
|
|
48
|
+
theme?: ThemeKey;
|
|
49
49
|
editorRef?: MutableRefObject<Editor | null>;
|
|
50
50
|
}
|
|
51
|
-
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect,
|
|
51
|
+
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, }: UseTabEditorArgs) => {
|
|
52
52
|
editor: Editor | null;
|
|
53
53
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
54
54
|
slides: string[];
|
|
@@ -14,9 +14,6 @@ export declare class SyncManager {
|
|
|
14
14
|
private uncommittedUpdatesIdList;
|
|
15
15
|
private contentTobeAppliedQueue;
|
|
16
16
|
private isProcessing;
|
|
17
|
-
private flushTimer;
|
|
18
|
-
private readonly FLUSH_INTERVAL_MS;
|
|
19
|
-
private readonly MAX_QUEUE_SIZE;
|
|
20
17
|
private _awarenessUpdateHandler;
|
|
21
18
|
private ydoc;
|
|
22
19
|
private servicesRef;
|
|
@@ -37,15 +34,6 @@ export declare class SyncManager {
|
|
|
37
34
|
disconnect(): Promise<void>;
|
|
38
35
|
terminateSession(): Promise<void>;
|
|
39
36
|
enqueueLocalUpdate(update: Uint8Array): void;
|
|
40
|
-
private flushUpdates;
|
|
41
|
-
private awaitFlush;
|
|
42
|
-
/**
|
|
43
|
-
* Fire-and-forget: merge all queued updates, encrypt, and emit via Socket.IO
|
|
44
|
-
* without awaiting the server ACK. The server broadcasts to peers immediately
|
|
45
|
-
* (before MongoDB write), so content reaches observers in near-real-time.
|
|
46
|
-
* ACK callback handles updateId tracking and auto-commit asynchronously.
|
|
47
|
-
*/
|
|
48
|
-
private sendUpdateBatch;
|
|
49
37
|
forceCleanup(): void;
|
|
50
38
|
private handleConnectionError;
|
|
51
39
|
private handleReconnection;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -40,9 +40,12 @@ export interface CustomModel {
|
|
|
40
40
|
apiKey: string;
|
|
41
41
|
systemPrompt: string;
|
|
42
42
|
}
|
|
43
|
+
export type ThemeKey = 'light' | 'dark' | 'theme-sepia';
|
|
43
44
|
export interface ThemeVariantValue {
|
|
44
45
|
light: string;
|
|
45
46
|
dark: string;
|
|
47
|
+
sepia?: string;
|
|
48
|
+
[key: string]: string | undefined;
|
|
46
49
|
}
|
|
47
50
|
export type DocumentStylingValue = string | ThemeVariantValue;
|
|
48
51
|
/**
|
|
@@ -119,7 +122,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
119
122
|
setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
|
|
120
123
|
inlineCommentData?: InlineCommentData;
|
|
121
124
|
setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
|
|
122
|
-
theme?:
|
|
125
|
+
theme?: ThemeKey;
|
|
123
126
|
zoomLevel: string;
|
|
124
127
|
setZoomLevel: React.Dispatch<SetStateAction<string>>;
|
|
125
128
|
isNavbarVisible: boolean;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ThemeKey } from '../types';
|
|
2
|
+
|
|
1
3
|
export declare const colors: {
|
|
2
4
|
color: string;
|
|
3
5
|
code: string;
|
|
@@ -7,4 +9,4 @@ export declare const textColors: {
|
|
|
7
9
|
light: string;
|
|
8
10
|
dark: string;
|
|
9
11
|
}[];
|
|
10
|
-
export declare const getResponsiveColor: (color?: string, theme?:
|
|
12
|
+
export declare const getResponsiveColor: (color?: string, theme?: ThemeKey) => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentStylingValue, ThemeVariantValue } from '../types';
|
|
1
|
+
import { DocumentStylingValue, ThemeKey, ThemeVariantValue } from '../types';
|
|
2
2
|
|
|
3
3
|
export declare const isThemeVariantValue: (value: DocumentStylingValue | undefined) => value is ThemeVariantValue;
|
|
4
|
-
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?:
|
|
5
|
-
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?:
|
|
4
|
+
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
|
|
5
|
+
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?: ThemeKey) => string | undefined;
|