Browse Source

Fixed dispose function. Added svelte example

Ievgen Naida 1 year ago
parent
commit
726b19ad54
71 changed files with 7181 additions and 4663 deletions
  1. 2 0
      .gitignore
  2. 7 2
      .vscode/extensions.json
  3. 6 0
      CHANGELOG.md
  4. 104 18
      README.md
  5. 1 0
      index.html
  6. 46 46
      lib/animation-timeline.d.ts
  7. 380 370
      lib/animation-timeline.js
  8. 0 0
      lib/animation-timeline.js.map
  9. 0 0
      lib/animation-timeline.min.js
  10. 5 5
      lib/enums/timelineCapShape.d.ts
  11. 37 37
      lib/enums/timelineCursorType.d.ts
  12. 22 22
      lib/enums/timelineElementType.d.ts
  13. 14 11
      lib/enums/timelineEventSource.d.ts
  14. 15 15
      lib/enums/timelineEvents.d.ts
  15. 24 24
      lib/enums/timelineInteractionMode.d.ts
  16. 6 6
      lib/enums/timelineKeyframeShape.d.ts
  17. 5 5
      lib/enums/timelineScrollSource.d.ts
  18. 9 9
      lib/enums/timelineSelectionEventSource.d.ts
  19. 17 17
      lib/enums/timelineSelectionMode.d.ts
  20. 28 28
      lib/models/timelineGroup.d.ts
  21. 28 28
      lib/models/timelineKeyframe.d.ts
  22. 4 4
      lib/models/timelineModel.d.ts
  23. 10 10
      lib/models/timelineRanged.d.ts
  24. 13 13
      lib/models/timelineRow.d.ts
  25. 3 3
      lib/settings/defaults/defaultGroupStyle.d.ts
  26. 2 2
      lib/settings/defaults/defaultTimelineConsts.d.ts
  27. 2 2
      lib/settings/defaults/defaultTimelineKeyframeStyle.d.ts
  28. 2 2
      lib/settings/defaults/defaultTimelineOptions.d.ts
  29. 2 2
      lib/settings/defaults/defaultTimelineRowStyle.d.ts
  30. 2 2
      lib/settings/defaults/defaultTimelineStyle.d.ts
  31. 28 28
      lib/settings/styles/TimelineRowStyle.d.ts
  32. 26 26
      lib/settings/styles/timelineCapStyle.d.ts
  33. 32 32
      lib/settings/styles/timelineGroupStyle.d.ts
  34. 40 40
      lib/settings/styles/timelineKeyframeStyle.d.ts
  35. 32 32
      lib/settings/styles/timelineStyle.d.ts
  36. 46 46
      lib/settings/timelineConsts.d.ts
  37. 107 107
      lib/settings/timelineOptions.d.ts
  38. 81 81
      lib/tests/settingsTests.test.js
  39. 670 670
      lib/tests/styleTests.test.js
  40. 0 866
      lib/tests/timelineTests.test.js
  41. 552 552
      lib/timeline.d.ts
  42. 34 34
      lib/timelineEventsEmitter.d.ts
  43. 30 30
      lib/utils/TimelineElement.d.ts
  44. 11 11
      lib/utils/TimelineElementDragState.d.ts
  45. 11 11
      lib/utils/events/timelineBaseEvent.d.ts
  46. 23 23
      lib/utils/events/timelineClickEvent.d.ts
  47. 23 23
      lib/utils/events/timelineDragEvent.d.ts
  48. 21 21
      lib/utils/events/timelineKeyframeChangedEvent.d.ts
  49. 11 11
      lib/utils/events/timelineScrollEvent.d.ts
  50. 16 16
      lib/utils/events/timelineSelectedEvent.d.ts
  51. 16 16
      lib/utils/events/timelineTimeChangedEvent.d.ts
  52. 8 8
      lib/utils/timelineCutBoundsRectResults.d.ts
  53. 32 32
      lib/utils/timelineDraggableData.d.ts
  54. 14 14
      lib/utils/timelineMouseData.d.ts
  55. 22 22
      lib/utils/timelinePoint.d.ts
  56. 7 7
      lib/utils/timelineSelectable.d.ts
  57. 15 15
      lib/utils/timelineSelectionResults.d.ts
  58. 41 41
      lib/utils/timelineStyleUtils.d.ts
  59. 44 44
      lib/utils/timelineUtils.d.ts
  60. 24 24
      lib/viewModels/timelineGroupViewModel.d.ts
  61. 26 26
      lib/viewModels/timelineKeyframeViewModel.d.ts
  62. 31 31
      lib/viewModels/timelineRowViewModel.d.ts
  63. 18 18
      lib/viewModels/timelineViewModel.d.ts
  64. 4253 990
      package-lock.json
  65. 23 22
      package.json
  66. 3 0
      src/enums/timelineEventSource.ts
  67. 1 1
      src/settings/timelineOptions.ts
  68. 6 2
      src/timeline.ts
  69. 2 2
      tests/unittests.html
  70. 2 1
      tsconfig.json
  71. 3 4
      tsconfig.tests.json

+ 2 - 0
.gitignore

@@ -36,3 +36,5 @@ lib/settings/timelineOptions.js
 lib/settings/styles/timelineKeyframeStyle.js
 lib/settings/styles/timelineRowStyle.js
 lib/settings/styles/timelineStyle.js
+test
+copy.sh

+ 7 - 2
.vscode/extensions.json

@@ -1,4 +1,9 @@
 {
-  "recommendations": ["esbenp.prettier-vscode", "davidanson.vscode-markdownlint", "dbaeumer.vscode-eslint", "streetsidesoftware.code-spell-checker"],
+  "recommendations": [
+    "esbenp.prettier-vscode",
+    "davidanson.vscode-markdownlint",
+    "dbaeumer.vscode-eslint",
+    "streetsidesoftware.code-spell-checker"
+  ],
   "unwantedRecommendations": []
-}
+}

+ 6 - 0
CHANGELOG.md

@@ -2,6 +2,12 @@
 
 ## Changes
 
+## [2.3.1] - 03.24.2024
+
+### Changed
+
+- Fixed dispose function. Added svelte example
+
 ## [2.3.0] - 11.06.2022 (Breakings changes)
 
 ### Added

+ 104 - 18
README.md

@@ -23,10 +23,12 @@ Features:
 - [Live demo](https://ievgennaida.github.io/animation-timeline-control/)
 - [Run unittests](https://ievgennaida.github.io/animation-timeline-control/tests/unittests)
 
-## Configuration
-
 ## Usage
 
+```bash
+npm i animation-timeline-js
+```
+
 ### HTML/JavaScript
 
 ```JavaScript
@@ -74,10 +76,10 @@ const timeline = new Timeline(options, model);
 ### React
 
 ```TypeScript
-import React, { useEffect, useRef, useState } from 'react';
-import { Timeline, TimelineModel } from 'animation-timeline-js';
+import React, { useEffect, useRef, useState } from "react";
+import { Timeline, TimelineModel } from "animation-timeline-js";
 type Props = {
-  time: number;
+  time?: number;
   model: TimelineModel;
 };
 
@@ -96,29 +98,113 @@ function TimelineComponent(props: Props) {
     }
 
     // cleanup on component unmounted.
-    return () => {
-      timeline?.dispose();
-    };
-  // eslint-disable-next-line react-hooks/exhaustive-deps
-  }, []);
+    return () => newTimeline?.dispose();
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [timelineElRef.current]);
 
   // Example to subscribe and pass model or time update:
   useEffect(() => {
-    if (timeline) {
-      timeline.setModel(model);
-    }
+    timeline?.setModel(model);
   }, [model, timeline]);
 
   // Example to subscribe and pass model or time update:
   useEffect(() => {
-    if (timeline) {
-      timeline.setTime(time);
+    if (time || time === 0) {
+      timeline?.setTime(time);
     }
   }, [time, timeline]);
 
-  return <div ref={timelineElRef} />;
+  return <div style={{ width: "100%", minHeight: 300 }} ref={timelineElRef} />;
 }
 export default TimelineComponent;
+
+
+// Usage: 
+<TimelineComponent
+  time={0}
+  model={{
+    rows: [
+      {
+        keyframes: [
+          {
+            val: 40,
+          },
+          {
+            val: 3000,
+          },
+        ],
+      },
+    ],
+  }}
+></TimelineComponent>
+```
+
+### Svelte
+
+```TypeScript
+<script lang="ts">
+  import { Timeline } from "animation-timeline-js";
+  import type { TimelineModel } from "animation-timeline-js";
+  import { onMount } from "svelte";
+
+  export let time: number = 0;
+  export let model: TimelineModel;
+
+  let timelineEl!: HTMLDivElement;
+  let timeline: Timeline | null = null;
+
+  // Equivalent to componentDidMount and componentWillUnmount
+  onMount(() => {
+    let newTimeline: Timeline | null = null;
+    if (timelineEl) {
+      newTimeline = new Timeline({ id: timelineEl });
+    }
+    timeline = newTimeline;
+    // Cleanup
+    return () => {
+      if (newTimeline) {
+        newTimeline.dispose();
+      }
+    };
+  });
+  $: if (model) {
+    // Reactive statements for model and time
+    timeline?.setModel(model);
+  }
+  $: if (time || time === 0) {
+    timeline?.setTime(time);
+  }
+</script>
+
+<div bind:this={timelineEl} class="editor"></div>
+
+<style>
+  .editor {
+    width: 100%;
+    min-height: 300px;
+  }
+</style>
+
+
+
+// Usage: 
+<TimelineComponent
+  time={0}
+  model={{
+    rows: [
+      {
+        keyframes: [
+          {
+            val: 40,
+          },
+          {
+            val: 3000,
+          },
+        ],
+      },
+    ],
+  }}
+></TimelineComponent>
 ```
 
 ### Outline list
@@ -314,8 +400,8 @@ Recommended extensions:
 ### Dev Dependencies
 
 Component has no production dependencies when built.
-To pack and transpile TypeScript Babel + Webpack is used.
-For the testing mocha and chai, as the assertion library are used.
+TypeScript Babel + Webpack is used to pack and transpile the library.
+Mocha and chai are used as test & assertion library.
 
 ### Build Tests
 

+ 1 - 0
index.html

@@ -112,6 +112,7 @@
       width: 100%;
       font-family: Roboto, 'Helvetica Neue', sans-serif;
       color: white;
+      -webkit-user-select: none;
       user-select: none;
       height: 30px;
     }

+ 46 - 46
lib/animation-timeline.d.ts

@@ -1,46 +1,46 @@
-export * from './timeline';
-export * from './timelineEventsEmitter';
-export * from './settings/timelineConsts';
-export * from './models/timelineRanged';
-export * from './models/timelineModel';
-export * from './models/timelineRow';
-export * from './models/timelineKeyframe';
-export * from './settings/timelineOptions';
-export * from './settings/styles/timelineKeyframeStyle';
-export * from './settings/styles/timelineRowStyle';
-export * from './settings/styles/timelineStyle';
-export * from './utils/timelineStyleUtils';
-export * from './utils/timelineUtils';
-export * from './utils/timelineElement';
-export * from './utils/timelineSelectable';
-export * from './utils/timelineCutBoundsRectResults';
-export * from './utils/timelineSelectionResults';
-export * from './utils/timelinePoint';
-export * from './utils/timelineMouseData';
-export * from './utils/timelineElementDragState';
-export * from './utils/timelineDraggableData';
-export * from './viewModels/timelineGroupViewModel';
-export * from './viewModels/timelineKeyframeViewModel';
-export * from './viewModels/timelineRowViewModel';
-export * from './viewModels/timelineViewModel';
-export * from './utils/events/timelineKeyframeChangedEvent';
-export * from './utils/events/timelineTimeChangedEvent';
-export * from './utils/events/timelineSelectedEvent';
-export * from './utils/events/timelineScrollEvent';
-export * from './utils/events/timelineClickEvent';
-export * from './utils/events/timelineDragEvent';
-export * from './enums/timelineKeyframeShape';
-export * from './enums/timelineInteractionMode';
-export * from './enums/timelineScrollSource';
-export * from './enums/timelineElementType';
-export * from './enums/timelineCursorType';
-export * from './enums/timelineCapShape';
-export * from './enums/timelineEventSource';
-export * from './enums/timelineSelectionMode';
-export * from './enums/timelineEvents';
-export * from './settings/defaults/defaultTimelineStyle';
-export * from './settings/defaults/defaultTimelineRowStyle';
-export * from './settings/defaults/defaultTimelineOptions';
-export * from './settings/defaults/defaultTimelineKeyframeStyle';
-export * from './settings/defaults/defaultTimelineConsts';
-export * from './settings/defaults/defaultGroupStyle';
+export * from './timeline';
+export * from './timelineEventsEmitter';
+export * from './settings/timelineConsts';
+export * from './models/timelineRanged';
+export * from './models/timelineModel';
+export * from './models/timelineRow';
+export * from './models/timelineKeyframe';
+export * from './settings/timelineOptions';
+export * from './settings/styles/timelineKeyframeStyle';
+export * from './settings/styles/timelineRowStyle';
+export * from './settings/styles/timelineStyle';
+export * from './utils/timelineStyleUtils';
+export * from './utils/timelineUtils';
+export * from './utils/timelineElement';
+export * from './utils/timelineSelectable';
+export * from './utils/timelineCutBoundsRectResults';
+export * from './utils/timelineSelectionResults';
+export * from './utils/timelinePoint';
+export * from './utils/timelineMouseData';
+export * from './utils/timelineElementDragState';
+export * from './utils/timelineDraggableData';
+export * from './viewModels/timelineGroupViewModel';
+export * from './viewModels/timelineKeyframeViewModel';
+export * from './viewModels/timelineRowViewModel';
+export * from './viewModels/timelineViewModel';
+export * from './utils/events/timelineKeyframeChangedEvent';
+export * from './utils/events/timelineTimeChangedEvent';
+export * from './utils/events/timelineSelectedEvent';
+export * from './utils/events/timelineScrollEvent';
+export * from './utils/events/timelineClickEvent';
+export * from './utils/events/timelineDragEvent';
+export * from './enums/timelineKeyframeShape';
+export * from './enums/timelineInteractionMode';
+export * from './enums/timelineScrollSource';
+export * from './enums/timelineElementType';
+export * from './enums/timelineCursorType';
+export * from './enums/timelineCapShape';
+export * from './enums/timelineEventSource';
+export * from './enums/timelineSelectionMode';
+export * from './enums/timelineEvents';
+export * from './settings/defaults/defaultTimelineStyle';
+export * from './settings/defaults/defaultTimelineRowStyle';
+export * from './settings/defaults/defaultTimelineOptions';
+export * from './settings/defaults/defaultTimelineKeyframeStyle';
+export * from './settings/defaults/defaultTimelineConsts';
+export * from './settings/defaults/defaultGroupStyle';

File diff suppressed because it is too large
+ 380 - 370
lib/animation-timeline.js


File diff suppressed because it is too large
+ 0 - 0
lib/animation-timeline.js.map


File diff suppressed because it is too large
+ 0 - 0
lib/animation-timeline.min.js


+ 5 - 5
lib/enums/timelineCapShape.d.ts

@@ -1,5 +1,5 @@
-export declare enum TimelineCapShape {
-    None = "none",
-    Triangle = "triangle",
-    Rect = "rect"
-}
+export declare enum TimelineCapShape {
+    None = "none",
+    Triangle = "triangle",
+    Rect = "rect"
+}

+ 37 - 37
lib/enums/timelineCursorType.d.ts

@@ -1,37 +1,37 @@
-export declare enum TimelineCursorType {
-    Alias = "alias",
-    AllScroll = "all-scroll",
-    Auto = "auto",
-    Cell = "cell",
-    ContextMenu = "context-menu",
-    ColResize = "col-resize",
-    Copy = "copy",
-    Crosshair = "crosshair",
-    Default = "default",
-    EResize = "e-resize",
-    EWResize = "ew-resize",
-    Grab = "grab",
-    Grabbing = "grabbing",
-    Help = "help",
-    Move = "move",
-    NResize = "n-resize",
-    NEResize = "ne-resize",
-    NESWResize = "nesw-resize",
-    NSResize = "ns-resize",
-    NWResize = "nw-resize",
-    NWSEResize = "nwse-resize",
-    NoDrop = "no-drop",
-    None = "none",
-    NotAllowed = "not-allowed",
-    Pointer = "pointer",
-    Progress = "progress",
-    RowResize = "row-resize",
-    SResize = "s-resize",
-    SEResize = "se-resize",
-    SWResize = "sw-resize",
-    Text = "text",
-    WResize = "w-resize",
-    Wait = "wait",
-    ZoomIn = "zoom-in",
-    ZoomOut = "zoom-out"
-}
+export declare enum TimelineCursorType {
+    Alias = "alias",
+    AllScroll = "all-scroll",
+    Auto = "auto",
+    Cell = "cell",
+    ContextMenu = "context-menu",
+    ColResize = "col-resize",
+    Copy = "copy",
+    Crosshair = "crosshair",
+    Default = "default",
+    EResize = "e-resize",
+    EWResize = "ew-resize",
+    Grab = "grab",
+    Grabbing = "grabbing",
+    Help = "help",
+    Move = "move",
+    NResize = "n-resize",
+    NEResize = "ne-resize",
+    NESWResize = "nesw-resize",
+    NSResize = "ns-resize",
+    NWResize = "nw-resize",
+    NWSEResize = "nwse-resize",
+    NoDrop = "no-drop",
+    None = "none",
+    NotAllowed = "not-allowed",
+    Pointer = "pointer",
+    Progress = "progress",
+    RowResize = "row-resize",
+    SResize = "s-resize",
+    SEResize = "se-resize",
+    SWResize = "sw-resize",
+    Text = "text",
+    WResize = "w-resize",
+    Wait = "wait",
+    ZoomIn = "zoom-in",
+    ZoomOut = "zoom-out"
+}

+ 22 - 22
lib/enums/timelineElementType.d.ts

@@ -1,22 +1,22 @@
-/**
- * Internal element type.
- */
-export declare enum TimelineElementType {
-    /**
-     * Timeline
-     */
-    Timeline = "timeline",
-    /**
-     * Keyframes
-     */
-    Keyframe = "keyframe",
-    /**
-     * Keyframes connected and presenting one group.
-     */
-    Group = "group",
-    /**
-     * Timeline row.
-     */
-    Row = "row",
-    None = "none"
-}
+/**
+ * Internal element type.
+ */
+export declare enum TimelineElementType {
+    /**
+     * Timeline
+     */
+    Timeline = "timeline",
+    /**
+     * Keyframes
+     */
+    Keyframe = "keyframe",
+    /**
+     * Keyframes connected and presenting one group.
+     */
+    Group = "group",
+    /**
+     * Timeline row.
+     */
+    Row = "row",
+    None = "none"
+}

+ 14 - 11
lib/enums/timelineEventSource.d.ts

@@ -1,11 +1,14 @@
-export declare enum TimelineEventSource {
-    /**
-     * Changed by user interaction events.
-     */
-    User = "user",
-    /**
-     * Changed programmatically.
-     */
-    Programmatically = "programmatically",
-    SetTimeMethod = "setTimeMethod"
-}
+export declare enum TimelineEventSource {
+    /**
+     * Changed by user interaction events.
+     */
+    User = "user",
+    /**
+     * Changed programmatically.
+     */
+    Programmatically = "programmatically",
+    /**
+     * Changed by the set time function.
+     */
+    SetTimeMethod = "setTimeMethod"
+}

+ 15 - 15
lib/enums/timelineEvents.d.ts

@@ -1,15 +1,15 @@
-/**
- * Event names of the component.
- */
-export declare enum TimelineEvents {
-    Selected = "selected",
-    TimeChanged = "timechanged",
-    KeyframeChanged = "keyframeChanged",
-    DragStarted = "dragStarted",
-    Drag = "drag",
-    DragFinished = "dragFinished",
-    Scroll = "scroll",
-    ScrollFinished = "scrollFinished",
-    DoubleClick = "doubleClick",
-    MouseDown = "mouseDown"
-}
+/**
+ * Event names of the component.
+ */
+export declare enum TimelineEvents {
+    Selected = "selected",
+    TimeChanged = "timechanged",
+    KeyframeChanged = "keyframeChanged",
+    DragStarted = "dragStarted",
+    Drag = "drag",
+    DragFinished = "dragFinished",
+    Scroll = "scroll",
+    ScrollFinished = "scrollFinished",
+    DoubleClick = "doubleClick",
+    MouseDown = "mouseDown"
+}

+ 24 - 24
lib/enums/timelineInteractionMode.d.ts

@@ -1,24 +1,24 @@
-export declare enum TimelineInteractionMode {
-    /**
-     * Keyframe selection tool selecting single or group of keyframes.
-     */
-    Selection = "selection",
-    /**
-     * Pan tool with the possibility to select keyframes.
-     */
-    Pan = "pan",
-    /**
-     * Allow only pan without any keyframes interaction.
-     * Timeline still can be moved and controlled by option 'timelineDraggable'.
-     */
-    NonInteractivePan = "nonInteractivePan",
-    /**
-     * Zoom tool.
-     */
-    Zoom = "zoom",
-    /**
-     * No iteraction, except moving a timeline.
-     * Timeline still can be moved and controlled by option 'timelineDraggable'.
-     */
-    None = "none"
-}
+export declare enum TimelineInteractionMode {
+    /**
+     * Keyframe selection tool selecting single or group of keyframes.
+     */
+    Selection = "selection",
+    /**
+     * Pan tool with the possibility to select keyframes.
+     */
+    Pan = "pan",
+    /**
+     * Allow only pan without any keyframes interaction.
+     * Timeline still can be moved and controlled by option 'timelineDraggable'.
+     */
+    NonInteractivePan = "nonInteractivePan",
+    /**
+     * Zoom tool.
+     */
+    Zoom = "zoom",
+    /**
+     * No iteraction, except moving a timeline.
+     * Timeline still can be moved and controlled by option 'timelineDraggable'.
+     */
+    None = "none"
+}

+ 6 - 6
lib/enums/timelineKeyframeShape.d.ts

@@ -1,6 +1,6 @@
-export declare enum TimelineKeyframeShape {
-    None = "none",
-    Rhomb = "rhomb",
-    Circle = "circle",
-    Rect = "rect"
-}
+export declare enum TimelineKeyframeShape {
+    None = "none",
+    Rhomb = "rhomb",
+    Circle = "circle",
+    Rect = "rect"
+}

+ 5 - 5
lib/enums/timelineScrollSource.d.ts

@@ -1,5 +1,5 @@
-export declare enum TimelineScrollSource {
-    DefaultMode = "none",
-    ZoomMode = "zoom",
-    ScrollBySelection = "scrollBySelection"
-}
+export declare enum TimelineScrollSource {
+    DefaultMode = "none",
+    ZoomMode = "zoom",
+    ScrollBySelection = "scrollBySelection"
+}

+ 9 - 9
lib/enums/timelineSelectionEventSource.d.ts

@@ -1,9 +1,9 @@
-/**
- * Timeline selection event type.
- */
-export declare enum TimelineSelectionEventSource {
-    /**
-     * Keyframe selection is performed.
-     */
-    Keyframes = "keyframes"
-}
+/**
+ * Timeline selection event type.
+ */
+export declare enum TimelineSelectionEventSource {
+    /**
+     * Keyframe selection is performed.
+     */
+    Keyframes = "keyframes"
+}

+ 17 - 17
lib/enums/timelineSelectionMode.d.ts

@@ -1,17 +1,17 @@
-/**
- * Timeline selection mode.
- */
-export declare enum TimelineSelectionMode {
-    /**
-     * Select new items. deselect changed.
-     */
-    Normal = "normal",
-    /**
-     * Append current selection.
-     */
-    Append = "append",
-    /**
-     * Revert selection of a specified nodes.
-     */
-    Revert = "revert"
-}
+/**
+ * Timeline selection mode.
+ */
+export declare enum TimelineSelectionMode {
+    /**
+     * Select new items. deselect changed.
+     */
+    Normal = "normal",
+    /**
+     * Append current selection.
+     */
+    Append = "append",
+    /**
+     * Revert selection of a specified nodes.
+     */
+    Revert = "revert"
+}

+ 28 - 28
lib/models/timelineGroup.d.ts

@@ -1,28 +1,28 @@
-import { TimelineKeyframeStyle } from '../settings/styles/timelineKeyframeStyle';
-import { TimelineGroupStyle } from '../settings/styles/timelineGroupStyle';
-/**
- * Timeline group view model.
- */
-export interface TimelineGroup {
-    /**
-     * Group style.
-     */
-    style: TimelineGroupStyle;
-    /**
-     * Child keyframes style.
-     */
-    keyframesStyle: TimelineKeyframeStyle;
-    /**
-     * Whether group is draggable.
-     * Considered to be false when really set as false.
-     */
-    draggable?: boolean;
-    /**
-     * Whether group keyframes are draggable.
-     */
-    keyframesDraggable?: boolean;
-    /**
-     * Whether group is hidden.
-     */
-    hidden?: boolean;
-}
+import { TimelineKeyframeStyle } from '../settings/styles/timelineKeyframeStyle';
+import { TimelineGroupStyle } from '../settings/styles/timelineGroupStyle';
+/**
+ * Timeline group view model.
+ */
+export interface TimelineGroup {
+    /**
+     * Group style.
+     */
+    style: TimelineGroupStyle;
+    /**
+     * Child keyframes style.
+     */
+    keyframesStyle: TimelineKeyframeStyle;
+    /**
+     * Whether group is draggable.
+     * Considered to be false when really set as false.
+     */
+    draggable?: boolean;
+    /**
+     * Whether group keyframes are draggable.
+     */
+    keyframesDraggable?: boolean;
+    /**
+     * Whether group is hidden.
+     */
+    hidden?: boolean;
+}

+ 28 - 28
lib/models/timelineKeyframe.d.ts

@@ -1,28 +1,28 @@
-import { TimelineKeyframeStyle } from '../settings/styles/timelineKeyframeStyle';
-import { TimelineSelectable } from '../utils/timelineSelectable';
-import { TimelineRanged } from './timelineRanged';
-import { TimelineGroup } from './timelineGroup';
-export interface TimelineKeyframe extends TimelineSelectable, TimelineRanged {
-    /**
-     * Keyframe value.
-     */
-    val: number;
-    /**
-     * Related keyframe group.
-     * Timeline keyframes groups are rendered as one instance.
-     */
-    group?: string | TimelineGroup;
-    /**
-     * Keyframe style.
-     */
-    style?: TimelineKeyframeStyle;
-    /**
-     * Whether keyframe is hidden.
-     */
-    hidden?: boolean;
-    /**
-     * Whether group is draggable.
-     * Considered to be false when really set as false.
-     */
-    draggable?: boolean;
-}
+import { TimelineKeyframeStyle } from '../settings/styles/timelineKeyframeStyle';
+import { TimelineSelectable } from '../utils/timelineSelectable';
+import { TimelineRanged } from './timelineRanged';
+import { TimelineGroup } from './timelineGroup';
+export interface TimelineKeyframe extends TimelineSelectable, TimelineRanged {
+    /**
+     * Keyframe value.
+     */
+    val: number;
+    /**
+     * Related keyframe group.
+     * Timeline keyframes groups are rendered as one instance.
+     */
+    group?: string | TimelineGroup;
+    /**
+     * Keyframe style.
+     */
+    style?: TimelineKeyframeStyle;
+    /**
+     * Whether keyframe is hidden.
+     */
+    hidden?: boolean;
+    /**
+     * Whether group is draggable.
+     * Considered to be false when really set as false.
+     */
+    draggable?: boolean;
+}

+ 4 - 4
lib/models/timelineModel.d.ts

@@ -1,4 +1,4 @@
-import { TimelineRow } from './timelineRow';
-export interface TimelineModel {
-    rows: TimelineRow[];
-}
+import { TimelineRow } from './timelineRow';
+export interface TimelineModel {
+    rows: TimelineRow[];
+}

+ 10 - 10
lib/models/timelineRanged.d.ts

@@ -1,10 +1,10 @@
-export interface TimelineRanged {
-    /**
-     * min
-     */
-    min?: number | null;
-    /**
-     * max.
-     */
-    max?: number | null;
-}
+export interface TimelineRanged {
+    /**
+     * min
+     */
+    min?: number | null;
+    /**
+     * max.
+     */
+    max?: number | null;
+}

+ 13 - 13
lib/models/timelineRow.d.ts

@@ -1,13 +1,13 @@
-import { TimelineKeyframe } from './timelineKeyframe';
-import { TimelineRowStyle } from '../settings/styles/timelineRowStyle';
-import { TimelineRanged } from './timelineRanged';
-export interface TimelineRow extends TimelineRanged {
-    style?: TimelineRowStyle;
-    keyframes?: TimelineKeyframe[] | null;
-    hidden?: boolean;
-    /**
-     * Whether group keyframes are draggable.
-     */
-    keyframesDraggable?: boolean;
-    groupsDraggable?: boolean;
-}
+import { TimelineKeyframe } from './timelineKeyframe';
+import { TimelineRowStyle } from '../settings/styles/timelineRowStyle';
+import { TimelineRanged } from './timelineRanged';
+export interface TimelineRow extends TimelineRanged {
+    style?: TimelineRowStyle;
+    keyframes?: TimelineKeyframe[] | null;
+    hidden?: boolean;
+    /**
+     * Whether group keyframes are draggable.
+     */
+    keyframesDraggable?: boolean;
+    groupsDraggable?: boolean;
+}

+ 3 - 3
lib/settings/defaults/defaultGroupStyle.d.ts

@@ -1,3 +1,3 @@
-import { TimelineGroupStyle } from '../styles/timelineGroupStyle';
-export declare const defaultRowHeight = 24;
-export declare const defaultGroupStyle: TimelineGroupStyle;
+import { TimelineGroupStyle } from '../styles/timelineGroupStyle';
+export declare const defaultRowHeight = 24;
+export declare const defaultGroupStyle: TimelineGroupStyle;

+ 2 - 2
lib/settings/defaults/defaultTimelineConsts.d.ts

@@ -1,2 +1,2 @@
-import { TimelineConsts } from '../timelineConsts';
-export declare const defaultTimelineConsts: TimelineConsts;
+import { TimelineConsts } from '../timelineConsts';
+export declare const defaultTimelineConsts: TimelineConsts;

+ 2 - 2
lib/settings/defaults/defaultTimelineKeyframeStyle.d.ts

@@ -1,2 +1,2 @@
-import { TimelineKeyframeStyle } from '../styles/timelineKeyframeStyle';
-export declare const defaultTimelineKeyframeStyle: TimelineKeyframeStyle;
+import { TimelineKeyframeStyle } from '../styles/timelineKeyframeStyle';
+export declare const defaultTimelineKeyframeStyle: TimelineKeyframeStyle;

+ 2 - 2
lib/settings/defaults/defaultTimelineOptions.d.ts

@@ -1,2 +1,2 @@
-import { TimelineOptions } from '../timelineOptions';
-export declare const defaultTimelineOptions: TimelineOptions;
+import { TimelineOptions } from '../timelineOptions';
+export declare const defaultTimelineOptions: TimelineOptions;

+ 2 - 2
lib/settings/defaults/defaultTimelineRowStyle.d.ts

@@ -1,2 +1,2 @@
-import { TimelineRowStyle } from '../styles/timelineRowStyle';
-export declare const defaultTimelineRowStyle: TimelineRowStyle;
+import { TimelineRowStyle } from '../styles/timelineRowStyle';
+export declare const defaultTimelineRowStyle: TimelineRowStyle;

+ 2 - 2
lib/settings/defaults/defaultTimelineStyle.d.ts

@@ -1,2 +1,2 @@
-import { TimelineStyle } from '../styles/timelineStyle';
-export declare const defaultTimelineStyle: TimelineStyle;
+import { TimelineStyle } from '../styles/timelineStyle';
+export declare const defaultTimelineStyle: TimelineStyle;

+ 28 - 28
lib/settings/styles/TimelineRowStyle.d.ts

@@ -1,28 +1,28 @@
-import { TimelineGroupStyle } from './timelineGroupStyle';
-import { TimelineKeyframeStyle } from './timelineKeyframeStyle';
-/**
- * Style of the row.
- */
-export interface TimelineRowStyle {
-    /**
-     * Size of the row in pixels.
-     */
-    height?: number;
-    /**
-     * Track fill color.
-     */
-    fillColor?: string;
-    /**
-     * Row margin bottom in pixels between tracks/rows.
-     */
-    marginBottom?: number;
-    /**
-     * Style for the all keyframes in a current row.
-     * Individual keyframe can have own style.
-     */
-    keyframesStyle?: TimelineKeyframeStyle;
-    /**
-     * Style of the groups. Keyframe groups can be also styles separately.
-     */
-    groupsStyle?: TimelineGroupStyle;
-}
+import { TimelineGroupStyle } from './timelineGroupStyle';
+import { TimelineKeyframeStyle } from './timelineKeyframeStyle';
+/**
+ * Style of the row.
+ */
+export interface TimelineRowStyle {
+    /**
+     * Size of the row in pixels.
+     */
+    height?: number;
+    /**
+     * Track fill color.
+     */
+    fillColor?: string;
+    /**
+     * Row margin bottom in pixels between tracks/rows.
+     */
+    marginBottom?: number;
+    /**
+     * Style for the all keyframes in a current row.
+     * Individual keyframe can have own style.
+     */
+    keyframesStyle?: TimelineKeyframeStyle;
+    /**
+     * Style of the groups. Keyframe groups can be also styles separately.
+     */
+    groupsStyle?: TimelineGroupStyle;
+}

+ 26 - 26
lib/settings/styles/timelineCapStyle.d.ts

@@ -1,26 +1,26 @@
-import { TimelineCapShape } from '../../enums/timelineCapShape';
-/**
- * Timeline active/current value indicator style.
- */
-export interface TimelineCapStyle {
-    /**
-     * Cap style width in pixels.
-     */
-    width?: number;
-    /**
-     * Cap style height in pixels.
-     */
-    height?: number;
-    /**
-     * Cap stroke color.
-     */
-    strokeColor: string;
-    /**
-     * Cap fill color.
-     */
-    fillColor: string;
-    /**
-     * Cap type
-     */
-    capType?: TimelineCapShape;
-}
+import { TimelineCapShape } from '../../enums/timelineCapShape';
+/**
+ * Timeline active/current value indicator style.
+ */
+export interface TimelineCapStyle {
+    /**
+     * Cap style width in pixels.
+     */
+    width?: number;
+    /**
+     * Cap style height in pixels.
+     */
+    height?: number;
+    /**
+     * Cap stroke color.
+     */
+    strokeColor: string;
+    /**
+     * Cap fill color.
+     */
+    fillColor: string;
+    /**
+     * Cap type
+     */
+    capType?: TimelineCapShape;
+}

+ 32 - 32
lib/settings/styles/timelineGroupStyle.d.ts

@@ -1,32 +1,32 @@
-import { TimelineCursorType } from '../../enums/timelineCursorType';
-import { TimelineKeyframeStyle } from '../styles/timelineKeyframeStyle';
-/**
- * Timeline group style.
- */
-export interface TimelineGroupStyle {
-    /**
-     * Keyframes style height in pixels.
-     * 'auto' to automatically calculate.
-     */
-    height?: number | string;
-    /**
-     * Group stroke color.
-     */
-    strokeColor: string;
-    /**
-     * Group fill color.
-     */
-    fillColor: string;
-    /**
-     * Group mouse over cursor style.
-     */
-    cursor?: TimelineCursorType;
-    /**
-     * Margin top in px or 'auto' to center element.
-     */
-    marginTop?: number | string;
-    /**
-     * Style for all the keyframes in the current group.
-     */
-    keyframesStyle: TimelineKeyframeStyle;
-}
+import { TimelineCursorType } from '../../enums/timelineCursorType';
+import { TimelineKeyframeStyle } from '../styles/timelineKeyframeStyle';
+/**
+ * Timeline group style.
+ */
+export interface TimelineGroupStyle {
+    /**
+     * Keyframes style height in pixels.
+     * 'auto' to automatically calculate.
+     */
+    height?: number | string;
+    /**
+     * Group stroke color.
+     */
+    strokeColor: string;
+    /**
+     * Group fill color.
+     */
+    fillColor: string;
+    /**
+     * Group mouse over cursor style.
+     */
+    cursor?: TimelineCursorType;
+    /**
+     * Margin top in px or 'auto' to center element.
+     */
+    marginTop?: number | string;
+    /**
+     * Style for all the keyframes in the current group.
+     */
+    keyframesStyle: TimelineKeyframeStyle;
+}

+ 40 - 40
lib/settings/styles/timelineKeyframeStyle.d.ts

@@ -1,40 +1,40 @@
-import { TimelineCursorType } from '../../enums/timelineCursorType';
-import { TimelineKeyframeShape } from '../../enums/timelineKeyframeShape';
-export interface TimelineKeyframeStyle {
-    /**
-     * Timeline cursor style.
-     */
-    cursor?: TimelineCursorType;
-    /**
-     * Timeline keyframe shape
-     */
-    shape?: TimelineKeyframeShape;
-    /**
-     * keyframe size, number or text 'auto'
-     */
-    height?: number | string;
-    /**
-     * keyframe size, number or text 'auto'
-     */
-    width?: number | string;
-    /**
-     * Keyframe fill color
-     */
-    fillColor?: string | null;
-    /**
-     * Keyframe selected fill color.
-     */
-    selectedFillColor?: string | null;
-    /**
-     * Keyframe stroke color.
-     */
-    strokeColor?: string | null;
-    /**
-     * Keyframe selected stroke color.
-     */
-    selectedStrokeColor?: string | null;
-    /**
-     * Keyframe stroke Thickness.
-     */
-    strokeThickness?: number | null;
-}
+import { TimelineCursorType } from '../../enums/timelineCursorType';
+import { TimelineKeyframeShape } from '../../enums/timelineKeyframeShape';
+export interface TimelineKeyframeStyle {
+    /**
+     * Timeline cursor style.
+     */
+    cursor?: TimelineCursorType;
+    /**
+     * Timeline keyframe shape
+     */
+    shape?: TimelineKeyframeShape;
+    /**
+     * keyframe size, number or text 'auto'
+     */
+    height?: number | string;
+    /**
+     * keyframe size, number or text 'auto'
+     */
+    width?: number | string;
+    /**
+     * Keyframe fill color
+     */
+    fillColor?: string | null;
+    /**
+     * Keyframe selected fill color.
+     */
+    selectedFillColor?: string | null;
+    /**
+     * Keyframe stroke color.
+     */
+    strokeColor?: string | null;
+    /**
+     * Keyframe selected stroke color.
+     */
+    selectedStrokeColor?: string | null;
+    /**
+     * Keyframe stroke Thickness.
+     */
+    strokeThickness?: number | null;
+}

+ 32 - 32
lib/settings/styles/timelineStyle.d.ts

@@ -1,32 +1,32 @@
-import { TimelineCursorType } from '../../enums/timelineCursorType';
-import { TimelineCapStyle } from './timelineCapStyle';
-/**
- * Timeline active/current value indicator style.
- */
-export interface TimelineStyle {
-    width?: number;
-    /**
-     * Margin top in pixels.
-     */
-    marginTop?: number;
-    /**
-     * Margin bottom in pixels.
-     */
-    marginBottom?: number;
-    /**
-     * Timeline top cap style.
-     */
-    capStyle?: TimelineCapStyle;
-    /**
-     * Timeline indicator stroke color.
-     */
-    strokeColor?: string;
-    /**
-     * Timeline fill color.
-     */
-    fillColor?: string;
-    /**
-     * Timeline cursor.
-     */
-    cursor?: TimelineCursorType;
-}
+import { TimelineCursorType } from '../../enums/timelineCursorType';
+import { TimelineCapStyle } from './timelineCapStyle';
+/**
+ * Timeline active/current value indicator style.
+ */
+export interface TimelineStyle {
+    width?: number;
+    /**
+     * Margin top in pixels.
+     */
+    marginTop?: number;
+    /**
+     * Margin bottom in pixels.
+     */
+    marginBottom?: number;
+    /**
+     * Timeline top cap style.
+     */
+    capStyle?: TimelineCapStyle;
+    /**
+     * Timeline indicator stroke color.
+     */
+    strokeColor?: string;
+    /**
+     * Timeline fill color.
+     */
+    fillColor?: string;
+    /**
+     * Timeline cursor.
+     */
+    cursor?: TimelineCursorType;
+}

+ 46 - 46
lib/settings/timelineConsts.d.ts

@@ -1,46 +1,46 @@
-/**
- * Internal components consts.
- * Still can be changed thru private property _consts but this is discouraged.
- */
-export interface TimelineConsts {
-    /**
-     * Auto pan speed.
-     */
-    autoPanSpeed: number;
-    /**
-     * scroll speed when mouse drag is used (from 0 to 1)
-     */
-    scrollByDragSpeed: number;
-    /**
-     * Determine whether item was clicked.
-     */
-    clickDetectionMs: number;
-    /**
-     * Timeout to detect double click.
-     */
-    doubleClickTimeoutMs: number;
-    /**
-     * Time in ms used to refresh scrollbars when pan is finished.
-     */
-    scrollFinishedTimeoutMs: number;
-    /**
-     * Auto pan padding
-     */
-    autoPanByScrollPadding: number;
-    /**
-     * Click threshold
-     */
-    clickThreshold: number;
-    /**
-     * Click min radius for the elements detection.
-     */
-    clickDetectionMinRadius: number;
-    /**
-     * Default auto size for the group. It's percents.
-     */
-    autoPanSpeedLimit: number;
-    /**
-     * Default auto size for the group. It's percents.
-     */
-    defaultGroupHeight: number;
-}
+/**
+ * Internal components consts.
+ * Still can be changed thru private property _consts but this is discouraged.
+ */
+export interface TimelineConsts {
+    /**
+     * Auto pan speed.
+     */
+    autoPanSpeed: number;
+    /**
+     * scroll speed when mouse drag is used (from 0 to 1)
+     */
+    scrollByDragSpeed: number;
+    /**
+     * Determine whether item was clicked.
+     */
+    clickDetectionMs: number;
+    /**
+     * Timeout to detect double click.
+     */
+    doubleClickTimeoutMs: number;
+    /**
+     * Time in ms used to refresh scrollbars when pan is finished.
+     */
+    scrollFinishedTimeoutMs: number;
+    /**
+     * Auto pan padding
+     */
+    autoPanByScrollPadding: number;
+    /**
+     * Click threshold
+     */
+    clickThreshold: number;
+    /**
+     * Click min radius for the elements detection.
+     */
+    clickDetectionMinRadius: number;
+    /**
+     * Default auto size for the group. It's percents.
+     */
+    autoPanSpeedLimit: number;
+    /**
+     * Default auto size for the group. It's percents.
+     */
+    defaultGroupHeight: number;
+}

+ 107 - 107
lib/settings/timelineOptions.d.ts

@@ -1,107 +1,107 @@
-import { TimelineRowStyle } from './styles/timelineRowStyle';
-import { TimelineStyle } from './styles/timelineStyle';
-import { TimelineRanged } from '../models/timelineRanged';
-export interface TimelineOptions extends TimelineRanged {
-    /**
-     * Id or HTMLElement of the timeline container.
-     */
-    id?: string | HTMLElement;
-    /**
-     * Check whether snapping is enabled.
-     */
-    snapEnabled?: boolean;
-    /**
-     *  Snap all selected keyframes as one bundle during the drag.
-     */
-    snapAllKeyframesOnMove?: boolean;
-    /**
-     * Approximate step for the timeline in pixels for 1 second
-     */
-    stepPx?: number;
-    /**
-     * Number of points that should fit into the one stepPx.
-     */
-    stepVal?: number;
-    stepSmallPx?: number;
-    /**
-     * Snap step in units. from 0 to stepVal
-     */
-    snapStep?: number;
-    /**
-     * additional left margin in pixels to start the line gauge from.
-     */
-    leftMargin?: number;
-    /**
-     * Component header background color.
-     */
-    headerFillColor?: string;
-    /**
-     * Component background color.
-     */
-    fillColor?: string;
-    /**
-     * Header labels color.
-     */
-    labelsColor?: string;
-    /**
-     * Header gauge tick color.
-     */
-    tickColor?: string;
-    /**
-     * Selection rectangle color.
-     */
-    selectionColor?: string;
-    /**
-     * Header height in pixels
-     */
-    headerHeight?: number;
-    /**
-     * Header ticks font
-     */
-    font?: string;
-    /**
-     * Default zoom level = 1. where screen pixels are equals to the corresponding stepVal stepPx.
-     */
-    zoom?: number;
-    /**
-     * Default zoom speed.
-     */
-    zoomSpeed?: number;
-    /**
-     * Max zoom value.
-     */
-    zoomMin?: number;
-    /**
-     * Min zoom value.
-     */
-    zoomMax?: number;
-    /**
-     * Set this to true in a MAC OS environment: The Meta key will be used instead of the Ctrl key.
-     */
-    controlKeyIsMetaKey?: boolean;
-    /**
-     * Access the scroll container via this class for e.g. scroll bar styling.
-     */
-    scrollContainerClass?: string;
-    /**
-     * Default rows style.
-     * Can be overridden by setting style individually for each row.
-     */
-    rowsStyle?: TimelineRowStyle;
-    /**
-     * Timeline indicator style.
-     */
-    timelineStyle?: TimelineStyle;
-    /**
-     * keyframes group is draggable. Default: true
-     */
-    groupsDraggable?: boolean;
-    /**
-     * keyframes group is draggable. Default: true
-     */
-    keyframesDraggable?: boolean;
-    /**
-     * Timeline can be dragged or position can be changed by user interaction. Default: true
-     */
-    timelineDraggable?: boolean;
-}
+import { TimelineRowStyle } from './styles/timelineRowStyle';
+import { TimelineStyle } from './styles/timelineStyle';
+import { TimelineRanged } from '../models/timelineRanged';
+export interface TimelineOptions extends TimelineRanged {
+    /**
+     * Id or HTMLElement of the timeline container.
+     */
+    id?: string | HTMLElement | null;
+    /**
+     * Check whether snapping is enabled.
+     */
+    snapEnabled?: boolean;
+    /**
+     *  Snap all selected keyframes as one bundle during the drag.
+     */
+    snapAllKeyframesOnMove?: boolean;
+    /**
+     * Approximate step for the timeline in pixels for 1 second
+     */
+    stepPx?: number;
+    /**
+     * Number of points that should fit into the one stepPx.
+     */
+    stepVal?: number;
+    stepSmallPx?: number;
+    /**
+     * Snap step in units. from 0 to stepVal
+     */
+    snapStep?: number;
+    /**
+     * additional left margin in pixels to start the line gauge from.
+     */
+    leftMargin?: number;
+    /**
+     * Component header background color.
+     */
+    headerFillColor?: string;
+    /**
+     * Component background color.
+     */
+    fillColor?: string;
+    /**
+     * Header labels color.
+     */
+    labelsColor?: string;
+    /**
+     * Header gauge tick color.
+     */
+    tickColor?: string;
+    /**
+     * Selection rectangle color.
+     */
+    selectionColor?: string;
+    /**
+     * Header height in pixels
+     */
+    headerHeight?: number;
+    /**
+     * Header ticks font
+     */
+    font?: string;
+    /**
+     * Default zoom level = 1. where screen pixels are equals to the corresponding stepVal stepPx.
+     */
+    zoom?: number;
+    /**
+     * Default zoom speed.
+     */
+    zoomSpeed?: number;
+    /**
+     * Max zoom value.
+     */
+    zoomMin?: number;
+    /**
+     * Min zoom value.
+     */
+    zoomMax?: number;
+    /**
+     * Set this to true in a MAC OS environment: The Meta key will be used instead of the Ctrl key.
+     */
+    controlKeyIsMetaKey?: boolean;
+    /**
+     * Access the scroll container via this class for e.g. scroll bar styling.
+     */
+    scrollContainerClass?: string;
+    /**
+     * Default rows style.
+     * Can be overridden by setting style individually for each row.
+     */
+    rowsStyle?: TimelineRowStyle;
+    /**
+     * Timeline indicator style.
+     */
+    timelineStyle?: TimelineStyle;
+    /**
+     * keyframes group is draggable. Default: true
+     */
+    groupsDraggable?: boolean;
+    /**
+     * keyframes group is draggable. Default: true
+     */
+    keyframesDraggable?: boolean;
+    /**
+     * Timeline can be dragged or position can be changed by user interaction. Default: true
+     */
+    timelineDraggable?: boolean;
+}

File diff suppressed because it is too large
+ 81 - 81
lib/tests/settingsTests.test.js


File diff suppressed because it is too large
+ 670 - 670
lib/tests/styleTests.test.js


File diff suppressed because it is too large
+ 0 - 866
lib/tests/timelineTests.test.js


+ 552 - 552
lib/timeline.d.ts

@@ -1,552 +1,552 @@
-import { TimelineEventsEmitter } from './timelineEventsEmitter';
-import { TimelineConsts } from './settings/timelineConsts';
-import { TimelineModel } from './models/timelineModel';
-import { TimelineRow } from './models/timelineRow';
-import { TimelineKeyframe } from './models/timelineKeyframe';
-import { TimelineOptions } from './settings/timelineOptions';
-import { TimelineElement } from './utils/timelineElement';
-import { TimelineCutBoundsRectResults } from './utils/timelineCutBoundsRectResults';
-import { TimelineSelectionResults } from './utils/timelineSelectionResults';
-import { TimelineMouseData } from './utils/timelineMouseData';
-import { TimelineElementDragState } from './utils/timelineElementDragState';
-import { TimelineDraggableData } from './utils/timelineDraggableData';
-import { TimelineGroupViewModel } from './viewModels/timelineGroupViewModel';
-import { TimelineKeyframeViewModel } from './viewModels/timelineKeyframeViewModel';
-import { TimelineRowViewModel } from './viewModels/timelineRowViewModel';
-import { TimelineViewModel } from './viewModels/timelineViewModel';
-import { TimelineKeyframeChangedEvent } from './utils/events/timelineKeyframeChangedEvent';
-import { TimelineTimeChangedEvent } from './utils/events/timelineTimeChangedEvent';
-import { TimelineSelectedEvent } from './utils/events/timelineSelectedEvent';
-import { TimelineScrollEvent } from './utils/events/timelineScrollEvent';
-import { TimelineClickEvent } from './utils/events/timelineClickEvent';
-import { TimelineDragEvent } from './utils/events/timelineDragEvent';
-import { TimelineKeyframeShape } from './enums/timelineKeyframeShape';
-import { TimelineInteractionMode } from './enums/timelineInteractionMode';
-import { TimelineElementType } from './enums/timelineElementType';
-import { TimelineEventSource } from './enums/timelineEventSource';
-import { TimelineSelectionMode } from './enums/timelineSelectionMode';
-import { TimelineEvents } from './enums/timelineEvents';
-import { TimelineScrollSource } from './enums/timelineScrollSource';
-export declare class Timeline extends TimelineEventsEmitter {
-    /**
-     * component container.
-     */
-    _container: HTMLElement | null;
-    /**
-     * Dynamically generated canvas inside of the container.
-     */
-    _canvas: HTMLCanvasElement | null;
-    /**
-     * Dynamically generated scroll container.
-     */
-    _scrollContainer: HTMLElement | null;
-    /**
-     * Dynamically generated virtual scroll content.
-     * While canvas has no real size, this element is used to create virtual scroll on the parent element.
-     */
-    _scrollContent: HTMLElement | null;
-    /**
-     * Rendering context
-     */
-    _ctx: CanvasRenderingContext2D | null;
-    /**
-     * Components settings
-     */
-    _options: TimelineOptions;
-    /**
-     * Drag start position.
-     */
-    _startPosMouseArgs: TimelineMouseData | null;
-    /**
-     * Drag scroll started position.
-     */
-    _scrollStartPos: DOMPoint | null;
-    /**
-     * Private. Current mouse position that is used to track values between mouse up/down events.
-     * Can be null, use public methods and properties instead.
-     */
-    _currentPos: TimelineMouseData | null;
-    /**
-     * Private. Current active mouse area selection rectangle displayed during the mouse up/down drag events.
-     */
-    _selectionRect: DOMRect | null;
-    /**
-     * Private. Whether selection rectangle is displayed.
-     */
-    _selectionRectEnabled: boolean;
-    /**
-     * Private. Information in regard of current active drag state.
-     */
-    _drag: TimelineDraggableData | null;
-    _startedDragWithCtrl: boolean;
-    _startedDragWithShiftKey: boolean;
-    _scrollProgrammatically: boolean;
-    _clickTimeout: number | null;
-    _lastClickTime: number;
-    _lastClickPoint: DOMPoint | null;
-    _consts: TimelineConsts;
-    /**
-     * Private. whether click is allowed.
-     */
-    _clickAllowed: boolean;
-    /**
-     * Private. scroll finished timer reference.
-     */
-    _scrollFinishedTimerRef?: number | null;
-    /**
-     * Private.Current timeline position.
-     * Please use public get\set methods to properly change the timeline position.
-     */
-    _val: number;
-    _pixelRatio: number;
-    /**
-     * Private. Current zoom level. Please use publicly available properties to set zoom levels.
-     */
-    _currentZoom: number;
-    /**
-     * Private. Ref for the auto pan scroll interval.
-     */
-    _intervalRef?: number | null;
-    /**
-     * Private.
-     * When last auto pan scroll action was started.
-     */
-    _autoPanLastActionDate: number;
-    /**
-     * Private.
-     * Is pan mouse interactions are started.
-     */
-    _isPanStarted: boolean;
-    /**
-     * Private.
-     * Component interaction mode. Please use publicly available methods.
-     */
-    _interactionMode: TimelineInteractionMode;
-    _lastUsedArgs: MouseEvent | TouchEvent | null;
-    /**
-     * Private.
-     * Current set timeline model.
-     */
-    _model: TimelineModel | null;
-    /**
-     * Private.
-     * Indication when scroll are drag or click is started.
-     */
-    _scrollAreaClickOrDragStarted: boolean;
-    /**
-     * Create Timeline instance
-     * @param options Timeline settings.
-     * @param model Timeline model.
-     */
-    constructor(options?: TimelineOptions | null, model?: TimelineModel | null);
-    /**
-     * Initialize Timeline
-     * @param options Timeline settings.
-     * @param model Timeline model.
-     */
-    initialize: (options: TimelineOptions | null, model: TimelineModel | null) => void;
-    /**
-     * Generate component html.
-     * @param id container.
-     */
-    _generateContainers: (id: string | HTMLElement) => void;
-    /**
-     * Get drawing context
-     */
-    _getCtx(): CanvasRenderingContext2D | null;
-    /**
-     * Subscribe current component on the related events.
-     * Private. Use initialize method instead.
-     */
-    _subscribeComponentEvents: () => void;
-    /**
-     * Private. Use dispose method instead.
-     */
-    _unsubscribeComponentEvents: () => void;
-    /**
-     * Dispose current component: unsubscribe component and user events.
-     */
-    dispose: () => void;
-    /**
-     * On key up is received.
-     */
-    _handleKeyUp: (event: KeyboardEvent) => void;
-    /**
-     * On key down is received.
-     */
-    _handleKeyDown: (event: KeyboardEvent) => void;
-    _setZoomCursor: (e: MouseEvent | KeyboardEvent) => void;
-    _handleBlurEvent: () => void;
-    _handleWindowResizeEvent: () => void;
-    _clearScrollFinishedTimer: () => void;
-    _handleScrollMouseDownEvent: () => void;
-    _handleScrollEvent: (args: Event) => void;
-    _controlKeyPressed: (e: MouseEvent | KeyboardEvent | TouchEvent) => boolean;
-    _handleWheelEvent: (event: WheelEvent) => void;
-    _zoom: (direction: number, speed: number, x: number) => void;
-    /**
-     * Zoom in
-     * @param speed value from 0 to 1
-     */
-    zoomIn: (speed?: number | undefined) => void;
-    /**
-     * Zoom out.
-     * @param speed value from 0 to 1
-     */
-    zoomOut: (speed?: number | undefined) => void;
-    /**
-     * Set direct zoom value.
-     * @param zoom zoom value to set. percent 0-1 and etc.
-     * @param min min zoom.
-     * @param max max zoom.
-     * @return normalized value.
-     */
-    _setZoom: (zoom: number, min?: number | null | undefined, max?: number | null | undefined) => number;
-    /**
-     * Set direct zoom value.
-     * @public
-     * @param zoom zoom value to set. percent 0-1 and etc.
-     * @return normalized value.
-     */
-    setZoom: (zoom: number) => number;
-    /**
-     * Get current zoom level.
-     */
-    getZoom: () => number;
-    _getClickDetectionRadius: (point: TimelineMouseData) => number;
-    /**
-     * @param args
-     */
-    _handleMouseDownEvent: (args: MouseEvent | TouchEvent) => void;
-    _setElementDragState: (element: TimelineElement | TimelineElementDragState, val: number) => TimelineElementDragState;
-    /**
-     * Check is mouse left button is clicked.
-     */
-    isLeftButtonClicked: (args: MouseEvent | TouchEvent | any) => boolean;
-    /**
-     * Browser mouse move handler.
-     */
-    _handleMouseMoveEvent: (args: MouseEvent | TouchEvent | null) => void;
-    /**
-     * Move elements
-     * @param offset vector to move elements along.
-     * @param elements Element to move.
-     * @returns real moved value.
-     */
-    _moveElements(offset: number, elements: TimelineElementDragState[], source?: TimelineEventSource): number;
-    /**
-     * Mouse up handler.
-     */
-    _handleMouseUpEvent: (args: MouseEvent | TouchEvent) => void;
-    /**
-     * Canvas client height.
-     */
-    _canvasClientHeight: () => number;
-    /**
-     * Canvas client width.
-     */
-    _canvasClientWidth: () => number;
-    /**
-     * Get all keyframes under the screen rectangle.
-     * @param screenRect screen coordinates to get keyframes.
-     */
-    _getKeyframesByRectangle: (screenRect: DOMRect) => TimelineKeyframe[];
-    /**
-     * Private.
-     * Perform timeline click.
-     */
-    _performClick: (pos: TimelineMouseData, drag: TimelineDraggableData | null) => boolean;
-    /**
-     * Set keyframe value.
-     * @param keyframe
-     * @param value
-     * @return set value.
-     */
-    _setKeyframePos: (element: TimelineElementDragState, value: number, source?: TimelineEventSource) => number;
-    /**
-     * @param cursor to set.
-     */
-    _setCursor: (cursor: string) => void;
-    /**
-     * Set component interaction mode.
-     */
-    setInteractionMode: (mode: TimelineInteractionMode) => void;
-    /**
-     * Get current interaction mode.
-     */
-    getInteractionMode: () => TimelineInteractionMode;
-    /**
-     * Private.
-     * Helper method. Convert model element  to timeline element.
-     */
-    _convertToTimelineElement: (rowModel: TimelineRow | null, keyframe: TimelineKeyframe) => TimelineElement;
-    getSelectedKeyframes: () => TimelineKeyframe[];
-    /**
-     * Get selected timeline elements.
-     */
-    getSelectedElements: () => TimelineElement[];
-    /**
-     * Get all keyframe models available in the model.
-     */
-    getAllKeyframes: () => TimelineKeyframe[];
-    selectAllKeyframes: () => TimelineSelectionResults;
-    deselectAll: () => TimelineSelectionResults;
-    private _changeNodeState;
-    select: (nodes: TimelineKeyframe[] | TimelineKeyframe | null, mode?: TimelineSelectionMode) => TimelineSelectionResults;
-    /**
-     * Select keyframes
-     * @param nodes keyframe or list of the keyframes to be selected.
-     * @param mode selection mode.
-     */
-    _selectInternal: (nodes: TimelineKeyframe[] | TimelineKeyframe | null, mode?: TimelineSelectionMode) => TimelineSelectionResults;
-    /**
-     * foreach visible keyframe.
-     */
-    _forEachKeyframe(callback: (keyframe: TimelineKeyframeViewModel, index?: number, newRow?: boolean) => void): void;
-    /**
-     * Private.
-     * Create extended mouse position and calculate size of the selection rectangle.
-     */
-    _trackMousePos(canvas: HTMLCanvasElement, mouseArgs: MouseEvent | TouchEvent): TimelineMouseData;
-    /**
-     * Get scroll container client width.
-     */
-    getClientWidth(): number;
-    /**
-     * Get scroll container client height.
-     */
-    getClientHeight(): number;
-    _cleanUpSelection(forcePrevent?: boolean): void;
-    /**
-     * Check whether click timeout is over.
-     */
-    _clickTimeoutIsOver(): boolean;
-    /**
-     * Automatically pan. Scroll canvas when selection is made and mouse outside of the bounds.
-     */
-    _startAutoPan: () => void;
-    /**
-     * Stop current running auto pan
-     */
-    _stopAutoPan: () => void;
-    /**
-     * Check whether auto pan should be slowed down a bit.
-     */
-    _checkUpdateSpeedTooFast(): boolean;
-    /**
-     * Scroll virtual canvas when pan mode is enabled.
-     */
-    _scrollByPan(start: DOMPoint, pos: DOMPoint, scrollStartPos: DOMPoint | null): void;
-    _scrollBySelectionOutOfBounds(pos: DOMPoint): boolean;
-    /**
-     * Convert screen pixel to value.
-     */
-    pxToVal(px: number): number;
-    /**
-     * Convert value to local screen component coordinates.
-     */
-    _toScreenPx: (val: number) => number;
-    /**
-     * Convert screen local coordinates to a global value info.
-     */
-    _fromScreen: (px: number) => number;
-    /**
-     * Convert area value to global screen pixel coordinates.
-     */
-    valToPx: (val: number) => number;
-    /**
-     * Snap a value to a nearest grid point.
-     */
-    snapVal(val: number): number;
-    /**
-     * Convert mouse position to the timeline units considering all the scrolling and offsets.
-     */
-    _mousePosToVal: (x: number, snapEnabled?: boolean) => number;
-    /**
-     * Format line gauge text.
-     * Default formatting is HMS
-     * @param ms milliseconds to convert.
-     * @param isSeconds whether seconds are passed.
-     */
-    _formatUnitsText: (ms: number, isSeconds?: boolean) => string;
-    /**
-     * Left padding of the timeline.
-     */
-    _leftMargin: () => number;
-    /**
-     * Private.
-     * Render line gauge ticks.
-     */
-    _renderTicks: () => void;
-    /**
-     * Private.
-     * Calculate virtual view model.
-     * Determine screen positions for the model elements given.
-     */
-    _generateViewModel: () => TimelineViewModel;
-    /**
-     * Render timeline rows.
-     */
-    _renderRows: () => void;
-    /**
-     * Render group for the row.
-     */
-    _renderGroupBounds: (rowViewModel: TimelineRowViewModel) => void;
-    /**
-     * Method is used for the canvas drawing optimization.
-     * Bounds are cut to draw only visible parts for the active canvas.
-     */
-    _cutBounds: (rect: DOMRect) => TimelineCutBoundsRectResults | null;
-    _cutBoundsWhenOverlap: (rect: DOMRect, minX: number, maxX: number, minY: number, maxY: number) => TimelineCutBoundsRectResults | null;
-    /**
-     * Calculate keyframe group screen rect size that is used during the rendering.
-     * @param row
-     * @param rowY row screen coords y position
-     */
-    _getKeyframesGroupSize: (groupViewModel: TimelineGroupViewModel, rowViewModel: TimelineRowViewModel) => DOMRect;
-    _getKeyframePosition: (keyframe: TimelineKeyframe, groupViewModel: TimelineGroupViewModel, rowViewModel: TimelineRowViewModel, keyframeShape: TimelineKeyframeShape) => DOMRect | null;
-    _renderKeyframes: () => void;
-    _renderSelectionRect: () => void;
-    _renderBackground: () => void;
-    _renderTimeline: () => void;
-    /**
-     * Render timeline cap top.
-     */
-    _renderTimelineCap: (timeLinePos: number, y: number) => void;
-    _renderHeaderBackground: () => void;
-    redraw: () => void;
-    /**
-     * perform scroll to max right.
-     */
-    scrollToRightBounds: () => void;
-    /**
-     * Redraw parts of the component in the specific order.
-     */
-    _redrawInternal: () => void;
-    /**
-     * Find sharp pixel position
-     */
-    _getSharp: (pos: number, thickness?: number) => number;
-    /**
-     * Get current time:
-     */
-    getTime: () => number;
-    /**
-     * Set current time internal
-     * @param val value.
-     * @param source event source.
-     */
-    _setTimeInternal: (val: number, source?: TimelineEventSource) => boolean;
-    setTime: (val: number) => boolean;
-    getOptions: () => TimelineOptions;
-    /**
-     * Current scroll left position.
-     */
-    get scrollLeft(): number;
-    set scrollLeft(value: number);
-    get scrollTop(): number;
-    set scrollTop(value: number);
-    /**
-     * Set options and render the component.
-     * Note: Options will be merged\appended with the defaults and component will be invalidated/rendered again.
-     */
-    setOptions: (toSet: TimelineOptions) => TimelineOptions;
-    /**
-     * Private. Apply html container styles from options if any is set.
-     */
-    _applyContainersStyles: () => void;
-    _setOptions: (toSet: TimelineOptions) => TimelineOptions;
-    /**
-     * Get current model.
-     */
-    getModel: () => TimelineModel | null;
-    /**
-     * Set model and redraw application.
-     * @param data
-     */
-    setModel: (data: TimelineModel) => void;
-    _getMousePos: (canvas: HTMLCanvasElement, e: TouchEvent | MouseEvent | any) => TimelineMouseData;
-    /**
-     * Apply container div size to the container on changes detected.
-     */
-    _updateCanvasScale: () => boolean;
-    /**
-     * Rescale and update size of the container.
-     */
-    rescale: () => boolean;
-    /**
-     * This method is used to draw additional space when after there are no keyframes.
-     * When scrolled we should allow to indefinitely scroll right, so space should be extended to drag keyframes outside of the current size bounds.
-     */
-    _rescaleInternal: (newWidth?: number | null, newHeight?: number | null, scrollMode?: TimelineScrollSource) => boolean;
-    /**
-     * Filter elements that can be dragged.
-     * Filtration is done based on the timeline styles and options.
-     */
-    _filterDraggableElements: (elements: TimelineElement[]) => TimelineElement[];
-    /**
-     * Filter and sort draggable elements by the priority to get first draggable element closest to the passed value.
-     */
-    _findDraggableElement: (elements: TimelineElement[], val?: number | null) => TimelineElement | null;
-    /**
-     * get all clickable elements by the given local screen coordinate.
-     */
-    elementFromPoint: (pos: DOMPoint, clickRadius: number, onlyTypes?: TimelineElementType[] | null) => TimelineElement[];
-    /**
-     * Subscribe user callback on time changed.
-     */
-    onTimeChanged: (callback: (eventArgs: TimelineTimeChangedEvent) => void) => void;
-    /**
-     * Subscribe user callback on drag started event.
-     */
-    onDragStarted: (callback: (eventArgs: TimelineDragEvent) => void) => void;
-    /**
-     * Subscribe user callback on drag event.
-     */
-    onDrag: (callback: (eventArgs: TimelineDragEvent) => void) => void;
-    /**
-     * Subscribe user callback on drag finished event.
-     */
-    onDragFinished: (callback: (eventArgs: TimelineDragEvent) => void) => void;
-    /**
-     * Subscribe user callback on double click.
-     */
-    onDoubleClick: (callback: (eventArgs: TimelineClickEvent) => void) => void;
-    /**
-     * Subscribe user callback on keyframe changed event.
-     */
-    onKeyframeChanged: (callback: (eventArgs: TimelineKeyframeChangedEvent) => void) => void;
-    /**
-     * Subscribe user callback on drag finished event.
-     */
-    onMouseDown: (callback: (eventArgs: TimelineClickEvent) => void) => void;
-    /**
-     * Subscribe user callback on selected.
-     */
-    onSelected: (callback: (eventArgs: TimelineSelectedEvent) => void) => void;
-    /**
-     * Subscribe user callback on scroll event
-     */
-    onScroll: (callback: (eventArgs: TimelineScrollEvent) => void) => void;
-    /**
-     * Subscribe on scroll finished event.
-     */
-    onScrollFinished: (callback: (eventArgs: TimelineScrollEvent) => void) => void;
-    /**
-     * Private.
-     * Emit internally scroll eve
-     */
-    _emitScrollEvent: (args: Event | null, scrollProgrammatically: boolean, eventType?: TimelineEvents) => TimelineScrollEvent;
-    _emitKeyframeChanged: (element: TimelineElementDragState, source?: TimelineEventSource) => TimelineKeyframeChangedEvent;
-    _emitDragStartedEvent: (dragState: TimelineDraggableData) => TimelineDragEvent | null;
-    /**
-     * Private emit timeline event that dragging element is finished.
-     * @param forcePrevent - needed when during dragging components set to the state when they cannot be dragged anymore. (used only as recovery state).
-     * @returns
-     */
-    _emitDragFinishedEvent: (dragState: TimelineDraggableData, forcePrevent?: boolean) => TimelineDragEvent | null;
-    _preventDrag: (dragArgs: TimelineDragEvent, data: TimelineDraggableData, toStart?: boolean) => void;
-    _emitDragEvent: (dragState: TimelineDraggableData) => TimelineDragEvent | null;
-    _emitKeyframesSelected: (state: TimelineSelectionResults) => TimelineSelectedEvent;
-    _getDragEventArgs: (dragState: TimelineDraggableData, point: TimelineMouseData | null) => TimelineDragEvent;
-}
+import { TimelineEventsEmitter } from './timelineEventsEmitter';
+import { TimelineConsts } from './settings/timelineConsts';
+import { TimelineModel } from './models/timelineModel';
+import { TimelineRow } from './models/timelineRow';
+import { TimelineKeyframe } from './models/timelineKeyframe';
+import { TimelineOptions } from './settings/timelineOptions';
+import { TimelineElement } from './utils/timelineElement';
+import { TimelineCutBoundsRectResults } from './utils/timelineCutBoundsRectResults';
+import { TimelineSelectionResults } from './utils/timelineSelectionResults';
+import { TimelineMouseData } from './utils/timelineMouseData';
+import { TimelineElementDragState } from './utils/timelineElementDragState';
+import { TimelineDraggableData } from './utils/timelineDraggableData';
+import { TimelineGroupViewModel } from './viewModels/timelineGroupViewModel';
+import { TimelineKeyframeViewModel } from './viewModels/timelineKeyframeViewModel';
+import { TimelineRowViewModel } from './viewModels/timelineRowViewModel';
+import { TimelineViewModel } from './viewModels/timelineViewModel';
+import { TimelineKeyframeChangedEvent } from './utils/events/timelineKeyframeChangedEvent';
+import { TimelineTimeChangedEvent } from './utils/events/timelineTimeChangedEvent';
+import { TimelineSelectedEvent } from './utils/events/timelineSelectedEvent';
+import { TimelineScrollEvent } from './utils/events/timelineScrollEvent';
+import { TimelineClickEvent } from './utils/events/timelineClickEvent';
+import { TimelineDragEvent } from './utils/events/timelineDragEvent';
+import { TimelineKeyframeShape } from './enums/timelineKeyframeShape';
+import { TimelineInteractionMode } from './enums/timelineInteractionMode';
+import { TimelineElementType } from './enums/timelineElementType';
+import { TimelineEventSource } from './enums/timelineEventSource';
+import { TimelineSelectionMode } from './enums/timelineSelectionMode';
+import { TimelineEvents } from './enums/timelineEvents';
+import { TimelineScrollSource } from './enums/timelineScrollSource';
+export declare class Timeline extends TimelineEventsEmitter {
+    /**
+     * component container.
+     */
+    _container: HTMLElement | null;
+    /**
+     * Dynamically generated canvas inside of the container.
+     */
+    _canvas: HTMLCanvasElement | null;
+    /**
+     * Dynamically generated scroll container.
+     */
+    _scrollContainer: HTMLElement | null;
+    /**
+     * Dynamically generated virtual scroll content.
+     * While canvas has no real size, this element is used to create virtual scroll on the parent element.
+     */
+    _scrollContent: HTMLElement | null;
+    /**
+     * Rendering context
+     */
+    _ctx: CanvasRenderingContext2D | null;
+    /**
+     * Components settings
+     */
+    _options: TimelineOptions;
+    /**
+     * Drag start position.
+     */
+    _startPosMouseArgs: TimelineMouseData | null;
+    /**
+     * Drag scroll started position.
+     */
+    _scrollStartPos: DOMPoint | null;
+    /**
+     * Private. Current mouse position that is used to track values between mouse up/down events.
+     * Can be null, use public methods and properties instead.
+     */
+    _currentPos: TimelineMouseData | null;
+    /**
+     * Private. Current active mouse area selection rectangle displayed during the mouse up/down drag events.
+     */
+    _selectionRect: DOMRect | null;
+    /**
+     * Private. Whether selection rectangle is displayed.
+     */
+    _selectionRectEnabled: boolean;
+    /**
+     * Private. Information in regard of current active drag state.
+     */
+    _drag: TimelineDraggableData | null;
+    _startedDragWithCtrl: boolean;
+    _startedDragWithShiftKey: boolean;
+    _scrollProgrammatically: boolean;
+    _clickTimeout: number | null;
+    _lastClickTime: number;
+    _lastClickPoint: DOMPoint | null;
+    _consts: TimelineConsts;
+    /**
+     * Private. whether click is allowed.
+     */
+    _clickAllowed: boolean;
+    /**
+     * Private. scroll finished timer reference.
+     */
+    _scrollFinishedTimerRef?: number | null;
+    /**
+     * Private.Current timeline position.
+     * Please use public get\set methods to properly change the timeline position.
+     */
+    _val: number;
+    _pixelRatio: number;
+    /**
+     * Private. Current zoom level. Please use publicly available properties to set zoom levels.
+     */
+    _currentZoom: number;
+    /**
+     * Private. Ref for the auto pan scroll interval.
+     */
+    _intervalRef?: number | null;
+    /**
+     * Private.
+     * When last auto pan scroll action was started.
+     */
+    _autoPanLastActionDate: number;
+    /**
+     * Private.
+     * Is pan mouse interactions are started.
+     */
+    _isPanStarted: boolean;
+    /**
+     * Private.
+     * Component interaction mode. Please use publicly available methods.
+     */
+    _interactionMode: TimelineInteractionMode;
+    _lastUsedArgs: MouseEvent | TouchEvent | null;
+    /**
+     * Private.
+     * Current set timeline model.
+     */
+    _model: TimelineModel | null;
+    /**
+     * Private.
+     * Indication when scroll are drag or click is started.
+     */
+    _scrollAreaClickOrDragStarted: boolean;
+    /**
+     * Create Timeline instance
+     * @param options Timeline settings.
+     * @param model Timeline model.
+     */
+    constructor(options?: TimelineOptions | null, model?: TimelineModel | null);
+    /**
+     * Initialize Timeline
+     * @param options Timeline settings.
+     * @param model Timeline model.
+     */
+    initialize: (options: TimelineOptions | null, model: TimelineModel | null) => void;
+    /**
+     * Generate component html.
+     * @param id container.
+     */
+    _generateContainers: (id: string | HTMLElement) => void;
+    /**
+     * Get drawing context
+     */
+    _getCtx(): CanvasRenderingContext2D | null;
+    /**
+     * Subscribe current component on the related events.
+     * Private. Use initialize method instead.
+     */
+    _subscribeComponentEvents: () => void;
+    /**
+     * Private. Use dispose method instead.
+     */
+    _unsubscribeComponentEvents: () => void;
+    /**
+     * Dispose current component: unsubscribe component and user events.
+     */
+    dispose: () => void;
+    /**
+     * On key up is received.
+     */
+    _handleKeyUp: (event: KeyboardEvent) => void;
+    /**
+     * On key down is received.
+     */
+    _handleKeyDown: (event: KeyboardEvent) => void;
+    _setZoomCursor: (e: MouseEvent | KeyboardEvent) => void;
+    _handleBlurEvent: () => void;
+    _handleWindowResizeEvent: () => void;
+    _clearScrollFinishedTimer: () => void;
+    _handleScrollMouseDownEvent: () => void;
+    _handleScrollEvent: (args: Event) => void;
+    _controlKeyPressed: (e: MouseEvent | KeyboardEvent | TouchEvent) => boolean;
+    _handleWheelEvent: (event: WheelEvent) => void;
+    _zoom: (direction: number, speed: number, x: number) => void;
+    /**
+     * Zoom in
+     * @param speed value from 0 to 1
+     */
+    zoomIn: (speed?: number | undefined) => void;
+    /**
+     * Zoom out.
+     * @param speed value from 0 to 1
+     */
+    zoomOut: (speed?: number | undefined) => void;
+    /**
+     * Set direct zoom value.
+     * @param zoom zoom value to set. percent 0-1 and etc.
+     * @param min min zoom.
+     * @param max max zoom.
+     * @return normalized value.
+     */
+    _setZoom: (zoom: number, min?: number | null | undefined, max?: number | null | undefined) => number;
+    /**
+     * Set direct zoom value.
+     * @public
+     * @param zoom zoom value to set. percent 0-1 and etc.
+     * @return normalized value.
+     */
+    setZoom: (zoom: number) => number;
+    /**
+     * Get current zoom level.
+     */
+    getZoom: () => number;
+    _getClickDetectionRadius: (point: TimelineMouseData) => number;
+    /**
+     * @param args
+     */
+    _handleMouseDownEvent: (args: MouseEvent | TouchEvent) => void;
+    _setElementDragState: (element: TimelineElement | TimelineElementDragState, val: number) => TimelineElementDragState;
+    /**
+     * Check is mouse left button is clicked.
+     */
+    isLeftButtonClicked: (args: MouseEvent | TouchEvent | any) => boolean;
+    /**
+     * Browser mouse move handler.
+     */
+    _handleMouseMoveEvent: (args: MouseEvent | TouchEvent | null) => void;
+    /**
+     * Move elements
+     * @param offset vector to move elements along.
+     * @param elements Element to move.
+     * @returns real moved value.
+     */
+    _moveElements(offset: number, elements: TimelineElementDragState[], source?: TimelineEventSource): number;
+    /**
+     * Mouse up handler.
+     */
+    _handleMouseUpEvent: (args: MouseEvent | TouchEvent) => void;
+    /**
+     * Canvas client height.
+     */
+    _canvasClientHeight: () => number;
+    /**
+     * Canvas client width.
+     */
+    _canvasClientWidth: () => number;
+    /**
+     * Get all keyframes under the screen rectangle.
+     * @param screenRect screen coordinates to get keyframes.
+     */
+    _getKeyframesByRectangle: (screenRect: DOMRect) => TimelineKeyframe[];
+    /**
+     * Private.
+     * Perform timeline click.
+     */
+    _performClick: (pos: TimelineMouseData, drag: TimelineDraggableData | null) => boolean;
+    /**
+     * Set keyframe value.
+     * @param keyframe
+     * @param value
+     * @return set value.
+     */
+    _setKeyframePos: (element: TimelineElementDragState, value: number, source?: TimelineEventSource) => number;
+    /**
+     * @param cursor to set.
+     */
+    _setCursor: (cursor: string) => void;
+    /**
+     * Set component interaction mode.
+     */
+    setInteractionMode: (mode: TimelineInteractionMode) => void;
+    /**
+     * Get current interaction mode.
+     */
+    getInteractionMode: () => TimelineInteractionMode;
+    /**
+     * Private.
+     * Helper method. Convert model element  to timeline element.
+     */
+    _convertToTimelineElement: (rowModel: TimelineRow | null, keyframe: TimelineKeyframe) => TimelineElement;
+    getSelectedKeyframes: () => TimelineKeyframe[];
+    /**
+     * Get selected timeline elements.
+     */
+    getSelectedElements: () => TimelineElement[];
+    /**
+     * Get all keyframe models available in the model.
+     */
+    getAllKeyframes: () => TimelineKeyframe[];
+    selectAllKeyframes: () => TimelineSelectionResults;
+    deselectAll: () => TimelineSelectionResults;
+    private _changeNodeState;
+    select: (nodes: TimelineKeyframe[] | TimelineKeyframe | null, mode?: TimelineSelectionMode) => TimelineSelectionResults;
+    /**
+     * Select keyframes
+     * @param nodes keyframe or list of the keyframes to be selected.
+     * @param mode selection mode.
+     */
+    _selectInternal: (nodes: TimelineKeyframe[] | TimelineKeyframe | null, mode?: TimelineSelectionMode) => TimelineSelectionResults;
+    /**
+     * foreach visible keyframe.
+     */
+    _forEachKeyframe(callback: (keyframe: TimelineKeyframeViewModel, index?: number, newRow?: boolean) => void): void;
+    /**
+     * Private.
+     * Create extended mouse position and calculate size of the selection rectangle.
+     */
+    _trackMousePos(canvas: HTMLCanvasElement, mouseArgs: MouseEvent | TouchEvent): TimelineMouseData;
+    /**
+     * Get scroll container client width.
+     */
+    getClientWidth(): number;
+    /**
+     * Get scroll container client height.
+     */
+    getClientHeight(): number;
+    _cleanUpSelection(forcePrevent?: boolean): void;
+    /**
+     * Check whether click timeout is over.
+     */
+    _clickTimeoutIsOver(): boolean;
+    /**
+     * Automatically pan. Scroll canvas when selection is made and mouse outside of the bounds.
+     */
+    _startAutoPan: () => void;
+    /**
+     * Stop current running auto pan
+     */
+    _stopAutoPan: () => void;
+    /**
+     * Check whether auto pan should be slowed down a bit.
+     */
+    _checkUpdateSpeedTooFast(): boolean;
+    /**
+     * Scroll virtual canvas when pan mode is enabled.
+     */
+    _scrollByPan(start: DOMPoint, pos: DOMPoint, scrollStartPos: DOMPoint | null): void;
+    _scrollBySelectionOutOfBounds(pos: DOMPoint): boolean;
+    /**
+     * Convert screen pixel to value.
+     */
+    pxToVal(px: number): number;
+    /**
+     * Convert value to local screen component coordinates.
+     */
+    _toScreenPx: (val: number) => number;
+    /**
+     * Convert screen local coordinates to a global value info.
+     */
+    _fromScreen: (px: number) => number;
+    /**
+     * Convert area value to global screen pixel coordinates.
+     */
+    valToPx: (val: number) => number;
+    /**
+     * Snap a value to a nearest grid point.
+     */
+    snapVal(val: number): number;
+    /**
+     * Convert mouse position to the timeline units considering all the scrolling and offsets.
+     */
+    _mousePosToVal: (x: number, snapEnabled?: boolean) => number;
+    /**
+     * Format line gauge text.
+     * Default formatting is HMS
+     * @param ms milliseconds to convert.
+     * @param isSeconds whether seconds are passed.
+     */
+    _formatUnitsText: (ms: number, isSeconds?: boolean) => string;
+    /**
+     * Left padding of the timeline.
+     */
+    _leftMargin: () => number;
+    /**
+     * Private.
+     * Render line gauge ticks.
+     */
+    _renderTicks: () => void;
+    /**
+     * Private.
+     * Calculate virtual view model.
+     * Determine screen positions for the model elements given.
+     */
+    _generateViewModel: () => TimelineViewModel;
+    /**
+     * Render timeline rows.
+     */
+    _renderRows: () => void;
+    /**
+     * Render group for the row.
+     */
+    _renderGroupBounds: (rowViewModel: TimelineRowViewModel) => void;
+    /**
+     * Method is used for the canvas drawing optimization.
+     * Bounds are cut to draw only visible parts for the active canvas.
+     */
+    _cutBounds: (rect: DOMRect) => TimelineCutBoundsRectResults | null;
+    _cutBoundsWhenOverlap: (rect: DOMRect, minX: number, maxX: number, minY: number, maxY: number) => TimelineCutBoundsRectResults | null;
+    /**
+     * Calculate keyframe group screen rect size that is used during the rendering.
+     * @param row
+     * @param rowY row screen coords y position
+     */
+    _getKeyframesGroupSize: (groupViewModel: TimelineGroupViewModel, rowViewModel: TimelineRowViewModel) => DOMRect;
+    _getKeyframePosition: (keyframe: TimelineKeyframe, groupViewModel: TimelineGroupViewModel, rowViewModel: TimelineRowViewModel, keyframeShape: TimelineKeyframeShape) => DOMRect | null;
+    _renderKeyframes: () => void;
+    _renderSelectionRect: () => void;
+    _renderBackground: () => void;
+    _renderTimeline: () => void;
+    /**
+     * Render timeline cap top.
+     */
+    _renderTimelineCap: (timeLinePos: number, y: number) => void;
+    _renderHeaderBackground: () => void;
+    redraw: () => void;
+    /**
+     * perform scroll to max right.
+     */
+    scrollToRightBounds: () => void;
+    /**
+     * Redraw parts of the component in the specific order.
+     */
+    _redrawInternal: () => void;
+    /**
+     * Find sharp pixel position
+     */
+    _getSharp: (pos: number, thickness?: number) => number;
+    /**
+     * Get current time:
+     */
+    getTime: () => number;
+    /**
+     * Set current time internal
+     * @param val value.
+     * @param source event source.
+     */
+    _setTimeInternal: (val: number, source?: TimelineEventSource) => boolean;
+    setTime: (val: number) => boolean;
+    getOptions: () => TimelineOptions;
+    /**
+     * Current scroll left position.
+     */
+    get scrollLeft(): number;
+    set scrollLeft(value: number);
+    get scrollTop(): number;
+    set scrollTop(value: number);
+    /**
+     * Set options and render the component.
+     * Note: Options will be merged\appended with the defaults and component will be invalidated/rendered again.
+     */
+    setOptions: (toSet: TimelineOptions) => TimelineOptions;
+    /**
+     * Private. Apply html container styles from options if any is set.
+     */
+    _applyContainersStyles: () => void;
+    _setOptions: (toSet: TimelineOptions) => TimelineOptions;
+    /**
+     * Get current model.
+     */
+    getModel: () => TimelineModel | null;
+    /**
+     * Set model and redraw application.
+     * @param data
+     */
+    setModel: (data: TimelineModel) => void;
+    _getMousePos: (canvas: HTMLCanvasElement, e: TouchEvent | MouseEvent | any) => TimelineMouseData;
+    /**
+     * Apply container div size to the container on changes detected.
+     */
+    _updateCanvasScale: () => boolean;
+    /**
+     * Rescale and update size of the container.
+     */
+    rescale: () => boolean;
+    /**
+     * This method is used to draw additional space when after there are no keyframes.
+     * When scrolled we should allow to indefinitely scroll right, so space should be extended to drag keyframes outside of the current size bounds.
+     */
+    _rescaleInternal: (newWidth?: number | null, newHeight?: number | null, scrollMode?: TimelineScrollSource) => boolean;
+    /**
+     * Filter elements that can be dragged.
+     * Filtration is done based on the timeline styles and options.
+     */
+    _filterDraggableElements: (elements: TimelineElement[]) => TimelineElement[];
+    /**
+     * Filter and sort draggable elements by the priority to get first draggable element closest to the passed value.
+     */
+    _findDraggableElement: (elements: TimelineElement[], val?: number | null) => TimelineElement | null;
+    /**
+     * get all clickable elements by the given local screen coordinate.
+     */
+    elementFromPoint: (pos: DOMPoint, clickRadius: number, onlyTypes?: TimelineElementType[] | null) => TimelineElement[];
+    /**
+     * Subscribe user callback on time changed.
+     */
+    onTimeChanged: (callback: (eventArgs: TimelineTimeChangedEvent) => void) => void;
+    /**
+     * Subscribe user callback on drag started event.
+     */
+    onDragStarted: (callback: (eventArgs: TimelineDragEvent) => void) => void;
+    /**
+     * Subscribe user callback on drag event.
+     */
+    onDrag: (callback: (eventArgs: TimelineDragEvent) => void) => void;
+    /**
+     * Subscribe user callback on drag finished event.
+     */
+    onDragFinished: (callback: (eventArgs: TimelineDragEvent) => void) => void;
+    /**
+     * Subscribe user callback on double click.
+     */
+    onDoubleClick: (callback: (eventArgs: TimelineClickEvent) => void) => void;
+    /**
+     * Subscribe user callback on keyframe changed event.
+     */
+    onKeyframeChanged: (callback: (eventArgs: TimelineKeyframeChangedEvent) => void) => void;
+    /**
+     * Subscribe user callback on drag finished event.
+     */
+    onMouseDown: (callback: (eventArgs: TimelineClickEvent) => void) => void;
+    /**
+     * Subscribe user callback on selected.
+     */
+    onSelected: (callback: (eventArgs: TimelineSelectedEvent) => void) => void;
+    /**
+     * Subscribe user callback on scroll event
+     */
+    onScroll: (callback: (eventArgs: TimelineScrollEvent) => void) => void;
+    /**
+     * Subscribe on scroll finished event.
+     */
+    onScrollFinished: (callback: (eventArgs: TimelineScrollEvent) => void) => void;
+    /**
+     * Private.
+     * Emit internally scroll eve
+     */
+    _emitScrollEvent: (args: Event | null, scrollProgrammatically: boolean, eventType?: TimelineEvents) => TimelineScrollEvent;
+    _emitKeyframeChanged: (element: TimelineElementDragState, source?: TimelineEventSource) => TimelineKeyframeChangedEvent;
+    _emitDragStartedEvent: (dragState: TimelineDraggableData) => TimelineDragEvent | null;
+    /**
+     * Private emit timeline event that dragging element is finished.
+     * @param forcePrevent - needed when during dragging components set to the state when they cannot be dragged anymore. (used only as recovery state).
+     * @returns
+     */
+    _emitDragFinishedEvent: (dragState: TimelineDraggableData, forcePrevent?: boolean) => TimelineDragEvent | null;
+    _preventDrag: (dragArgs: TimelineDragEvent, data: TimelineDraggableData, toStart?: boolean) => void;
+    _emitDragEvent: (dragState: TimelineDraggableData) => TimelineDragEvent | null;
+    _emitKeyframesSelected: (state: TimelineSelectionResults) => TimelineSelectedEvent;
+    _getDragEventArgs: (dragState: TimelineDraggableData, point: TimelineMouseData | null) => TimelineDragEvent;
+}

+ 34 - 34
lib/timelineEventsEmitter.d.ts

@@ -1,34 +1,34 @@
-interface TimelineEvent {
-    topic: string;
-    callback: (args: any) => void;
-}
-/**
- * Timeline events emitter.
- */
-export declare class TimelineEventsEmitter {
-    /**
-     * Active events subscriptions.
-     */
-    _subscriptions: TimelineEvent[];
-    /**
-     * Subscribe event.
-     * @param topic event name.
-     * @param callback callback to be added.
-     */
-    on<T>(topic: string, callback: (args: T) => void): boolean;
-    /**
-     * Remove an event from the subscriptions list.
-     */
-    off<T>(topic: string, callback: (args: T) => void): boolean;
-    /**
-     * Unsubscribe all
-     */
-    offAll(): void;
-    /**
-     * Emit event.
-     * @param topic Event name.
-     * @param args Event arguments.
-     */
-    emit<T>(topic: string, args: T): void;
-}
-export {};
+interface TimelineEvent {
+    topic: string;
+    callback: (args: any) => void;
+}
+/**
+ * Timeline events emitter.
+ */
+export declare class TimelineEventsEmitter {
+    /**
+     * Active events subscriptions.
+     */
+    _subscriptions: TimelineEvent[];
+    /**
+     * Subscribe event.
+     * @param topic event name.
+     * @param callback callback to be added.
+     */
+    on<T>(topic: string, callback: (args: T) => void): boolean;
+    /**
+     * Remove an event from the subscriptions list.
+     */
+    off<T>(topic: string, callback: (args: T) => void): boolean;
+    /**
+     * Unsubscribe all
+     */
+    offAll(): void;
+    /**
+     * Emit event.
+     * @param topic Event name.
+     * @param args Event arguments.
+     */
+    emit<T>(topic: string, args: T): void;
+}
+export {};

+ 30 - 30
lib/utils/TimelineElement.d.ts

@@ -1,30 +1,30 @@
-import { TimelineKeyframe } from '../models/timelineKeyframe';
-import { TimelineElementType } from '../enums/timelineElementType';
-import { TimelineRow } from '../models/timelineRow';
-import { TimelineGroup } from '../models/timelineGroup';
-/**
- * Timeline clickable element.
- */
-export interface TimelineElement {
-    type: TimelineElementType;
-    /**
-     * Timeline value,
-     */
-    val: number;
-    /**
-     * Related keyframe model.
-     */
-    keyframe?: TimelineKeyframe;
-    /**
-     * Related row model.
-     */
-    row?: TimelineRow;
-    /**
-     * Current group.
-     */
-    group?: string | TimelineGroup;
-    /**
-     * List of the selected, grouped, row keyframes.
-     */
-    keyframes?: TimelineKeyframe[];
-}
+import { TimelineKeyframe } from '../models/timelineKeyframe';
+import { TimelineElementType } from '../enums/timelineElementType';
+import { TimelineRow } from '../models/timelineRow';
+import { TimelineGroup } from '../models/timelineGroup';
+/**
+ * Timeline clickable element.
+ */
+export interface TimelineElement {
+    type: TimelineElementType;
+    /**
+     * Timeline value,
+     */
+    val: number;
+    /**
+     * Related keyframe model.
+     */
+    keyframe?: TimelineKeyframe;
+    /**
+     * Related row model.
+     */
+    row?: TimelineRow;
+    /**
+     * Current group.
+     */
+    group?: string | TimelineGroup;
+    /**
+     * List of the selected, grouped, row keyframes.
+     */
+    keyframes?: TimelineKeyframe[];
+}

+ 11 - 11
lib/utils/TimelineElementDragState.d.ts

@@ -1,11 +1,11 @@
-import { TimelineElement } from './timelineElement';
-export interface TimelineElementDragState extends TimelineElement {
-    /**
-     * Value that preserved before dragging is started.
-     */
-    startedVal: number;
-    /**
-     * Value before change.
-     */
-    prevVal: number;
-}
+import { TimelineElement } from './timelineElement';
+export interface TimelineElementDragState extends TimelineElement {
+    /**
+     * Value that preserved before dragging is started.
+     */
+    startedVal: number;
+    /**
+     * Value before change.
+     */
+    prevVal: number;
+}

+ 11 - 11
lib/utils/events/timelineBaseEvent.d.ts

@@ -1,11 +1,11 @@
-/**
- * Timeline base preventable event.
- */
-export declare class TimelineBaseEvent {
-    private _prevented;
-    /**
-     * Prevent default click logic.
-     */
-    preventDefault(): void;
-    isPrevented(): boolean;
-}
+/**
+ * Timeline base preventable event.
+ */
+export declare class TimelineBaseEvent {
+    private _prevented;
+    /**
+     * Prevent default click logic.
+     */
+    preventDefault(): void;
+    isPrevented(): boolean;
+}

+ 23 - 23
lib/utils/events/timelineClickEvent.d.ts

@@ -1,23 +1,23 @@
-import { TimelineElement } from '../timelineElement';
-import { TimelinePoint } from '../timelinePoint';
-import { TimelineBaseEvent } from './timelineBaseEvent';
-export declare class TimelineClickEvent extends TimelineBaseEvent {
-    args: MouseEvent | TouchEvent | null;
-    /**
-     * Clicked screen position.
-     */
-    get pos(): DOMPoint | null;
-    get val(): number;
-    /**
-     * All elements located under current mouse activity.
-     */
-    elements: TimelineElement[];
-    /**
-     * Element that selected as target under the click.
-     */
-    target: TimelineElement | null;
-    /**
-     * Timeline current active drag position.
-     */
-    point: TimelinePoint | null;
-}
+import { TimelineElement } from '../timelineElement';
+import { TimelinePoint } from '../timelinePoint';
+import { TimelineBaseEvent } from './timelineBaseEvent';
+export declare class TimelineClickEvent extends TimelineBaseEvent {
+    args: MouseEvent | TouchEvent | null;
+    /**
+     * Clicked screen position.
+     */
+    get pos(): DOMPoint | null;
+    get val(): number;
+    /**
+     * All elements located under current mouse activity.
+     */
+    elements: TimelineElement[];
+    /**
+     * Element that selected as target under the click.
+     */
+    target: TimelineElement | null;
+    /**
+     * Timeline current active drag position.
+     */
+    point: TimelinePoint | null;
+}

+ 23 - 23
lib/utils/events/timelineDragEvent.d.ts

@@ -1,23 +1,23 @@
-import { TimelinePoint } from '../timelinePoint';
-import { TimelineBaseEvent } from './timelineBaseEvent';
-import { TimelineElementDragState } from '../timelineElementDragState';
-export declare class TimelineDragEvent extends TimelineBaseEvent {
-    args: MouseEvent | TouchEvent | null;
-    get pos(): DOMPoint | null;
-    /**
-     * Elements to be dragged as a group.
-     */
-    elements: TimelineElementDragState[] | null;
-    /**
-     * Target element
-     */
-    target: TimelineElementDragState | null;
-    /**
-     * Timeline current active drag position.
-     */
-    point: TimelinePoint | null;
-    /**
-     * Timeline previous drag position.
-     */
-    prevPoint: TimelinePoint | null;
-}
+import { TimelinePoint } from '../timelinePoint';
+import { TimelineBaseEvent } from './timelineBaseEvent';
+import { TimelineElementDragState } from '../timelineElementDragState';
+export declare class TimelineDragEvent extends TimelineBaseEvent {
+    args: MouseEvent | TouchEvent | null;
+    get pos(): DOMPoint | null;
+    /**
+     * Elements to be dragged as a group.
+     */
+    elements: TimelineElementDragState[] | null;
+    /**
+     * Target element
+     */
+    target: TimelineElementDragState | null;
+    /**
+     * Timeline current active drag position.
+     */
+    point: TimelinePoint | null;
+    /**
+     * Timeline previous drag position.
+     */
+    prevPoint: TimelinePoint | null;
+}

+ 21 - 21
lib/utils/events/timelineKeyframeChangedEvent.d.ts

@@ -1,21 +1,21 @@
-import { TimelineBaseEvent } from './timelineBaseEvent';
-import { TimelineElement } from '../timelineElement';
-import { TimelineEventSource } from '../../enums/timelineEventSource';
-export declare class TimelineKeyframeChangedEvent extends TimelineBaseEvent {
-    /**
-     * Value to be used.
-     */
-    val: number;
-    /**
-     * Previous value.
-     */
-    prevVal: number;
-    /**
-     * Target element
-     */
-    target: TimelineElement;
-    /**
-     * Event source.
-     */
-    source: TimelineEventSource;
-}
+import { TimelineBaseEvent } from './timelineBaseEvent';
+import { TimelineElement } from '../timelineElement';
+import { TimelineEventSource } from '../../enums/timelineEventSource';
+export declare class TimelineKeyframeChangedEvent extends TimelineBaseEvent {
+    /**
+     * Value to be used.
+     */
+    val: number;
+    /**
+     * Previous value.
+     */
+    prevVal: number;
+    /**
+     * Target element
+     */
+    target: TimelineElement;
+    /**
+     * Event source.
+     */
+    source: TimelineEventSource;
+}

+ 11 - 11
lib/utils/events/timelineScrollEvent.d.ts

@@ -1,11 +1,11 @@
-export interface TimelineScrollEvent {
-    args: MouseEvent;
-    /**
-     * Whether scroll was component or user initiated.
-     */
-    scrollProgrammatically: boolean;
-    scrollLeft: number;
-    scrollTop: number;
-    scrollHeight: number;
-    scrollWidth: number;
-}
+export interface TimelineScrollEvent {
+    args: MouseEvent;
+    /**
+     * Whether scroll was component or user initiated.
+     */
+    scrollProgrammatically: boolean;
+    scrollLeft: number;
+    scrollTop: number;
+    scrollHeight: number;
+    scrollWidth: number;
+}

+ 16 - 16
lib/utils/events/timelineSelectedEvent.d.ts

@@ -1,16 +1,16 @@
-import { TimelineSelectionEventSource } from '../../enums/timelineSelectionEventSource';
-import { TimelineKeyframe } from '../../models/timelineKeyframe';
-export declare class TimelineSelectedEvent {
-    /**
-     * Selected Keyframes list.
-     */
-    selected: TimelineKeyframe[];
-    /**
-     * Changed selection.
-     */
-    changed: TimelineKeyframe[];
-    /**
-     * Selection mode.
-     */
-    mode: TimelineSelectionEventSource;
-}
+import { TimelineSelectionEventSource } from '../../enums/timelineSelectionEventSource';
+import { TimelineKeyframe } from '../../models/timelineKeyframe';
+export declare class TimelineSelectedEvent {
+    /**
+     * Selected Keyframes list.
+     */
+    selected: TimelineKeyframe[];
+    /**
+     * Changed selection.
+     */
+    changed: TimelineKeyframe[];
+    /**
+     * Selection mode.
+     */
+    mode: TimelineSelectionEventSource;
+}

+ 16 - 16
lib/utils/events/timelineTimeChangedEvent.d.ts

@@ -1,16 +1,16 @@
-import { TimelineBaseEvent } from './timelineBaseEvent';
-import { TimelineEventSource } from '../../enums/timelineEventSource';
-export declare class TimelineTimeChangedEvent extends TimelineBaseEvent {
-    /**
-     * New value to be set if not prevented.
-     */
-    val: number;
-    /**
-     * previous value, that actually set at the moment.
-     */
-    prevVal: number;
-    /**
-     * Source of the change.
-     */
-    source: TimelineEventSource;
-}
+import { TimelineBaseEvent } from './timelineBaseEvent';
+import { TimelineEventSource } from '../../enums/timelineEventSource';
+export declare class TimelineTimeChangedEvent extends TimelineBaseEvent {
+    /**
+     * New value to be set if not prevented.
+     */
+    val: number;
+    /**
+     * previous value, that actually set at the moment.
+     */
+    prevVal: number;
+    /**
+     * Source of the change.
+     */
+    source: TimelineEventSource;
+}

+ 8 - 8
lib/utils/timelineCutBoundsRectResults.d.ts

@@ -1,8 +1,8 @@
-/**
- * Helper container. Cut bounds method results.
- */
-export interface TimelineCutBoundsRectResults {
-    rect: DOMRect;
-    overlapY: boolean;
-    overlapX: boolean;
-}
+/**
+ * Helper container. Cut bounds method results.
+ */
+export interface TimelineCutBoundsRectResults {
+    rect: DOMRect;
+    overlapY: boolean;
+    overlapX: boolean;
+}

+ 32 - 32
lib/utils/timelineDraggableData.d.ts

@@ -1,32 +1,32 @@
-import { TimelineElementType } from '../enums/timelineElementType';
-import { TimelineElementDragState } from './timelineElementDragState';
-/**
- * Information about current drag state.
- */
-export declare class TimelineDraggableData {
-    /**
-     * Whether position was changed.
-     */
-    changed: boolean;
-    /**
-     * Drag initial click target.
-     */
-    target: TimelineElementDragState;
-    /**
-     * Elements to be dragged.
-     * Can be multiple elements, but drag will be started with target.
-     */
-    elements: TimelineElementDragState[];
-    /**
-     * Dragging type.
-     */
-    type: TimelineElementType;
-    /**
-     * Prev value.
-     */
-    val: number;
-    /**
-     * Prev value.
-     */
-    prevVal: number;
-}
+import { TimelineElementType } from '../enums/timelineElementType';
+import { TimelineElementDragState } from './timelineElementDragState';
+/**
+ * Information about current drag state.
+ */
+export declare class TimelineDraggableData {
+    /**
+     * Whether position was changed.
+     */
+    changed: boolean;
+    /**
+     * Drag initial click target.
+     */
+    target: TimelineElementDragState;
+    /**
+     * Elements to be dragged.
+     * Can be multiple elements, but drag will be started with target.
+     */
+    elements: TimelineElementDragState[];
+    /**
+     * Dragging type.
+     */
+    type: TimelineElementType;
+    /**
+     * Prev value.
+     */
+    val: number;
+    /**
+     * Prev value.
+     */
+    prevVal: number;
+}

+ 14 - 14
lib/utils/timelineMouseData.d.ts

@@ -1,14 +1,14 @@
-import { TimelinePoint } from './timelinePoint';
-/**
- * Mouse data helper container.
- */
-export interface TimelineMouseData extends TimelinePoint {
-    /**
-     * Originated event args.
-     */
-    args: TouchEvent | MouseEvent;
-    /**
-     * Click radius.
-     */
-    radius?: number;
-}
+import { TimelinePoint } from './timelinePoint';
+/**
+ * Mouse data helper container.
+ */
+export interface TimelineMouseData extends TimelinePoint {
+    /**
+     * Originated event args.
+     */
+    args: TouchEvent | MouseEvent;
+    /**
+     * Click radius.
+     */
+    radius?: number;
+}

+ 22 - 22
lib/utils/timelinePoint.d.ts

@@ -1,22 +1,22 @@
-/**
- * Timeline values interface.
- */
-export interface TimelinePoint {
-    /**
-     * Value used for the visualization.
-     * It can be snapped or original.
-     */
-    val: number;
-    /**
-     * Snapped value if snapping is enabled. In other case corresponding to original value.
-     */
-    snapVal: number;
-    /**
-     * Unsnapped original value.
-     */
-    originalVal: number;
-    /**
-     * Screen click point.
-     */
-    pos: DOMPoint;
-}
+/**
+ * Timeline values interface.
+ */
+export interface TimelinePoint {
+    /**
+     * Value used for the visualization.
+     * It can be snapped or original.
+     */
+    val: number;
+    /**
+     * Snapped value if snapping is enabled. In other case corresponding to original value.
+     */
+    snapVal: number;
+    /**
+     * Unsnapped original value.
+     */
+    originalVal: number;
+    /**
+     * Screen click point.
+     */
+    pos: DOMPoint;
+}

+ 7 - 7
lib/utils/timelineSelectable.d.ts

@@ -1,7 +1,7 @@
-/**
- * Timeline selectable element.
- */
-export interface TimelineSelectable {
-    selected?: boolean;
-    selectable?: boolean;
-}
+/**
+ * Timeline selectable element.
+ */
+export interface TimelineSelectable {
+    selected?: boolean;
+    selectable?: boolean;
+}

+ 15 - 15
lib/utils/timelineSelectionResults.d.ts

@@ -1,15 +1,15 @@
-import { TimelineKeyframe } from '../models/timelineKeyframe';
-export interface TimelineSelectionResults {
-    /**
-     * Changed nodes.
-     */
-    changed: TimelineKeyframe[];
-    /**
-     * Selected nodes.
-     */
-    selected: TimelineKeyframe[];
-    /**
-     * Whether data was changed.
-     */
-    selectionChanged: boolean;
-}
+import { TimelineKeyframe } from '../models/timelineKeyframe';
+export interface TimelineSelectionResults {
+    /**
+     * Changed nodes.
+     */
+    changed: TimelineKeyframe[];
+    /**
+     * Selected nodes.
+     */
+    selected: TimelineKeyframe[];
+    /**
+     * Whether data was changed.
+     */
+    selectionChanged: boolean;
+}

+ 41 - 41
lib/utils/timelineStyleUtils.d.ts

@@ -1,41 +1,41 @@
-import { TimelineOptions } from '../settings/timelineOptions';
-import { TimelineRowStyle } from '../settings/styles/timelineRowStyle';
-import { TimelineKeyframeShape } from '../enums/timelineKeyframeShape';
-import { TimelineGroupStyle } from '../settings/styles/timelineGroupStyle';
-import { TimelineKeyframe } from '../models/timelineKeyframe';
-import { TimelineGroup } from '../models/timelineGroup';
-import { TimelineRow } from '../models/timelineRow';
-export declare class TimelineStyleUtils {
-    static getGroup(groupModel: TimelineGroup | string | null | undefined): TimelineGroup | null;
-    static getGroupStyle(groupModel: TimelineGroup | string | null | undefined): TimelineGroupStyle | null;
-    static getFirstSet<T>(defaultValue: T, ...params: Array<T | undefined | null>): T;
-    /**
-     * Get first value set or default.
-     * @param defaultValue default value in a case when no value is set.
-     * @param returnFalseIfAnyFalse - find first negative bool and return false.
-     * @param params collection of values to check.
-     * @returns value.
-     */
-    static getValue<T>(defaultValue: T, returnFalseIfAnyFalse?: boolean, ...params: Array<T | undefined | null>): T;
-    static getValueOrDefault<T>(value: T, defaultValue: T): T | undefined;
-    static keyframeWidth(keyframe: TimelineKeyframe | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined, options: TimelineOptions | null | undefined): number | string;
-    static keyframeHeight(keyframe: TimelineKeyframe | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined, options: TimelineOptions | null | undefined): number | string;
-    static keyframeShape(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): TimelineKeyframeShape;
-    static keyframeFillColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
-    static keyframeSelectedFillColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
-    static keyframeStrokeThickness(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
-    static keyframeStrokeColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
-    static keyframeSelectedStrokeColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
-    static groupHeight(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): number | string;
-    static groupMarginTop(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): number | string;
-    static groupFillColor(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): string;
-    /**
-     * Get current row height from styles
-     */
-    static getRowHeight(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
-    static getRowMarginBottom(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
-    static getRowFillColor(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
-    static headerHeight(options: TimelineOptions | null, defaultRowHeight?: number): number;
-    static keyframeDraggable(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null, row: TimelineRow | null, options: TimelineOptions | null, defaultValue?: boolean): boolean;
-    static groupDraggable(group: TimelineGroup | string | null | undefined, row: TimelineRow | null, options: TimelineOptions): boolean;
-}
+import { TimelineOptions } from '../settings/timelineOptions';
+import { TimelineRowStyle } from '../settings/styles/timelineRowStyle';
+import { TimelineKeyframeShape } from '../enums/timelineKeyframeShape';
+import { TimelineGroupStyle } from '../settings/styles/timelineGroupStyle';
+import { TimelineKeyframe } from '../models/timelineKeyframe';
+import { TimelineGroup } from '../models/timelineGroup';
+import { TimelineRow } from '../models/timelineRow';
+export declare class TimelineStyleUtils {
+    static getGroup(groupModel: TimelineGroup | string | null | undefined): TimelineGroup | null;
+    static getGroupStyle(groupModel: TimelineGroup | string | null | undefined): TimelineGroupStyle | null;
+    static getFirstSet<T>(defaultValue: T, ...params: Array<T | undefined | null>): T;
+    /**
+     * Get first value set or default.
+     * @param defaultValue default value in a case when no value is set.
+     * @param returnFalseIfAnyFalse - find first negative bool and return false.
+     * @param params collection of values to check.
+     * @returns value.
+     */
+    static getValue<T>(defaultValue: T, returnFalseIfAnyFalse?: boolean, ...params: Array<T | undefined | null>): T;
+    static getValueOrDefault<T>(value: T, defaultValue: T): T | undefined;
+    static keyframeWidth(keyframe: TimelineKeyframe | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined, options: TimelineOptions | null | undefined): number | string;
+    static keyframeHeight(keyframe: TimelineKeyframe | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined, options: TimelineOptions | null | undefined): number | string;
+    static keyframeShape(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): TimelineKeyframeShape;
+    static keyframeFillColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
+    static keyframeSelectedFillColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
+    static keyframeStrokeThickness(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
+    static keyframeStrokeColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
+    static keyframeSelectedStrokeColor(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null, rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
+    static groupHeight(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): number | string;
+    static groupMarginTop(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): number | string;
+    static groupFillColor(options: TimelineOptions | null | undefined, group: TimelineGroup | string | null | undefined, rowStyle: TimelineRowStyle | null | undefined): string;
+    /**
+     * Get current row height from styles
+     */
+    static getRowHeight(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
+    static getRowMarginBottom(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): number;
+    static getRowFillColor(rowStyle: TimelineRowStyle | null, options: TimelineOptions | null): string;
+    static headerHeight(options: TimelineOptions | null, defaultRowHeight?: number): number;
+    static keyframeDraggable(keyframe: TimelineKeyframe | null, group: TimelineGroup | string | null, row: TimelineRow | null, options: TimelineOptions | null, defaultValue?: boolean): boolean;
+    static groupDraggable(group: TimelineGroup | string | null | undefined, row: TimelineRow | null, options: TimelineOptions): boolean;
+}

+ 44 - 44
lib/utils/timelineUtils.d.ts

@@ -1,44 +1,44 @@
-import { TimelineRanged } from '../models/timelineRanged';
-import { TimelineOptions } from '../settings/timelineOptions';
-export declare class TimelineUtils {
-    static drawLine(ctx: CanvasRenderingContext2D, x1: number, y1: number, x2: number, y2: number): void;
-    /**
-     * Check is valid number.
-     */
-    static isNumber(val?: number | null): boolean;
-    static deleteElement<T>(array: Array<T>, element: T): Array<T>;
-    /**
-     * Check rectangle overlap x,y
-     */
-    static isOverlap(x: number, y: number, rectangle: DOMRect): boolean;
-    /**
-     * Find beautiful step for the header line gauge.
-     */
-    static findGoodStep(originalStep: number, divisionCheck?: number): number;
-    /**
-     * Keep value in min, max bounds.
-     */
-    static keepInBounds(value: number, min?: number | null | undefined, max?: number | null | undefined): number;
-    static setMinMax(to: TimelineRanged, from: TimelineRanged | null, shrink?: boolean): TimelineRanged;
-    static shrinkSelf(rect: DOMRect, value: number): DOMRect;
-    /**
-     * Check whether rectangle intersects another rectangle
-     */
-    static isRectIntersects(rect: DOMRect, rect2: DOMRect, touch?: boolean): boolean;
-    static getDistance(x1: number, y1: number, x2?: number, y2?: number): number;
-    /**
-     * Get sign of the number. 1 or -1.
-     */
-    static sign(p: number): number;
-    /**
-     * Clear browser text selection.
-     */
-    static clearBrowserSelection(): void;
-    static getPowArgument(toCheck: number): number;
-    static deepClone: <T>(previousOptions: T) => T;
-    static cloneOptions: (previousOptions: TimelineOptions) => TimelineOptions;
-    /**
-     * Merge options. New keys will be added.
-     */
-    static mergeOptions(previousOptions: TimelineOptions, newOptions: TimelineOptions): TimelineOptions;
-}
+import { TimelineRanged } from '../models/timelineRanged';
+import { TimelineOptions } from '../settings/timelineOptions';
+export declare class TimelineUtils {
+    static drawLine(ctx: CanvasRenderingContext2D, x1: number, y1: number, x2: number, y2: number): void;
+    /**
+     * Check is valid number.
+     */
+    static isNumber(val?: number | null): boolean;
+    static deleteElement<T>(array: Array<T>, element: T): Array<T>;
+    /**
+     * Check rectangle overlap x,y
+     */
+    static isOverlap(x: number, y: number, rectangle: DOMRect): boolean;
+    /**
+     * Find beautiful step for the header line gauge.
+     */
+    static findGoodStep(originalStep: number, divisionCheck?: number): number;
+    /**
+     * Keep value in min, max bounds.
+     */
+    static keepInBounds(value: number, min?: number | null | undefined, max?: number | null | undefined): number;
+    static setMinMax(to: TimelineRanged, from: TimelineRanged | null, shrink?: boolean): TimelineRanged;
+    static shrinkSelf(rect: DOMRect, value: number): DOMRect;
+    /**
+     * Check whether rectangle intersects another rectangle
+     */
+    static isRectIntersects(rect: DOMRect, rect2: DOMRect, touch?: boolean): boolean;
+    static getDistance(x1: number, y1: number, x2?: number, y2?: number): number;
+    /**
+     * Get sign of the number. 1 or -1.
+     */
+    static sign(p: number): number;
+    /**
+     * Clear browser text selection.
+     */
+    static clearBrowserSelection(): void;
+    static getPowArgument(toCheck: number): number;
+    static deepClone: <T>(previousOptions: T) => T;
+    static cloneOptions: (previousOptions: TimelineOptions) => TimelineOptions;
+    /**
+     * Merge options. New keys will be added.
+     */
+    static mergeOptions(previousOptions: TimelineOptions, newOptions: TimelineOptions): TimelineOptions;
+}

+ 24 - 24
lib/viewModels/timelineGroupViewModel.d.ts

@@ -1,24 +1,24 @@
-import { TimelineGroup } from '../models/timelineGroup';
-import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
-export interface TimelineGroupViewModel {
-    /**
-     * Size of the element in screen coordinates.
-     */
-    size: DOMRect | null;
-    /**
-     * From value in the timeline keyframes collection.
-     */
-    min: number;
-    /**
-     * To value in the timeline keyframes collection.
-     */
-    max: number;
-    /**
-     * Related Group Model.
-     */
-    groupModel: string | TimelineGroup;
-    /**
-     * Related Grouped keyframes view models.
-     */
-    keyframesViewModels: TimelineKeyframeViewModel[];
-}
+import { TimelineGroup } from '../models/timelineGroup';
+import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
+export interface TimelineGroupViewModel {
+    /**
+     * Size of the element in screen coordinates.
+     */
+    size: DOMRect | null;
+    /**
+     * From value in the timeline keyframes collection.
+     */
+    min: number;
+    /**
+     * To value in the timeline keyframes collection.
+     */
+    max: number;
+    /**
+     * Related Group Model.
+     */
+    groupModel: string | TimelineGroup;
+    /**
+     * Related Grouped keyframes view models.
+     */
+    keyframesViewModels: TimelineKeyframeViewModel[];
+}

+ 26 - 26
lib/viewModels/timelineKeyframeViewModel.d.ts

@@ -1,26 +1,26 @@
-import { TimelineKeyframeShape } from '../enums/timelineKeyframeShape';
-import { TimelineKeyframe } from '../models/timelineKeyframe';
-import { TimelineGroupViewModel } from './timelineGroupViewModel';
-import { TimelineRowViewModel } from './timelineRowViewModel';
-/**
- * Timeline calculated view model.
- */
-export interface TimelineKeyframeViewModel {
-    /**
-     * Size of the keyframe.
-     */
-    size: DOMRect;
-    shape: TimelineKeyframeShape;
-    /**
-     * Related keyframe model.
-     */
-    model: TimelineKeyframe;
-    /**
-     * Related calculated parent row view model.
-     */
-    rowViewModel: TimelineRowViewModel;
-    /**
-     * Related calculated parent group view model.
-     */
-    groupViewModel: TimelineGroupViewModel;
-}
+import { TimelineKeyframeShape } from '../enums/timelineKeyframeShape';
+import { TimelineKeyframe } from '../models/timelineKeyframe';
+import { TimelineGroupViewModel } from './timelineGroupViewModel';
+import { TimelineRowViewModel } from './timelineRowViewModel';
+/**
+ * Timeline calculated view model.
+ */
+export interface TimelineKeyframeViewModel {
+    /**
+     * Size of the keyframe.
+     */
+    size: DOMRect;
+    shape: TimelineKeyframeShape;
+    /**
+     * Related keyframe model.
+     */
+    model: TimelineKeyframe;
+    /**
+     * Related calculated parent row view model.
+     */
+    rowViewModel: TimelineRowViewModel;
+    /**
+     * Related calculated parent group view model.
+     */
+    groupViewModel: TimelineGroupViewModel;
+}

+ 31 - 31
lib/viewModels/timelineRowViewModel.d.ts

@@ -1,31 +1,31 @@
-import { TimelineRow } from '../models/timelineRow';
-import { TimelineGroupViewModel } from './timelineGroupViewModel';
-import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
-export interface TimelineRowViewModel {
-    /**
-     * Screen coordinates of the element.
-     */
-    size: DOMRect;
-    /**
-     * Related row model.
-     */
-    model: TimelineRow;
-    /**
-     * Current row index.
-     */
-    index: number;
-    /**
-     * Row margin bottom
-     */
-    marginBottom: number;
-    /**
-     * Collection of the keyframes groups view models exists in the current row.
-     */
-    groupsViewModels: TimelineGroupViewModel[];
-    /**
-     * All keyframes in the current row.
-     */
-    keyframesViewModels: TimelineKeyframeViewModel[];
-    min: number | null;
-    max: number | null;
-}
+import { TimelineRow } from '../models/timelineRow';
+import { TimelineGroupViewModel } from './timelineGroupViewModel';
+import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
+export interface TimelineRowViewModel {
+    /**
+     * Screen coordinates of the element.
+     */
+    size: DOMRect;
+    /**
+     * Related row model.
+     */
+    model: TimelineRow;
+    /**
+     * Current row index.
+     */
+    index: number;
+    /**
+     * Row margin bottom
+     */
+    marginBottom: number;
+    /**
+     * Collection of the keyframes groups view models exists in the current row.
+     */
+    groupsViewModels: TimelineGroupViewModel[];
+    /**
+     * All keyframes in the current row.
+     */
+    keyframesViewModels: TimelineKeyframeViewModel[];
+    min: number | null;
+    max: number | null;
+}

+ 18 - 18
lib/viewModels/timelineViewModel.d.ts

@@ -1,18 +1,18 @@
-import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
-import { TimelineRowViewModel } from './timelineRowViewModel';
-export interface TimelineViewModel {
-    /**
-     * Screen coordinates of the element.
-     */
-    size: DOMRect;
-    /**
-     * Keyframes view models.
-     */
-    keyframesViewModels: TimelineKeyframeViewModel[];
-    /**
-     * Collection of the rows sizes.
-     */
-    rowsViewModels: TimelineRowViewModel[];
-    min: number | null;
-    max: number | null;
-}
+import { TimelineKeyframeViewModel } from './timelineKeyframeViewModel';
+import { TimelineRowViewModel } from './timelineRowViewModel';
+export interface TimelineViewModel {
+    /**
+     * Screen coordinates of the element.
+     */
+    size: DOMRect;
+    /**
+     * Keyframes view models.
+     */
+    keyframesViewModels: TimelineKeyframeViewModel[];
+    /**
+     * Collection of the rows sizes.
+     */
+    rowsViewModels: TimelineRowViewModel[];
+    min: number | null;
+    max: number | null;
+}

File diff suppressed because it is too large
+ 4253 - 990
package-lock.json


+ 23 - 22
package.json

@@ -1,34 +1,35 @@
 {
   "name": "animation-timeline-js",
-  "version": "2.3.0",
+  "version": "2.3.1",
   "description": "animation timeline control based on the canvas.",
   "main": "lib/animation-timeline.min.js",
   "types": "lib/animation-timeline.d.ts",
   "devDependencies": {
-    "@babel/cli": "7.19.3",
-    "@babel/core": "7.20.5",
+    "@babel/cli": "7.24.1",
+    "@babel/core": "7.24.3",
     "@babel/plugin-proposal-class-properties": "7.18.6",
-    "@babel/preset-env": "7.20.2",
-    "@babel/preset-typescript": "7.18.6",
-    "@types/chai": "4.3.4",
-    "@types/mocha": "10.0.01",
-    "@typescript-eslint/eslint-plugin": "5.46.1",
-    "@typescript-eslint/parser": "5.46.1",
-    "babel-loader": "9.1.0",
-    "chai": "4.3.7",
-    "eslint": "8.30.0",
-    "eslint-config-prettier": "8.5.0",
-    "eslint-plugin-prettier": "4.2.1",
-    "mocha": "10.2.0",
-    "prettier": "2.8.1",
-    "ts-loader": "9.4.2",
-    "typescript": "4.9.4",
-    "webpack": "5.75.0",
-    "webpack-cli": "5.0.1"
+    "@babel/plugin-proposal-object-rest-spread": "7.20.7",
+    "@babel/preset-env": "7.24.3",
+    "@babel/preset-typescript": "7.24.1",
+    "@types/chai": "4.3.14",
+    "@types/mocha": "10.0.6",
+    "@typescript-eslint/eslint-plugin": "7.3.1",
+    "@typescript-eslint/parser": "7.3.1",
+    "babel-loader": "9.1.3",
+    "chai": "5.1.0",
+    "eslint": "8.57.0",
+    "eslint-config-prettier": "9.1.0",
+    "eslint-plugin-prettier": "5.1.3",
+    "mocha": "10.3.0",
+    "prettier": "3.2.5",
+    "ts-loader": "9.5.1",
+    "typescript": "5.4.3",
+    "webpack": "5.91.0",
+    "webpack-cli": "5.1.4"
   },
   "scripts": {
-    "start": "echo \"Run npm build and run index.html in your browser. You have to run build command every time files are changed.\" && exit 1",
-    "test": "echo \"Run tests/unittest.html explicitly to execute tests. Build after files are changed.\" && exit 1",
+    "start": "echo \"Run npm build and open index.html in your browser. You have to run build command every time files are changed.\" && exit 1",
+    "test": "echo \"Open tests/unittest.html explicitly to execute tests. Build after files are changed.\" && exit 1",
     "build-ts-def": "tsc -emitDeclarationOnly",
     "build": "webpack && npm run build-ts-def && npm run build-tests",
     "lint": "eslint --ext .ts,.html src --ignore-path .gitignore && prettier \"src/*.ts\" --check --ignore-path .gitignore",

+ 3 - 0
src/enums/timelineEventSource.ts

@@ -7,5 +7,8 @@ export enum TimelineEventSource {
    * Changed programmatically.
    */
   Programmatically = 'programmatically',
+  /**
+   * Changed by the set time function.
+   */
   SetTimeMethod = 'setTimeMethod',
 }

+ 1 - 1
src/settings/timelineOptions.ts

@@ -6,7 +6,7 @@ export interface TimelineOptions extends TimelineRanged {
   /**
    * Id or HTMLElement of the timeline container.
    */
-  id?: string | HTMLElement;
+  id?: string | HTMLElement | null;
   /**
    * Check whether snapping is enabled.
    */

+ 6 - 2
src/timeline.ts

@@ -218,7 +218,7 @@ export class Timeline extends TimelineEventsEmitter {
       console.log('Cannot initialize canvas context.');
       return;
     }
-
+    this._container.innerHTML = '';
     this._container.style.position = 'relative';
     // Generate size container:
     this._canvas.style.cssText =
@@ -338,6 +338,9 @@ export class Timeline extends TimelineEventsEmitter {
     this._stopAutoPan();
     this._clearScrollFinishedTimer();
     this._unsubscribeComponentEvents();
+    if (this._container) {
+      this._container.innerHTML = '';
+    }
     this._container = null;
     this._canvas = null;
     this._scrollContainer = null;
@@ -1910,7 +1913,8 @@ export class Timeline extends TimelineEventsEmitter {
     if (width === 'auto') {
       width = height;
     }
-    if (height > 0) {
+    height = Number(height);
+    if (!Number.isNaN(height) && height && (height as number) > 0) {
       const x = Math.floor(this._toScreenPx(val));
       y = Math.floor(y);
       const rect = {

+ 2 - 2
tests/unittests.html

@@ -14,8 +14,8 @@
     </div>
     <div id="mocha"></div>
 
-    <script src="https://unpkg.com/chai/chai.js"></script>
-    <script src="https://unpkg.com/mocha/mocha.js"></script>
+    <script src="https://unpkg.com/chai@4.3.7/chai.js"></script>
+    <script src="https://unpkg.com/mocha@10.3.0/mocha.js"></script>
     <script src="../lib/animation-timeline.js"></script>
     <script>
       if (!window.exports) {

+ 2 - 1
tsconfig.json

@@ -9,7 +9,8 @@
     "allowJs": false,
     "sourceMap": true,
     "strict": true,
-    "declaration": true
+    "declaration": true,
+    "forceConsistentCasingInFileNames": true
   },
   "include": ["src"],
   "exclude": ["node_modules", "lib", "dist", "tests", "*.json", "*.js", "webpack.config.js"]

+ 3 - 4
tsconfig.tests.json

@@ -7,10 +7,9 @@
     "allowJs": false,
     "inlineSourceMap": true,
     "strict": false,
-    "declaration": false
+    "declaration": false,
+    "forceConsistentCasingInFileNames": true
   },
-  "include": [
-    "./tests/*"
-],
+  "include": ["./tests/*"],
   "exclude": ["node_modules", "lib", "tests/js", "src", "src/*", "dist", "*.json", "*.js"]
 }

Some files were not shown because too many files changed in this diff