@braccato/core 1.13.1 → 1.13.2

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
@@ -23,7 +23,6 @@ let longWordWrapThreshold = registerThemeSetting("blyrics-long-word-wrap-thresho
23
23
  let letterWave = registerThemeSetting("blyrics-letter-wave", true, true);
24
24
  export const hideCredits = registerThemeSetting("blyrics-hide-credits", false, true);
25
25
  const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
26
- const RTL_SCRIPT_REGEX = /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}]/u;
27
26
  const LTR_SCRIPT_REGEX = /[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Han}\p{Script=Hangul}\p{Script=Hiragana}\p{Script=Katakana}]/u;
28
27
  const SPACE_REGEX = /^\s+$/u;
29
28
  export function findNearestAgent(lyrics, fromIndex) {
@@ -97,7 +96,7 @@ export function newLineData(lyricElement, startTimeMs, durationMs) {
97
96
  }
98
97
  function detectDirection(text) {
99
98
  for (const char of text) {
100
- if (RTL_SCRIPT_REGEX.test(char))
99
+ if (testRtl(char))
101
100
  return "rtl";
102
101
  if (LTR_SCRIPT_REGEX.test(char))
103
102
  return "ltr";
package/dist/text.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Script detection for the text the module renders. Pure string work, no DOM and no host state.
2
- export const testRtl = (text) => /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}]/u.test(text);
2
+ export const testRtl = (text) => /[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}\p{Script=Adlam}\p{Script=Mandaic}\p{Script=Hanifi_Rohingya}\p{Script=Samaritan}\p{Script=Yezidi}\p{Script=Mende_Kikakui}\p{Script=Old_Hungarian}]/u.test(text);
3
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);
4
4
  /**
5
5
  * This regex is designed to detect any characters that are outside of the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braccato/core",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "description": "Synchronized lyrics renderer with word-by-word animations",
5
5
  "type": "module",
6
6
  "license": "MIT",