@checksub_team/peaks_timeline 2.0.0-alpha.3 → 2.0.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksub_team/peaks_timeline",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "JavaScript UI component for displaying audio waveforms",
5
5
  "main": "./peaks.js",
6
6
  "types": "./peaks.js.d.ts",
package/peaks.js CHANGED
@@ -15601,19 +15601,15 @@ module.exports = function (SegmentsGroup, LineGroup, LineIndicator, Utils) {
15601
15601
  };
15602
15602
  LineGroups.prototype.refreshLineYs = function () {
15603
15603
  var y = this._peaks.options.padding - this._view.getFrameOffsetY();
15604
- var anyChange = false;
15605
15604
  for (var position in this._lineGroupsByPosition) {
15606
15605
  if (Utils.objectHasProperty(this._lineGroupsByPosition, position)) {
15607
15606
  if (this._lineGroupsByPosition[position].y() !== y) {
15608
- anyChange = true;
15609
15607
  this._lineGroupsByPosition[position].y(y);
15610
15608
  }
15611
15609
  y += this._lineGroupsByPosition[position].lineHeight() + this._peaks.options.interline;
15612
15610
  }
15613
15611
  }
15614
- if (anyChange && this._lineIndicator.refreshIndicators()) {
15615
- this._lineIndicator.draw();
15616
- }
15612
+ this._lineIndicator.refreshIndicators();
15617
15613
  };
15618
15614
  LineGroups.prototype._setLinePosition = function (lineId, position) {
15619
15615
  const lineGroup = this._lineGroupsById[lineId];
@@ -15911,6 +15907,9 @@ module.exports = function (Konva, SVGs, Utils) {
15911
15907
  anyChange = this.refreshIndicator(lineId) || anyChange;
15912
15908
  }
15913
15909
  }
15910
+ if (anyChange) {
15911
+ this.draw();
15912
+ }
15914
15913
  return anyChange;
15915
15914
  };
15916
15915
  LineIndicator.prototype.draw = function () {
@@ -18800,6 +18799,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
18800
18799
  volumeSliderGroup.add(volumeSliderLine);
18801
18800
  volumeSliderGroup.on('dragstart', function () {
18802
18801
  volumeText.visible(true);
18802
+ self._peaks.emit('source.startVolumeChange', self._source);
18803
18803
  });
18804
18804
  volumeSliderGroup.on('dragmove', function () {
18805
18805
  var volume = self._getVolumeFromY(volumeSliderGroup.y());
@@ -18810,6 +18810,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
18810
18810
  });
18811
18811
  volumeSliderGroup.on('dragend', function () {
18812
18812
  volumeText.visible(false);
18813
+ self._peaks.emit('source.endVolumeChange', self._source);
18813
18814
  });
18814
18815
  volumeSliderGroup.on('mouseover', function () {
18815
18816
  self._cursor = 'ns-resize';
@@ -441,23 +441,19 @@ define([
441
441
 
442
442
  LineGroups.prototype.refreshLineYs = function() {
443
443
  var y = this._peaks.options.padding - this._view.getFrameOffsetY();
444
- var anyChange = false;
445
444
 
446
445
  // This code assumes that lines are ordered in ascending order of position
447
446
  // This is the case as the keys are integers
448
447
  for (var position in this._lineGroupsByPosition) {
449
448
  if (Utils.objectHasProperty(this._lineGroupsByPosition, position)) {
450
449
  if (this._lineGroupsByPosition[position].y() !== y) {
451
- anyChange = true;
452
450
  this._lineGroupsByPosition[position].y(y);
453
451
  }
454
452
  y += this._lineGroupsByPosition[position].lineHeight() + this._peaks.options.interline;
455
453
  }
456
454
  }
457
455
 
458
- if (anyChange && this._lineIndicator.refreshIndicators()) {
459
- this._lineIndicator.draw();
460
- }
456
+ this._lineIndicator.refreshIndicators();
461
457
  };
462
458
 
463
459
  LineGroups.prototype._setLinePosition = function(lineId, position) {
@@ -297,6 +297,9 @@ define([
297
297
  }
298
298
  }
299
299
 
300
+ if (anyChange) {
301
+ this.draw();
302
+ }
300
303
  return anyChange;
301
304
  };
302
305
 
@@ -1592,6 +1592,7 @@ define([
1592
1592
 
1593
1593
  volumeSliderGroup.on('dragstart', function() {
1594
1594
  volumeText.visible(true);
1595
+ self._peaks.emit('source.startVolumeChange', self._source);
1595
1596
  });
1596
1597
 
1597
1598
  volumeSliderGroup.on('dragmove', function() {
@@ -1607,6 +1608,7 @@ define([
1607
1608
 
1608
1609
  volumeSliderGroup.on('dragend', function() {
1609
1610
  volumeText.visible(false);
1611
+ self._peaks.emit('source.endVolumeChange', self._source);
1610
1612
  });
1611
1613
 
1612
1614
  volumeSliderGroup.on('mouseover', function() {