@braccato/core 0.1.6 → 1.0.0
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 +1 -1
- package/README.md +267 -32
- package/dist/LICENSE +21 -0
- package/dist/README.md +298 -0
- package/dist/constants.d.ts +25 -0
- package/dist/constants.js +42 -0
- package/dist/element.d.ts +155 -0
- package/dist/element.js +655 -0
- package/dist/engine.d.ts +309 -0
- package/dist/engine.js +1940 -0
- package/dist/index.d.ts +12 -128
- package/dist/index.js +11 -948
- package/dist/inject.d.ts +37 -0
- package/dist/inject.js +376 -0
- package/dist/instrumental.d.ts +10 -0
- package/dist/instrumental.js +78 -0
- package/dist/renderer.d.ts +29 -0
- package/dist/renderer.js +349 -0
- package/dist/seek.d.ts +1 -0
- package/dist/seek.js +27 -0
- package/dist/styles/instrumental.css +103 -0
- package/dist/styles/lyrics.css +274 -0
- package/dist/styles/variables.css +181 -0
- package/dist/text.d.ts +11 -0
- package/dist/text.js +54 -0
- package/dist/themeSettings.d.ts +23 -0
- package/dist/themeSettings.js +126 -0
- package/dist/types.d.ts +199 -0
- package/dist/types.js +1 -0
- package/dist/util.d.ts +21 -0
- package/dist/util.js +64 -0
- package/dist/view.d.ts +22 -0
- package/dist/view.js +93 -0
- package/package.json +34 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,128 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
longWordThreshold: number;
|
|
14
|
-
lineSyncedDelay: number;
|
|
15
|
-
disableRichsync: boolean;
|
|
16
|
-
debug: boolean;
|
|
17
|
-
source: string | null;
|
|
18
|
-
src: string | null;
|
|
19
|
-
onLineActive?: (line: Lyric, index: number) => void;
|
|
20
|
-
onLineInactive?: (line: Lyric, index: number) => void;
|
|
21
|
-
private _lyricsData;
|
|
22
|
-
private _animState;
|
|
23
|
-
private _rafId;
|
|
24
|
-
private _lastLyrics;
|
|
25
|
-
private _resizeObserver;
|
|
26
|
-
private _mediaElement;
|
|
27
|
-
private _lastSrc;
|
|
28
|
-
private _srcAbortController;
|
|
29
|
-
connectedCallback(): void;
|
|
30
|
-
disconnectedCallback(): void;
|
|
31
|
-
updated(changed: Map<string, unknown>): void;
|
|
32
|
-
render(): TemplateResult<1>;
|
|
33
|
-
private _log;
|
|
34
|
-
private _injectLyrics;
|
|
35
|
-
private _recalculatePositions;
|
|
36
|
-
private _startLoop;
|
|
37
|
-
private _stopLoop;
|
|
38
|
-
private _tickCount;
|
|
39
|
-
private _tick;
|
|
40
|
-
private _getScrollContainer;
|
|
41
|
-
private _onScroll;
|
|
42
|
-
private _handleLineClick;
|
|
43
|
-
private _resolveMediaElement;
|
|
44
|
-
private _fetchLyricsFromSrc;
|
|
45
|
-
private _emitError;
|
|
46
|
-
resumeAutoscroll(): void;
|
|
47
|
-
recalculatePositions(): void;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare interface BraccatoEventMap {
|
|
51
|
-
"braccato:line-click": CustomEvent<{
|
|
52
|
-
time: number;
|
|
53
|
-
lineIndex: number;
|
|
54
|
-
}>;
|
|
55
|
-
"braccato:word-click": CustomEvent<{
|
|
56
|
-
time: number;
|
|
57
|
-
lineIndex: number;
|
|
58
|
-
wordIndex: number;
|
|
59
|
-
}>;
|
|
60
|
-
"braccato:lyrics-loaded": CustomEvent<{
|
|
61
|
-
syncType: SyncType;
|
|
62
|
-
lineCount: number;
|
|
63
|
-
}>;
|
|
64
|
-
"braccato:scroll-state": CustomEvent<{
|
|
65
|
-
userScrolling: boolean;
|
|
66
|
-
}>;
|
|
67
|
-
"braccato:error": CustomEvent<{
|
|
68
|
-
error: Error;
|
|
69
|
-
}>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export declare interface LineData {
|
|
73
|
-
parts: PartData[];
|
|
74
|
-
isScrolled: boolean;
|
|
75
|
-
isAnimationPlayStatePlaying: boolean;
|
|
76
|
-
accumulatedOffsetMs: number;
|
|
77
|
-
isAnimating: boolean;
|
|
78
|
-
lastAnimSetupAt: number;
|
|
79
|
-
isSelected: boolean;
|
|
80
|
-
height: number;
|
|
81
|
-
position: number;
|
|
82
|
-
time: number;
|
|
83
|
-
duration: number;
|
|
84
|
-
element: HTMLElement;
|
|
85
|
-
animationStartTimeMs: number;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export declare interface Lyric {
|
|
89
|
-
startTimeMs: number;
|
|
90
|
-
words: string;
|
|
91
|
-
durationMs: number;
|
|
92
|
-
key?: string;
|
|
93
|
-
parts?: LyricPart[];
|
|
94
|
-
agent?: string;
|
|
95
|
-
translation?: {
|
|
96
|
-
text: string;
|
|
97
|
-
lang: string;
|
|
98
|
-
};
|
|
99
|
-
romanization?: string;
|
|
100
|
-
timedRomanization?: LyricPart[];
|
|
101
|
-
isInstrumental?: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export declare interface LyricPart {
|
|
105
|
-
startTimeMs: number;
|
|
106
|
-
words: string;
|
|
107
|
-
durationMs: number;
|
|
108
|
-
isBackground?: boolean;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export declare interface LyricsData {
|
|
112
|
-
lines: LineData[];
|
|
113
|
-
syncType: SyncType;
|
|
114
|
-
width: number;
|
|
115
|
-
height: number;
|
|
116
|
-
container: HTMLElement;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export declare interface PartData {
|
|
120
|
-
time: number;
|
|
121
|
-
duration: number;
|
|
122
|
-
element: HTMLElement;
|
|
123
|
-
animationStartTimeMs: number;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export declare type SyncType = "richsync" | "synced" | "none";
|
|
127
|
-
|
|
128
|
-
export { }
|
|
1
|
+
export { resetPlaybackClock, resumeAllAutoscroll } from "./engine.js";
|
|
2
|
+
export { injectRomanization, injectTranslation, type LineData } from "./inject.js";
|
|
3
|
+
export { createLyricsRenderer } from "./renderer.js";
|
|
4
|
+
export type { Lyric, LyricsRenderer, LyricsRendererHost, TickOptions } from "./types.js";
|
|
5
|
+
/** @public */
|
|
6
|
+
export type { AnimationTickStatus } from "./engine.js";
|
|
7
|
+
/** @public */
|
|
8
|
+
export type { PartData } from "./inject.js";
|
|
9
|
+
/** @public */
|
|
10
|
+
export type { LyricPart, LyricsRendererDebugSink, LyricsRendererOptions, LyricSyncType } from "./types.js";
|
|
11
|
+
/** @public */
|
|
12
|
+
export type { SetLyricsOptions } from "./view.js";
|