@checksub_team/peaks_timeline 1.9.5-beta.14 → 1.9.5-beta.2
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 +1 -1
- package/peaks.js +8 -34
- package/src/main.js +2 -2
- package/src/segment.js +1 -11
- package/src/source-group.js +5 -5
- package/src/source.js +1 -11
- package/src/sources-layer.js +0 -9
package/package.json
CHANGED
package/peaks.js
CHANGED
|
@@ -15589,8 +15589,8 @@ module.exports = function (Colors, EventEmitter, TimelineSegments, TimelineSourc
|
|
|
15589
15589
|
Peaks.prototype.addSource = function (source) {
|
|
15590
15590
|
this.sources.add(source);
|
|
15591
15591
|
};
|
|
15592
|
-
Peaks.prototype.destroySource = function (sourceId
|
|
15593
|
-
this.sources.destroyById(sourceId
|
|
15592
|
+
Peaks.prototype.destroySource = function (sourceId) {
|
|
15593
|
+
this.sources.destroyById(sourceId);
|
|
15594
15594
|
};
|
|
15595
15595
|
Peaks.prototype.showSource = function (sourceId) {
|
|
15596
15596
|
this.sources.showById(sourceId);
|
|
@@ -17060,15 +17060,6 @@ module.exports = function (Utils) {
|
|
|
17060
17060
|
set: function (newId) {
|
|
17061
17061
|
this._relativeId = newId;
|
|
17062
17062
|
}
|
|
17063
|
-
},
|
|
17064
|
-
selected: {
|
|
17065
|
-
enumerable: true,
|
|
17066
|
-
get: function () {
|
|
17067
|
-
return this._selected;
|
|
17068
|
-
},
|
|
17069
|
-
set: function (selected) {
|
|
17070
|
-
this._selected = selected;
|
|
17071
|
-
}
|
|
17072
17063
|
}
|
|
17073
17064
|
});
|
|
17074
17065
|
Segment.prototype.update = function (options) {
|
|
@@ -17114,7 +17105,6 @@ module.exports = function (Utils) {
|
|
|
17114
17105
|
};
|
|
17115
17106
|
Segment.prototype.setSelected = function (selected) {
|
|
17116
17107
|
this._selected = selected;
|
|
17117
|
-
this._peaks.emit('segment.selected', this);
|
|
17118
17108
|
};
|
|
17119
17109
|
Segment.prototype.isVisible = function (startTime, endTime) {
|
|
17120
17110
|
return this.startTime < endTime && startTime < this.endTime;
|
|
@@ -17709,7 +17699,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
|
|
|
17709
17699
|
}
|
|
17710
17700
|
this._addHandles();
|
|
17711
17701
|
this.setWrapping(source.wrapped);
|
|
17712
|
-
this.
|
|
17702
|
+
this._setSelected();
|
|
17713
17703
|
this._indicatorsGroup = new Konva.Group();
|
|
17714
17704
|
this._group.add(this._indicatorsGroup);
|
|
17715
17705
|
this.createIndicators();
|
|
@@ -18172,9 +18162,9 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
|
|
|
18172
18162
|
return preview.type === 'audio';
|
|
18173
18163
|
});
|
|
18174
18164
|
};
|
|
18175
|
-
SourceGroup.prototype.
|
|
18165
|
+
SourceGroup.prototype._setSelected = function () {
|
|
18176
18166
|
if (this._border) {
|
|
18177
|
-
if (this._source.
|
|
18167
|
+
if (this._source._selected) {
|
|
18178
18168
|
this._border.fill(this._source.selectedColor);
|
|
18179
18169
|
this._borderWidth = this._peaks.options.sourceSelectedBorderWidth;
|
|
18180
18170
|
} else {
|
|
@@ -18187,7 +18177,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
|
|
|
18187
18177
|
return node.getClassName() === 'Shape';
|
|
18188
18178
|
});
|
|
18189
18179
|
if (unwrap_background) {
|
|
18190
|
-
if (this._source.
|
|
18180
|
+
if (this._source._selected) {
|
|
18191
18181
|
unwrap_background.stroke(this._source.selectedColor);
|
|
18192
18182
|
unwrap_background.strokeWidth(this._peaks.options.sourceSelectedBorderWidth);
|
|
18193
18183
|
} else {
|
|
@@ -18200,7 +18190,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Utils, Konva) {
|
|
|
18200
18190
|
return node.getClassName() === 'Shape';
|
|
18201
18191
|
});
|
|
18202
18192
|
if (wrap_background) {
|
|
18203
|
-
if (this._source.
|
|
18193
|
+
if (this._source._selected) {
|
|
18204
18194
|
wrap_background.stroke(this._source.selectedColor);
|
|
18205
18195
|
wrap_background.strokeWidth(this._peaks.options.sourceSelectedBorderWidth);
|
|
18206
18196
|
} else {
|
|
@@ -18908,15 +18898,6 @@ module.exports = function (Utils) {
|
|
|
18908
18898
|
get: function () {
|
|
18909
18899
|
return this._minSize;
|
|
18910
18900
|
}
|
|
18911
|
-
},
|
|
18912
|
-
selected: {
|
|
18913
|
-
enumerable: true,
|
|
18914
|
-
get: function () {
|
|
18915
|
-
return this._selected;
|
|
18916
|
-
},
|
|
18917
|
-
set: function (selected) {
|
|
18918
|
-
this._selected = selected;
|
|
18919
|
-
}
|
|
18920
18901
|
}
|
|
18921
18902
|
});
|
|
18922
18903
|
Source.prototype.updateTimes = function (newStartTime, newEndTime) {
|
|
@@ -19078,7 +19059,7 @@ module.exports = function (Utils) {
|
|
|
19078
19059
|
};
|
|
19079
19060
|
Source.prototype.setSelected = function (selected) {
|
|
19080
19061
|
this._selected = selected;
|
|
19081
|
-
this._peaks.emit('source.
|
|
19062
|
+
this._peaks.emit('source.update', this);
|
|
19082
19063
|
};
|
|
19083
19064
|
Source.prototype.isVisible = function (startTime, endTime) {
|
|
19084
19065
|
return this._startTime < endTime && startTime < this._endTime;
|
|
@@ -19108,7 +19089,6 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
|
|
|
19108
19089
|
this._peaks.on('sources.show', this._onSourcesShow.bind(this));
|
|
19109
19090
|
this._peaks.on('sources.hide', this._onSourcesHide.bind(this));
|
|
19110
19091
|
this._peaks.on('source.update', this._onSourceUpdate.bind(this));
|
|
19111
|
-
this._peaks.on('source.selected', this._onSourceSelected.bind(this));
|
|
19112
19092
|
this._peaks.on('data.retrieved', this._onDataRetrieved.bind(this));
|
|
19113
19093
|
this._peaks.on('sources.refresh', this._onSourcesRefresh.bind(this));
|
|
19114
19094
|
this._peaks.on('segments.show', this._onSegmentsShow.bind(this));
|
|
@@ -19177,12 +19157,6 @@ module.exports = function (SourceGroup, Lines, DataRetriever, Utils, Invoker, Ko
|
|
|
19177
19157
|
this.updateSources(frameStartTime, frameEndTime);
|
|
19178
19158
|
}
|
|
19179
19159
|
};
|
|
19180
|
-
SourcesLayer.prototype._onSourceSelected = function (source) {
|
|
19181
|
-
var sourceGroup = this._sourcesGroup[source.id];
|
|
19182
|
-
if (sourceGroup) {
|
|
19183
|
-
sourceGroup.setSelected();
|
|
19184
|
-
}
|
|
19185
|
-
};
|
|
19186
19160
|
SourcesLayer.prototype._onSourcesShow = function (sources) {
|
|
19187
19161
|
var self = this;
|
|
19188
19162
|
sources.forEach(function (source) {
|
package/src/main.js
CHANGED
|
@@ -637,8 +637,8 @@ define([
|
|
|
637
637
|
* @param {String} sourceId
|
|
638
638
|
*/
|
|
639
639
|
|
|
640
|
-
Peaks.prototype.destroySource = function(sourceId
|
|
641
|
-
this.sources.destroyById(sourceId
|
|
640
|
+
Peaks.prototype.destroySource = function(sourceId) {
|
|
641
|
+
this.sources.destroyById(sourceId);
|
|
642
642
|
};
|
|
643
643
|
|
|
644
644
|
/**
|
package/src/segment.js
CHANGED
|
@@ -292,16 +292,6 @@ define([
|
|
|
292
292
|
set: function(newId) {
|
|
293
293
|
this._relativeId = newId;
|
|
294
294
|
}
|
|
295
|
-
},
|
|
296
|
-
selected: {
|
|
297
|
-
enumerable: true,
|
|
298
|
-
get: function() {
|
|
299
|
-
return this._selected;
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
set: function(selected) {
|
|
303
|
-
this._selected = selected;
|
|
304
|
-
}
|
|
305
295
|
}
|
|
306
296
|
});
|
|
307
297
|
|
|
@@ -353,7 +343,7 @@ define([
|
|
|
353
343
|
|
|
354
344
|
Segment.prototype.setSelected = function(selected) {
|
|
355
345
|
this._selected = selected;
|
|
356
|
-
this._peaks.emit('segment.
|
|
346
|
+
// this._peaks.emit('segment.update', this); // It's currently useless
|
|
357
347
|
};
|
|
358
348
|
|
|
359
349
|
/**
|
package/src/source-group.js
CHANGED
|
@@ -98,7 +98,7 @@ define([
|
|
|
98
98
|
|
|
99
99
|
this.setWrapping(source.wrapped);
|
|
100
100
|
|
|
101
|
-
this.
|
|
101
|
+
this._setSelected();
|
|
102
102
|
|
|
103
103
|
this._indicatorsGroup = new Konva.Group();
|
|
104
104
|
this._group.add(this._indicatorsGroup);
|
|
@@ -741,9 +741,9 @@ define([
|
|
|
741
741
|
});
|
|
742
742
|
};
|
|
743
743
|
|
|
744
|
-
SourceGroup.prototype.
|
|
744
|
+
SourceGroup.prototype._setSelected = function() {
|
|
745
745
|
if (this._border) {
|
|
746
|
-
if (this._source.
|
|
746
|
+
if (this._source._selected) {
|
|
747
747
|
this._border.fill(this._source.selectedColor);
|
|
748
748
|
this._borderWidth = this._peaks.options.sourceSelectedBorderWidth;
|
|
749
749
|
}
|
|
@@ -760,7 +760,7 @@ define([
|
|
|
760
760
|
});
|
|
761
761
|
|
|
762
762
|
if (unwrap_background) {
|
|
763
|
-
if (this._source.
|
|
763
|
+
if (this._source._selected) {
|
|
764
764
|
unwrap_background.stroke(this._source.selectedColor);
|
|
765
765
|
unwrap_background.strokeWidth(this._peaks.options.sourceSelectedBorderWidth);
|
|
766
766
|
}
|
|
@@ -777,7 +777,7 @@ define([
|
|
|
777
777
|
});
|
|
778
778
|
|
|
779
779
|
if (wrap_background) {
|
|
780
|
-
if (this._source.
|
|
780
|
+
if (this._source._selected) {
|
|
781
781
|
wrap_background.stroke(this._source.selectedColor);
|
|
782
782
|
wrap_background.strokeWidth(this._peaks.options.sourceSelectedBorderWidth);
|
|
783
783
|
}
|
package/src/source.js
CHANGED
|
@@ -669,16 +669,6 @@ define([
|
|
|
669
669
|
get: function() {
|
|
670
670
|
return this._minSize;
|
|
671
671
|
}
|
|
672
|
-
},
|
|
673
|
-
selected: {
|
|
674
|
-
enumerable: true,
|
|
675
|
-
get: function() {
|
|
676
|
-
return this._selected;
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
set: function(selected) {
|
|
680
|
-
this._selected = selected;
|
|
681
|
-
}
|
|
682
672
|
}
|
|
683
673
|
});
|
|
684
674
|
|
|
@@ -877,7 +867,7 @@ define([
|
|
|
877
867
|
|
|
878
868
|
Source.prototype.setSelected = function(selected) {
|
|
879
869
|
this._selected = selected;
|
|
880
|
-
this._peaks.emit('source.
|
|
870
|
+
this._peaks.emit('source.update', this);
|
|
881
871
|
};
|
|
882
872
|
|
|
883
873
|
/**
|
package/src/sources-layer.js
CHANGED
|
@@ -54,7 +54,6 @@ define([
|
|
|
54
54
|
this._peaks.on('sources.show', this._onSourcesShow.bind(this));
|
|
55
55
|
this._peaks.on('sources.hide', this._onSourcesHide.bind(this));
|
|
56
56
|
this._peaks.on('source.update', this._onSourceUpdate.bind(this));
|
|
57
|
-
this._peaks.on('source.selected', this._onSourceSelected.bind(this));
|
|
58
57
|
this._peaks.on('data.retrieved', this._onDataRetrieved.bind(this));
|
|
59
58
|
this._peaks.on('sources.refresh', this._onSourcesRefresh.bind(this));
|
|
60
59
|
this._peaks.on('segments.show', this._onSegmentsShow.bind(this));
|
|
@@ -153,14 +152,6 @@ define([
|
|
|
153
152
|
}
|
|
154
153
|
};
|
|
155
154
|
|
|
156
|
-
SourcesLayer.prototype._onSourceSelected = function(source) {
|
|
157
|
-
var sourceGroup = this._sourcesGroup[source.id];
|
|
158
|
-
|
|
159
|
-
if (sourceGroup) {
|
|
160
|
-
sourceGroup.setSelected();
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
155
|
SourcesLayer.prototype._onSourcesShow = function(sources) {
|
|
165
156
|
var self = this;
|
|
166
157
|
|