@waveform-playlist/ui-components 11.3.1 → 12.0.0

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/index.mjs CHANGED
@@ -2786,11 +2786,20 @@ var StyledTimeScale = withTheme2(TimeScale);
2786
2786
  import {
2787
2787
  PPQN,
2788
2788
  ticksToSamples,
2789
- ticksToBarBeatLabel,
2789
+ ticksPerBeat as ticksPerBeat2,
2790
+ ticksPerBar as ticksPerBar2,
2790
2791
  samplesToPixels,
2791
2792
  secondsToPixels
2792
2793
  } from "@waveform-playlist/core";
2793
2794
  import { jsx as jsx27 } from "react/jsx-runtime";
2795
+ function ticksToBarBeatLabel(ticks, timeSignature, ppqn = PPQN) {
2796
+ const barTicks = ticksPerBar2(timeSignature, ppqn);
2797
+ const beatTicks = ticksPerBeat2(timeSignature, ppqn);
2798
+ const bar = Math.floor(ticks / barTicks) + 1;
2799
+ const beatInBar = Math.floor(ticks % barTicks / beatTicks) + 1;
2800
+ if (beatInBar === 1) return `${bar}`;
2801
+ return `${bar}.${beatInBar}`;
2802
+ }
2794
2803
  var timeinfo = /* @__PURE__ */ new Map([
2795
2804
  [700, { marker: 1e3, bigStep: 500, smallStep: 100 }],
2796
2805
  [1500, { marker: 2e3, bigStep: 1e3, smallStep: 200 }],