Called immediately before mounting occurs, and before Component#render
.
Avoid introducing any side-effects or subscriptions in this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
This method will not stop working in React 17.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Assigns a new duration to a given asset, but only if the current duration of the asset is equal to zero. If the asset's duration is not zero, the asset is returned unchanged. This is acheived by opening a dialogue, prompting to select a duration for the asset. If the new value is invalid or the user cancels the prompt, the asset is returne unchanged.
The asset for which the duration shall be updated
The updated asset
Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.
Called immediately after a compoment is mounted. Setting state here will trigger re-rendering.
Called immediately after updating occurs. Not called for the initial render.
The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.
Callback invoked when the component mounts for the first time. Checks whether there is a timeline associated to the given chapter and redirects back to the ProgramAuthor component if not.
Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.
Calling Component#setState
generally does not trigger this method.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as
cancelled network requests, or cleaning up any DOM elements created in componentDidMount
.
Called immediately before rendering when new props or state is received. Not called for the initial render.
Note: You cannot call Component#setState
here.
Note: the presence of getSnapshotBeforeUpdate or getDerivedStateFromProps prevents this from being invoked.
Callback invoked when the user clicks an element on a timeline track. The callback receives timeline, track, element ID and current duration of the element. This function is intended for the user to update an element's duration. This is achieved by showing the user a prompt to type in a new duration. If the selected duration is invalid of if the user cancels the prompt, the function does nothing.
The ID of the timeline on which the removed element is located
The ID of the track in which the removed element is located
The ID of the removed element itself
Callback invoked when the user triggers the event for removing a specific element on a timeline track. The callback receives timeline, track and element ID and updates the Redux tree accordingly.
The ID of the timeline on which the removed element is located
The ID of the track in which the removed element is located
The ID of the removed element itself
Returns the duration of the current chapter, taking durations of descendant chapters into account.
The duration of the current chapter
Runs before React applies the result of render
to the document, and
returns an object to be given to componentDidUpdate. Useful for saving
things such as scroll position before render
causes changes to it.
Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.
Returns the timeline associated with the current chapter.
The timeline for the current chapter
Computes the global track layout as seen from the current chapter. This means that elements on timeline for the current chapter govern the duration if the timeline and elements located in ancestor chapters are trimmed to fit inside the timeline and rendered on locked tracks. Moreover, descendant tracks are merged and also rendered on locked tracks. I.e. only tracks which contain elements associated to the current chapter can be changed. The function returns a list with an entry for each region on all preview screens, containing region ID, color and a track object if there were any elements assigned to that track in some chapter in the current branch.
The global track layout as seen from the current chapter
Callback invoked when the name of a chapter in the program structure sidebar is clicked. The callback receives the access path of the chapter that was clicked and navigates to the TimelineEditor for that chapter.
Callback invoked when an element is dropped into a preview screen region. The callback receives the component and region ID for the region the component was dropped into. Updates the data structures on the server as well as the Redux state.
ID of component which was dropped
ID of region component was dropped into
Callback invoked when an element is dropped onto a timeline track. The callback receives the original drag event and updates the data structures on the server as well as the Redux state.
Renders the component.
Renders a preview screen components can be dropped into. The actual screen
that is rendered depends on the currentScreen
property found in the
Redux state.
Desired height of the screen to be rendered
JSX elements for placing and rendering the screen
Called to determine whether the change in props and state should trigger a re-render.
Component
always returns true.
PureComponent
implements a shallow comparison on props and state and returns true if any
props or states have changed.
If false is returned, Component#render
, componentWillUpdate
and componentDidUpdate
will not be called.
Generated using TypeDoc
TimelineEditor is a Redux-connected component responsible for rendering and manipulating the timeline for a given chapter by dragging elements to timeline tracks or preview screens, thereby composing the presentation on an element-level. This works in idea like a traditional non-linear video editor. It receives all its props via the Redux state tree.