@fileverse-dev/ddoc 3.0.80 → 3.0.82-focus-mode-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.d.ts +3 -0
- package/dist/index.es.js +22366 -21911
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/fullscreen-toolbar.d.ts +14 -0
- package/dist/package/components/tabs/utils/tab-utils.d.ts +33 -9
- package/dist/package/components/tabs/utils/version-diff-snapshot.d.ts +16 -0
- package/dist/package/constants/canvas-dimensions.d.ts +12 -12
- package/dist/package/constants/zoom.d.ts +4 -0
- package/dist/package/context/editor-context.d.ts +2 -0
- package/dist/package/hooks/use-fullscreen-mode.d.ts +8 -0
- package/dist/package/types.d.ts +1 -0
- package/dist/package/utils/get-editor-scroll-container.d.ts +5 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
|
4
4
|
import { Tab } from './tabs/utils/tab-utils';
|
|
5
5
|
|
|
6
6
|
import * as Y from 'yjs';
|
|
7
|
-
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, }: {
|
|
7
|
+
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, }: {
|
|
8
8
|
editor: Editor | null;
|
|
9
9
|
onError?: (errorString: string) => void;
|
|
10
10
|
zoomLevel: string;
|
|
@@ -27,6 +27,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
|
|
|
27
27
|
isConnected?: boolean;
|
|
28
28
|
tabs: Tab[];
|
|
29
29
|
ydoc: Y.Doc;
|
|
30
|
+
toggleFocusMode?: () => void;
|
|
30
31
|
onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
|
|
31
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
33
|
export default TiptapToolBar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { DdocProps } from '../types';
|
|
3
|
+
|
|
4
|
+
type FullScreenToolbarProps = {
|
|
5
|
+
dropdownOpen: boolean;
|
|
6
|
+
setDropdownOpen: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
zoomLevel: DdocProps['zoomLevel'];
|
|
8
|
+
setZoomLevel: DdocProps['setZoomLevel'];
|
|
9
|
+
showTOC: DdocProps['showTOC'];
|
|
10
|
+
setShowTOC: DdocProps['setShowTOC'];
|
|
11
|
+
toggleFocusMode: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export declare const FullScreenToolbar: ({ dropdownOpen, setDropdownOpen, zoomLevel, setZoomLevel, showTOC, setShowTOC, toggleFocusMode, }: FullScreenToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -4,18 +4,42 @@ export interface Tab {
|
|
|
4
4
|
name: string;
|
|
5
5
|
emoji: string | null;
|
|
6
6
|
}
|
|
7
|
+
export interface TabsYdocNodes {
|
|
8
|
+
order: Y.Array<string>;
|
|
9
|
+
nameById: Y.Map<string>;
|
|
10
|
+
emojiById: Y.Map<string | null>;
|
|
11
|
+
tabState: Y.Map<unknown>;
|
|
12
|
+
deletedById: Y.Map<boolean>;
|
|
13
|
+
}
|
|
14
|
+
export interface SyncedTabsYdocNodes extends TabsYdocNodes {
|
|
15
|
+
didWrite: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface TabSyncOptions {
|
|
18
|
+
createDefaultTabIfMissing?: boolean;
|
|
19
|
+
}
|
|
7
20
|
export declare const DEFAULT_TAB_ID = "default";
|
|
8
21
|
export declare const DEFAULT_TAB_NAME = "Tab 1";
|
|
9
|
-
export declare
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
export declare const LEGACY_ROOT_KEY = "ddocTabs";
|
|
23
|
+
export declare const ORDER_ROOT_KEY = "tabs_order";
|
|
24
|
+
export declare const NAME_ROOT_KEY = "tabs_name_registry";
|
|
25
|
+
export declare const EMOJI_ROOT_KEY = "tabs_emoji_registry";
|
|
26
|
+
export declare const STATE_ROOT_KEY = "tabs_state";
|
|
27
|
+
export declare const DELETED_ROOT_KEY = "tabs_delete_registry";
|
|
28
|
+
export declare const ACTIVE_TAB_STATE_KEY = "activeTabId";
|
|
29
|
+
export declare function syncTabState(doc: Y.Doc, options?: TabSyncOptions, transactionOrigin?: unknown): boolean;
|
|
30
|
+
export declare function deriveTabsFromEncodedState(yjsEncodedState: string | string[] | null | undefined, doc: Y.Doc, options?: TabSyncOptions): {
|
|
12
31
|
tabList: Tab[];
|
|
13
32
|
activeTabId: string;
|
|
33
|
+
didWrite: boolean;
|
|
14
34
|
};
|
|
15
|
-
export declare function getTabsYdocNodes(doc: Y.Doc):
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
35
|
+
export declare function getTabsYdocNodes(doc: Y.Doc): TabsYdocNodes;
|
|
36
|
+
export declare function syncTabStateAndGetNodes(doc: Y.Doc, options?: TabSyncOptions, transactionOrigin?: unknown): SyncedTabsYdocNodes;
|
|
37
|
+
export declare function mergeTabAwareYjsUpdates(encodedUpdates: string[], options?: TabSyncOptions): string;
|
|
38
|
+
export declare function getActiveTabIdFromNodes(tabNodes: Pick<TabsYdocNodes, 'tabState'>): string | null;
|
|
39
|
+
export declare function getTabMetadata(tabNodes: Pick<TabsYdocNodes, 'nameById' | 'emojiById'>, tabId: string): {
|
|
40
|
+
name: string;
|
|
41
|
+
emoji: string | null;
|
|
42
|
+
} | null;
|
|
43
|
+
export declare function getTabListFromNodes(tabNodes: Pick<TabsYdocNodes, 'order' | 'nameById' | 'emojiById'>): Tab[];
|
|
21
44
|
export declare function cloneFragmentContent(fragment: Y.XmlFragment): (Y.XmlElement | Y.XmlText)[];
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
type TabSummary = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
export type VersionTabSnapshot = {
|
|
8
|
+
hasTabState: boolean;
|
|
9
|
+
tabs: TabSummary[];
|
|
10
|
+
activeTabId: string | null;
|
|
11
|
+
defaultTabId: string;
|
|
12
|
+
docDefault: JSONContent | null;
|
|
13
|
+
docByTabId: Record<string, JSONContent | null>;
|
|
14
|
+
};
|
|
15
|
+
export declare function buildVersionDiffSnapshot(content: string): VersionTabSnapshot;
|
|
16
|
+
export {};
|
|
@@ -40,16 +40,16 @@ export declare const CANVAS_DIMENSIONS: {
|
|
|
40
40
|
readonly minHeight: "100%";
|
|
41
41
|
};
|
|
42
42
|
readonly '1.4': {
|
|
43
|
-
readonly width:
|
|
44
|
-
readonly minHeight: "
|
|
43
|
+
readonly width: 1190;
|
|
44
|
+
readonly minHeight: "140%";
|
|
45
45
|
};
|
|
46
46
|
readonly '1.5': {
|
|
47
|
-
readonly width:
|
|
48
|
-
readonly minHeight: "
|
|
47
|
+
readonly width: 1275;
|
|
48
|
+
readonly minHeight: "150%";
|
|
49
49
|
};
|
|
50
50
|
readonly '2': {
|
|
51
|
-
readonly width:
|
|
52
|
-
readonly minHeight:
|
|
51
|
+
readonly width: 1700;
|
|
52
|
+
readonly minHeight: "200%";
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
readonly landscape: {
|
|
@@ -66,16 +66,16 @@ export declare const CANVAS_DIMENSIONS: {
|
|
|
66
66
|
readonly minHeight: "100%";
|
|
67
67
|
};
|
|
68
68
|
readonly '1.4': {
|
|
69
|
-
readonly width:
|
|
70
|
-
readonly minHeight: "
|
|
69
|
+
readonly width: 1666;
|
|
70
|
+
readonly minHeight: "140%";
|
|
71
71
|
};
|
|
72
72
|
readonly '1.5': {
|
|
73
|
-
readonly width:
|
|
74
|
-
readonly minHeight: "
|
|
73
|
+
readonly width: 1785;
|
|
74
|
+
readonly minHeight: "150%";
|
|
75
75
|
};
|
|
76
76
|
readonly '2': {
|
|
77
|
-
readonly width:
|
|
78
|
-
readonly minHeight:
|
|
77
|
+
readonly width: 2380;
|
|
78
|
+
readonly minHeight: "200%";
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
};
|
|
@@ -4,6 +4,7 @@ import { DocumentStyling } from '../types';
|
|
|
4
4
|
interface EditorContextType {
|
|
5
5
|
documentStyling?: DocumentStyling;
|
|
6
6
|
theme: 'light' | 'dark';
|
|
7
|
+
isFocusMode: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const EditorContext: React.Context<EditorContextType | null>;
|
|
9
10
|
export declare const useEditorContext: () => EditorContextType;
|
|
@@ -11,5 +12,6 @@ export declare const EditorProvider: React.FC<{
|
|
|
11
12
|
children: ReactNode;
|
|
12
13
|
documentStyling?: DocumentStyling;
|
|
13
14
|
theme?: 'light' | 'dark';
|
|
15
|
+
isFocusMode?: boolean;
|
|
14
16
|
}>;
|
|
15
17
|
export {};
|
package/dist/package/types.d.ts
CHANGED
|
@@ -158,6 +158,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
158
158
|
setIsPresentationMode?: React.Dispatch<SetStateAction<boolean>>;
|
|
159
159
|
onComment?: () => void;
|
|
160
160
|
onInlineComment?: () => void;
|
|
161
|
+
onFocusMode?: (isFocusMode: boolean) => void;
|
|
161
162
|
onMarkdownExport?: () => void;
|
|
162
163
|
onMarkdownImport?: () => void;
|
|
163
164
|
onPdfExport?: () => void;
|