@dsebastien/music-notation 0.21.0 → 0.21.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/README.md CHANGED
@@ -191,7 +191,7 @@ Add this to your site's `publish.js`. It loads the bundle only on pages that hav
191
191
 
192
192
  ```js
193
193
  ;(() => {
194
- const VERSION = '0.20.0'
194
+ const VERSION = '0.21.0'
195
195
  const CDN = `https://cdn.jsdelivr.net/npm/@dsebastien/music-notation@${VERSION}/dist`
196
196
  const selector = (languages) => languages.map((l) => `pre > code.language-${l}`).join(', ')
197
197
  const BLOCKS = selector([
package/dist/index.js CHANGED
@@ -4502,6 +4502,12 @@ function lightPlayer(win, random = Math.random) {
4502
4502
 
4503
4503
  // src/playback/follow.ts
4504
4504
  var PLAYING_CLASS = "mn-playing";
4505
+ function raise(el) {
4506
+ const group = el.closest("[data-mn-raise]");
4507
+ const parent = group?.parentNode;
4508
+ if (group && parent && parent.lastChild !== group)
4509
+ parent.appendChild(group);
4510
+ }
4505
4511
  var START_WAIT = 300;
4506
4512
  var reporting = new WeakSet;
4507
4513
  function startsReported(player) {
@@ -4614,6 +4620,7 @@ function followNotes(win, drawing, targets, events, wait = START_WAIT) {
4614
4620
  if (!lit.has(el)) {
4615
4621
  el.classList.add(PLAYING_CLASS);
4616
4622
  lit.add(el);
4623
+ raise(el);
4617
4624
  }
4618
4625
  if (next === Infinity)
4619
4626
  return end();
@@ -11262,7 +11269,9 @@ function renderCircle(doc, options = {}) {
11262
11269
  const title = svg(doc, "title");
11263
11270
  title.textContent = chord ? `${chord.numeral}: ${name}` : name.replace("/", " or ");
11264
11271
  cell.appendChild(title);
11265
- g.appendChild(cell);
11272
+ const slot = svg(doc, "g", { class: "mn-circle-slot", "data-mn-raise": "" });
11273
+ slot.appendChild(cell);
11274
+ g.appendChild(slot);
11266
11275
  const mid = (outer + inner) / 2;
11267
11276
  const solid = mark === " mn-circle-tonic" || mark === " mn-circle-neighbour";
11268
11277
  const textClass = `mn-circle-label mn-circle-label-${ring}${solid ? " mn-circle-on" : ""}`;
@@ -11273,7 +11282,7 @@ function renderCircle(doc, options = {}) {
11273
11282
  lines.forEach((line, i) => {
11274
11283
  const [x, y] = point(mid, position * 30, top);
11275
11284
  const isNumeral = chord !== undefined && i === lines.length - 1;
11276
- g.appendChild(svgText(doc, line, {
11285
+ slot.appendChild(svgText(doc, line, {
11277
11286
  class: isNumeral ? `${textClass} mn-circle-numeral` : textClass,
11278
11287
  x,
11279
11288
  y: y + 4 + (i - (lines.length - 1) / 2) * step,
@@ -16426,5 +16435,5 @@ export {
16426
16435
  withTonicizations
16427
16436
  };
16428
16437
 
16429
- //# debugId=39249053506929F764756E2164756E21
16438
+ //# debugId=454C7243D7F5E48F64756E2164756E21
16430
16439
  //# sourceMappingURL=index.js.map