@checksub_team/peaks_timeline 1.4.40 → 1.4.41

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": "1.4.40",
3
+ "version": "1.4.41",
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
@@ -18811,10 +18811,10 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
18811
18811
  this._view.updateTimelineLength();
18812
18812
  this.updateSources(frameStartTime, frameEndTime);
18813
18813
  };
18814
- SourcesLayer.prototype._onSourcesDestroy = function (sources) {
18814
+ SourcesLayer.prototype._onSourcesDestroy = function (sources, shouldBlockEvent) {
18815
18815
  var self = this;
18816
18816
  sources.forEach(function (source) {
18817
- self._removeSource(source, true);
18817
+ self._removeSource(source, true, shouldBlockEvent);
18818
18818
  });
18819
18819
  this._view.updateTimelineLength();
18820
18820
  this._layer.draw();
@@ -18976,14 +18976,14 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
18976
18976
  return result;
18977
18977
  }, []);
18978
18978
  };
18979
- SourcesLayer.prototype._removeSource = function (source, isPermanent) {
18979
+ SourcesLayer.prototype._removeSource = function (source, isPermanent, shouldBlockEvent) {
18980
18980
  var sourceGroup = this._sourcesGroup[source.id];
18981
18981
  if (sourceGroup) {
18982
18982
  delete this._sourcesGroup[source.id];
18983
18983
  this._lines.removeSourceGroup(source, isPermanent);
18984
18984
  sourceGroup.destroy();
18985
18985
  }
18986
- if (isPermanent) {
18986
+ if (isPermanent && !shouldBlockEvent) {
18987
18987
  this._peaks.emit('source.destroyed', source);
18988
18988
  }
18989
18989
  };
@@ -19473,23 +19473,23 @@ module.exports = function (Source, Utils) {
19473
19473
  }
19474
19474
  return destroyed;
19475
19475
  };
19476
- TimelineSources.prototype._destroySources = function (predicate) {
19476
+ TimelineSources.prototype._destroySources = function (predicate, shouldBlockEvent) {
19477
19477
  var indexes = this._findSource(predicate);
19478
19478
  var destroyed = this._destroyIndexes(indexes);
19479
- this._peaks.emit('sources.destroy', destroyed);
19479
+ this._peaks.emit('sources.destroy', destroyed, shouldBlockEvent);
19480
19480
  return destroyed;
19481
19481
  };
19482
- TimelineSources.prototype.destroy = function (source) {
19482
+ TimelineSources.prototype.destroy = function (source, shouldBlockEvent) {
19483
19483
  return this._destroySources(function (s) {
19484
19484
  return s === source;
19485
- });
19485
+ }, shouldBlockEvent);
19486
19486
  };
19487
- TimelineSources.prototype.destroyById = function (sourceId) {
19487
+ TimelineSources.prototype.destroyById = function (sourceId, shouldBlockEvent) {
19488
19488
  return this._destroySources(function (source) {
19489
19489
  return source.id === sourceId;
19490
- });
19490
+ }, shouldBlockEvent);
19491
19491
  };
19492
- TimelineSources.prototype.destroyByTime = function (startTime, endTime) {
19492
+ TimelineSources.prototype.destroyByTime = function (startTime, endTime, shouldBlockEvent) {
19493
19493
  var fnFilter;
19494
19494
  if (endTime > 0) {
19495
19495
  fnFilter = function (source) {
@@ -19500,12 +19500,12 @@ module.exports = function (Source, Utils) {
19500
19500
  return source.startTime === startTime;
19501
19501
  };
19502
19502
  }
19503
- return this._destroySources(fnFilter);
19503
+ return this._destroySources(fnFilter, shouldBlockEvent);
19504
19504
  };
19505
- TimelineSources.prototype.destroyAll = function () {
19505
+ TimelineSources.prototype.destroyAll = function (shouldBlockEvent) {
19506
19506
  this._destroySources(function () {
19507
19507
  return true;
19508
- });
19508
+ }, shouldBlockEvent);
19509
19509
  };
19510
19510
  TimelineSources.prototype.showById = function (sourceId) {
19511
19511
  this._sourcesById[sourceId].wrapped = false;