@checksub_team/peaks_timeline 2.0.0-alpha.2 → 2.0.0-alpha.4

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.2",
3
+ "version": "2.0.0-alpha.4",
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
@@ -18800,6 +18800,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
18800
18800
  volumeSliderGroup.add(volumeSliderLine);
18801
18801
  volumeSliderGroup.on('dragstart', function () {
18802
18802
  volumeText.visible(true);
18803
+ self._peaks.emit('source.startVolumeChange', self._source);
18803
18804
  });
18804
18805
  volumeSliderGroup.on('dragmove', function () {
18805
18806
  var volume = self._getVolumeFromY(volumeSliderGroup.y());
@@ -18810,6 +18811,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
18810
18811
  });
18811
18812
  volumeSliderGroup.on('dragend', function () {
18812
18813
  volumeText.visible(false);
18814
+ self._peaks.emit('source.endVolumeChange', self._source);
18813
18815
  });
18814
18816
  volumeSliderGroup.on('mouseover', function () {
18815
18817
  self._cursor = 'ns-resize';
@@ -19950,14 +19952,6 @@ module.exports = function (Colors, EventEmitter, SegmentHandler, SourceHandler,
19950
19952
  Peaks.prototype.setCutMode = function () {
19951
19953
  this.emit('handler.view.cutmode');
19952
19954
  };
19953
- Peaks.prototype.setIndicatorType = function (linePosition, type) {
19954
- var lineId = this.view.getLineByPosition(linePosition).getId();
19955
- this.emit('lineIndicator.setType', lineId, type);
19956
- };
19957
- Peaks.prototype.setIndicatorText = function (linePosition, text) {
19958
- var lineId = this.view.getLineByPosition(linePosition).getId();
19959
- this.emit('lineIndicator.setText', lineId, text);
19960
- };
19961
19955
  Peaks.prototype.getVisibleSegments = function () {
19962
19956
  return this.view.getSegmentsGroup().getVisibleSegments();
19963
19957
  };
@@ -20065,9 +20059,6 @@ module.exports = function (Utils) {
20065
20059
  return this._position;
20066
20060
  },
20067
20061
  set: function (pos) {
20068
- if (!Utils.isInteger(pos) || pos < 0) {
20069
- throw new TypeError('peaks.lines.setPosition(): position must be a non-negative integer');
20070
- }
20071
20062
  this._position = pos;
20072
20063
  }
20073
20064
  },
@@ -20091,24 +20082,10 @@ module.exports = function (Utils) {
20091
20082
  indicatorText: this.indicatorText
20092
20083
  };
20093
20084
  Utils.extend(opts, options);
20094
- validateLine(this._peaks, opts, 'update()');
20095
- this._startTime = opts.startTime;
20096
- this._endTime = opts.endTime;
20097
- this._duration = opts.duration;
20098
- this._labelText = opts.labelText;
20099
- this._color = opts.color;
20100
- this._textColor = opts.textColor;
20101
- this._handleTextColor = opts.handleTextColor;
20102
- this._hoverColor = opts.hoverColor;
20103
- this._warningColor = opts.warningColor;
20104
- this._opacity = opts.opacity;
20105
- this._borderColor = opts.borderColor;
20106
- this._borderWidth = opts.borderWidth;
20107
- this._borderRadius = opts.borderRadius;
20108
- this._editable = opts.editable;
20109
- this._allowDeletion = opts.allowDeletion;
20110
- this._line = opts.line;
20111
- this._indicators = opts.indicators;
20085
+ validateLine(opts, 'update()');
20086
+ this._position = opts.position;
20087
+ this._indicatorType = opts.indicatorType;
20088
+ this._indicatorText = opts.indicatorText;
20112
20089
  this._peaks.emit('model.line.update', this);
20113
20090
  };
20114
20091
  Line.prototype.toSerializable = function () {
@@ -22086,7 +22063,6 @@ module.exports = function (MouseDragHandler, PlayheadLayer, SourcesLayer, ModeLa
22086
22063
  self._timelineLength = 0;
22087
22064
  self._timeToPixelsScale = self._options.initialZoomLevel;
22088
22065
  self._timeToPixelsMinScale = self._options.minScale;
22089
- self._resizeTimeoutId = null;
22090
22066
  self._isFocused = false;
22091
22067
  self._isClickable = true;
22092
22068
  self._width = container.clientWidth;
@@ -22603,10 +22579,6 @@ module.exports = function (MouseDragHandler, PlayheadLayer, SourcesLayer, ModeLa
22603
22579
  return this._sourcesLayer.getFullHeight();
22604
22580
  };
22605
22581
  View.prototype.destroy = function () {
22606
- if (this._resizeTimeoutId) {
22607
- clearTimeout(this._resizeTimeoutId);
22608
- this._resizeTimeoutId = null;
22609
- }
22610
22582
  this._peaks.off('player_time_update', this._onTimeUpdate);
22611
22583
  this._peaks.off('user_seek', this._onSeek);
22612
22584
  this._peaks.off('player_play', this._onPlay);
@@ -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() {
package/src/main.js CHANGED
@@ -749,18 +749,6 @@ define([
749
749
  this.emit('handler.view.cutmode');
750
750
  };
751
751
 
752
- Peaks.prototype.setIndicatorType = function(linePosition, type) {
753
- var lineId = this.view.getLineByPosition(linePosition).getId();
754
-
755
- this.emit('lineIndicator.setType', lineId, type);
756
- };
757
-
758
- Peaks.prototype.setIndicatorText = function(linePosition, text) {
759
- var lineId = this.view.getLineByPosition(linePosition).getId();
760
-
761
- this.emit('lineIndicator.setText', lineId, text);
762
- };
763
-
764
752
  Peaks.prototype.getVisibleSegments = function() {
765
753
  return this.view
766
754
  .getSegmentsGroup()
@@ -74,9 +74,6 @@ define([
74
74
  },
75
75
 
76
76
  set: function(pos) {
77
- if (!Utils.isInteger(pos) || pos < 0) {
78
- throw new TypeError('peaks.lines.setPosition(): position must be a non-negative integer');
79
- }
80
77
  this._position = pos;
81
78
  }
82
79
  },
@@ -103,25 +100,11 @@ define([
103
100
 
104
101
  Utils.extend(opts, options);
105
102
 
106
- validateLine(this._peaks, opts, 'update()');
107
-
108
- this._startTime = opts.startTime;
109
- this._endTime = opts.endTime;
110
- this._duration = opts.duration;
111
- this._labelText = opts.labelText;
112
- this._color = opts.color;
113
- this._textColor = opts.textColor;
114
- this._handleTextColor = opts.handleTextColor;
115
- this._hoverColor = opts.hoverColor;
116
- this._warningColor = opts.warningColor;
117
- this._opacity = opts.opacity;
118
- this._borderColor = opts.borderColor;
119
- this._borderWidth = opts.borderWidth;
120
- this._borderRadius = opts.borderRadius;
121
- this._editable = opts.editable;
122
- this._allowDeletion = opts.allowDeletion;
123
- this._line = opts.line;
124
- this._indicators = opts.indicators;
103
+ validateLine(opts, 'update()');
104
+
105
+ this._position = opts.position;
106
+ this._indicatorType = opts.indicatorType;
107
+ this._indicatorText = opts.indicatorText;
125
108
 
126
109
  this._peaks.emit('model.line.update', this);
127
110
  };
package/src/view.js CHANGED
@@ -79,7 +79,6 @@ define([
79
79
  self._timeToPixelsScale = self._options.initialZoomLevel;
80
80
  self._timeToPixelsMinScale = self._options.minScale;
81
81
 
82
- self._resizeTimeoutId = null;
83
82
  self._isFocused = false;
84
83
  self._isClickable = true;
85
84
 
@@ -887,11 +886,6 @@ define([
887
886
  };
888
887
 
889
888
  View.prototype.destroy = function() {
890
- if (this._resizeTimeoutId) {
891
- clearTimeout(this._resizeTimeoutId);
892
- this._resizeTimeoutId = null;
893
- }
894
-
895
889
  // Unregister event handlers
896
890
  this._peaks.off('player_time_update', this._onTimeUpdate);
897
891
  this._peaks.off('user_seek', this._onSeek);