@ugfoundation/swaralipi-js 0.7.2 → 0.7.4
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/{batch-W56YUPJC.js → batch-S6KXVZ7Z.js} +5 -5
- package/dist/{batch-W56YUPJC.js.map → batch-S6KXVZ7Z.js.map} +1 -1
- package/dist/{chunk-GHWURC4U.js → chunk-2SAZWTTK.js} +8 -10
- package/dist/chunk-2SAZWTTK.js.map +1 -0
- package/dist/{chunk-AAQIY4VS.js → chunk-NSZXESTN.js} +9 -6
- package/dist/chunk-NSZXESTN.js.map +1 -0
- package/dist/{chunk-6ETPFHZ6.js → chunk-UF5OSJRP.js} +9 -3
- package/dist/chunk-UF5OSJRP.js.map +1 -0
- package/dist/{chunk-RLJQ5UIN.js → chunk-ZDSF7Y33.js} +4 -4
- package/dist/{chunk-RLJQ5UIN.js.map → chunk-ZDSF7Y33.js.map} +1 -1
- package/dist/cli.cjs +7 -4
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/convert/index.cjs +6 -3
- package/dist/convert/index.cjs.map +1 -1
- package/dist/convert/index.d.cts +1 -1
- package/dist/convert/index.d.ts +1 -1
- package/dist/convert/index.js +3 -3
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/player/index.cjs +29 -22
- package/dist/player/index.cjs.map +1 -1
- package/dist/player/index.d.cts +3 -12
- package/dist/player/index.d.ts +3 -12
- package/dist/player/index.js +21 -18
- package/dist/player/index.js.map +1 -1
- package/dist/{schedule-CjPcD-Hf.d.cts → schedule-BpBYGXPL.d.cts} +3 -2
- package/dist/{schedule-8WFUBJqB.d.ts → schedule-Tzk01FKj.d.ts} +3 -2
- package/dist/{schema-D_86x4oV.d.ts → schema-DqBXPGkL.d.cts} +13 -4
- package/dist/{schema-D_86x4oV.d.cts → schema-DqBXPGkL.d.ts} +13 -4
- package/dist/spec/index.cjs +14 -3
- package/dist/spec/index.cjs.map +1 -1
- package/dist/spec/index.d.cts +13 -4
- package/dist/spec/index.d.ts +13 -4
- package/dist/spec/index.js +2 -2
- package/dist/viewer/index.cjs +58 -20
- package/dist/viewer/index.cjs.map +1 -1
- package/dist/viewer/index.d.cts +2 -2
- package/dist/viewer/index.d.ts +2 -2
- package/dist/viewer/index.js +31 -11
- package/dist/viewer/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6ETPFHZ6.js.map +0 -1
- package/dist/chunk-AAQIY4VS.js.map +0 -1
- package/dist/chunk-GHWURC4U.js.map +0 -1
package/dist/viewer/index.d.cts
CHANGED
|
@@ -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-
|
|
2
|
-
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-
|
|
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';
|
package/dist/viewer/index.d.ts
CHANGED
|
@@ -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-
|
|
2
|
-
import { D as DrumVoice, S as Schedule, P as PlayEvent } from '../schedule-
|
|
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';
|
package/dist/viewer/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isArcRaw, glideTargets, buildSchedule, drumPattern } from '../chunk-
|
|
2
|
-
import { TAALS } from '../chunk-
|
|
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(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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 "";
|
|
@@ -530,6 +540,14 @@ var FONT_FACES = Object.entries(NOTATION_FONT_URLS).map(
|
|
|
530
540
|
var SWARALIPI_CSS = `
|
|
531
541
|
${FONT_FACES}
|
|
532
542
|
|
|
543
|
+
/* A custom element is display:inline by default, and Resize Observer
|
|
544
|
+
"Observations do not fire for non-replaced inline Elements" \u2014 they report
|
|
545
|
+
one empty content rect and nothing after
|
|
546
|
+
(https://drafts.csswg.org/resize-observer/). The element's re-fit-on-resize
|
|
547
|
+
is that observer, so without this rule the sheet is fitted once, to whatever
|
|
548
|
+
width it happened to have, and never again. */
|
|
549
|
+
:host { display: block; }
|
|
550
|
+
|
|
533
551
|
.sw-sheet {
|
|
534
552
|
font-family: var(--sw-font, 'Noto Sans Bengali', 'Kohinoor Bangla', 'Bangla Sangam MN', 'Nirmala UI', 'Noto Sans Devanagari', sans-serif);
|
|
535
553
|
font-size: var(--sw-size, 1.125rem);
|
|
@@ -788,7 +806,7 @@ function abcDuration(beats) {
|
|
|
788
806
|
return `${sixteenths}/4`;
|
|
789
807
|
}
|
|
790
808
|
function abcNote(ev) {
|
|
791
|
-
const grace = ev.kan
|
|
809
|
+
const grace = ev.kan.length > 0 ? `{${ev.kan.map(midiToAbc).join("")}}` : "";
|
|
792
810
|
return `${grace}${midiToAbc(ev.midi)}${abcDuration(ev.durationBeats)}`;
|
|
793
811
|
}
|
|
794
812
|
function eventPaths(schedule) {
|
|
@@ -1213,11 +1231,16 @@ function createElementClass() {
|
|
|
1213
1231
|
});
|
|
1214
1232
|
this.#resize.observe(this);
|
|
1215
1233
|
}
|
|
1234
|
+
document.fonts?.addEventListener("loadingdone", this.#onFontsLoaded);
|
|
1216
1235
|
}
|
|
1236
|
+
#onFontsLoaded = () => {
|
|
1237
|
+
if (this.#doc !== void 0) this.fit();
|
|
1238
|
+
};
|
|
1217
1239
|
disconnectedCallback() {
|
|
1218
1240
|
this.#abort?.abort();
|
|
1219
1241
|
this.#resize?.disconnect();
|
|
1220
1242
|
this.#resize = void 0;
|
|
1243
|
+
document.fonts?.removeEventListener("loadingdone", this.#onFontsLoaded);
|
|
1221
1244
|
}
|
|
1222
1245
|
/** Scale the notation to fit the available width, times the zoom factor. */
|
|
1223
1246
|
#fit() {
|
|
@@ -1316,9 +1339,6 @@ function createElementClass() {
|
|
|
1316
1339
|
});
|
|
1317
1340
|
this.#root.innerHTML = this.#styleFallback() + html;
|
|
1318
1341
|
this.#fit();
|
|
1319
|
-
void document.fonts?.ready.then(() => {
|
|
1320
|
-
if (seq === this.#renderSeq) this.fit();
|
|
1321
|
-
});
|
|
1322
1342
|
}
|
|
1323
1343
|
#renderError(message) {
|
|
1324
1344
|
const div = document.createElement("div");
|