@checksub_team/peaks_timeline 1.16.1 → 2.0.0-alpha.10
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 +4691 -4380
- package/peaks.js.d.ts +5 -5
- package/src/{timeline-axis.js → components/axis.js} +244 -244
- package/src/{data-retriever.js → components/data-retriever.js} +117 -117
- package/src/{default-segment-marker.js → components/default-segment-marker.js} +132 -132
- package/src/{invoker.js → components/invoker.js} +81 -81
- package/src/components/line-group.js +696 -0
- package/src/components/line-groups.js +591 -0
- package/src/{line-indicator.js → components/line-indicator.js} +313 -303
- package/src/{marker-factories.js → components/marker-factories.js} +1 -1
- package/src/{mode-layer.js → components/mode-layer.js} +8 -12
- package/src/{playhead-layer.js → components/playhead-layer.js} +3 -3
- package/src/{segment-marker.js → components/segment-marker.js} +2 -2
- package/src/{segment-shape.js → components/segment-shape.js} +508 -508
- package/src/{segments-group.js → components/segments-group.js} +805 -801
- package/src/{source-group.js → components/source-group.js} +1663 -1640
- package/src/{sources-layer.js → components/sources-layer.js} +722 -730
- package/src/{waveform-builder.js → components/waveform-builder.js} +2 -2
- package/src/{waveform-shape.js → components/waveform-shape.js} +214 -214
- package/src/keyboard-handler.js +9 -9
- package/src/line-handler.js +180 -0
- package/src/main.js +109 -82
- package/src/models/line.js +156 -0
- package/src/{segment.js → models/segment.js} +420 -419
- package/src/{source.js → models/source.js} +1311 -1315
- package/src/player.js +2 -2
- package/src/{timeline-segments.js → segment-handler.js} +435 -435
- package/src/{timeline-sources.js → source-handler.js} +521 -514
- package/src/utils.js +5 -1
- package/src/{timeline-zoomview.js → view.js} +136 -143
- package/src/line.js +0 -690
- package/src/lines.js +0 -427
- /package/src/{data.js → components/data.js} +0 -0
- /package/src/{loader.js → components/loader.js} +0 -0
- /package/src/{mouse-drag-handler.js → components/mouse-drag-handler.js} +0 -0
- /package/src/{svgs.js → components/svgs.js} +0 -0
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
define([
|
|
10
|
-
'./utils',
|
|
11
|
-
'./source',
|
|
12
10
|
'./source-group',
|
|
11
|
+
'../models/source',
|
|
12
|
+
'../utils',
|
|
13
13
|
'konva'
|
|
14
|
-
], function(
|
|
14
|
+
], function(SourceGroup, Source, Utils, Konva) {
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
17
|
var TIME_X_OFFSET = 20;
|
|
@@ -56,7 +56,7 @@ define([
|
|
|
56
56
|
|
|
57
57
|
this.setMode(initialMode);
|
|
58
58
|
|
|
59
|
-
this._peaks.on('sources.destroy', this._onSourcesDestroy.bind(this));
|
|
59
|
+
this._peaks.on('handler.sources.destroy', this._onSourcesDestroy.bind(this));
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
ModeLayer.prototype._onSourcesDestroy = function(sources) {
|
|
@@ -299,7 +299,7 @@ define([
|
|
|
299
299
|
|
|
300
300
|
if (hoveredElement.getWidth() >= 2 * minSize) {
|
|
301
301
|
var height = hoveredElement.getCurrentHeight();
|
|
302
|
-
var y = hoveredElement.
|
|
302
|
+
var y = hoveredElement.getAbsoluteY();
|
|
303
303
|
|
|
304
304
|
if (position.x < hoveredElement.x() + minSize) {
|
|
305
305
|
this._cuttingLine.points([
|
|
@@ -410,11 +410,7 @@ define([
|
|
|
410
410
|
|
|
411
411
|
this._cuttingLine.visible(false);
|
|
412
412
|
|
|
413
|
-
this._peaks.
|
|
414
|
-
'source.cut',
|
|
415
|
-
hoveredElement.getSource(),
|
|
416
|
-
this._view.pixelsToTime(cuttingPixel)
|
|
417
|
-
);
|
|
413
|
+
this._peaks.cutSource(hoveredElement.getSource(), this._view.pixelsToTime(cuttingPixel));
|
|
418
414
|
|
|
419
415
|
this._view.setHoveredElement(null);
|
|
420
416
|
|
|
@@ -452,7 +448,7 @@ define([
|
|
|
452
448
|
break;
|
|
453
449
|
case 'default':
|
|
454
450
|
this._stage.off('click', this._onMouseClickInDefaultMode);
|
|
455
|
-
this._peaks.off('keyboard.delete', this._onKeyboardDelete);
|
|
451
|
+
this._peaks.off('handler.keyboard.delete', this._onKeyboardDelete);
|
|
456
452
|
break;
|
|
457
453
|
}
|
|
458
454
|
|
|
@@ -491,7 +487,7 @@ define([
|
|
|
491
487
|
break;
|
|
492
488
|
case 'default':
|
|
493
489
|
this._stage.on('click', this._onMouseClickInDefaultMode);
|
|
494
|
-
this._peaks.on('keyboard.delete', this._onKeyboardDelete);
|
|
490
|
+
this._peaks.on('handler.keyboard.delete', this._onKeyboardDelete);
|
|
495
491
|
break;
|
|
496
492
|
default:
|
|
497
493
|
return;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
define([
|
|
10
|
-
'
|
|
10
|
+
'../utils',
|
|
11
11
|
'konva'
|
|
12
12
|
], function(Utils, Konva) {
|
|
13
13
|
'use strict';
|
|
@@ -48,8 +48,8 @@ define([
|
|
|
48
48
|
|
|
49
49
|
this.fitToView();
|
|
50
50
|
|
|
51
|
-
this._peaks.on('segments.remove_all', this._onSegmentsRemoveAll.bind(this));
|
|
52
|
-
this._peaks.on('segments.remove', this._onSegmentsRemove.bind(this));
|
|
51
|
+
this._peaks.on('handler.segments.remove_all', this._onSegmentsRemoveAll.bind(this));
|
|
52
|
+
this._peaks.on('handler.segments.remove', this._onSegmentsRemove.bind(this));
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
PlayheadLayer.prototype._onSegmentsRemoveAll = function() {
|
|
@@ -130,8 +130,8 @@ define([
|
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
SegmentMarker.prototype.
|
|
134
|
-
|
|
133
|
+
SegmentMarker.prototype.moveTo = function(group) {
|
|
134
|
+
this._group.moveTo(group);
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
SegmentMarker.prototype.getSegment = function() {
|