@checksub_team/peaks_timeline 1.13.4 → 1.13.6

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.13.4",
3
+ "version": "1.13.6",
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
@@ -15914,6 +15914,8 @@ module.exports = function (Colors, EventEmitter, TimelineSegments, TimelineSourc
15914
15914
  sourceHandleWidth: 12,
15915
15915
  sourceTextXOffset: 10,
15916
15916
  sourceTextYOffset: 10,
15917
+ sourceIndicatorsXOffset: 8,
15918
+ sourceIndicatorsYOffset: 12,
15917
15919
  autoScrollThreshold: 0.05,
15918
15920
  enableLineIndicatorContextMenu: true,
15919
15921
  minSourceSize: 0.05,
@@ -18106,8 +18108,6 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
18106
18108
  var SPACING_BETWEEN_PREVIEWS = 1.5;
18107
18109
  var CORNER_RADIUS = 8;
18108
18110
  var INDICATOR_RADIUS = 4;
18109
- var INDICATORS_MARGIN_LEFT = 8;
18110
- var INDICATORS_MARGIN_TOP = 12;
18111
18111
  function SourceGroup(source, peaks, layer, view) {
18112
18112
  this._source = source;
18113
18113
  this._peaks = peaks;
@@ -18842,8 +18842,8 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
18842
18842
  zIndex += 1;
18843
18843
  }
18844
18844
  }
18845
- this._indicatorsGroup.offsetX(currentX - INDICATORS_MARGIN_LEFT);
18846
- this._indicatorsGroup.offsetY(-INDICATORS_MARGIN_TOP);
18845
+ this._indicatorsGroup.offsetX(currentX - this._peaks.options.sourceIndicatorsXOffset);
18846
+ this._indicatorsGroup.offsetY(-this._peaks.options.sourceIndicatorsYOffset);
18847
18847
  };
18848
18848
  SourceGroup.prototype._createMarkers = function () {
18849
18849
  const markersGroup = new Konva.Group({ listening: false });
@@ -19256,7 +19256,7 @@ module.exports = function (Utils) {
19256
19256
  validateSource(peaks, opts, 'add()');
19257
19257
  this._peaks = peaks;
19258
19258
  this._id = id;
19259
- this._originId = originId;
19259
+ this._originId = originId || id;
19260
19260
  this._elementId = elementId;
19261
19261
  this._title = opts.title;
19262
19262
  this._url = opts.url;
@@ -20649,7 +20649,7 @@ module.exports = function (Source, Utils) {
20649
20649
  });
20650
20650
  var newSource = this._add([{
20651
20651
  id: Utils.createUuidv4(),
20652
- originId: sourceToCut.id,
20652
+ originId: sourceToCut.originId,
20653
20653
  elementId: sourceToCut.elementId,
20654
20654
  title: sourceToCut.title,
20655
20655
  url: sourceToCut.url,
package/src/main.js CHANGED
@@ -355,6 +355,20 @@ define([
355
355
  */
356
356
  sourceTextYOffset: 10,
357
357
 
358
+ /**
359
+ * X Offset of the source indicators, in pixels
360
+ * This is the offset of the source indicators
361
+ * from the left side of the source
362
+ */
363
+ sourceIndicatorsXOffset: 8,
364
+
365
+ /**
366
+ * Y Offset of the source indicators, in pixels
367
+ * This is the offset of the source indicators
368
+ * from the top of the source
369
+ */
370
+ sourceIndicatorsYOffset: 12,
371
+
358
372
  /**
359
373
  * Threshold size on the left and right border of the view,
360
374
  * where auto scrolling is activated, between 0 and 1.
@@ -22,8 +22,6 @@ define([
22
22
  var SPACING_BETWEEN_PREVIEWS = 1.5;
23
23
  var CORNER_RADIUS = 8;
24
24
  var INDICATOR_RADIUS = 4; // px
25
- var INDICATORS_MARGIN_LEFT = 8; // px
26
- var INDICATORS_MARGIN_TOP = 12; // px
27
25
 
28
26
  /**
29
27
  * Creates a source group for the given source.
@@ -1039,8 +1037,8 @@ define([
1039
1037
  }
1040
1038
  }
1041
1039
 
1042
- this._indicatorsGroup.offsetX(currentX - INDICATORS_MARGIN_LEFT);
1043
- this._indicatorsGroup.offsetY(-INDICATORS_MARGIN_TOP);
1040
+ this._indicatorsGroup.offsetX(currentX - this._peaks.options.sourceIndicatorsXOffset);
1041
+ this._indicatorsGroup.offsetY(-this._peaks.options.sourceIndicatorsYOffset);
1044
1042
  };
1045
1043
 
1046
1044
  SourceGroup.prototype._createMarkers = function() {
package/src/source.js CHANGED
@@ -400,7 +400,7 @@ define([
400
400
 
401
401
  this._peaks = peaks;
402
402
  this._id = id;
403
- this._originId = originId;
403
+ this._originId = originId || id;
404
404
  this._elementId = elementId;
405
405
  this._title = opts.title;
406
406
  this._url = opts.url;
@@ -64,7 +64,7 @@ define([
64
64
  // Create the copy (cut)
65
65
  var newSource = this._add([{
66
66
  id: Utils.createUuidv4(),
67
- originId: sourceToCut.id,
67
+ originId: sourceToCut.originId,
68
68
  elementId: sourceToCut.elementId,
69
69
  title: sourceToCut.title,
70
70
  url: sourceToCut.url,