@dawcore/components 0.0.36 → 0.0.38

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
@@ -448,7 +448,7 @@ Core orchestrator. Attributes:
448
448
  | `fill-viewport` | boolean | `false` | Keep ruler/timeline filling the viewport even when audio is shorter (layout only) |
449
449
  | `scale-mode` | string | `'temporal'` | `'temporal'` (seconds) or `'beats'` (tick-linear grid) |
450
450
  | `ticks-per-pixel` | number | `24` | Zoom level in beats mode |
451
- | `snap-to` | string | `'off'` | Grid snapping in beats mode (`'bar'`, `'beat'`, `'1/2'`…`'1/16'`, `'off'`) |
451
+ | `snap-to` | string | `'off'` | Grid snapping in beats mode (`'bar'`, `'beat'`, `'1/2'`…`'1/16'`, `'off'`). Grid lines restart at each bar line, so in odd meters (7/8) and for subdivisions that don't divide the bar (a half note in 3/4) the last line before a bar line is the bar line itself — the same grid the ruler draws and `Transport.quantizeTick` uses |
452
452
  | `eager-resume` | string | — | Resume AudioContext on first gesture; bare attribute targets the editor, or pass `"document"` / a CSS selector |
453
453
  | `time-format` | string | `'hh:mm:ss.sss'` | Clock format read by `<daw-time-display>` / `<daw-time-format>`: `'hh:mm:ss.sss'`, `'hh:mm:ss'`, or `'seconds'` |
454
454
 
package/dist/index.js CHANGED
@@ -7337,11 +7337,11 @@ var DawEditorElement = class extends import_lit19.LitElement {
7337
7337
  this._selectionEndTime = 0;
7338
7338
  this._currentTime = 0;
7339
7339
  // Bounded-playback watermark for the current play(start, end) call
7340
- // (selection/annotation playback). The adapter's own auto-stop at
7341
- // endTime (e.g. native Transport's internal timer) tears down audio but
7342
- // never notifies isPlaying/daw-stop back up — the _startPlayhead rAF
7343
- // loop below is the sole place that detects reaching it, same pattern
7344
- // as the whole-track _duration check.
7340
+ // (selection/annotation playback). Adapters with the engine's
7341
+ // onPlaybackEnded hook (Tone, and native since #636) report their
7342
+ // endTime self-stop through the engine's `stop` event; this watermark is
7343
+ // the fallback check in the _startPlayhead loop for adapters without the
7344
+ // hook, same pattern as the whole-track _duration check.
7345
7345
  this._activePlayEndTime = null;
7346
7346
  this._externalAdapter = null;
7347
7347
  /** True after a disconnect disposed the consumer's adapter via the engine
@@ -9790,11 +9790,16 @@ var DawEditorElement = class extends import_lit19.LitElement {
9790
9790
  if (els.length < 2) return;
9791
9791
  const byId = new Map(els.map((el) => [el.trackId, el]));
9792
9792
  const desired = tracks.map((t) => byId.get(t.id)).filter((el) => el != null);
9793
- if (desired.length === 0) return;
9794
- if (desired.every((el, i) => el === els[i])) return;
9795
- if (els[0] !== desired[0]) els[0].before(desired[0]);
9796
- for (let i = 1; i < desired.length; i++) {
9797
- if (desired[i - 1].nextElementSibling !== desired[i]) desired[i - 1].after(desired[i]);
9793
+ if (desired.length < 2) return;
9794
+ const desiredSet = new Set(desired);
9795
+ const slots = els.filter((el) => desiredSet.has(el));
9796
+ if (desired.every((el, i) => el === slots[i])) return;
9797
+ for (let i = 0; i < desired.length; i++) {
9798
+ if (slots[i] === desired[i]) continue;
9799
+ slots[i].before(desired[i]);
9800
+ const from = slots.indexOf(desired[i]);
9801
+ slots.splice(from, 1);
9802
+ slots.splice(i, 0, desired[i]);
9798
9803
  }
9799
9804
  }
9800
9805
  _getOrderedTracks() {