dsh-mega-chat-nav 0.1.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/LICENSE +201 -0
- package/README.en.md +149 -0
- package/README.md +149 -0
- package/cordis.patch.yml +4 -0
- package/lib/client/NavOverlay.js +35 -0
- package/lib/client/NavRail.js +12 -0
- package/lib/client/QuestionNavSettingsTab.js +26 -0
- package/lib/client/QuestionNavStrip.js +555 -0
- package/lib/client/components/ConfigPanel.js +14 -0
- package/lib/client/components/DotRail.js +62 -0
- package/lib/client/components/NavOverlay.js +121 -0
- package/lib/client/components/NavRail.js +97 -0
- package/lib/client/components/RailDispatch.js +22 -0
- package/lib/client/components/RailHost.js +79 -0
- package/lib/client/components/SearchBox.js +66 -0
- package/lib/client/components/SettingsPage.js +46 -0
- package/lib/client/components/StandaloneSettings.js +16 -0
- package/lib/client/components/codex/CodexRail.js +139 -0
- package/lib/client/components/deepseek/DeepseekRail.js +264 -0
- package/lib/client/components/minimal/MinimalRail.js +135 -0
- package/lib/client/components/minimal/cards.js +32 -0
- package/lib/client/components/minimal/dot.js +11 -0
- package/lib/client/components/minimal/hint.js +30 -0
- package/lib/client/components/minimal/paging.js +5 -0
- package/lib/client/components/minimal/quick-settings.js +28 -0
- package/lib/client/components/minimal/search.js +67 -0
- package/lib/client/components/minimal/useRail.js +716 -0
- package/lib/client/components/rail/cards.js +32 -0
- package/lib/client/components/rail/hint.js +30 -0
- package/lib/client/components/rail/paging.js +5 -0
- package/lib/client/components/rail/quick-settings.js +28 -0
- package/lib/client/components/rail/search.js +76 -0
- package/lib/client/components/rail/useRail.js +845 -0
- package/lib/client/components/settings/SettingsPage.js +46 -0
- package/lib/client/components/settings/SettingsTab.js +17 -0
- package/lib/client/components/settings/StandaloneSettings.js +16 -0
- package/lib/client/components/shared/Cascade.js +26 -0
- package/lib/client/components/shared/ConfigPanel.js +27 -0
- package/lib/client/components/shared/Dot.js +8 -0
- package/lib/client/components/shared/Hint.js +5 -0
- package/lib/client/components/shared/PagingButton.js +5 -0
- package/lib/client/components/shared/RailShell.js +78 -0
- package/lib/client/components/shared/SearchBox.js +63 -0
- package/lib/client/components/shared/hooks.js +427 -0
- package/lib/client/components/shared/types.js +1 -0
- package/lib/client/config.js +1 -0
- package/lib/client/engines/jump.js +34 -0
- package/lib/client/engines/useAtBottom.js +25 -0
- package/lib/client/engines/useJump.js +40 -0
- package/lib/client/engines/useScrollSpy.js +88 -0
- package/lib/client/hooks.js +11 -0
- package/lib/client/index.js +312 -0
- package/lib/client/jump.js +255 -0
- package/lib/client/locales.js +142 -0
- package/lib/client/pure.js +61 -0
- package/lib/client/settings.js +369 -0
- package/lib/client/virtual/VirtualList.js +21 -0
- package/lib/client.js +3213 -0
- package/lib/compat.js +145 -0
- package/lib/config.js +37 -0
- package/lib/core/active-dot.js +17 -0
- package/lib/core/align.js +9 -0
- package/lib/core/config.js +37 -0
- package/lib/core/focus.js +38 -0
- package/lib/core/jump.js +98 -0
- package/lib/core/logic/active-dot.js +16 -0
- package/lib/core/logic/focus.js +34 -0
- package/lib/core/logic/jump.js +188 -0
- package/lib/core/logic/nodes.js +59 -0
- package/lib/core/model/nav-item.js +1 -0
- package/lib/core/model/turns.js +73 -0
- package/lib/core/nav-item.js +1 -0
- package/lib/core/nodes.js +57 -0
- package/lib/core/page-size.js +7 -0
- package/lib/core/question-entry.js +1 -0
- package/lib/core/time.js +23 -0
- package/lib/core/turn-dots.js +85 -0
- package/lib/core/utils/measure.js +24 -0
- package/lib/core/utils/time.js +26 -0
- package/lib/index.js +64 -0
- package/lib/nav-item.js +1 -0
- package/lib/nodes.js +59 -0
- package/lib/projection.js +126 -0
- package/lib/schema.js +26 -0
- package/lib/search.js +285 -0
- package/lib/settings.js +89 -0
- package/lib/types/client/NavOverlay.d.ts +18 -0
- package/lib/types/client/NavRail.d.ts +7 -0
- package/lib/types/client/QuestionNavSettingsTab.d.ts +16 -0
- package/lib/types/client/QuestionNavStrip.d.ts +48 -0
- package/lib/types/client/components/ConfigPanel.d.ts +14 -0
- package/lib/types/client/components/DotRail.d.ts +15 -0
- package/lib/types/client/components/NavOverlay.d.ts +30 -0
- package/lib/types/client/components/NavRail.d.ts +16 -0
- package/lib/types/client/components/RailDispatch.d.ts +8 -0
- package/lib/types/client/components/RailHost.d.ts +27 -0
- package/lib/types/client/components/SearchBox.d.ts +9 -0
- package/lib/types/client/components/SettingsPage.d.ts +9 -0
- package/lib/types/client/components/StandaloneSettings.d.ts +13 -0
- package/lib/types/client/components/codex/CodexRail.d.ts +3 -0
- package/lib/types/client/components/deepseek/DeepseekRail.d.ts +3 -0
- package/lib/types/client/components/minimal/MinimalRail.d.ts +8 -0
- package/lib/types/client/components/minimal/cards.d.ts +19 -0
- package/lib/types/client/components/minimal/dot.d.ts +14 -0
- package/lib/types/client/components/minimal/hint.d.ts +11 -0
- package/lib/types/client/components/minimal/paging.d.ts +10 -0
- package/lib/types/client/components/minimal/quick-settings.d.ts +8 -0
- package/lib/types/client/components/minimal/search.d.ts +27 -0
- package/lib/types/client/components/minimal/useRail.d.ts +90 -0
- package/lib/types/client/components/rail/cards.d.ts +19 -0
- package/lib/types/client/components/rail/hint.d.ts +11 -0
- package/lib/types/client/components/rail/paging.d.ts +10 -0
- package/lib/types/client/components/rail/quick-settings.d.ts +8 -0
- package/lib/types/client/components/rail/search.d.ts +34 -0
- package/lib/types/client/components/rail/useRail.d.ts +132 -0
- package/lib/types/client/components/settings/SettingsPage.d.ts +9 -0
- package/lib/types/client/components/settings/SettingsTab.d.ts +6 -0
- package/lib/types/client/components/settings/StandaloneSettings.d.ts +13 -0
- package/lib/types/client/components/shared/Cascade.d.ts +14 -0
- package/lib/types/client/components/shared/ConfigPanel.d.ts +8 -0
- package/lib/types/client/components/shared/Dot.d.ts +17 -0
- package/lib/types/client/components/shared/Hint.d.ts +6 -0
- package/lib/types/client/components/shared/PagingButton.d.ts +10 -0
- package/lib/types/client/components/shared/RailShell.d.ts +43 -0
- package/lib/types/client/components/shared/SearchBox.d.ts +18 -0
- package/lib/types/client/components/shared/hooks.d.ts +64 -0
- package/lib/types/client/components/shared/types.d.ts +101 -0
- package/lib/types/client/config.d.ts +9 -0
- package/lib/types/client/engines/jump.d.ts +17 -0
- package/lib/types/client/engines/useAtBottom.d.ts +1 -0
- package/lib/types/client/engines/useJump.d.ts +16 -0
- package/lib/types/client/engines/useScrollSpy.d.ts +12 -0
- package/lib/types/client/hooks.d.ts +7 -0
- package/lib/types/client/index.d.ts +31 -0
- package/lib/types/client/jump.d.ts +47 -0
- package/lib/types/client/locales.d.ts +142 -0
- package/lib/types/client/pure.d.ts +21 -0
- package/lib/types/client/settings.d.ts +173 -0
- package/lib/types/client/virtual/VirtualList.d.ts +15 -0
- package/lib/types/compat.d.ts +44 -0
- package/lib/types/config.d.ts +44 -0
- package/lib/types/core/active-dot.d.ts +15 -0
- package/lib/types/core/align.d.ts +10 -0
- package/lib/types/core/config.d.ts +44 -0
- package/lib/types/core/focus.d.ts +24 -0
- package/lib/types/core/jump.d.ts +39 -0
- package/lib/types/core/logic/active-dot.d.ts +15 -0
- package/lib/types/core/logic/focus.d.ts +22 -0
- package/lib/types/core/logic/jump.d.ts +39 -0
- package/lib/types/core/logic/nodes.d.ts +48 -0
- package/lib/types/core/model/nav-item.d.ts +12 -0
- package/lib/types/core/model/turns.d.ts +30 -0
- package/lib/types/core/nav-item.d.ts +12 -0
- package/lib/types/core/nodes.d.ts +43 -0
- package/lib/types/core/page-size.d.ts +8 -0
- package/lib/types/core/question-entry.d.ts +12 -0
- package/lib/types/core/time.d.ts +4 -0
- package/lib/types/core/turn-dots.d.ts +29 -0
- package/lib/types/core/utils/measure.d.ts +12 -0
- package/lib/types/core/utils/time.d.ts +4 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/nav-item.d.ts +12 -0
- package/lib/types/nodes.d.ts +48 -0
- package/lib/types/projection.d.ts +71 -0
- package/lib/types/schema.d.ts +37 -0
- package/lib/types/search.d.ts +42 -0
- package/lib/types/settings.d.ts +99 -0
- package/package.json +71 -0
- package/src/client/components/RailDispatch.tsx +27 -0
- package/src/client/components/codex/CodexRail.tsx +348 -0
- package/src/client/components/deepseek/DeepseekRail.tsx +522 -0
- package/src/client/components/minimal/MinimalRail.tsx +324 -0
- package/src/client/components/minimal/dot.tsx +32 -0
- package/src/client/components/rail/cards.tsx +102 -0
- package/src/client/components/rail/hint.tsx +50 -0
- package/src/client/components/rail/paging.tsx +26 -0
- package/src/client/components/rail/quick-settings.tsx +130 -0
- package/src/client/components/rail/search.tsx +147 -0
- package/src/client/components/rail/useRail.ts +906 -0
- package/src/client/components/settings/SettingsPage.tsx +198 -0
- package/src/client/components/settings/StandaloneSettings.tsx +28 -0
- package/src/client/components/shared/types.ts +99 -0
- package/src/client/index.ts +388 -0
- package/src/client/jump.ts +293 -0
- package/src/client/locales.ts +143 -0
- package/src/client/settings.ts +482 -0
- package/src/client/styles.css +1580 -0
- package/src/compat.ts +161 -0
- package/src/index.ts +66 -0
- package/src/projection.ts +174 -0
- package/src/search.ts +291 -0
- package/src/settings.ts +169 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DotProps {
|
|
2
|
+
/** 缩放(聚焦模型输出;跳转中 1.6) */
|
|
3
|
+
scale: number;
|
|
4
|
+
className: string;
|
|
5
|
+
label: string;
|
|
6
|
+
index: number;
|
|
7
|
+
keyName: string;
|
|
8
|
+
focused: boolean;
|
|
9
|
+
revealed?: {
|
|
10
|
+
dir: 1 | -1;
|
|
11
|
+
order: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const Dot: import("react").NamedExoticComponent<DotProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { RailAlign } from '../../settings.ts';
|
|
3
|
+
export interface HintProps {
|
|
4
|
+
text: string;
|
|
5
|
+
align: RailAlign;
|
|
6
|
+
/** bottom:显示在对话输入框上方(加载较早记录提示),水平对齐跟随对话区域左右边缘 */
|
|
7
|
+
position?: 'rail' | 'bottom';
|
|
8
|
+
/** 加载点动画(仅加载中提示) */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function Hint({ text, align, position, loading }: HintProps): ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PagingButtonProps {
|
|
3
|
+
dir: 1 | -1;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onEnter: () => void;
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function PagingButton(props: PagingButtonProps): ReactNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavInjected, Translate } from '../shared/types.ts';
|
|
3
|
+
export interface QuickSettingsProps {
|
|
4
|
+
injected: NavInjected;
|
|
5
|
+
t: Translate;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function QuickSettings(props: QuickSettingsProps): ReactNode;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Translate } from '../shared/types.ts';
|
|
3
|
+
export interface SearchHit {
|
|
4
|
+
key: string;
|
|
5
|
+
seq: number;
|
|
6
|
+
time: number;
|
|
7
|
+
role: string;
|
|
8
|
+
/** 命中消息所在轮次(host 由 turn/start 计数;未定位为 0) */
|
|
9
|
+
turn: number;
|
|
10
|
+
/** 命中是否来自更早历史 */
|
|
11
|
+
historic: boolean;
|
|
12
|
+
snippet: string;
|
|
13
|
+
hitStart: number;
|
|
14
|
+
hitLen: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SearchBoxProps {
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
t: Translate;
|
|
19
|
+
/** 搜索内容范围(多选;host 按此过滤) */
|
|
20
|
+
scopes: readonly string[];
|
|
21
|
+
/** 点击命中:key = 完整 DOM 锚点 key(host 按消息 kind 拼好);seq = 方向判定序号 */
|
|
22
|
+
onJump: (key: string, seq: number) => void;
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
/** 查询为空时显示的内容(如全部轮次列表);缺省显示空区域 */
|
|
25
|
+
emptyContent?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function SearchBox(props: SearchBoxProps): ReactNode;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { FocusState, NavInjected, RailMarker, SessionListLike, Translate } from '../shared/types.ts';
|
|
3
|
+
import { type BandHeight, type CardCount, type CardItem, type NavStyle, type RailAlign, type ScrollMode, type SearchScope, type ShowMode } from '../../settings.ts';
|
|
4
|
+
/** 圆点数据:会话可见性 + 标记装配(订阅集中管理,共用一条刷新管线) */
|
|
5
|
+
export declare function useMarkerData(injected: NavInjected | undefined, useSessions?: <S>(selector: (s: SessionListLike) => S) => S): {
|
|
6
|
+
sessionId: string | undefined;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
markers: RailMarker[];
|
|
9
|
+
};
|
|
10
|
+
/** 布局钉位:期望几何 → 比对 → 写入(rAF 循环,连续 3 帧稳定停车;resize/尺寸变化唤醒) */
|
|
11
|
+
export declare function usePinning(panelRef: RefObject<HTMLDivElement>, visible: boolean, align: RailAlign, offset?: number, sessionId?: string): void;
|
|
12
|
+
/** 阅读间谍:滚动/尺寸变化按 rAF 采样行位置,标记当前所在回合。
|
|
13
|
+
* 返回 [currentKey, forceKey]——forceKey 用于点击跳转瞬间强制激活目标,
|
|
14
|
+
* 滚动稳定后由采样判据接管。 */
|
|
15
|
+
export declare function useReadingSpy(visible: boolean, markers: readonly RailMarker[]): [string | null, (key: string) => void];
|
|
16
|
+
/** 条带翻页:▲/▼ 步进(固定 5 行/页)+ 溢出检测 + 入场错峰动画 */
|
|
17
|
+
export declare function useBandPaging(listRef: RefObject<HTMLDivElement>, markers: readonly RailMarker[]): {
|
|
18
|
+
scrollable: boolean;
|
|
19
|
+
revealed: ReadonlyMap<string, {
|
|
20
|
+
dir: 1 | -1;
|
|
21
|
+
order: number;
|
|
22
|
+
}> | null;
|
|
23
|
+
syncScroll: () => void;
|
|
24
|
+
pageBy: (dir: 1 | -1) => void;
|
|
25
|
+
canPageUp: boolean;
|
|
26
|
+
canPageDown: boolean;
|
|
27
|
+
};
|
|
28
|
+
export interface CardMetrics {
|
|
29
|
+
widthPx: number;
|
|
30
|
+
fontSize: number;
|
|
31
|
+
maxLines: number;
|
|
32
|
+
}
|
|
33
|
+
/** 距离 → 卡片呈现参数;聚焦窗口外返回 null */
|
|
34
|
+
export declare function cardMetrics(distance: number): CardMetrics | null;
|
|
35
|
+
/** 距离 → 聚焦档(窗口内 0..2,窗口外 null;圆点缩放层级用) */
|
|
36
|
+
export declare function markerTier(distance: number): number | null;
|
|
37
|
+
/** 距离 → 放大倍数:仅选中点放大,邻居/窗口外均为 1 */
|
|
38
|
+
export declare function markerScale(distance: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* 卡片预览:悬停标记弹出级联卡(minimal 能力,enabled=false 时整组失效——
|
|
41
|
+
* 其他风格可无卡片)。
|
|
42
|
+
*/
|
|
43
|
+
export declare function useCardPreview(markers: readonly RailMarker[], align: RailAlign, radius: number, enabled: boolean): {
|
|
44
|
+
focus: FocusState | null;
|
|
45
|
+
openCards: (marker: RailMarker, target: HTMLElement) => void;
|
|
46
|
+
cancelClear: () => void;
|
|
47
|
+
scheduleClear: () => void;
|
|
48
|
+
};
|
|
49
|
+
/** 跳转失败提示:监听 mega-chat-nav:jump-failed 事件,1.8s 后自动消退 */
|
|
50
|
+
export declare function useFailureNotice(t: Translate): string | null;
|
|
51
|
+
/** 监听跳转编排的扩窗加载状态,显示「正在加载较早记录以定位…(第 N 页)」 */
|
|
52
|
+
export declare function useLoadingNotice(t: Translate): string | null;
|
|
53
|
+
/** 设置订阅:全部配置项跟随(align/bandHeight/cardCount/显示模式/动画方式) */
|
|
54
|
+
export declare function useNavSettings(injected: NavInjected | undefined): {
|
|
55
|
+
style: NavStyle;
|
|
56
|
+
align: RailAlign;
|
|
57
|
+
bandHeight: BandHeight;
|
|
58
|
+
cardCount: CardCount;
|
|
59
|
+
cardItems: CardItem[];
|
|
60
|
+
scrollBehavior: ScrollMode;
|
|
61
|
+
showCount: ShowMode;
|
|
62
|
+
showSearch: ShowMode;
|
|
63
|
+
showQuickSettings: ShowMode;
|
|
64
|
+
showFavorites: ShowMode;
|
|
65
|
+
searchScopes: SearchScope[];
|
|
66
|
+
railOffset: number;
|
|
67
|
+
};
|
|
68
|
+
/** 相对时间:同日 HH:MM / 同年 MM-DD HH:MM / 跨年 YYYY-MM-DD HH:MM;非法输入返回空串 */
|
|
69
|
+
export declare function clockText(time: number, now: number): string;
|
|
70
|
+
/** 收藏状态:localStorage 持久化 + 切换动作(跨刷新保留) */
|
|
71
|
+
export declare function useFavorites(sessionId: string | undefined): {
|
|
72
|
+
favorites: Set<string>;
|
|
73
|
+
toggle: (key: string) => void;
|
|
74
|
+
};
|
|
75
|
+
/** 毫秒 → 人类可读时长(1分21秒 / 10秒) */
|
|
76
|
+
export declare function durationText(ms: number): string;
|
|
77
|
+
/** 完整指标行:本轮用时 1分21秒 · 首 token 10秒 · 188 tok/s */
|
|
78
|
+
export declare function metricsLine(metrics: {
|
|
79
|
+
durationMs: number;
|
|
80
|
+
firstTokenMs: number;
|
|
81
|
+
tokensPerSec: number;
|
|
82
|
+
}): string;
|
|
83
|
+
/** 手机模式:页面宽度小于 breakpoint(默认 1024px),resize 实时跟随 */
|
|
84
|
+
export declare function useMobileMode(breakpoint?: number): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* 手机模式:向对话滚动容器 [data-conversation-scroll] 头部插入零高 wrapper
|
|
87
|
+
* (width:100%; height:0; sticky top:0; overflow:visible),按钮 absolute 相对
|
|
88
|
+
* wrapper 定位——sticky 粘在滚动视口顶部,按钮不随内容滚走、不占布局空间。
|
|
89
|
+
*/
|
|
90
|
+
export declare function useMobileSearchButton(onClick: () => void, enabled: boolean, align: RailAlign, label: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RailAlign, CardItem } from '../../settings.ts';
|
|
3
|
+
import type { FocusState, RailMarker } from '../shared/types.ts';
|
|
4
|
+
export interface CardsProps {
|
|
5
|
+
focus: FocusState;
|
|
6
|
+
align: RailAlign;
|
|
7
|
+
/** 显示哪些内容块(多选配置) */
|
|
8
|
+
cardItems: readonly CardItem[];
|
|
9
|
+
/** 收藏集合 */
|
|
10
|
+
favorites: ReadonlySet<string>;
|
|
11
|
+
/** 切换收藏(按该轮首问锚点 key) */
|
|
12
|
+
onToggleFavorite: (key: string) => void;
|
|
13
|
+
onJump: (dot: RailMarker) => void;
|
|
14
|
+
/** 卡片 hover 保活(取消 rail 的清焦定时) */
|
|
15
|
+
onEnter: () => void;
|
|
16
|
+
/** 离开卡片后重新排程清焦 */
|
|
17
|
+
onLeave: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function Cards(props: CardsProps): ReactNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { RailAlign } from '../../settings.ts';
|
|
3
|
+
export interface HintProps {
|
|
4
|
+
text: string;
|
|
5
|
+
align: RailAlign;
|
|
6
|
+
/** bottom:显示在对话输入框上方(加载较早记录提示),水平对齐跟随对话区域左右边缘 */
|
|
7
|
+
position?: 'rail' | 'bottom';
|
|
8
|
+
/** 加载点动画(仅加载中提示) */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function Hint({ text, align, position, loading }: HintProps): ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PagingButtonProps {
|
|
3
|
+
dir: 1 | -1;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onEnter: () => void;
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function PagingButton(props: PagingButtonProps): ReactNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavInjected, Translate } from '../shared/types.ts';
|
|
3
|
+
export interface QuickSettingsProps {
|
|
4
|
+
injected: NavInjected;
|
|
5
|
+
t: Translate;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function QuickSettings(props: QuickSettingsProps): ReactNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Translate } from '../shared/types.ts';
|
|
3
|
+
export interface SearchHit {
|
|
4
|
+
key: string;
|
|
5
|
+
seq: number;
|
|
6
|
+
time: number;
|
|
7
|
+
role: string;
|
|
8
|
+
/** 命中消息所在轮次(host 由 turn/start 计数;未定位为 0) */
|
|
9
|
+
turn: number;
|
|
10
|
+
/** 命中是否来自更早历史 */
|
|
11
|
+
historic: boolean;
|
|
12
|
+
snippet: string;
|
|
13
|
+
hitStart: number;
|
|
14
|
+
hitLen: number;
|
|
15
|
+
}
|
|
16
|
+
export interface SearchBoxProps {
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
t: Translate;
|
|
19
|
+
/** 搜索内容范围(多选;host 按此过滤) */
|
|
20
|
+
scopes: readonly string[];
|
|
21
|
+
/** 点击命中:key = 完整 DOM 锚点 key(host 按消息 kind 拼好);seq = 方向判定序号 */
|
|
22
|
+
onJump: (key: string, seq: number) => void;
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
/** 查询为空时显示的内容(如全部轮次列表);缺省显示空区域 */
|
|
25
|
+
emptyContent?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/** 检索:携带 AbortController 的 host 请求(scopes 过滤由 host 执行) */
|
|
28
|
+
/**
|
|
29
|
+
* 检索 + 统一排序:host 按日志顺序返回,此处统一按轮次倒序(最新轮在上;
|
|
30
|
+
* 同轮按 seq 倒序——最新消息在前)。minimal/codex 浮层、deepseek 面板与移动抽屉共用,
|
|
31
|
+
* 保证三种风格与搜索抽屉的命中顺序一致。
|
|
32
|
+
*/
|
|
33
|
+
export declare function fetchHits(sessionId: string | undefined, query: string, scopes: readonly string[], signal: AbortSignal): Promise<SearchHit[]>;
|
|
34
|
+
export declare function SearchBox(props: SearchBoxProps): ReactNode;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { FocusState, NavInjected, RailMarker, SessionListLike, Translate } from '../shared/types.ts';
|
|
3
|
+
import { type BandHeight, type CardCount, type CardItem, type MarkTone, type NavStyle, type RailAlign, type ScrollMode, type SearchScope, type ShowMode } from '../../settings.ts';
|
|
4
|
+
/** 圆点数据:会话可见性 + 标记装配(订阅集中管理,共用一条刷新管线) */
|
|
5
|
+
export declare function useMarkerData(injected: NavInjected | undefined, useSessions?: <S>(selector: (s: SessionListLike) => S) => S): {
|
|
6
|
+
sessionId: string | undefined;
|
|
7
|
+
visible: boolean;
|
|
8
|
+
markers: RailMarker[];
|
|
9
|
+
};
|
|
10
|
+
/** 布局钉位:期望几何 → 比对 → 写入(rAF 循环,连续 3 帧稳定停车;resize/尺寸变化唤醒) */
|
|
11
|
+
/**
|
|
12
|
+
* 布局钉位:校准状态机(鲁棒 + 长会话低成本)。
|
|
13
|
+
*
|
|
14
|
+
* 会话/工作区切换时对话区可能整体重建、或复用同一容器异步填充——校准必须
|
|
15
|
+
* 覆盖这些路径,同时**行级消息增删绝不唤醒校准**(那会让长会话的 rAF 校准
|
|
16
|
+
* 循环停不下来,每帧 reflow 拖慢一切交互——与对话几何无关)。
|
|
17
|
+
*
|
|
18
|
+
* 状态机:
|
|
19
|
+
* - running:切换/尺寸事件后启动,每帧 calibrate 一次;
|
|
20
|
+
* changed → 重置稳定帧;stable → 连续 3 帧停车(parked);
|
|
21
|
+
* missing(对话区未出现/高度为 0)→ 不停车,继续等待重建完成。
|
|
22
|
+
* - parked:静默。唤醒条件:
|
|
23
|
+
* 1) ResizeObserver(frame / 对话区根元素尺寸变化)
|
|
24
|
+
* 2) window resize
|
|
25
|
+
* 3) MutationObserver 发现对话区根元素被移除或替换(会话/工作区切换)
|
|
26
|
+
* 4) effect 依赖变化重启(sessionId / visible / align / offset)
|
|
27
|
+
*
|
|
28
|
+
* 行级变化(追加消息、装载历史、其他插件改 body 子树)只做一次 O(1) 的
|
|
29
|
+
* isConnected 检查,不唤醒校准。
|
|
30
|
+
*/
|
|
31
|
+
export declare function usePinning(panelRef: RefObject<HTMLDivElement>, visible: boolean, align: RailAlign, offset?: number, sessionId?: string): void;
|
|
32
|
+
/** 阅读间谍:滚动/尺寸变化按 rAF 采样行位置,标记当前所在回合。
|
|
33
|
+
* 返回 [currentKey, forceKey]——forceKey 用于点击跳转瞬间强制激活目标,
|
|
34
|
+
* 滚动稳定后由采样判据接管。 */
|
|
35
|
+
export declare function useReadingSpy(visible: boolean, markers: readonly RailMarker[]): [string | null, (key: string) => void];
|
|
36
|
+
/** 行内节点几何:节点 8px + 行距 6px = 行高 14px(minimal 圆点与 codex 刻度槽一致;
|
|
37
|
+
* 与样式 .mgcn-dots gap 6px / 节点 8px、codex 槽高 14px 对齐) */
|
|
38
|
+
export declare const NODE_SIZE = 8;
|
|
39
|
+
export declare const ROW_GAP = 6;
|
|
40
|
+
export declare const ROW_HEIGHT: number;
|
|
41
|
+
export declare const ROWS_PER_PAGE = 5;
|
|
42
|
+
/** 条带翻页:▲/▼ 步进(固定 5 行/页)+ 溢出检测 + 入场错峰动画 */
|
|
43
|
+
export declare function useBandPaging(listRef: RefObject<HTMLDivElement>, markers: readonly RailMarker[]): {
|
|
44
|
+
scrollable: boolean;
|
|
45
|
+
revealed: ReadonlyMap<string, {
|
|
46
|
+
dir: 1 | -1;
|
|
47
|
+
order: number;
|
|
48
|
+
}> | null;
|
|
49
|
+
syncScroll: () => void;
|
|
50
|
+
pageBy: (dir: 1 | -1) => void;
|
|
51
|
+
canPageUp: boolean;
|
|
52
|
+
canPageDown: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 浮现态(minimal/codex 共用):进入 rail 立即显示;移出后至少停留 1s 再隐藏。
|
|
56
|
+
* peekCls 供 show=peek 模式使用(open 态不隐藏)。
|
|
57
|
+
*/
|
|
58
|
+
export declare function usePeekState(): {
|
|
59
|
+
peekVisible: boolean;
|
|
60
|
+
showPeek: () => void;
|
|
61
|
+
hidePeek: () => void;
|
|
62
|
+
peekCls: (mode: string, open: boolean) => string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* 点击浮层之外(非 .mgcn-gear-wrap)→ 关闭 config/search 浮层(minimal/codex 共用)。
|
|
66
|
+
*/
|
|
67
|
+
export declare function useClosePopoversOnOutside(configOpen: boolean, searchOpen: boolean, close: () => void): void;
|
|
68
|
+
export interface CardMetrics {
|
|
69
|
+
widthPx: number;
|
|
70
|
+
fontSize: number;
|
|
71
|
+
maxLines: number;
|
|
72
|
+
}
|
|
73
|
+
/** 距离 → 卡片呈现参数;聚焦窗口外返回 null */
|
|
74
|
+
export declare function cardMetrics(distance: number): CardMetrics | null;
|
|
75
|
+
/** 距离 → 聚焦档(窗口内 0..2,窗口外 null;圆点缩放层级用) */
|
|
76
|
+
export declare function markerTier(distance: number): number | null;
|
|
77
|
+
/** 距离 → 放大倍数:仅选中点放大,邻居/窗口外均为 1 */
|
|
78
|
+
export declare function markerScale(distance: number): number;
|
|
79
|
+
/**
|
|
80
|
+
* 卡片预览:悬停标记弹出级联卡(minimal 能力,enabled=false 时整组失效——
|
|
81
|
+
* 其他风格可无卡片)。
|
|
82
|
+
*/
|
|
83
|
+
export declare function useCardPreview(markers: readonly RailMarker[], align: RailAlign, radius: number, enabled: boolean): {
|
|
84
|
+
focus: FocusState | null;
|
|
85
|
+
openCards: (marker: RailMarker, target: HTMLElement) => void;
|
|
86
|
+
cancelClear: () => void;
|
|
87
|
+
scheduleClear: () => void;
|
|
88
|
+
};
|
|
89
|
+
/** 跳转失败提示:监听 mega-chat-nav:jump-failed 事件,1.8s 后自动消退 */
|
|
90
|
+
export declare function useFailureNotice(t: Translate): string | null;
|
|
91
|
+
/** 监听跳转编排的扩窗加载状态,显示「正在加载较早记录以定位…(第 N 页)」 */
|
|
92
|
+
export declare function useLoadingNotice(t: Translate): string | null;
|
|
93
|
+
/** 设置订阅:全部配置项跟随(align/bandHeight/cardCount/markTone/显示模式/动画方式) */
|
|
94
|
+
export declare function useNavSettings(injected: NavInjected | undefined): {
|
|
95
|
+
style: NavStyle;
|
|
96
|
+
align: RailAlign;
|
|
97
|
+
bandHeight: BandHeight;
|
|
98
|
+
cardCount: CardCount;
|
|
99
|
+
cardItems: CardItem[];
|
|
100
|
+
markTone: MarkTone;
|
|
101
|
+
scrollBehavior: ScrollMode;
|
|
102
|
+
showCount: ShowMode;
|
|
103
|
+
showSearch: ShowMode;
|
|
104
|
+
showQuickSettings: ShowMode;
|
|
105
|
+
showFavorites: ShowMode;
|
|
106
|
+
showPaging: ShowMode;
|
|
107
|
+
searchScopes: SearchScope[];
|
|
108
|
+
railOffset: number;
|
|
109
|
+
};
|
|
110
|
+
/** 相对时间:同日 HH:MM / 同年 MM-DD HH:MM / 跨年 YYYY-MM-DD HH:MM;非法输入返回空串 */
|
|
111
|
+
export declare function clockText(time: number, now: number): string;
|
|
112
|
+
/** 收藏状态:localStorage 持久化 + 切换动作(跨刷新保留) */
|
|
113
|
+
export declare function useFavorites(sessionId: string | undefined): {
|
|
114
|
+
favorites: Set<string>;
|
|
115
|
+
toggle: (key: string) => void;
|
|
116
|
+
};
|
|
117
|
+
/** 毫秒 → 人类可读时长(1分21秒 / 10秒) */
|
|
118
|
+
export declare function durationText(ms: number): string;
|
|
119
|
+
/** 完整指标行:本轮用时 1分21秒 · 首 token 10秒 · 188 tok/s */
|
|
120
|
+
export declare function metricsLine(metrics: {
|
|
121
|
+
durationMs: number;
|
|
122
|
+
firstTokenMs: number;
|
|
123
|
+
tokensPerSec: number;
|
|
124
|
+
}): string;
|
|
125
|
+
/** 手机模式:页面宽度小于 breakpoint(默认 1024px),resize 实时跟随 */
|
|
126
|
+
export declare function useMobileMode(breakpoint?: number): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 手机模式:向对话滚动容器 [data-conversation-scroll] 头部插入零高 wrapper
|
|
129
|
+
* (width:100%; height:0; sticky top:0; overflow:visible),按钮 absolute 相对
|
|
130
|
+
* wrapper 定位——sticky 粘在滚动视口顶部,按钮不随内容滚走、不占布局空间。
|
|
131
|
+
*/
|
|
132
|
+
export declare function useMobileSearchButton(onClick: () => void, enabled: boolean, align: RailAlign, label: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavInjected, Translate } from '../shared/types.ts';
|
|
3
|
+
export interface SettingsPageProps {
|
|
4
|
+
injected: NavInjected;
|
|
5
|
+
t: Translate;
|
|
6
|
+
/** 已收纳至 mega-settings 时仅显示提示(自足入口让位) */
|
|
7
|
+
hosted?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function SettingsPage(props: SettingsPageProps): ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavInjected, Translate } from '../shared/types.ts';
|
|
3
|
+
interface SlotsLike {
|
|
4
|
+
entries?(key: string): readonly unknown[];
|
|
5
|
+
subscribe?(key: string, fn: () => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface StandaloneSettingsProps {
|
|
8
|
+
injected: NavInjected;
|
|
9
|
+
slots?: SlotsLike;
|
|
10
|
+
t: Translate;
|
|
11
|
+
}
|
|
12
|
+
export declare function StandaloneSettings(props: StandaloneSettingsProps): ReactNode;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RailAlign } from '../../../core/config.ts';
|
|
3
|
+
import type { FocusState } from '../shared/types.ts';
|
|
4
|
+
import type { NavDot } from '../../../core/model/turns.ts';
|
|
5
|
+
export interface CascadeProps {
|
|
6
|
+
focus: FocusState;
|
|
7
|
+
align: RailAlign;
|
|
8
|
+
onJump: (dot: NavDot) => void;
|
|
9
|
+
/** 级联卡 hover 保活(取消 rail 的清焦定时) */
|
|
10
|
+
onEnter: () => void;
|
|
11
|
+
/** 离开级联卡后重新排程清焦 */
|
|
12
|
+
onLeave: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function Cascade(props: CascadeProps): ReactNode;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { NavInjected, Translate } from '../shared/types.ts';
|
|
3
|
+
export interface ConfigPanelProps {
|
|
4
|
+
injected: NavInjected;
|
|
5
|
+
t: Translate;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConfigPanel(props: ConfigPanelProps): ReactNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface DotProps {
|
|
3
|
+
/** 缩放(波纹模型 focusScale 输出;跳转中 1.6) */
|
|
4
|
+
scale: number;
|
|
5
|
+
className: string;
|
|
6
|
+
label: string;
|
|
7
|
+
index: number;
|
|
8
|
+
keyName: string;
|
|
9
|
+
focused: boolean;
|
|
10
|
+
revealed?: {
|
|
11
|
+
dir: 1 | -1;
|
|
12
|
+
order: number;
|
|
13
|
+
};
|
|
14
|
+
onEnter: (target: HTMLElement) => void;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function Dot(props: DotProps): ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PagingButtonProps {
|
|
3
|
+
dir: 1 | -1;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onEnter: () => void;
|
|
7
|
+
onLeave: () => void;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function PagingButton(props: PagingButtonProps): ReactNode;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import type { NavDot } from '../../../core/model/turns.ts';
|
|
3
|
+
import { useFocus } from './hooks.ts';
|
|
4
|
+
import type { NavInjected, SessionListLike, Translate } from './types.ts';
|
|
5
|
+
export interface RailShellProps {
|
|
6
|
+
injected: NavInjected | undefined;
|
|
7
|
+
useSessions?: <S>(selector: (s: SessionListLike) => S) => S;
|
|
8
|
+
t: Translate;
|
|
9
|
+
children: (state: RailShellState) => ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface RailShellState {
|
|
12
|
+
injected: NavInjected;
|
|
13
|
+
sessionId: string | undefined;
|
|
14
|
+
dots: readonly NavDot[];
|
|
15
|
+
style: 'minimal';
|
|
16
|
+
align: 'left' | 'right';
|
|
17
|
+
bandHeight: 'compact' | 'standard' | 'tall';
|
|
18
|
+
scrollBehavior: 'smooth' | 'instant';
|
|
19
|
+
showCount: 'show' | 'peek' | 'hide';
|
|
20
|
+
showSearch: 'show' | 'peek' | 'hide';
|
|
21
|
+
showQuickSettings: 'show' | 'peek' | 'hide';
|
|
22
|
+
cardCount: 1 | 3 | 5;
|
|
23
|
+
currentKey: string | null;
|
|
24
|
+
hint: string | null;
|
|
25
|
+
scrollable: boolean;
|
|
26
|
+
canPageUp: boolean;
|
|
27
|
+
canPageDown: boolean;
|
|
28
|
+
revealed: ReadonlyMap<string, {
|
|
29
|
+
dir: 1 | -1;
|
|
30
|
+
order: number;
|
|
31
|
+
}> | null;
|
|
32
|
+
jumpingKey: string | null;
|
|
33
|
+
panelRef: RefObject<HTMLDivElement>;
|
|
34
|
+
listRef: RefObject<HTMLDivElement>;
|
|
35
|
+
focus: ReturnType<typeof useFocus>['focus'];
|
|
36
|
+
openFocus: (dot: NavDot, target: HTMLElement) => void;
|
|
37
|
+
cancelClearFocus: () => void;
|
|
38
|
+
scheduleClearFocus: () => void;
|
|
39
|
+
syncScroll: () => void;
|
|
40
|
+
pageBy: (dir: 1 | -1) => void;
|
|
41
|
+
onJump: (dot: NavDot) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function RailShell(props: RailShellProps): ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Translate } from './types.ts';
|
|
3
|
+
export interface SearchHit {
|
|
4
|
+
key: string;
|
|
5
|
+
seq: number;
|
|
6
|
+
time: number;
|
|
7
|
+
role: string;
|
|
8
|
+
snippet: string;
|
|
9
|
+
hitStart: number;
|
|
10
|
+
hitLen: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SearchBoxProps {
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
t: Translate;
|
|
15
|
+
onJump: (key: string) => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function SearchBox(props: SearchBoxProps): ReactNode;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { NavDot } from '../../../core/model/turns.ts';
|
|
3
|
+
import { focusCardMetrics, focusScale, focusTier } from '../../../core/logic/focus.ts';
|
|
4
|
+
import { formatNavTime } from '../../../core/utils/time.ts';
|
|
5
|
+
import type { BandHeight, CardCount, NavStyle, RailAlign, ScrollMode, ShowMode } from '../../../core/config.ts';
|
|
6
|
+
import type { FocusState, NavInjected, SessionListLike, Translate } from './types.ts';
|
|
7
|
+
/** 会话可见性守卫:当前会话存在且非空白 */
|
|
8
|
+
export declare function useVisibleSession(useSessions?: <S>(selector: (s: SessionListLike) => S) => S): {
|
|
9
|
+
sessionId: string | undefined;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
};
|
|
12
|
+
/** 圆点列表装配:投影(全量)+ 活窗口合并;同内容复用引用(React bail out) */
|
|
13
|
+
export declare function useSessionDots(injected: NavInjected | undefined, sessionId: string | undefined, visible: boolean): NavDot[];
|
|
14
|
+
/** 会话滚动容器(钉位基准) */
|
|
15
|
+
export declare function findConvRoot(): HTMLElement | null;
|
|
16
|
+
/**
|
|
17
|
+
* 布局钉位:布局校正循环把 rail 钉到对话列(rAF 连续 3 帧稳定停车;
|
|
18
|
+
* ResizeObserver 观察 frame 与对话根;resize 唤醒)。直接写 panel.style。
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRailLayout(panelRef: RefObject<HTMLDivElement>, visible: boolean, align: RailAlign): void;
|
|
21
|
+
/**
|
|
22
|
+
* scroll-spy:标记阅读位置所在 turn(35% 视口线,core/active-dot 判据)。
|
|
23
|
+
* 仅已渲染行参与;rAF 合并 + 捕获式 scroll + ResizeObserver 跟踪 flow 重挂载。
|
|
24
|
+
*/
|
|
25
|
+
export declare function useScrollSpyDot(visible: boolean, dots: readonly NavDot[]): [string | null, (key: string) => void];
|
|
26
|
+
/** 设置订阅:align / bandHeight / scrollBehavior / 显示开关 跟随 */
|
|
27
|
+
export declare function useNavSettings(injected: NavInjected | undefined): {
|
|
28
|
+
style: NavStyle;
|
|
29
|
+
align: RailAlign;
|
|
30
|
+
bandHeight: BandHeight;
|
|
31
|
+
cardCount: CardCount;
|
|
32
|
+
scrollBehavior: ScrollMode;
|
|
33
|
+
showCount: ShowMode;
|
|
34
|
+
showSearch: ShowMode;
|
|
35
|
+
showQuickSettings: ShowMode;
|
|
36
|
+
};
|
|
37
|
+
/** 翻页模型:▲/▼ 步进 + 溢出检测 + 错峰弹出动画 */
|
|
38
|
+
export declare function usePaging(listRef: RefObject<HTMLDivElement>, dots: readonly NavDot[], align: RailAlign): {
|
|
39
|
+
scrollable: boolean;
|
|
40
|
+
scrollPos: {
|
|
41
|
+
top: number;
|
|
42
|
+
max: number;
|
|
43
|
+
};
|
|
44
|
+
revealed: ReadonlyMap<string, {
|
|
45
|
+
dir: 1 | -1;
|
|
46
|
+
order: number;
|
|
47
|
+
}> | null;
|
|
48
|
+
syncScroll: () => void;
|
|
49
|
+
pageBy: (dir: 1 | -1) => void;
|
|
50
|
+
canPageUp: boolean;
|
|
51
|
+
canPageDown: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** 悬停聚焦:选中点 + 邻居窗口 + 级联几何;240ms 清焦延迟(鼠标可移入级联卡) */
|
|
54
|
+
export declare function useFocus(dots: readonly NavDot[], align: RailAlign, radius?: number): {
|
|
55
|
+
focus: FocusState | null;
|
|
56
|
+
openFocus: (dot: NavDot, target: HTMLElement) => void;
|
|
57
|
+
cancelClearFocus: () => void;
|
|
58
|
+
scheduleClearFocus: () => void;
|
|
59
|
+
};
|
|
60
|
+
/** 跳转失败提示:监听 mega-chat-nav:jump-failed 事件 */
|
|
61
|
+
export declare function useJumpHint(t: Translate): {
|
|
62
|
+
hint: string | null;
|
|
63
|
+
};
|
|
64
|
+
export { formatNavTime, focusCardMetrics, focusScale, focusTier };
|