@ugfoundation/swaralipi-js 0.7.2 → 0.7.3

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.
Files changed (48) hide show
  1. package/dist/{batch-W56YUPJC.js → batch-CYQH6Q33.js} +5 -5
  2. package/dist/{batch-W56YUPJC.js.map → batch-CYQH6Q33.js.map} +1 -1
  3. package/dist/{chunk-GHWURC4U.js → chunk-2SAZWTTK.js} +8 -10
  4. package/dist/chunk-2SAZWTTK.js.map +1 -0
  5. package/dist/{chunk-AAQIY4VS.js → chunk-56NFRQOW.js} +9 -6
  6. package/dist/chunk-56NFRQOW.js.map +1 -0
  7. package/dist/{chunk-RLJQ5UIN.js → chunk-PEOVWTJB.js} +4 -4
  8. package/dist/{chunk-RLJQ5UIN.js.map → chunk-PEOVWTJB.js.map} +1 -1
  9. package/dist/{chunk-6ETPFHZ6.js → chunk-UF5OSJRP.js} +9 -3
  10. package/dist/chunk-UF5OSJRP.js.map +1 -0
  11. package/dist/cli.cjs +7 -4
  12. package/dist/cli.cjs.map +1 -1
  13. package/dist/cli.js +3 -3
  14. package/dist/convert/index.cjs +6 -3
  15. package/dist/convert/index.cjs.map +1 -1
  16. package/dist/convert/index.d.cts +1 -1
  17. package/dist/convert/index.d.ts +1 -1
  18. package/dist/convert/index.js +3 -3
  19. package/dist/index.cjs +14 -3
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +2 -2
  24. package/dist/player/index.cjs +29 -22
  25. package/dist/player/index.cjs.map +1 -1
  26. package/dist/player/index.d.cts +3 -12
  27. package/dist/player/index.d.ts +3 -12
  28. package/dist/player/index.js +21 -18
  29. package/dist/player/index.js.map +1 -1
  30. package/dist/{schedule-CjPcD-Hf.d.cts → schedule-BpBYGXPL.d.cts} +3 -2
  31. package/dist/{schedule-8WFUBJqB.d.ts → schedule-Tzk01FKj.d.ts} +3 -2
  32. package/dist/{schema-D_86x4oV.d.ts → schema-DqBXPGkL.d.cts} +13 -4
  33. package/dist/{schema-D_86x4oV.d.cts → schema-DqBXPGkL.d.ts} +13 -4
  34. package/dist/spec/index.cjs +14 -3
  35. package/dist/spec/index.cjs.map +1 -1
  36. package/dist/spec/index.d.cts +13 -4
  37. package/dist/spec/index.d.ts +13 -4
  38. package/dist/spec/index.js +2 -2
  39. package/dist/viewer/index.cjs +45 -17
  40. package/dist/viewer/index.cjs.map +1 -1
  41. package/dist/viewer/index.d.cts +2 -2
  42. package/dist/viewer/index.d.ts +2 -2
  43. package/dist/viewer/index.js +18 -8
  44. package/dist/viewer/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunk-6ETPFHZ6.js.map +0 -1
  47. package/dist/chunk-AAQIY4VS.js.map +0 -1
  48. package/dist/chunk-GHWURC4U.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-D_86x4oV.cjs';
2
- import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-CjPcD-Hf.cjs';
1
+ import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-DqBXPGkL.cjs';
2
+ import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-BpBYGXPL.cjs';
3
3
  import 'zod';
4
4
  import 'tone';
5
5
  import '../taals-CjzBuZ35.cjs';
@@ -1,5 +1,5 @@
1
- import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-D_86x4oV.js';
2
- import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-8WFUBJqB.js';
1
+ import { O as Octave, a as SvaraLetter, N as Note, M as Meta, S as Swaralipi, T as Taal } from '../schema-DqBXPGkL.js';
2
+ import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-Tzk01FKj.js';
3
3
  import 'zod';
4
4
  import 'tone';
5
5
  import '../taals-CjzBuZ35.js';
@@ -1,5 +1,5 @@
1
- import { isArcRaw, glideTargets, buildSchedule, drumPattern } from '../chunk-GHWURC4U.js';
2
- import { TAALS } from '../chunk-6ETPFHZ6.js';
1
+ import { isArcRaw, glideTargets, buildSchedule, drumPattern } from '../chunk-2SAZWTTK.js';
2
+ import { TAALS, graceNotes } from '../chunk-UF5OSJRP.js';
3
3
 
4
4
  // src/viewer/glyphs.ts
5
5
  var SWARABITAN_SHUDDHA = {
@@ -266,11 +266,21 @@ function bracketGlyphs(note, edge) {
266
266
  function matraGlyph(ctx) {
267
267
  return ctx.lang === "bn" ? '<span class="sw-cl">a</span>' : '<span class="sw-iso">\u2013</span>';
268
268
  }
269
- function renderGrace(svara, cls, ctx) {
270
- if (svara === void 0) return "";
271
- const [octave, letter] = svara;
272
- const c = composeCluster(letter, { octave, withMatra: false, lang: ctx.lang });
273
- return `<span class="${[cls, ...c.classes].join(" ")}">${c.text}</span>`;
269
+ function renderGrace(grace, cls, ctx) {
270
+ return graceNotes(grace).map((n) => {
271
+ if (n.svara === void 0) return "";
272
+ const [octave, letter] = n.svara;
273
+ const c = composeCluster(letter, {
274
+ komal: n.komal,
275
+ tivra: n.tivra,
276
+ octave,
277
+ withMatra: false,
278
+ lang: ctx.lang
279
+ });
280
+ const hy = n.sustain === true ? ctx.marks.hyphen : "";
281
+ const micro = n.microtone !== void 0 ? `<span class="sw-micro" title="${n.microtone}">${localizeDigits(n.microtone === "atikomal" ? "2" : "1", ctx.lang)}</span>` : "";
282
+ return `<span class="${[cls, ...c.classes].join(" ")}">${hy}${c.text}</span>${micro}`;
283
+ }).join("");
274
284
  }
275
285
  function cutGlyphs(marks, ctx) {
276
286
  if (marks === "") return "";
@@ -788,7 +798,7 @@ function abcDuration(beats) {
788
798
  return `${sixteenths}/4`;
789
799
  }
790
800
  function abcNote(ev) {
791
- const grace = ev.kan !== null ? `{${midiToAbc(ev.kan)}}` : "";
801
+ const grace = ev.kan.length > 0 ? `{${ev.kan.map(midiToAbc).join("")}}` : "";
792
802
  return `${grace}${midiToAbc(ev.midi)}${abcDuration(ev.durationBeats)}`;
793
803
  }
794
804
  function eventPaths(schedule) {