@braccato/core 1.6.0 → 1.6.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/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/inject.js +6 -3
- package/dist/styles/lyrics.css +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare const BACKGROUND_LINE_CLASS: "blyrics-background-line";
|
|
|
20
20
|
export declare const WORD_GROUP_CLASS: "blyrics-word-group";
|
|
21
21
|
export declare const LONG_WORD_GROUP_CLASS: "blyrics-word-group-long";
|
|
22
22
|
export declare const WORD_HIGHLIGHT_CLASS: "blyrics-word-highlight";
|
|
23
|
+
export declare const WORD_HIGHLIGHT_LETTERED_CLASS: "blyrics-word-highlight--lettered";
|
|
23
24
|
export declare const HIGHLIGHT_RUN_CLASS: "blyrics-highlight-run";
|
|
24
25
|
export declare const LINE_SYNCED_WORD_CLASS: "blyrics-line-synced-word";
|
|
25
26
|
export declare const BIDI_RUN_CLASS: "blyrics-bidi-run";
|
package/dist/constants.js
CHANGED
|
@@ -26,6 +26,7 @@ export const BACKGROUND_LINE_CLASS = "blyrics-background-line";
|
|
|
26
26
|
export const WORD_GROUP_CLASS = "blyrics-word-group";
|
|
27
27
|
export const LONG_WORD_GROUP_CLASS = "blyrics-word-group-long";
|
|
28
28
|
export const WORD_HIGHLIGHT_CLASS = "blyrics-word-highlight";
|
|
29
|
+
export const WORD_HIGHLIGHT_LETTERED_CLASS = "blyrics-word-highlight--lettered";
|
|
29
30
|
export const HIGHLIGHT_RUN_CLASS = "blyrics-highlight-run";
|
|
30
31
|
export const LINE_SYNCED_WORD_CLASS = "blyrics-line-synced-word";
|
|
31
32
|
export const BIDI_RUN_CLASS = "blyrics-bidi-run";
|
package/dist/inject.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// animates is one word, so every part is split on whitespace with its timing pro-rated across the
|
|
12
12
|
// split by character count. A line that arrives with no timed parts at all is rebuilt the same way
|
|
13
13
|
// into zero duration words, so line synced lyrics reach the DOM the sweep already knows.
|
|
14
|
-
import { BACKGROUND_LINE_CLASS, BACKGROUND_LYRIC_CLASS, BIDI_RUN_CLASS, BIDI_SENSITIVE_CLASS, CONTENT_LINE_CLASS, EXPLICIT_WORD_CLASS, HIGHLIGHT_RUN_CLASS, LETTER_CLASS, LINE_MAIN_CLASS, LINE_SYNCED_WORD_CLASS, LONG_WORD_GROUP_CLASS, ROMANIZED_LYRICS_CLASS, RTL_CLASS, TRANSLATED_LYRICS_CLASS, WORD_CLASS, WORD_GROUP_CLASS, WORD_HIGHLIGHT_CLASS, ZERO_DURATION_ANIMATION_CLASS, } from "./constants.js";
|
|
14
|
+
import { BACKGROUND_LINE_CLASS, BACKGROUND_LYRIC_CLASS, BIDI_RUN_CLASS, BIDI_SENSITIVE_CLASS, CONTENT_LINE_CLASS, EXPLICIT_WORD_CLASS, HIGHLIGHT_RUN_CLASS, LETTER_CLASS, LINE_MAIN_CLASS, LINE_SYNCED_WORD_CLASS, LONG_WORD_GROUP_CLASS, ROMANIZED_LYRICS_CLASS, RTL_CLASS, TRANSLATED_LYRICS_CLASS, WORD_CLASS, WORD_GROUP_CLASS, WORD_HIGHLIGHT_CLASS, WORD_HIGHLIGHT_LETTERED_CLASS, ZERO_DURATION_ANIMATION_CLASS, } from "./constants.js";
|
|
15
15
|
import { getSeekTimeFromClick } from "./seek.js";
|
|
16
16
|
import { testRtl } from "./text.js";
|
|
17
17
|
import { registerThemeSetting } from "./themeSettings.js";
|
|
@@ -235,10 +235,13 @@ function createTimedWordSpan(doc, part, wrapThreshold, perLetter) {
|
|
|
235
235
|
wordElement.classList.add(EXPLICIT_WORD_CLASS);
|
|
236
236
|
if (perLetter) {
|
|
237
237
|
const collected = appendLetters(doc, wordElement, part.words);
|
|
238
|
-
if (wordElement === span)
|
|
238
|
+
if (wordElement === span) {
|
|
239
239
|
letters = collected;
|
|
240
|
-
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
241
242
|
highlightLetters = collected;
|
|
243
|
+
wordElement.classList.add(WORD_HIGHLIGHT_LETTERED_CLASS);
|
|
244
|
+
}
|
|
242
245
|
}
|
|
243
246
|
else {
|
|
244
247
|
appendLongWordBreaks(doc, wordElement, part.words, wrapThreshold);
|
package/dist/styles/lyrics.css
CHANGED