@dawcore/components 0.0.30 → 0.0.32

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.js CHANGED
@@ -8451,7 +8451,7 @@ DawKeyboardShortcutsElement = __decorateClass([
8451
8451
  // src/elements/daw-spectrogram.ts
8452
8452
  var import_lit19 = require("lit");
8453
8453
  var import_decorators17 = require("lit/decorators.js");
8454
- var MAX_CANVAS_WIDTH5 = 1e3;
8454
+ var import_core11 = require("@waveform-playlist/core");
8455
8455
  var DawSpectrogramElement = class extends import_lit19.LitElement {
8456
8456
  constructor() {
8457
8457
  super(...arguments);
@@ -8516,11 +8516,11 @@ var DawSpectrogramElement = class extends import_lit19.LitElement {
8516
8516
  this._unregisterAllCanvases();
8517
8517
  this._canvases = [];
8518
8518
  if (this.length <= 0) return;
8519
- const chunkCount = Math.ceil(this.length / MAX_CANVAS_WIDTH5);
8519
+ const chunkCount = Math.ceil(this.length / import_core11.MAX_CANVAS_WIDTH);
8520
8520
  for (let i = 0; i < chunkCount; i++) {
8521
- const widthPx = Math.min(MAX_CANVAS_WIDTH5, this.length - i * MAX_CANVAS_WIDTH5);
8521
+ const widthPx = Math.min(import_core11.MAX_CANVAS_WIDTH, this.length - i * import_core11.MAX_CANVAS_WIDTH);
8522
8522
  const canvas = document.createElement("canvas");
8523
- canvas.style.left = i * MAX_CANVAS_WIDTH5 + "px";
8523
+ canvas.style.left = i * import_core11.MAX_CANVAS_WIDTH + "px";
8524
8524
  canvas.style.width = widthPx + "px";
8525
8525
  const dpr = window.devicePixelRatio || 1;
8526
8526
  canvas.width = widthPx * dpr;
@@ -8546,7 +8546,11 @@ var DawSpectrogramElement = class extends import_lit19.LitElement {
8546
8546
  }
8547
8547
  for (let i = 0; i < this._canvases.length; i++) {
8548
8548
  const canvas = this._canvases[i];
8549
- const canvasId = this.clipId + "-ch" + this.channelIndex + "-chunk" + i;
8549
+ const canvasId = (0, import_core11.buildSpectrogramCanvasId)({
8550
+ clipId: this.clipId,
8551
+ channelIndex: this.channelIndex,
8552
+ chunkIndex: i
8553
+ });
8550
8554
  let offscreen;
8551
8555
  try {
8552
8556
  offscreen = canvas.transferControlToOffscreen();
@@ -8563,7 +8567,7 @@ var DawSpectrogramElement = class extends import_lit19.LitElement {
8563
8567
  trackId: this.trackId,
8564
8568
  channelIndex: this.channelIndex,
8565
8569
  chunkIndex: i,
8566
- globalPixelOffset: this.originX + i * MAX_CANVAS_WIDTH5,
8570
+ globalPixelOffset: this.originX + i * import_core11.MAX_CANVAS_WIDTH,
8567
8571
  widthPx: parseFloat(canvas.style.width),
8568
8572
  heightPx: this.waveHeight
8569
8573
  });