|
@@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
/******/
|
|
|
/******/
|
|
|
/******/ // Load entry module and return exports
|
|
|
-/******/ return __webpack_require__(__webpack_require__.s = 10);
|
|
|
+/******/ return __webpack_require__(__webpack_require__.s = 14);
|
|
|
/******/ })
|
|
|
/************************************************************************/
|
|
|
/******/ ([
|
|
@@ -156,6 +156,30 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
|
|
|
/***/ }),
|
|
|
/* 10 */
|
|
|
+/***/ (function(module, exports) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+/* 11 */
|
|
|
+/***/ (function(module, exports) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+/* 12 */
|
|
|
+/***/ (function(module, exports) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+/* 13 */
|
|
|
+/***/ (function(module, exports) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/***/ }),
|
|
|
+/* 14 */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
@@ -164,14 +188,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, "Timeline", function() { return /* reexport */ timeline_Timeline; });
|
|
|
-__webpack_require__.d(__webpack_exports__, "TimelineModel", function() { return /* reexport */ TimelineModel; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "TimelineModel", function() { return /* reexport */ timelineModel["TimelineModel"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineRow", function() { return /* reexport */ timelineRow["TimelineRow"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineKeyframe", function() { return /* reexport */ timelineKeyframe["TimelineKeyframe"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineEventsEmitter", function() { return /* reexport */ TimelineEventsEmitter; });
|
|
|
-__webpack_require__.d(__webpack_exports__, "TimelineOptions", function() { return /* reexport */ timelineOptions_TimelineOptions; });
|
|
|
-__webpack_require__.d(__webpack_exports__, "TimelineStyleUtils", function() { return /* reexport */ TimelineStyleUtils; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "TimelineConsts", function() { return /* reexport */ timelineConsts["TimelineConsts"]; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "TimelineOptions", function() { return /* reexport */ timelineOptions["TimelineOptions"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineKeyframeStyle", function() { return /* reexport */ timelineKeyframeStyle["TimelineKeyframeStyle"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineRowStyle", function() { return /* reexport */ timelineRowStyle["TimelineRowStyle"]; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "TimelineStyle", function() { return /* reexport */ styles_timelineStyle["TimelineStyle"]; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "TimelineStyleUtils", function() { return /* reexport */ TimelineStyleUtils; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineUtils", function() { return /* reexport */ TimelineUtils; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineClickableElement", function() { return /* reexport */ timelineClickableElement["TimelineClickableElement"]; });
|
|
|
__webpack_require__.d(__webpack_exports__, "Selectable", function() { return /* reexport */ selectable["Selectable"]; });
|
|
@@ -183,12 +209,16 @@ __webpack_require__.d(__webpack_exports__, "TimelineScrollEvent", function() { r
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineClickEvent", function() { return /* reexport */ TimelineClickEvent; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineDragEvent", function() { return /* reexport */ TimelineDragEvent; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineEvents", function() { return /* reexport */ TimelineEvents; });
|
|
|
-__webpack_require__.d(__webpack_exports__, "TimelineConsts", function() { return /* reexport */ /* Cannot get final name for export "TimelineConsts" in "./src/settings/timelineConsts.ts" (known exports: defaultTimelineConsts, known reexports: ) */ undefined; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineKeyframeShape", function() { return /* reexport */ TimelineKeyframeShape; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineInteractionMode", function() { return /* reexport */ TimelineInteractionMode; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineElementType", function() { return /* reexport */ TimelineElementType; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineCursorType", function() { return /* reexport */ TimelineCursorType; });
|
|
|
__webpack_require__.d(__webpack_exports__, "TimelineCapShape", function() { return /* reexport */ TimelineCapShape; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "defaultTimelineOptions", function() { return /* reexport */ defaultTimelineOptions; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "defaultTimelineKeyframeStyle", function() { return /* reexport */ defaultTimelineKeyframeStyle; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "defaultTimelineRowStyle", function() { return /* reexport */ defaultTimelineRowStyle; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "defaultTimelineStyle", function() { return /* reexport */ defaultTimelineStyle; });
|
|
|
+__webpack_require__.d(__webpack_exports__, "defaultTimelineConsts", function() { return /* reexport */ defaultTimelineConsts; });
|
|
|
|
|
|
// CONCATENATED MODULE: ./src/timelineEventsEmitter.ts
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -415,158 +445,6 @@ var TimelineUtils = /*#__PURE__*/function () {
|
|
|
|
|
|
return TimelineUtils;
|
|
|
}();
|
|
|
-// CONCATENATED MODULE: ./src/enums/timelineKeyframeShape.ts
|
|
|
-var TimelineKeyframeShape;
|
|
|
-
|
|
|
-(function (TimelineKeyframeShape) {
|
|
|
- TimelineKeyframeShape["None"] = "none";
|
|
|
- TimelineKeyframeShape["Rhomb"] = "rhomb";
|
|
|
- TimelineKeyframeShape["Circle"] = "circle";
|
|
|
- TimelineKeyframeShape["Rect"] = "rect";
|
|
|
-})(TimelineKeyframeShape || (TimelineKeyframeShape = {}));
|
|
|
-// CONCATENATED MODULE: ./src/enums/timelineCapShape.ts
|
|
|
-var TimelineCapShape;
|
|
|
-
|
|
|
-(function (TimelineCapShape) {
|
|
|
- TimelineCapShape["None"] = "none";
|
|
|
- TimelineCapShape["Triangle"] = "triangle";
|
|
|
- TimelineCapShape["Rect"] = "rect";
|
|
|
-})(TimelineCapShape || (TimelineCapShape = {}));
|
|
|
-// CONCATENATED MODULE: ./src/settings/timelineOptions.ts
|
|
|
-function timelineOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
-
|
|
|
-function timelineOptions_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-var timelineOptions_TimelineOptions = function TimelineOptions() {
|
|
|
- timelineOptions_classCallCheck(this, TimelineOptions);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "id", void 0);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "snapsPerSeconds", 5);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "snapEnabled", true);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "snapAllKeyframesOnMove", false);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineThicknessPx", 2);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineMarginTopPx", 15);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineCapWidthPx", 4);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineCapHeightPx", 10);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineCap", TimelineCapShape.Rect);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "timelineColor", 'DarkOrange');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "stepPx", 120);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "stepSmallPx", 30);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "smallSteps", 50);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "leftMarginPx", 25);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "headerFillColor", '#101011');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "fillColor", '#101011');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "labelsColor", '#D5D5D5');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "tickColor", '#D5D5D5');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "selectionColor", 'White');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "rowsStyle", {
|
|
|
- /**
|
|
|
- * Row height in pixels.
|
|
|
- */
|
|
|
- height: 24,
|
|
|
- marginBottom: 2,
|
|
|
- fillColor: '#252526',
|
|
|
-
|
|
|
- /**
|
|
|
- * Keyframes stripe color
|
|
|
- */
|
|
|
- stripeFillColor: '#094771',
|
|
|
- stripeHeight: 'auto',
|
|
|
- keyframesStyle: {
|
|
|
- /**
|
|
|
- * keyframe fill color.
|
|
|
- */
|
|
|
- fillColor: 'red',
|
|
|
- shape: TimelineKeyframeShape.Rhomb,
|
|
|
-
|
|
|
- /**
|
|
|
- * Selected keyframe fill color.
|
|
|
- */
|
|
|
- selectedFillColor: 'DarkOrange',
|
|
|
- strokeColor: 'Black',
|
|
|
- strokeThickness: 0.2,
|
|
|
- draggable: true
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "headerHeight", 30);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "ticksFont", '11px sans-serif');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "zoom", 1000);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "zoomSpeed", 0.1);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "zoomMin", 80);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "zoomMax", 8000);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "controlKeyIsMetaKey", false);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "scrollContainerClass", 'scroll-container');
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "stripesDraggable", true);
|
|
|
-
|
|
|
- timelineOptions_defineProperty(this, "keyframesDraggable", true);
|
|
|
-};
|
|
|
-// CONCATENATED MODULE: ./src/settings/timelineConsts.ts
|
|
|
-var defaultTimelineConsts = {
|
|
|
- /**
|
|
|
- * Auto pan speed.
|
|
|
- */
|
|
|
- autoPanSpeed: 50,
|
|
|
-
|
|
|
- /**
|
|
|
- * scroll speed when mouse drag is used (from 0 to 1)
|
|
|
- */
|
|
|
- scrollByDragSpeed: 0.12,
|
|
|
-
|
|
|
- /**
|
|
|
- * Determine whether item was clicked.
|
|
|
- */
|
|
|
- clickDetectionMs: 120,
|
|
|
-
|
|
|
- /**
|
|
|
- * Timeout to detect double click.
|
|
|
- */
|
|
|
- doubleClickTimeoutMs: 400,
|
|
|
-
|
|
|
- /**
|
|
|
- * Time in ms used to refresh scrollbars when pan is finished.
|
|
|
- */
|
|
|
- scrollFinishedTimeoutMs: 500,
|
|
|
-
|
|
|
- /**
|
|
|
- * Auto pan padding
|
|
|
- */
|
|
|
- autoPanByScrollPadding: 10,
|
|
|
-
|
|
|
- /**
|
|
|
- * Click threshold
|
|
|
- */
|
|
|
- clickThreshold: 3
|
|
|
-};
|
|
|
// CONCATENATED MODULE: ./src/enums/timelineCursorType.ts
|
|
|
var TimelineCursorType;
|
|
|
|
|
@@ -607,7 +485,16 @@ var TimelineCursorType;
|
|
|
TimelineCursorType["ZoomIn"] = "zoom-in";
|
|
|
TimelineCursorType["ZoomOut"] = "zoom-out";
|
|
|
})(TimelineCursorType || (TimelineCursorType = {}));
|
|
|
-// CONCATENATED MODULE: ./src/settings/timelineStyleUtils.ts
|
|
|
+// CONCATENATED MODULE: ./src/enums/timelineKeyframeShape.ts
|
|
|
+var TimelineKeyframeShape;
|
|
|
+
|
|
|
+(function (TimelineKeyframeShape) {
|
|
|
+ TimelineKeyframeShape["None"] = "none";
|
|
|
+ TimelineKeyframeShape["Rhomb"] = "rhomb";
|
|
|
+ TimelineKeyframeShape["Circle"] = "circle";
|
|
|
+ TimelineKeyframeShape["Rect"] = "rect";
|
|
|
+})(TimelineKeyframeShape || (TimelineKeyframeShape = {}));
|
|
|
+// CONCATENATED MODULE: ./src/utils/timelineStyleUtils.ts
|
|
|
function timelineStyleUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
function timelineStyleUtils_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -630,7 +517,7 @@ var TimelineStyleUtils = /*#__PURE__*/function () {
|
|
|
* @param propertyName property to get.
|
|
|
* @param defaultValue default value to return
|
|
|
*/
|
|
|
- value: function getKeyframeStyle(keyframe, row, rowsStyle, propertyName, defaultValue) {
|
|
|
+ value: function getKeyframeStyle(keyframe, row, options, propertyName, defaultValue) {
|
|
|
if (keyframe && keyframe) {
|
|
|
var style = keyframe;
|
|
|
|
|
@@ -647,8 +534,10 @@ var TimelineStyleUtils = /*#__PURE__*/function () {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (rowsStyle && rowsStyle.keyframesStyle) {
|
|
|
- var _style2 = rowsStyle.keyframesStyle;
|
|
|
+ var globalRowStyle = options ? options.rowsStyle : null;
|
|
|
+
|
|
|
+ if (globalRowStyle && globalRowStyle.keyframesStyle) {
|
|
|
+ var _style2 = globalRowStyle.keyframesStyle;
|
|
|
|
|
|
if (_style2[propertyName] !== undefined) {
|
|
|
return _style2[propertyName];
|
|
@@ -659,13 +548,11 @@ var TimelineStyleUtils = /*#__PURE__*/function () {
|
|
|
}
|
|
|
/**
|
|
|
* Get row style from default settings or overrides by a row settings.
|
|
|
- * @param row
|
|
|
- * @param property
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
key: "getRowStyle",
|
|
|
- value: function getRowStyle(rowStyle, globalRowStyle, propertyName, defaultValue) {
|
|
|
+ value: function getRowStyle(rowStyle, options, propertyName, defaultValue) {
|
|
|
if (rowStyle) {
|
|
|
var style = rowStyle;
|
|
|
|
|
@@ -674,6 +561,8 @@ var TimelineStyleUtils = /*#__PURE__*/function () {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ var globalRowStyle = options ? options.rowsStyle : null;
|
|
|
+
|
|
|
if (globalRowStyle) {
|
|
|
var _style3 = globalRowStyle;
|
|
|
|
|
@@ -686,29 +575,27 @@ var TimelineStyleUtils = /*#__PURE__*/function () {
|
|
|
}
|
|
|
/**
|
|
|
* Get current row height from styling
|
|
|
- * @param row
|
|
|
- * @param includeMargin include margin to the bounds
|
|
|
*/
|
|
|
|
|
|
}, {
|
|
|
key: "getRowHeight",
|
|
|
- value: function getRowHeight(rowStyle, globalRowStyle) {
|
|
|
- return TimelineStyleUtils.getRowStyle(rowStyle, globalRowStyle, 'height', 24);
|
|
|
+ value: function getRowHeight(rowStyle, options) {
|
|
|
+ return TimelineStyleUtils.getRowStyle(rowStyle, options, 'height', 24);
|
|
|
}
|
|
|
}, {
|
|
|
key: "rowStripeHeight",
|
|
|
- value: function rowStripeHeight(rowStyle, globalRowStyle) {
|
|
|
- return TimelineStyleUtils.getRowStyle(rowStyle, globalRowStyle, 'stripeHeight', 'auto');
|
|
|
+ value: function rowStripeHeight(rowStyle, options) {
|
|
|
+ return TimelineStyleUtils.getRowStyle(rowStyle, options, 'stripeHeight', 'auto');
|
|
|
}
|
|
|
}, {
|
|
|
key: "stripeFillColor",
|
|
|
- value: function stripeFillColor(rowStyle, globalRowStyle) {
|
|
|
- return TimelineStyleUtils.getRowStyle(rowStyle, globalRowStyle, 'stripeFillColor');
|
|
|
+ value: function stripeFillColor(rowStyle, options) {
|
|
|
+ return TimelineStyleUtils.getRowStyle(rowStyle, options, 'stripeFillColor');
|
|
|
}
|
|
|
}, {
|
|
|
key: "getRowMarginBottom",
|
|
|
- value: function getRowMarginBottom(rowStyle, globalRowStyle) {
|
|
|
- return TimelineStyleUtils.getRowStyle(rowStyle, globalRowStyle, 'marginBottom', 0);
|
|
|
+ value: function getRowMarginBottom(rowStyle, options) {
|
|
|
+ return TimelineStyleUtils.getRowStyle(rowStyle, options, 'marginBottom', 0);
|
|
|
}
|
|
|
}]);
|
|
|
|
|
@@ -736,6 +623,14 @@ var TimelineEvents;
|
|
|
TimelineEvents["DoubleClick"] = "doubleclick";
|
|
|
TimelineEvents["MouseDown"] = "mousedown";
|
|
|
})(TimelineEvents || (TimelineEvents = {}));
|
|
|
+// CONCATENATED MODULE: ./src/enums/timelineCapShape.ts
|
|
|
+var TimelineCapShape;
|
|
|
+
|
|
|
+(function (TimelineCapShape) {
|
|
|
+ TimelineCapShape["None"] = "none";
|
|
|
+ TimelineCapShape["Triangle"] = "triangle";
|
|
|
+ TimelineCapShape["Rect"] = "rect";
|
|
|
+})(TimelineCapShape || (TimelineCapShape = {}));
|
|
|
// CONCATENATED MODULE: ./src/enums/timelineInteractionMode.ts
|
|
|
var TimelineInteractionMode;
|
|
|
|
|
@@ -820,6 +715,170 @@ var TimelineDragEvent = /*#__PURE__*/function (_TimelineClickEvent) {
|
|
|
|
|
|
return TimelineDragEvent;
|
|
|
}(TimelineClickEvent);
|
|
|
+// CONCATENATED MODULE: ./src/settings/defaults.ts
|
|
|
+
|
|
|
+
|
|
|
+var defaultTimelineStyle = {
|
|
|
+ width: 2,
|
|
|
+ marginTop: 15,
|
|
|
+ capWidth: 4,
|
|
|
+ capHeight: 10,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Draw timeline rectangular cap.
|
|
|
+ */
|
|
|
+ capType: TimelineCapShape.Rect,
|
|
|
+ strokeColor: 'DarkOrange',
|
|
|
+ fillColor: 'DarkOrange'
|
|
|
+};
|
|
|
+var defaultTimelineKeyframeStyle = {
|
|
|
+ /**
|
|
|
+ * keyframe fill color.
|
|
|
+ */
|
|
|
+ fillColor: 'red',
|
|
|
+ shape: TimelineKeyframeShape.Rhomb,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Selected keyframe fill color.
|
|
|
+ */
|
|
|
+ selectedFillColor: 'DarkOrange',
|
|
|
+ strokeColor: 'Black',
|
|
|
+ strokeThickness: 0.2,
|
|
|
+ draggable: true
|
|
|
+};
|
|
|
+var defaultTimelineRowStyle = {
|
|
|
+ /**
|
|
|
+ * Row height in pixels.
|
|
|
+ */
|
|
|
+ height: 24,
|
|
|
+ marginBottom: 2,
|
|
|
+ fillColor: '#252526',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Keyframes stripe color
|
|
|
+ */
|
|
|
+ stripeFillColor: '#094771',
|
|
|
+ stripeHeight: 'auto',
|
|
|
+ keyframesStyle: defaultTimelineKeyframeStyle
|
|
|
+};
|
|
|
+var defaultTimelineOptions = {
|
|
|
+ /**
|
|
|
+ * Snap the mouse to the values on a timeline.
|
|
|
+ * Value can be from 1 to 60
|
|
|
+ */
|
|
|
+ snapsPerSeconds: 5,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Snap all selected keyframes as a bundle during the drag.
|
|
|
+ */
|
|
|
+ snapAllKeyframesOnMove: false,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Check whether snapping is enabled.
|
|
|
+ */
|
|
|
+ snapEnabled: true,
|
|
|
+ timelineStyle: defaultTimelineStyle,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * approximate step for the timeline in pixels for 1 second
|
|
|
+ */
|
|
|
+ stepPx: 120,
|
|
|
+ stepSmallPx: 30,
|
|
|
+ smallSteps: 50,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * additional left margin in pixels to start the line gauge from.
|
|
|
+ */
|
|
|
+ leftMarginPx: 25,
|
|
|
+ headerFillColor: '#101011',
|
|
|
+ fillColor: '#101011',
|
|
|
+ labelsColor: '#D5D5D5',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Header gauge tick color.
|
|
|
+ */
|
|
|
+ tickColor: '#D5D5D5',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Selection rectangle color.
|
|
|
+ */
|
|
|
+ selectionColor: 'White',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Default rows style.
|
|
|
+ * Can be overridden by setting style individually for each row.
|
|
|
+ */
|
|
|
+ rowsStyle: defaultTimelineRowStyle,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Header height in pixels
|
|
|
+ */
|
|
|
+ headerHeight: 30,
|
|
|
+ font: '11px sans-serif',
|
|
|
+ zoom: 1000,
|
|
|
+ // Zoom speed. Use percent of the screen to set zoom speed.
|
|
|
+ zoomSpeed: 0.1,
|
|
|
+ // Max zoom
|
|
|
+ zoomMin: 80,
|
|
|
+ // Min zoom
|
|
|
+ zoomMax: 8000,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set this to true in a MAC OS environment: The Meta key will be used instead of the Ctrl key.
|
|
|
+ */
|
|
|
+ controlKeyIsMetaKey: false,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Access the scroll container via this class for e.g. scroll bar styling.
|
|
|
+ */
|
|
|
+ scrollContainerClass: 'scroll-container',
|
|
|
+
|
|
|
+ /**
|
|
|
+ * keyframes stripe is draggable.
|
|
|
+ */
|
|
|
+ stripesDraggable: true,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * keyframes stripe is draggable.
|
|
|
+ */
|
|
|
+ keyframesDraggable: true
|
|
|
+};
|
|
|
+var defaultTimelineConsts = {
|
|
|
+ /**
|
|
|
+ * Auto pan speed.
|
|
|
+ */
|
|
|
+ autoPanSpeed: 50,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * scroll speed when mouse drag is used (from 0 to 1)
|
|
|
+ */
|
|
|
+ scrollByDragSpeed: 0.12,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Determine whether item was clicked.
|
|
|
+ */
|
|
|
+ clickDetectionMs: 120,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Timeout to detect double click.
|
|
|
+ */
|
|
|
+ doubleClickTimeoutMs: 400,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Time in ms used to refresh scrollbars when pan is finished.
|
|
|
+ */
|
|
|
+ scrollFinishedTimeoutMs: 500,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Auto pan padding
|
|
|
+ */
|
|
|
+ autoPanByScrollPadding: 10,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Click threshold
|
|
|
+ */
|
|
|
+ clickThreshold: 3
|
|
|
+};
|
|
|
// CONCATENATED MODULE: ./src/timeline.ts
|
|
|
function timeline_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { timeline_typeof = function _typeof(obj) { return typeof obj; }; } else { timeline_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return timeline_typeof(obj); }
|
|
|
|
|
@@ -861,7 +920,6 @@ function timeline_defineProperty(obj, key, value) { if (key in obj) { Object.def
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
timeline_inherits(Timeline, _TimelineEventsEmitte);
|
|
|
|
|
@@ -983,7 +1041,7 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
timeline_defineProperty(timeline_assertThisInitialized(_this), "_lastUsedArgs", null);
|
|
|
|
|
|
- timeline_defineProperty(timeline_assertThisInitialized(_this), "_model", void 0);
|
|
|
+ timeline_defineProperty(timeline_assertThisInitialized(_this), "_model", null);
|
|
|
|
|
|
timeline_defineProperty(timeline_assertThisInitialized(_this), "_handleBlurEvent", function () {
|
|
|
_this._cleanUpSelection();
|
|
@@ -1025,13 +1083,15 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
_this.redraw();
|
|
|
|
|
|
- var scrollData = args || {};
|
|
|
- scrollData.scrollLeft = _this._scrollContainer.scrollLeft;
|
|
|
- scrollData.scrollTop = _this._scrollContainer.scrollTop;
|
|
|
- scrollData.scrollHeight = _this._scrollContainer.scrollHeight;
|
|
|
- scrollData.scrollWidth = _this._scrollContainer.scrollWidth;
|
|
|
+ var scrollEvent = {
|
|
|
+ args: args,
|
|
|
+ scrollLeft: _this._scrollContainer.scrollLeft,
|
|
|
+ scrollTop: _this._scrollContainer.scrollTop,
|
|
|
+ scrollHeight: _this._scrollContainer.scrollHeight,
|
|
|
+ scrollWidth: _this._scrollContainer.scrollWidth
|
|
|
+ };
|
|
|
|
|
|
- _get((_thisSuper = timeline_assertThisInitialized(_this), timeline_getPrototypeOf(Timeline.prototype)), "emit", _thisSuper).call(_thisSuper, TimelineEvents.Scroll, scrollData);
|
|
|
+ _get((_thisSuper = timeline_assertThisInitialized(_this), timeline_getPrototypeOf(Timeline.prototype)), "emit", _thisSuper).call(_thisSuper, TimelineEvents.Scroll, scrollEvent);
|
|
|
});
|
|
|
|
|
|
timeline_defineProperty(timeline_assertThisInitialized(_this), "_handleWheelEvent", function (event) {
|
|
@@ -1313,7 +1373,11 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
});
|
|
|
|
|
|
timeline_defineProperty(timeline_assertThisInitialized(_this), "_redrawInternal", function () {
|
|
|
- // Rescale when animation is played out of the bounds.
|
|
|
+ if (!_this._ctx) {
|
|
|
+ return;
|
|
|
+ } // Rescale when animation is played out of the bounds.
|
|
|
+
|
|
|
+
|
|
|
if (_this.valToPx(_this._val, true) > _this._scrollContainer.scrollWidth) {
|
|
|
_this.rescale();
|
|
|
|
|
@@ -2075,8 +2139,8 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
this._ctx.fillStyle = this._options.labelsColor;
|
|
|
|
|
|
- if (this._options.ticksFont) {
|
|
|
- this._ctx.font = this._options.ticksFont;
|
|
|
+ if (this._options.font) {
|
|
|
+ this._ctx.font = this._options.font;
|
|
|
}
|
|
|
|
|
|
var text = this._formatLineGaugeText(i);
|
|
@@ -2152,8 +2216,8 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
} // draw with scroll virtualization:
|
|
|
|
|
|
|
|
|
- var rowHeight = TimelineStyleUtils.getRowHeight(row, _this5._options.rowsStyle);
|
|
|
- var marginBottom = TimelineStyleUtils.getRowMarginBottom(row, _this5._options.rowsStyle);
|
|
|
+ var rowHeight = TimelineStyleUtils.getRowHeight(row, _this5._options);
|
|
|
+ var marginBottom = TimelineStyleUtils.getRowMarginBottom(row, _this5._options);
|
|
|
rowAbsoluteHeight += rowHeight + marginBottom;
|
|
|
var currentRowY = rowAbsoluteHeight - _this5._scrollContainer.scrollTop;
|
|
|
|
|
@@ -2234,7 +2298,7 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- _this6._ctx.fillStyle = TimelineStyleUtils.getRowStyle(rowData.row, _this6._options.rowsStyle, 'fillColor', '#252526'); //this._ctx.fillRect(data.areaRect.x, data.areaRect.y, data.areaRect.w, data.areaRect.h);
|
|
|
+ _this6._ctx.fillStyle = TimelineStyleUtils.getRowStyle(rowData.row, _this6._options, 'fillColor', '#252526'); //this._ctx.fillRect(data.areaRect.x, data.areaRect.y, data.areaRect.w, data.areaRect.h);
|
|
|
// Note: bounds used instead of the clip while clip is slow!
|
|
|
|
|
|
var bounds = _this6._cutBounds(rowData);
|
|
@@ -2243,7 +2307,7 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
_this6._ctx.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
|
|
|
}
|
|
|
|
|
|
- var keyframeLaneColor = TimelineStyleUtils.stripeFillColor(rowData.row, _this6._options.rowsStyle);
|
|
|
+ var keyframeLaneColor = TimelineStyleUtils.stripeFillColor(rowData.row, _this6._options);
|
|
|
|
|
|
if (rowData.row.keyframes && rowData.row.keyframes.length <= 1 || !keyframeLaneColor) {
|
|
|
return;
|
|
@@ -2311,8 +2375,8 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
}, {
|
|
|
key: "_getKeyframesStripeSize",
|
|
|
value: function _getKeyframesStripeSize(row, rowY, minValue, maxValue) {
|
|
|
- var stripeHeight = TimelineStyleUtils.rowStripeHeight(row, this._options.rowsStyle);
|
|
|
- var height = TimelineStyleUtils.getRowHeight(row, this._options.rowsStyle);
|
|
|
+ var stripeHeight = TimelineStyleUtils.rowStripeHeight(row, this._options);
|
|
|
+ var height = TimelineStyleUtils.getRowHeight(row, this._options);
|
|
|
|
|
|
if (!stripeHeight && stripeHeight !== 0 || isNaN(stripeHeight) || stripeHeight == 'auto') {
|
|
|
stripeHeight = Math.floor(height * 0.8);
|
|
@@ -2408,15 +2472,15 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
_this7._ctx.clip();
|
|
|
}
|
|
|
|
|
|
- var shape = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options.rowsStyle, 'shape', TimelineKeyframeShape.Rhomb);
|
|
|
+ var shape = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options, 'shape', TimelineKeyframeShape.Rhomb);
|
|
|
|
|
|
if (shape === TimelineKeyframeShape.None) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- var keyframeColor = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options.rowsStyle, keyframe.selected ? 'fillColor' : 'selectedFillColor', keyframe.selected ? 'red' : 'DarkOrange');
|
|
|
- var border = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options.rowsStyle, 'strokeThickness', 0.2);
|
|
|
- var strokeColor = border > 0 ? TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options.rowsStyle, 'strokeColor', 'Black') : '';
|
|
|
+ var keyframeColor = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options, keyframe.selected ? 'fillColor' : 'selectedFillColor', keyframe.selected ? 'red' : 'DarkOrange');
|
|
|
+ var border = TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options, 'strokeThickness', 0.2);
|
|
|
+ var strokeColor = border > 0 ? TimelineStyleUtils.getKeyframeStyle(keyframe, row, _this7._options, 'strokeColor', 'Black') : '';
|
|
|
|
|
|
if (shape == TimelineKeyframeShape.Rhomb) {
|
|
|
_this7._ctx.beginPath();
|
|
@@ -2526,16 +2590,22 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
}, {
|
|
|
key: "_renderTimeline",
|
|
|
value: function _renderTimeline() {
|
|
|
+ if (!this._options || !this._options.timelineStyle) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var style = this._options.timelineStyle;
|
|
|
+
|
|
|
this._ctx.save();
|
|
|
|
|
|
- var thickness = this._options.timelineThicknessPx;
|
|
|
+ var thickness = style.width || 1;
|
|
|
this._ctx.lineWidth = thickness * this._pixelRatio;
|
|
|
|
|
|
var timeLinePos = this._getSharp(Math.round(this.valToPx(this._val)), thickness);
|
|
|
|
|
|
- this._ctx.strokeStyle = this._options.timelineColor;
|
|
|
- this._ctx.fillStyle = this._ctx.strokeStyle;
|
|
|
- var y = this._options.timelineMarginTopPx;
|
|
|
+ this._ctx.strokeStyle = style.strokeColor;
|
|
|
+ this._ctx.fillStyle = style.fillColor;
|
|
|
+ var y = style.marginTop;
|
|
|
|
|
|
this._ctx.beginPath();
|
|
|
|
|
@@ -2543,11 +2613,11 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
this._ctx.stroke();
|
|
|
|
|
|
- if (this._options.timelineCapWidthPx && this._options.timelineCapHeightPx) {
|
|
|
- var rectSize = this._options.timelineCapWidthPx;
|
|
|
- var capHeight = this._options.timelineCapHeightPx;
|
|
|
+ if (style.capHeight && style.capWidth) {
|
|
|
+ var rectSize = style.capWidth;
|
|
|
+ var capHeight = style.capHeight;
|
|
|
|
|
|
- if (this._options.timelineCap === TimelineCapShape.Triangle) {
|
|
|
+ if (style.capType === TimelineCapShape.Triangle) {
|
|
|
this._ctx.beginPath();
|
|
|
|
|
|
this._ctx.moveTo(timeLinePos - rectSize / 2, y);
|
|
@@ -2559,7 +2629,7 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
this._ctx.closePath();
|
|
|
|
|
|
this._ctx.stroke();
|
|
|
- } else if (this._options.timelineCap === TimelineCapShape.Rect) {
|
|
|
+ } else if (style.capType === TimelineCapShape.Rect) {
|
|
|
this._ctx.fillRect(timeLinePos - rectSize / 2, y, rectSize, capHeight);
|
|
|
|
|
|
this._ctx.fill();
|
|
@@ -2801,6 +2871,11 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
}, {
|
|
|
key: "_updateCanvasScale",
|
|
|
value: function _updateCanvasScale() {
|
|
|
+ if (!this._scrollContainer || !this._ctx) {
|
|
|
+ console.log('control should be initialized first');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
var changed = false;
|
|
|
var width = this._scrollContainer.clientWidth * this._pixelRatio;
|
|
|
var height = this._scrollContainer.clientHeight * this._pixelRatio;
|
|
@@ -2976,7 +3051,12 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
|
|
|
var timeLinePos = this.valToPx(this._val);
|
|
|
- var width = Math.max((this._options.timelineThicknessPx || 1) * this._pixelRatio, this._options.timelineCapWidthPx * this._pixelRatio || 1) + clickRadius;
|
|
|
+ var width = 0;
|
|
|
+
|
|
|
+ if (this._options && this._options.timelineStyle) {
|
|
|
+ var timelineStyle = this._options.timelineStyle;
|
|
|
+ width = Math.max((timelineStyle.width || 1) * this._pixelRatio, (timelineStyle.capWidth || 0) * this._pixelRatio || 1) + clickRadius;
|
|
|
+ }
|
|
|
|
|
|
if (pos.y <= this._options.headerHeight || pos.x >= timeLinePos - width / 2 && pos.x <= timeLinePos + width / 2) {
|
|
|
toReturn.push({
|
|
@@ -3047,7 +3127,7 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
value: function _mergeOptions(toSet) {
|
|
|
toSet = toSet || {}; // Apply incoming options to default. (override default)
|
|
|
|
|
|
- var options = new timelineOptions_TimelineOptions(); // Merge options with the default.
|
|
|
+ var options = {}; // Merge options with the default.
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
|
|
|
var mergeOptionsDeep = function mergeOptionsDeep(to, from) {
|
|
@@ -3164,45 +3244,47 @@ var timeline_Timeline = /*#__PURE__*/function (_TimelineEventsEmitte) {
|
|
|
|
|
|
return Timeline;
|
|
|
}(TimelineEventsEmitter);
|
|
|
-// CONCATENATED MODULE: ./src/timelineModel.ts
|
|
|
-function timelineModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
+// EXTERNAL MODULE: ./src/timelineModel.ts
|
|
|
+var timelineModel = __webpack_require__(1);
|
|
|
|
|
|
-function timelineModel_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
-
|
|
|
-var TimelineModel = function TimelineModel() {
|
|
|
- timelineModel_classCallCheck(this, TimelineModel);
|
|
|
-
|
|
|
- timelineModel_defineProperty(this, "rows", []);
|
|
|
-};
|
|
|
// EXTERNAL MODULE: ./src/timelineRow.ts
|
|
|
-var timelineRow = __webpack_require__(1);
|
|
|
+var timelineRow = __webpack_require__(2);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/timelineKeyframe.ts
|
|
|
-var timelineKeyframe = __webpack_require__(2);
|
|
|
+var timelineKeyframe = __webpack_require__(3);
|
|
|
+
|
|
|
+// EXTERNAL MODULE: ./src/settings/timelineConsts.ts
|
|
|
+var timelineConsts = __webpack_require__(4);
|
|
|
+
|
|
|
+// EXTERNAL MODULE: ./src/settings/timelineOptions.ts
|
|
|
+var timelineOptions = __webpack_require__(5);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/settings/styles/timelineKeyframeStyle.ts
|
|
|
-var timelineKeyframeStyle = __webpack_require__(3);
|
|
|
+var timelineKeyframeStyle = __webpack_require__(6);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/settings/styles/timelineRowStyle.ts
|
|
|
-var timelineRowStyle = __webpack_require__(4);
|
|
|
+var timelineRowStyle = __webpack_require__(7);
|
|
|
+
|
|
|
+// EXTERNAL MODULE: ./src/settings/styles/timelineStyle.ts
|
|
|
+var styles_timelineStyle = __webpack_require__(8);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/timelineClickableElement.ts
|
|
|
-var timelineClickableElement = __webpack_require__(5);
|
|
|
+var timelineClickableElement = __webpack_require__(9);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/selectable.ts
|
|
|
-var selectable = __webpack_require__(6);
|
|
|
+var selectable = __webpack_require__(10);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/rowsCalculationsResults.ts
|
|
|
var rowsCalculationsResults = __webpack_require__(0);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/cutBoundsRect.ts
|
|
|
-var cutBoundsRect = __webpack_require__(7);
|
|
|
+var cutBoundsRect = __webpack_require__(11);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/events/timelineSelectedEvent.ts
|
|
|
-var timelineSelectedEvent = __webpack_require__(8);
|
|
|
+var timelineSelectedEvent = __webpack_require__(12);
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/events/timelineScrollEvent.ts
|
|
|
-var timelineScrollEvent = __webpack_require__(9);
|
|
|
+var timelineScrollEvent = __webpack_require__(13);
|
|
|
|
|
|
// CONCATENATED MODULE: ./src/animation-timeline.ts
|
|
|
// bundle entry point
|
|
@@ -3226,6 +3308,13 @@ var timelineScrollEvent = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ // private defaults are exposed:
|
|
|
|
|
|
|
|
|
|