@braccato/core 1.2.1 → 1.3.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/dist/engine.js CHANGED
@@ -304,7 +304,9 @@ function resetLineAnimationState(lineData) {
304
304
  }
305
305
  function togglePartClass(part, className, force) {
306
306
  part.lyricElement.classList.toggle(className, force);
307
- part.highlightElement?.classList.toggle(className, force);
307
+ if ("highlightElement" in part) {
308
+ part.highlightElement.classList.toggle(className, force);
309
+ }
308
310
  }
309
311
  function setAnimationsPlayState(lineData, isPlaying) {
310
312
  const children = [lineData, ...lineData.parts];
package/dist/inject.d.ts CHANGED
@@ -3,7 +3,7 @@ export declare let disableRichsync: import("./themeSettings.js").Setting;
3
3
  export declare function findNearestAgent(lyrics: Lyric[], fromIndex: number): string | undefined;
4
4
  export declare function isNearestLyricRtl(lyrics: Lyric[], fromIndex: number): boolean;
5
5
  export declare function deriveSyncType(lyrics: Lyric[]): LyricSyncType;
6
- export interface PartData {
6
+ export interface AnimationData {
7
7
  /**
8
8
  * Time of this part in seconds
9
9
  */
@@ -14,7 +14,9 @@ export interface PartData {
14
14
  duration: number;
15
15
  lyricElement: HTMLElement;
16
16
  animations: Animation[];
17
- highlightElement?: HTMLElement;
17
+ }
18
+ export interface PartData extends AnimationData {
19
+ highlightElement: HTMLElement;
18
20
  }
19
21
  export type LineData = {
20
22
  parts: PartData[];
@@ -26,7 +28,7 @@ export type LineData = {
26
28
  isSelected: boolean;
27
29
  height: number;
28
30
  position: number;
29
- } & PartData;
31
+ } & AnimationData;
30
32
  export declare function newLineData(lyricElement: HTMLElement, startTimeMs: number, durationMs: number): LineData;
31
33
  export declare function applyDirection(element: HTMLElement, text: string): void;
32
34
  export declare function createLyricsLine(doc: Document, parts: LyricPart[], line: LineData, lyricElement: HTMLElement, options?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braccato/core",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Synchronized lyrics renderer with word-by-word animations",
5
5
  "type": "module",
6
6
  "license": "MIT",