@braccato/core 1.13.0 → 1.13.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/inject.js CHANGED
@@ -14,7 +14,7 @@
14
14
  import { normalizeLanguage } from "./language.js";
15
15
  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, WORD_STATE_ATTR, WORD_STATE_UPCOMING, ZERO_DURATION_ANIMATION_CLASS, } from "./constants.js";
16
16
  import { getSeekTimeFromClick } from "./seek.js";
17
- import { testRtl } from "./text.js";
17
+ import { testJoiningScript, testRtl } from "./text.js";
18
18
  import { registerThemeSetting } from "./themeSettings.js";
19
19
  export let disableRichsync = registerThemeSetting("blyrics-disable-richsync", false, true);
20
20
  let lineSyncedAnimationDelay = registerThemeSetting("blyrics-line-synced-animation-delay", 50, true);
@@ -238,7 +238,7 @@ function createTimedWordSpan(doc, part, wrapThreshold, perLetter) {
238
238
  wordElement.classList.add(BACKGROUND_LYRIC_CLASS);
239
239
  if (part.explicit)
240
240
  wordElement.classList.add(EXPLICIT_WORD_CLASS);
241
- if (perLetter) {
241
+ if (perLetter && !testJoiningScript(part.words)) {
242
242
  const collected = appendLetters(doc, wordElement, part.words);
243
243
  if (wordElement === span) {
244
244
  letters = collected;
package/dist/text.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export declare const testRtl: (text: string) => boolean;
2
+ export declare const testJoiningScript: (text: string) => boolean;
2
3
  /**
3
4
  * Checks if a given string contains any non-Latin characters.
4
5
  * @param text The string to check.
package/dist/text.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // Script detection for the text the module renders. Pure string work, no DOM and no host state.
2
2
  export const testRtl = (text) => /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}]/u.test(text);
3
+ export const testJoiningScript = (text) => /[\p{Script_Extensions=Arabic}\p{Script_Extensions=Syriac}\p{Script_Extensions=Nko}\p{Script_Extensions=Mongolian}\p{Script_Extensions=Adlam}\p{Script_Extensions=Mandaic}\p{Script_Extensions=Hanifi_Rohingya}]/u.test(text);
3
4
  /**
4
5
  * This regex is designed to detect any characters that are outside of the
5
6
  * standard "Basic Latin" and "Latin-1 Supplement" Unicode blocks, as well
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braccato/core",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Synchronized lyrics renderer with word-by-word animations",
5
5
  "type": "module",
6
6
  "license": "MIT",