@fileverse-dev/ddoc 4.8.0 → 4.8.2
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/headless-editor-utils.es.js +1 -1
- package/dist/{index-CFbL1TQf.mjs → index-SyVp89z7.mjs} +1 -1
- package/dist/index.es.js +4211 -4045
- package/dist/{markdown-source-pane-BHRwzDv3.mjs → markdown-source-pane-zl8gaBEG.mjs} +1 -1
- package/dist/package/hooks/use-tab-position-memory.d.ts +14 -0
- package/dist/package/utils/tab-position-memory.d.ts +33 -0
- package/dist/{split-view-toolbar-7KuHcrDp.mjs → split-view-toolbar-C7u41qZI.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-headless-editor-CFBrkR9Q.mjs → use-headless-editor-YGYoTi3o.mjs} +11 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ var Wr = (t, e, O) => e in t ? Vr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var gt = (t, e, O) => Wr(t, typeof e != "symbol" ? e + "" : e, O);
|
|
4
4
|
import { jsx as Cr } from "react/jsx-runtime";
|
|
5
5
|
import { useRef as pe, useEffect as St } from "react";
|
|
6
|
-
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-
|
|
6
|
+
import { s as y, A as pO, T as dO, a as Gr, S as et, b as Lr, P as fO, E as j, i as QO, c as _, D as le, k as tt, F as Ar, M as Pt, W as Er, R as Ur, d as mO, N as oe, e as V, f as Mr, g as Ot, h as ce, p as $O, j as Y, t as h, l as Ir, I as rt, L as at, m as ye, n as ue, o as Qe, q as gO, r as te, u as SO, v as Br, w as Nr, x as PO, y as kO, z as Dr, B as Fr, C as Kr, G as Oe, H as ZO, J as Jr, K as kt, O as Hr, Q as ea, U as ta, V as Oa, X as ra, Y as aa, Z as ia, _ as sa, $ as na, a0 as la, a1 as oa, a2 as ca } from "./index-SyVp89z7.mjs";
|
|
7
7
|
class ua {
|
|
8
8
|
/**
|
|
9
9
|
Create a new completion context. (Mostly useful for testing
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
|
|
3
|
+
export interface UseTabPositionMemoryArgs {
|
|
4
|
+
editor: Editor | null;
|
|
5
|
+
activeTabId: string;
|
|
6
|
+
ddocId?: string;
|
|
7
|
+
setActiveTabId: (id: string) => void;
|
|
8
|
+
isContentLoading: boolean;
|
|
9
|
+
isNativeMobile: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const useTabPositionMemory: ({ editor, activeTabId, ddocId, setActiveTabId, isContentLoading, isNativeMobile, disabled, }: UseTabPositionMemoryArgs) => {
|
|
13
|
+
switchTab: (nextTabId: string) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
import type * as Y from 'yjs';
|
|
4
|
+
export interface TabCursorPosition {
|
|
5
|
+
relAnchor: Y.RelativePosition | null;
|
|
6
|
+
relHead: Y.RelativePosition | null;
|
|
7
|
+
absAnchor: number;
|
|
8
|
+
absHead: number;
|
|
9
|
+
docGuid: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface TabPositionEntry {
|
|
12
|
+
cursor?: TabCursorPosition;
|
|
13
|
+
scrollTop?: number;
|
|
14
|
+
interacted: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const getTabPositionKey: (ddocId: string | undefined, tabId: string) => string;
|
|
17
|
+
export declare const markTabInteracted: (key: string) => void;
|
|
18
|
+
export declare const hasTabInteraction: (key: string) => boolean;
|
|
19
|
+
export declare const recordTabCursor: (key: string, cursor: TabCursorPosition) => boolean;
|
|
20
|
+
export declare const recordTabScrollFallback: (key: string, scrollTop: number) => void;
|
|
21
|
+
export declare const getTabPosition: (key: string) => TabPositionEntry | undefined;
|
|
22
|
+
export declare const clearTabPositionStore: () => void;
|
|
23
|
+
export declare const captureCursorPosition: (editor: Editor) => TabCursorPosition | null;
|
|
24
|
+
export declare const resolveCursorPosition: (editor: Editor, cursor: TabCursorPosition) => {
|
|
25
|
+
anchor: number;
|
|
26
|
+
head: number;
|
|
27
|
+
} | null;
|
|
28
|
+
export declare const computeCenteredScrollTop: ({ caretTop, containerTop, containerClientHeight, currentScrollTop, }: {
|
|
29
|
+
caretTop: number;
|
|
30
|
+
containerTop: number;
|
|
31
|
+
containerClientHeight: number;
|
|
32
|
+
currentScrollTop: number;
|
|
33
|
+
}) => number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as m, jsxs as L } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as D, useState as E, useEffect as A } from "react";
|
|
3
3
|
import { DynamicDropdown as P, Tooltip as O, IconButton as T } from "@fileverse/ui";
|
|
4
|
-
import { a3 as _, a4 as w, c as R } from "./index-
|
|
4
|
+
import { a3 as _, a4 as w, c as R } from "./index-SyVp89z7.mjs";
|
|
5
5
|
const p = (e, n, o = n) => {
|
|
6
6
|
const { state: i } = e, l = i.changeByRange((t) => {
|
|
7
7
|
const d = i.sliceDoc(t.from, t.to), r = i.sliceDoc(
|