@checksub_team/peaks_timeline 1.5.8 → 1.5.9

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.5.8",
3
+ "version": "1.5.9",
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
@@ -14376,10 +14376,12 @@ module.exports = function (Konva, Utils, SVGs) {
14376
14376
  text: text,
14377
14377
  fontSize: this._sizes.font,
14378
14378
  fontFamily: 'Arial',
14379
- fill: this._peaks.options.lineIndicatorColor,
14379
+ fill: this._peaks.options.lineIndicatorTextColor,
14380
14380
  align: 'center',
14381
14381
  width: this._width
14382
14382
  });
14383
+ textNode.setAttr('defaultColor', this._peaks.options.lineIndicatorTextColor);
14384
+ textNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedTextColor);
14383
14385
  indicator.add(textNode);
14384
14386
  indicatorHeight += this._sizes.font;
14385
14387
  }
@@ -14391,7 +14393,7 @@ module.exports = function (Konva, Utils, SVGs) {
14391
14393
  x: this._width / 2,
14392
14394
  y: indicatorHeight + this._sizes.icon.default / 2 + padding,
14393
14395
  radius: this._sizes.icon.default / 2,
14394
- fill: this._peaks.options.lineIndicatorColor,
14396
+ fill: this._peaks.options.lineIndicatorIconColor,
14395
14397
  strokeWidth: 0,
14396
14398
  lineId: line.getId()
14397
14399
  });
@@ -14401,7 +14403,7 @@ module.exports = function (Konva, Utils, SVGs) {
14401
14403
  x: (this._width - this._sizes.icon[type]) / 2,
14402
14404
  y: indicatorHeight,
14403
14405
  data: SVGs[type].path,
14404
- fill: this._peaks.options.lineIndicatorColor,
14406
+ fill: this._peaks.options.lineIndicatorIconColor,
14405
14407
  scale: {
14406
14408
  x: this._sizes.icon[type] / SVGs[type].width,
14407
14409
  y: this._sizes.icon[type] / SVGs[type].height
@@ -14409,6 +14411,8 @@ module.exports = function (Konva, Utils, SVGs) {
14409
14411
  lineId: line.getId()
14410
14412
  });
14411
14413
  }
14414
+ iconNode.setAttr('defaultColor', this._peaks.options.lineIndicatorIconColor);
14415
+ iconNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedIconColor);
14412
14416
  indicator.add(iconNode);
14413
14417
  indicatorHeight += this._sizes.icon[type];
14414
14418
  indicator.setAttr('trueHeight', indicatorHeight);
@@ -14416,13 +14420,13 @@ module.exports = function (Konva, Utils, SVGs) {
14416
14420
  var self = this;
14417
14421
  indicator.on('mouseover', function () {
14418
14422
  indicator.getChildren().forEach(function (child) {
14419
- child.fill(self._peaks.options.lineIndicatorSelected);
14423
+ child.fill(child.getAttr('selectedColor'));
14420
14424
  });
14421
14425
  self.draw();
14422
14426
  });
14423
14427
  indicator.on('mouseout', function () {
14424
14428
  indicator.getChildren().forEach(function (child) {
14425
- child.fill(self._peaks.options.lineIndicatorColor);
14429
+ child.fill(child.getAttr('defaultColor'));
14426
14430
  });
14427
14431
  self.draw();
14428
14432
  });
@@ -15417,8 +15421,10 @@ module.exports = function (Colors, EventEmitter, TimelineSegments, TimelineSourc
15417
15421
  lineIndicatorVisibilityIconSize: 24,
15418
15422
  lineIndicatorNoVisibilityIconSize: 24,
15419
15423
  lineIndicatorFontSize: 10,
15420
- lineIndicatorColor: '#8A8F98',
15421
- lineIndicatorSelected: '#ccc',
15424
+ lineIndicatorTextColor: '#8A8F98',
15425
+ lineIndicatorIconColor: '#8A8F98',
15426
+ lineIndicatorSelectedTextColor: '#ccc',
15427
+ lineIndicatorSelectedIconColor: '#ccc',
15422
15428
  autoScrollThreshold: 0.05,
15423
15429
  enableLineIndicatorContextMenu: true,
15424
15430
  minSourceSize: 0.05,
@@ -140,11 +140,14 @@ define([
140
140
  text: text,
141
141
  fontSize: this._sizes.font,
142
142
  fontFamily: 'Arial',
143
- fill: this._peaks.options.lineIndicatorColor,
143
+ fill: this._peaks.options.lineIndicatorTextColor,
144
144
  align: 'center',
145
145
  width: this._width
146
146
  });
147
147
 
148
+ textNode.setAttr('defaultColor', this._peaks.options.lineIndicatorTextColor);
149
+ textNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedTextColor);
150
+
148
151
  indicator.add(textNode);
149
152
  indicatorHeight += this._sizes.font;
150
153
  }
@@ -160,7 +163,7 @@ define([
160
163
  x: this._width / 2,
161
164
  y: indicatorHeight + this._sizes.icon.default / 2 + padding,
162
165
  radius: this._sizes.icon.default / 2,
163
- fill: this._peaks.options.lineIndicatorColor,
166
+ fill: this._peaks.options.lineIndicatorIconColor,
164
167
  strokeWidth: 0,
165
168
  lineId: line.getId()
166
169
  });
@@ -172,7 +175,7 @@ define([
172
175
  x: (this._width - this._sizes.icon[type]) / 2,
173
176
  y: indicatorHeight,
174
177
  data: SVGs[type].path,
175
- fill: this._peaks.options.lineIndicatorColor,
178
+ fill: this._peaks.options.lineIndicatorIconColor,
176
179
  scale: {
177
180
  x: (this._sizes.icon[type]) / SVGs[type].width,
178
181
  y: (this._sizes.icon[type]) / SVGs[type].height
@@ -181,6 +184,9 @@ define([
181
184
  });
182
185
  }
183
186
 
187
+ iconNode.setAttr('defaultColor', this._peaks.options.lineIndicatorIconColor);
188
+ iconNode.setAttr('selectedColor', this._peaks.options.lineIndicatorSelectedIconColor);
189
+
184
190
  indicator.add(iconNode);
185
191
  indicatorHeight += this._sizes.icon[type];
186
192
 
@@ -192,14 +198,14 @@ define([
192
198
 
193
199
  indicator.on('mouseover', function() {
194
200
  indicator.getChildren().forEach(function(child) {
195
- child.fill(self._peaks.options.lineIndicatorSelected);
201
+ child.fill(child.getAttr('selectedColor'));
196
202
  });
197
203
  self.draw();
198
204
  });
199
205
 
200
206
  indicator.on('mouseout', function() {
201
207
  indicator.getChildren().forEach(function(child) {
202
- child.fill(self._peaks.options.lineIndicatorColor);
208
+ child.fill(child.getAttr('defaultColor'));
203
209
  });
204
210
  self.draw();
205
211
  });
package/src/main.js CHANGED
@@ -311,14 +311,24 @@ define([
311
311
  lineIndicatorFontSize: 10,
312
312
 
313
313
  /**
314
- * Color of the line indicators
314
+ * Color of the line indicators' text
315
315
  */
316
- lineIndicatorColor: '#8A8F98',
316
+ lineIndicatorTextColor: '#8A8F98',
317
317
 
318
318
  /**
319
- * Color for the indicator when selected
319
+ * Color of the line indicators' icon
320
+ */
321
+ lineIndicatorIconColor: '#8A8F98',
322
+
323
+ /**
324
+ * Color for the indicator's text when selected
325
+ */
326
+ lineIndicatorSelectedTextColor: '#ccc',
327
+
328
+ /**
329
+ * Color for the indicator's icon when selected
320
330
  */
321
- lineIndicatorSelected: '#ccc',
331
+ lineIndicatorSelectedIconColor: '#ccc',
322
332
 
323
333
  /**
324
334
  * Threshold size on the left and right border of the view,