@checksub_team/peaks_timeline 1.4.48 → 1.4.51

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.48",
3
+ "version": "1.4.51",
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
@@ -17461,6 +17461,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
17461
17461
  this._group.on('dragend', this._onSourceGroupDragEnd.bind(this));
17462
17462
  this._addWrap(true);
17463
17463
  this._addUnwrap(true);
17464
+ this._addTitle(true);
17464
17465
  this._addHandles(true);
17465
17466
  this.setWrapping(source.wrapped);
17466
17467
  }
@@ -17513,12 +17514,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
17513
17514
  this._width = newWidth;
17514
17515
  this._rightHandle.x(newWidth - HANDLE_WIDTH);
17515
17516
  this.updatePreviews();
17516
- var title = this._wrap.getChildren(function (node) {
17517
- return node.getClassName() === 'Text';
17518
- });
17519
- if (title) {
17520
- title.width(newWidth - 10);
17521
- }
17517
+ this._title.width(newWidth - 10);
17522
17518
  }
17523
17519
  };
17524
17520
  SourceGroup.prototype.setWrapping = function (wrap) {
@@ -17745,10 +17741,20 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
17745
17741
  }
17746
17742
  });
17747
17743
  }
17744
+ wrap.add(background);
17745
+ return wrap;
17746
+ };
17747
+ SourceGroup.prototype._addTitle = function (forceCreate) {
17748
+ if (!this._title || forceCreate) {
17749
+ this._title = this._createTitle();
17750
+ }
17751
+ this._group.add(this._title);
17752
+ };
17753
+ SourceGroup.prototype._createTitle = function () {
17748
17754
  var title = new Konva.Text({
17749
17755
  x: 5,
17756
+ y: 5,
17750
17757
  width: this._width - 10,
17751
- height: this._wrappedHeight,
17752
17758
  text: Utils.removeLineBreaks(this._source.title),
17753
17759
  textAlign: 'left',
17754
17760
  verticalAlign: 'middle',
@@ -17759,9 +17765,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
17759
17765
  ellipsis: true,
17760
17766
  listening: false
17761
17767
  });
17762
- wrap.add(background);
17763
- wrap.add(title);
17764
- return wrap;
17768
+ return title;
17765
17769
  };
17766
17770
  SourceGroup.prototype.getWidth = function () {
17767
17771
  return this._width;
@@ -18253,13 +18257,14 @@ module.exports = function (Utils) {
18253
18257
  options.wrapped = false;
18254
18258
  }
18255
18259
  }
18256
- function Source(peaks, id, originId, elementId, title, url, previewUrl, binaryUrl, kind, duration, startTime, endTime, mediaStartTime, mediaEndTime, color, borderColor, selectedColor, textColor, borderWidth, wrapped, position, draggable, resizable, wrapping, previewHeight, binaryHeight) {
18260
+ function Source(peaks, id, originId, elementId, title, url, previewUrl, binaryUrl, kind, subkind, duration, startTime, endTime, mediaStartTime, mediaEndTime, color, borderColor, selectedColor, textColor, borderWidth, wrapped, position, draggable, resizable, wrapping, previewHeight, binaryHeight) {
18257
18261
  var opts = {
18258
18262
  title: title,
18259
18263
  url: url,
18260
18264
  previewUrl: previewUrl,
18261
18265
  binaryUrl: binaryUrl,
18262
18266
  kind: kind,
18267
+ subkind: subkind,
18263
18268
  duration: duration,
18264
18269
  startTime: startTime,
18265
18270
  endTime: endTime,
@@ -18288,6 +18293,7 @@ module.exports = function (Utils) {
18288
18293
  this._previewUrl = opts.previewUrl;
18289
18294
  this._binaryUrl = opts.binaryUrl;
18290
18295
  this._kind = opts.kind;
18296
+ this._subkind = opts.subkind;
18291
18297
  this._duration = opts.duration;
18292
18298
  this._startTime = opts.startTime;
18293
18299
  this._endTime = opts.endTime;
@@ -18362,6 +18368,15 @@ module.exports = function (Utils) {
18362
18368
  this._kind = kind;
18363
18369
  }
18364
18370
  },
18371
+ subkind: {
18372
+ enumerable: true,
18373
+ get: function () {
18374
+ return this._subkind;
18375
+ },
18376
+ set: function (subkind) {
18377
+ this._subkind = subkind;
18378
+ }
18379
+ },
18365
18380
  duration: {
18366
18381
  enumerable: true,
18367
18382
  get: function () {
@@ -18604,6 +18619,7 @@ module.exports = function (Utils) {
18604
18619
  previewUrl: this.previewUrl,
18605
18620
  binaryUrl: this.binaryUrl,
18606
18621
  kind: this.kind,
18622
+ subkind: this.subkind,
18607
18623
  duration: this.duration,
18608
18624
  startTime: this.startTime,
18609
18625
  endTime: this.endTime,
@@ -18629,6 +18645,7 @@ module.exports = function (Utils) {
18629
18645
  this._previewUrl = opts.previewUrl;
18630
18646
  this._binaryUrl = opts.binaryUrl;
18631
18647
  this._kind = opts.kind;
18648
+ this._subkind = opts.subkind;
18632
18649
  this._duration = opts.duration;
18633
18650
  this._startTime = opts.startTime;
18634
18651
  this._endTime = opts.endTime;
@@ -19322,6 +19339,7 @@ module.exports = function (Source, Utils) {
19322
19339
  previewUrl: sourceToCut.previewUrl,
19323
19340
  binaryUrl: sourceToCut.binaryUrl,
19324
19341
  kind: sourceToCut.kind,
19342
+ subkind: sourceToCut.subkind,
19325
19343
  duration: sourceToCut.duration,
19326
19344
  startTime: sourceToCut.endTime,
19327
19345
  endTime: originalEndTime,
@@ -19353,7 +19371,7 @@ module.exports = function (Source, Utils) {
19353
19371
  if (!Utils.isObject(options)) {
19354
19372
  throw new TypeError('peaks.sources.add(): expected a Source object parameter');
19355
19373
  }
19356
- var source = new Source(this._peaks, options.id || this._getNextSourceId(), options.originId, options.elementId, options.title, options.url, options.previewUrl, options.binaryUrl, options.kind, options.duration, options.startTime, options.endTime, options.mediaStartTime, options.mediaEndTime, options.color, options.borderColor, options.selectedColor, options.textColor, options.borderWidth, options.wrapped, options.position, options.draggable, options.resizable, options.wrapping, options.previewHeight, options.binaryHeight);
19374
+ var source = new Source(this._peaks, options.id || this._getNextSourceId(), options.originId, options.elementId, options.title, options.url, options.previewUrl, options.binaryUrl, options.kind, options.subkind, options.duration, options.startTime, options.endTime, options.mediaStartTime, options.mediaEndTime, options.color, options.borderColor, options.selectedColor, options.textColor, options.borderWidth, options.wrapped, options.position, options.draggable, options.resizable, options.wrapping, options.previewHeight, options.binaryHeight);
19357
19375
  return source;
19358
19376
  };
19359
19377
  TimelineSources.prototype.getSources = function () {
@@ -86,6 +86,7 @@ define([
86
86
 
87
87
  this._addWrap(true);
88
88
  this._addUnwrap(true);
89
+ this._addTitle(true);
89
90
  this._addHandles(true);
90
91
 
91
92
  this.setWrapping(source.wrapped);
@@ -205,13 +206,7 @@ define([
205
206
  this.updatePreviews();
206
207
 
207
208
  // update wrap
208
- var title = this._wrap.getChildren(function(node) {
209
- return node.getClassName() === 'Text';
210
- });
211
-
212
- if (title) {
213
- title.width(newWidth - 10);
214
- }
209
+ this._title.width(newWidth - 10);
215
210
  }
216
211
  };
217
212
 
@@ -498,10 +493,24 @@ define([
498
493
  });
499
494
  }
500
495
 
496
+ wrap.add(background);
497
+
498
+ return wrap;
499
+ };
500
+
501
+ SourceGroup.prototype._addTitle = function(forceCreate) {
502
+ if (!this._title || forceCreate) {
503
+ this._title = this._createTitle();
504
+ }
505
+
506
+ this._group.add(this._title);
507
+ };
508
+
509
+ SourceGroup.prototype._createTitle = function() {
501
510
  var title = new Konva.Text({
502
511
  x: 5,
512
+ y: 5,
503
513
  width: this._width - 10,
504
- height: this._wrappedHeight,
505
514
  text: Utils.removeLineBreaks(this._source.title),
506
515
  textAlign: 'left',
507
516
  verticalAlign: 'middle',
@@ -513,10 +522,7 @@ define([
513
522
  listening: false
514
523
  });
515
524
 
516
- wrap.add(background);
517
- wrap.add(title);
518
-
519
- return wrap;
525
+ return title;
520
526
  };
521
527
 
522
528
  SourceGroup.prototype.getWidth = function() {
package/src/source.js CHANGED
@@ -220,7 +220,7 @@ define([
220
220
  */
221
221
 
222
222
  function Source(peaks, id, originId, elementId, title, url, previewUrl, binaryUrl, kind,
223
- duration, startTime, endTime, mediaStartTime, mediaEndTime, color, borderColor,
223
+ subkind, duration, startTime, endTime, mediaStartTime, mediaEndTime, color, borderColor,
224
224
  selectedColor, textColor, borderWidth, wrapped, position, draggable, resizable, wrapping,
225
225
  previewHeight, binaryHeight) {
226
226
  var opts = {
@@ -229,6 +229,7 @@ define([
229
229
  previewUrl: previewUrl,
230
230
  binaryUrl: binaryUrl,
231
231
  kind: kind,
232
+ subkind: subkind,
232
233
  duration: duration,
233
234
  startTime: startTime,
234
235
  endTime: endTime,
@@ -259,6 +260,7 @@ define([
259
260
  this._previewUrl = opts.previewUrl;
260
261
  this._binaryUrl = opts.binaryUrl;
261
262
  this._kind = opts.kind;
263
+ this._subkind = opts.subkind;
262
264
  this._duration = opts.duration;
263
265
  this._startTime = opts.startTime;
264
266
  this._endTime = opts.endTime;
@@ -336,6 +338,16 @@ define([
336
338
  this._kind = kind;
337
339
  }
338
340
  },
341
+ subkind: {
342
+ enumerable: true,
343
+ get: function() {
344
+ return this._subkind;
345
+ },
346
+
347
+ set: function(subkind) {
348
+ this._subkind = subkind;
349
+ }
350
+ },
339
351
  duration: {
340
352
  enumerable: true,
341
353
  get: function() {
@@ -622,6 +634,7 @@ define([
622
634
  previewUrl: this.previewUrl,
623
635
  binaryUrl: this.binaryUrl,
624
636
  kind: this.kind,
637
+ subkind: this.subkind,
625
638
  duration: this.duration,
626
639
  startTime: this.startTime,
627
640
  endTime: this.endTime,
@@ -650,6 +663,7 @@ define([
650
663
  this._previewUrl = opts.previewUrl;
651
664
  this._binaryUrl = opts.binaryUrl;
652
665
  this._kind = opts.kind;
666
+ this._subkind = opts.subkind;
653
667
  this._duration = opts.duration;
654
668
  this._startTime = opts.startTime;
655
669
  this._endTime = opts.endTime;
@@ -71,6 +71,7 @@ define([
71
71
  previewUrl: sourceToCut.previewUrl,
72
72
  binaryUrl: sourceToCut.binaryUrl,
73
73
  kind: sourceToCut.kind,
74
+ subkind: sourceToCut.subkind,
74
75
  duration: sourceToCut.duration,
75
76
  startTime: sourceToCut.endTime,
76
77
  endTime: originalEndTime,
@@ -143,6 +144,7 @@ define([
143
144
  options.previewUrl,
144
145
  options.binaryUrl,
145
146
  options.kind,
147
+ options.subkind,
146
148
  options.duration,
147
149
  options.startTime,
148
150
  options.endTime,