@fileverse-dev/ddoc 3.0.80 → 3.0.82
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.
|
@@ -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 {};
|