@linker-design-plus/timeline-track 2.0.13 → 2.0.15
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/README.md +4 -0
- package/dist/components/panel/ClipConfigPanel.d.ts +0 -2
- package/dist/components/panel/ClipConfigPanelRenderer.d.ts +1 -0
- package/dist/core/controllers/previewBackend.d.ts +5 -0
- package/dist/core/controllers/previewPendingOverlayRenderer.d.ts +1 -0
- package/dist/core/controllers/timelineClipEventController.d.ts +1 -0
- package/dist/core/controllers/timelineKeyboardShortcutsController.d.ts +6 -0
- package/dist/core/controllers/timelinePreviewSession.d.ts +25 -1
- package/dist/core/facade/timelineManager.d.ts +57 -1
- package/dist/core/history/timelineHistoryRecorder.d.ts +1 -0
- package/dist/core/models/types.d.ts +5 -10
- package/dist/index.cjs.js +87 -89
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4794 -3548
- package/dist/utils/diagnostics/DiagnosticsCenter.d.ts +47 -0
- package/dist/utils/diagnostics/DiagnosticsPanel.d.ts +13 -0
- package/dist/utils/diagnostics/devConsole.d.ts +8 -0
- package/dist/utils/diagnostics/index.d.ts +4 -0
- package/dist/utils/diagnostics/types.d.ts +173 -0
- package/dist/utils/mediaElement.d.ts +1 -0
- package/package.json +1 -1
- package/dist/utils/logging/Logger.d.ts +0 -30
- package/dist/utils/logging/PreviewLoadTraceStore.d.ts +0 -37
- package/dist/utils/logging/index.d.ts +0 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { DiagnosticEmitInput, DiagnosticEvent, DiagnosticExportPackage, DiagnosticLiveSnapshot, DiagnosticsConfig, DiagnosticsListener, DiagnosticsLiveListener, DiagnosticRuntimeState, DiagnosticSessionMetadata, DiagnosticSessionSnapshot } from './types';
|
|
2
|
+
export declare class DiagnosticsCenter {
|
|
3
|
+
private readonly config;
|
|
4
|
+
private readonly listeners;
|
|
5
|
+
private readonly liveListeners;
|
|
6
|
+
private state;
|
|
7
|
+
private currentSessionId;
|
|
8
|
+
private latestFailureWindow;
|
|
9
|
+
private activeFailureCapture;
|
|
10
|
+
private notifyTimeoutId;
|
|
11
|
+
private persistTimeoutId;
|
|
12
|
+
constructor(config?: DiagnosticsConfig);
|
|
13
|
+
startSession(metadata?: DiagnosticSessionMetadata | null): DiagnosticSessionSnapshot;
|
|
14
|
+
getCurrentSessionId(): string | null;
|
|
15
|
+
emit(input: DiagnosticEmitInput): DiagnosticEvent | null;
|
|
16
|
+
subscribe(listener: DiagnosticsListener): () => void;
|
|
17
|
+
subscribeLive(listener: DiagnosticsLiveListener, recentEventLimit?: number): () => void;
|
|
18
|
+
getSnapshot(sessionId?: string | null): DiagnosticSessionSnapshot;
|
|
19
|
+
getLiveSnapshot(sessionId?: string | null, recentEventLimit?: number): DiagnosticLiveSnapshot;
|
|
20
|
+
exportPackage(options?: {
|
|
21
|
+
sessionId?: string | null;
|
|
22
|
+
recentFailureContext?: number;
|
|
23
|
+
recentEventsFallback?: number;
|
|
24
|
+
}): DiagnosticExportPackage;
|
|
25
|
+
clear(sessionOnly?: boolean): void;
|
|
26
|
+
private ensureCurrentSession;
|
|
27
|
+
private resolveSession;
|
|
28
|
+
private createEvent;
|
|
29
|
+
private trimSessionEvents;
|
|
30
|
+
private findCoalescedEvent;
|
|
31
|
+
private buildEventIdentity;
|
|
32
|
+
private areEventIdentitiesEqual;
|
|
33
|
+
private updateCoalescedEvent;
|
|
34
|
+
private normalizeUrl;
|
|
35
|
+
private emitToConsole;
|
|
36
|
+
private scheduleNotify;
|
|
37
|
+
private notifyNow;
|
|
38
|
+
private schedulePersist;
|
|
39
|
+
private persistNow;
|
|
40
|
+
private clearScheduledTasks;
|
|
41
|
+
private restoreIndexedDbState;
|
|
42
|
+
private captureFailureWindow;
|
|
43
|
+
private buildFailureWindow;
|
|
44
|
+
private resolveExportFailureWindow;
|
|
45
|
+
private persistToLocalStorage;
|
|
46
|
+
}
|
|
47
|
+
export declare function mergeDiagnosticRuntimeState(base: DiagnosticRuntimeState | null | undefined, next: DiagnosticRuntimeState | null | undefined): DiagnosticRuntimeState | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DiagnosticsCenter } from './DiagnosticsCenter';
|
|
2
|
+
export declare class DiagnosticsPanel {
|
|
3
|
+
private readonly diagnostics;
|
|
4
|
+
private container;
|
|
5
|
+
private summaryElement;
|
|
6
|
+
private failureElement;
|
|
7
|
+
private eventListElement;
|
|
8
|
+
private unsubscribe;
|
|
9
|
+
constructor(diagnostics: DiagnosticsCenter);
|
|
10
|
+
mount(host: HTMLElement): void;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
private render;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type LazyDataFactory = () => unknown;
|
|
2
|
+
export declare const devConsole: {
|
|
3
|
+
debug(_scope: string, _message: string, _data?: unknown): void;
|
|
4
|
+
debugLazy(_scope: string, _messageFactory: () => string, _dataFactory?: LazyDataFactory): void;
|
|
5
|
+
warn(scope: string, message: string, data?: unknown): void;
|
|
6
|
+
error(scope: string, message: string, data?: unknown): void;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DiagnosticsCenter, mergeDiagnosticRuntimeState } from './DiagnosticsCenter';
|
|
2
|
+
export { DiagnosticsPanel } from './DiagnosticsPanel';
|
|
3
|
+
export { devConsole } from './devConsole';
|
|
4
|
+
export type { DiagnosticCategory, DiagnosticEmitInput, DiagnosticEvent, DiagnosticExportPackage, DiagnosticHardwareInfo, DiagnosticLiveEvent, DiagnosticLiveSnapshot, DiagnosticMediaState, DiagnosticNetworkInfo, DiagnosticRuntimeState, DiagnosticsConfig, DiagnosticsListener, DiagnosticsLiveListener, DiagnosticSessionMetadata, DiagnosticSessionSnapshot, DiagnosticSessionSummary, DiagnosticSeverity } from './types';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
export type DiagnosticSeverity = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
+
export type DiagnosticCategory = 'session' | 'resource' | 'playback' | 'runtime' | 'recovery' | 'ui-trigger';
|
|
3
|
+
export interface DiagnosticsConfig {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
persist?: boolean;
|
|
6
|
+
storageQuotaMb?: number;
|
|
7
|
+
maxSessions?: number;
|
|
8
|
+
maxHotEvents?: number;
|
|
9
|
+
includeFullSourceUrl?: boolean;
|
|
10
|
+
enablePanel?: boolean;
|
|
11
|
+
consoleSeverityThreshold?: DiagnosticSeverity;
|
|
12
|
+
}
|
|
13
|
+
export interface DiagnosticMediaError {
|
|
14
|
+
code: number | null;
|
|
15
|
+
message: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface DiagnosticMediaState {
|
|
18
|
+
currentTime: number | null;
|
|
19
|
+
duration: number | null;
|
|
20
|
+
readyState: number | null;
|
|
21
|
+
networkState: number | null;
|
|
22
|
+
paused: boolean | null;
|
|
23
|
+
ended: boolean | null;
|
|
24
|
+
playbackRate: number | null;
|
|
25
|
+
currentSrc: string | null;
|
|
26
|
+
bufferedEnd: number | null;
|
|
27
|
+
videoWidth: number | null;
|
|
28
|
+
videoHeight: number | null;
|
|
29
|
+
error: DiagnosticMediaError | null;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface DiagnosticRuntimeState {
|
|
33
|
+
currentTimeMs?: number;
|
|
34
|
+
playState?: string;
|
|
35
|
+
speed?: number;
|
|
36
|
+
pendingMode?: 'seek' | 'scrub' | null;
|
|
37
|
+
loadingCount?: number;
|
|
38
|
+
isBuffering?: boolean;
|
|
39
|
+
runtimePhase?: string;
|
|
40
|
+
selectedClipId?: string | null;
|
|
41
|
+
activeClipIds?: string[];
|
|
42
|
+
previewAspectRatio?: {
|
|
43
|
+
mode: string;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
} | null;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface DiagnosticErrorPayload {
|
|
50
|
+
name: string | null;
|
|
51
|
+
message: string | null;
|
|
52
|
+
stack: string | null;
|
|
53
|
+
cause: unknown;
|
|
54
|
+
}
|
|
55
|
+
export interface DiagnosticHardwareInfo {
|
|
56
|
+
platform: string | null;
|
|
57
|
+
hardwareConcurrency: number | null;
|
|
58
|
+
deviceMemory: number | null;
|
|
59
|
+
maxTouchPoints: number | null;
|
|
60
|
+
language: string | null;
|
|
61
|
+
languages: string[] | null;
|
|
62
|
+
}
|
|
63
|
+
export interface DiagnosticNetworkInfo {
|
|
64
|
+
online: boolean | null;
|
|
65
|
+
effectiveType: string | null;
|
|
66
|
+
downlinkMbps: number | null;
|
|
67
|
+
rttMs: number | null;
|
|
68
|
+
saveData: boolean | null;
|
|
69
|
+
connectionType: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface DiagnosticEvent {
|
|
72
|
+
eventId: string;
|
|
73
|
+
sessionId: string;
|
|
74
|
+
sequence: number;
|
|
75
|
+
timestamp: number;
|
|
76
|
+
isoTime: string;
|
|
77
|
+
perfTimeMs: number | null;
|
|
78
|
+
severity: DiagnosticSeverity;
|
|
79
|
+
category: DiagnosticCategory;
|
|
80
|
+
eventName: string;
|
|
81
|
+
message: string | null;
|
|
82
|
+
syncRequestId: number | null;
|
|
83
|
+
playbackAttemptId: string | null;
|
|
84
|
+
previewBackend: string | null;
|
|
85
|
+
trackId: string | null;
|
|
86
|
+
clipId: string | null;
|
|
87
|
+
slotKey: string | null;
|
|
88
|
+
sourceUrl: string | null;
|
|
89
|
+
desiredSourceUrl: string | null;
|
|
90
|
+
actualSourceUrl: string | null;
|
|
91
|
+
mediaState: DiagnosticMediaState | null;
|
|
92
|
+
runtimeState: DiagnosticRuntimeState | null;
|
|
93
|
+
error: DiagnosticErrorPayload | null;
|
|
94
|
+
extra: Record<string, unknown> | null;
|
|
95
|
+
}
|
|
96
|
+
export interface DiagnosticSessionMetadata {
|
|
97
|
+
packageName?: string | null;
|
|
98
|
+
packageVersion?: string | null;
|
|
99
|
+
userAgent?: string | null;
|
|
100
|
+
href?: string | null;
|
|
101
|
+
configuredPreviewBackend?: string | null;
|
|
102
|
+
hardware?: DiagnosticHardwareInfo | null;
|
|
103
|
+
network?: DiagnosticNetworkInfo | null;
|
|
104
|
+
environmentCapturedAt?: string | null;
|
|
105
|
+
environmentExportedAt?: string | null;
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
export interface DiagnosticSessionSummary {
|
|
109
|
+
totalEvents: number;
|
|
110
|
+
severityCounts: Record<DiagnosticSeverity, number>;
|
|
111
|
+
categoryCounts: Record<DiagnosticCategory, number>;
|
|
112
|
+
failureCount: number;
|
|
113
|
+
lastFailureEvent: Pick<DiagnosticEvent, 'eventId' | 'eventName' | 'timestamp' | 'isoTime' | 'message' | 'trackId' | 'clipId' | 'syncRequestId' | 'playbackAttemptId'> | null;
|
|
114
|
+
}
|
|
115
|
+
export interface DiagnosticSessionSnapshot {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
startedAt: number;
|
|
118
|
+
updatedAt: number;
|
|
119
|
+
metadata: DiagnosticSessionMetadata | null;
|
|
120
|
+
events: DiagnosticEvent[];
|
|
121
|
+
summary: DiagnosticSessionSummary;
|
|
122
|
+
}
|
|
123
|
+
export interface DiagnosticLiveEvent {
|
|
124
|
+
sequence: number;
|
|
125
|
+
timestamp: number;
|
|
126
|
+
isoTime: string;
|
|
127
|
+
severity: DiagnosticSeverity;
|
|
128
|
+
category: DiagnosticCategory;
|
|
129
|
+
eventName: string;
|
|
130
|
+
message: string | null;
|
|
131
|
+
syncRequestId: number | null;
|
|
132
|
+
playbackAttemptId: string | null;
|
|
133
|
+
trackId: string | null;
|
|
134
|
+
clipId: string | null;
|
|
135
|
+
extra: Record<string, unknown> | null;
|
|
136
|
+
error: DiagnosticErrorPayload | null;
|
|
137
|
+
}
|
|
138
|
+
export interface DiagnosticLiveSnapshot {
|
|
139
|
+
sessionId: string;
|
|
140
|
+
startedAt: number;
|
|
141
|
+
updatedAt: number;
|
|
142
|
+
metadata: DiagnosticSessionMetadata | null;
|
|
143
|
+
summary: DiagnosticSessionSummary;
|
|
144
|
+
recentEvents: DiagnosticLiveEvent[];
|
|
145
|
+
}
|
|
146
|
+
export interface DiagnosticExportPackage {
|
|
147
|
+
exportedAt: string;
|
|
148
|
+
session: Omit<DiagnosticSessionSnapshot, 'events'>;
|
|
149
|
+
rawEvents: DiagnosticEvent[];
|
|
150
|
+
failureWindow: DiagnosticEvent[];
|
|
151
|
+
failureWindowSource: 'live' | 'persisted' | 'recent-events';
|
|
152
|
+
}
|
|
153
|
+
export interface DiagnosticEmitInput {
|
|
154
|
+
severity: DiagnosticSeverity;
|
|
155
|
+
category: DiagnosticCategory;
|
|
156
|
+
eventName: string;
|
|
157
|
+
message?: string | null;
|
|
158
|
+
syncRequestId?: number | null;
|
|
159
|
+
playbackAttemptId?: string | null;
|
|
160
|
+
previewBackend?: string | null;
|
|
161
|
+
trackId?: string | null;
|
|
162
|
+
clipId?: string | null;
|
|
163
|
+
slotKey?: string | null;
|
|
164
|
+
sourceUrl?: string | null;
|
|
165
|
+
desiredSourceUrl?: string | null;
|
|
166
|
+
actualSourceUrl?: string | null;
|
|
167
|
+
mediaState?: DiagnosticMediaState | null;
|
|
168
|
+
runtimeState?: DiagnosticRuntimeState | null;
|
|
169
|
+
error?: unknown;
|
|
170
|
+
extra?: Record<string, unknown> | null;
|
|
171
|
+
}
|
|
172
|
+
export type DiagnosticsListener = (snapshot: DiagnosticSessionSnapshot) => void;
|
|
173
|
+
export type DiagnosticsLiveListener = (snapshot: DiagnosticLiveSnapshot) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function disableVideoPictureInPicture(video: HTMLVideoElement): void;
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { LogConfig } from '../../core/models/types';
|
|
2
|
-
export declare class Logger {
|
|
3
|
-
private static config;
|
|
4
|
-
private static dedupeWindowMs;
|
|
5
|
-
private static readonly dedupeState;
|
|
6
|
-
/**
|
|
7
|
-
* 配置日志系统
|
|
8
|
-
* @param config 日志配置
|
|
9
|
-
*/
|
|
10
|
-
static setConfig(config?: LogConfig): void;
|
|
11
|
-
/**
|
|
12
|
-
* 输出调试级别日志
|
|
13
|
-
* @param module 模块名称
|
|
14
|
-
* @param message 日志消息
|
|
15
|
-
* @param data 附加数据
|
|
16
|
-
*/
|
|
17
|
-
static debug(module: string, message: string, data?: any): void;
|
|
18
|
-
static debugLazy(module: string, messageFactory: () => string, dataFactory?: () => any): void;
|
|
19
|
-
static info(module: string, message: string, data?: any): void;
|
|
20
|
-
static infoLazy(module: string, messageFactory: () => string, dataFactory?: () => any): void;
|
|
21
|
-
static warn(module: string, message: string, data?: any): void;
|
|
22
|
-
static warnLazy(module: string, messageFactory: () => string, dataFactory?: () => any): void;
|
|
23
|
-
static error(module: string, message: string, data?: any): void;
|
|
24
|
-
/**
|
|
25
|
-
* 设置去重窗口,减少高频日志刷屏
|
|
26
|
-
*/
|
|
27
|
-
static setDedupeWindowMs(windowMs: number): void;
|
|
28
|
-
private static emit;
|
|
29
|
-
private static resolveConsoleMethod;
|
|
30
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type PreviewLoadTraceLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
-
export interface PreviewLoadTraceEntry {
|
|
3
|
-
id: string;
|
|
4
|
-
sessionId: string;
|
|
5
|
-
createdAt: number;
|
|
6
|
-
isoTime: string;
|
|
7
|
-
perfTimeMs: number | null;
|
|
8
|
-
level: PreviewLoadTraceLevel;
|
|
9
|
-
event: string;
|
|
10
|
-
data: Record<string, unknown> | null;
|
|
11
|
-
}
|
|
12
|
-
export interface PreviewLoadTraceSnapshot {
|
|
13
|
-
storageKey: string;
|
|
14
|
-
currentSessionId: string;
|
|
15
|
-
updatedAt: number;
|
|
16
|
-
entries: PreviewLoadTraceEntry[];
|
|
17
|
-
}
|
|
18
|
-
type PreviewLoadTraceListener = (snapshot: PreviewLoadTraceSnapshot) => void;
|
|
19
|
-
export declare class PreviewLoadTraceStore {
|
|
20
|
-
private state;
|
|
21
|
-
private readonly listeners;
|
|
22
|
-
constructor();
|
|
23
|
-
getStorageKey(): string;
|
|
24
|
-
getSnapshot(): PreviewLoadTraceSnapshot;
|
|
25
|
-
subscribe(listener: PreviewLoadTraceListener): () => void;
|
|
26
|
-
append(input: {
|
|
27
|
-
level: PreviewLoadTraceLevel;
|
|
28
|
-
event: string;
|
|
29
|
-
data?: Record<string, unknown> | null;
|
|
30
|
-
}): PreviewLoadTraceEntry;
|
|
31
|
-
clear(): void;
|
|
32
|
-
exportJson(limit?: number): string;
|
|
33
|
-
private persist;
|
|
34
|
-
private emit;
|
|
35
|
-
}
|
|
36
|
-
export declare const previewLoadTraceStore: PreviewLoadTraceStore;
|
|
37
|
-
export {};
|