Options
All
  • Public
  • Public/Protected
  • All
Menu

2immerse-editor

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

ADD_ASSET

ADD_ASSET: PayloadAction<"ADD_ASSET", object>

ADD_CHAPTER_AFTER

ADD_CHAPTER_AFTER: PayloadAction<"ADD_CHAPTER_AFTER", object>

ADD_CHAPTER_BEFORE

ADD_CHAPTER_BEFORE: PayloadAction<"ADD_CHAPTER_BEFORE", object>

ADD_CHAPTER_CHILD

ADD_CHAPTER_CHILD: PayloadAction<"ADD_CHAPTER_CHILD", object>

ADD_DEVICE

ADD_DEVICE: PayloadAction<"ADD_DEVICE", object>

ADD_ELEMENT_TO_TIMELINE_TRACK

ADD_ELEMENT_TO_TIMELINE_TRACK: PayloadAction<"ADD_ELEMENT_TO_TIMELINE_TRACK", object>

ADD_MASTER_LAYOUT

ADD_MASTER_LAYOUT: PayloadAction<"ADD_MASTER_LAYOUT", object>

ADD_TIMELINE

ADD_TIMELINE: PayloadAction<"ADD_TIMELINE", object>

ADD_TIMELINE_TRACK

ADD_TIMELINE_TRACK: PayloadAction<"ADD_TIMELINE_TRACK", object>

ASSIGN_COMPONENT_TO_MASTER

ASSIGN_COMPONENT_TO_MASTER: PayloadAction<"ASSIGN_COMPONENT_TO_MASTER", object>

ASSIGN_DOCUMENT_ID

ASSIGN_DOCUMENT_ID: PayloadAction<"ASSIGN_DOCUMENT_ID", object>

ActionHandlerFunction

ActionHandlerFunction: function

Type for functions passed to the addHandler() method of ActionHandler.

param

State that the reducer will act upon

param

Action that the reducer will act upon

returns

The transformed state

Type declaration

    • (state: T, action: Action): T
    • Parameters

      Returns T

AssetState

AssetState: List<Asset>

AsyncAction

AsyncAction: ThunkAction<R, ApplicationState, void, A>

Type alias which wraps and simplifies ThunkAction.

ChapterState

ChapterState: List<Chapter>

ControlCommand

ControlCommand: object | object | object

Coords

Coords: [number, number]

GeneralSettingsKey

GeneralSettingsKey: keyof GeneralSettings

HTTPMethods

HTTPMethods: "GET" | "POST" | "PUT" | "DELETE"

InputMethod

InputMethod: "upload" | "url" | "id"

LOAD_CHAPTER_TREE

LOAD_CHAPTER_TREE: PayloadAction<"LOAD_CHAPTER_TREE", object>

LOAD_TIMELINES

LOAD_TIMELINES: PayloadAction<"LOAD_TIMELINES", object>

LayoutDesignerProps

MasterManagerProps

Nullable

Nullable: T | null

PLACE_REGION_ON_SCREEN

PLACE_REGION_ON_SCREEN: PayloadAction<"PLACE_REGION_ON_SCREEN", object>

ParamTypes

ParamTypes: "duration" | "time" | "string" | "url" | "const" | "set" | "selection"

ProgramAuthorProps

PromiseReject

PromiseReject: function

Type declaration

    • (err: object): void
    • Parameters

      • err: object
        • Optional body?: undefined | string
        • status: number
        • statusText: string

      Returns void

PromiseResolve

PromiseResolve: function

Type declaration

    • (data: string): void
    • Parameters

      • data: string

      Returns void

REMOVE_CHAPTER

REMOVE_CHAPTER: PayloadAction<"REMOVE_CHAPTER", object>

REMOVE_COMPONENT_FROM_MASTER

REMOVE_COMPONENT_FROM_MASTER: PayloadAction<"REMOVE_COMPONENT_FROM_MASTER", object>

REMOVE_DEVICE

REMOVE_DEVICE: PayloadAction<"REMOVE_DEVICE", object>

REMOVE_ELEMENT

REMOVE_ELEMENT: PayloadAction<"REMOVE_ELEMENT", object>

REMOVE_MASTER_LAYOUT

REMOVE_MASTER_LAYOUT: PayloadAction<"REMOVE_MASTER_LAYOUT", object>

REMOVE_REGION_FROM_LAYOUTS

REMOVE_REGION_FROM_LAYOUTS: PayloadAction<"REMOVE_REGION_FROM_LAYOUTS", object>

REMOVE_SCREEN_FROM_LAYOUTS

REMOVE_SCREEN_FROM_LAYOUTS: PayloadAction<"REMOVE_SCREEN_FROM_LAYOUTS", object>

REMOVE_TIMELINE

REMOVE_TIMELINE: PayloadAction<"REMOVE_TIMELINE", object>

REMOVE_TIMELINE_TRACK

REMOVE_TIMELINE_TRACK: PayloadAction<"REMOVE_TIMELINE_TRACK", object>

RENAME_CHAPTER

RENAME_CHAPTER: PayloadAction<"RENAME_CHAPTER", object>

ReducerFunction

ReducerFunction: function

Type of the function returned by getReducer() of ActionHandler.

param

State that the reducer will act upon. Optional

param

Action that the reducer will act upon

returns

The transformed state

Type declaration

    • (state: T | undefined, action: Action): T
    • Parameters

      • state: T | undefined
      • action: Action

      Returns T

SELECT_NEWEST_LAYOUT

SELECT_NEWEST_LAYOUT: BasicAction<"SELECT_NEWEST_LAYOUT">

SPLIT_REGION

SPLIT_REGION: PayloadAction<"SPLIT_REGION", object>

StartPageProps

TOGGLE_TRACK_LOCK

TOGGLE_TRACK_LOCK: PayloadAction<"TOGGLE_TRACK_LOCK", object>

TimelineEditorProps

TimelineState

TimelineState: List<Timeline>

TriggerMode

TriggerMode: "trigger" | "enqueue"

UNDO_LAST_SPLIT

UNDO_LAST_SPLIT: PayloadAction<"UNDO_LAST_SPLIT", object>

UPDATE_ELEMENT_LENGTH

UPDATE_ELEMENT_LENGTH: PayloadAction<"UPDATE_ELEMENT_LENGTH", object>

UPDATE_ELEMENT_OFFSET

UPDATE_ELEMENT_OFFSET: PayloadAction<"UPDATE_ELEMENT_OFFSET", object>

UPDATE_SELECTED_LAYOUT

UPDATE_SELECTED_LAYOUT: PayloadAction<"UPDATE_SELECTED_LAYOUT", object>

UPDATE_SELECTED_SCREEN

UPDATE_SELECTED_SCREEN: PayloadAction<"UPDATE_SELECTED_SCREEN", object>

Variables

Const TriggerModeContext

TriggerModeContext: Context<string> = React.createContext("trigger")

Const actionHandler

actionHandler: ActionHandler<List<Timeline>> = new ActionHandler<TimelineState>(initialState)

Const colorPalette

colorPalette: string[] = ["#f67088", "#f77276", "#f7745f", "#f77637", "#e88131", "#db8831", "#d08e31", "#c79231", "#be9631", "#b59931", "#ad9c31", "#a49f31", "#9ba231", "#91a531", "#86a731", "#77aa31", "#63ae31", "#41b231", "#31b252", "#32b16a", "#33b07a", "#33af85", "#34ae8e", "#34ad96", "#35ad9d", "#35aca4", "#36acaa", "#36abb0", "#36aab6", "#37a9bd", "#38a8c5", "#38a7cd", "#39a6d8", "#3aa4e6", "#49a0f4", "#6e9af4", "#8795f4", "#9a8ff4", "#ac88f4", "#bc81f4", "#cc79f4", "#dc6ff4", "#ed61f4", "#f45ee9", "#f562d9", "#f565cc", "#f568bf", "#f56ab3", "#f66ca6", "#f66e99"]

Const composeEnhancers

composeEnhancers: any = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose

Const downTriangle

downTriangle: string = String.fromCodePoint(9662)

Const history

history: History = createHashHistory()

Const rightTriangle

rightTriangle: string = String.fromCodePoint(9656)

Const router

router: Middleware<__type, any, Dispatch<AnyAction>> = routerMiddleware(history)

Const store

store: Store<Object, AnyAction> = createStore(createRootReducer(history),undefined,composeEnhancers(applyMiddleware(thunk), applyMiddleware(router)))

Functions

Const BoxHandle

  • This component renders a handle on one of the sides of a chapter node, which when clicked can be used to add a new chapter before, after or below the clicked node. This is facilitated by the onClick callback. The cursor is also changed to a pointer if the handle is hovered over.

    Parameters

    Returns Element

Const CheckboxInputField

  • Renders an input field for a checkbox with the given label, an initial toggle state for the checkbox and an optional description. Accepts a callback onChange which is invoked when the user updates the field.

    Parameters

    Returns Element

Const DMAppcContainer

  • This component renders a container at half the height of the screen and a container for each asset passed in through the assets prop. This container renders a preview image for each asset, its title and a short description. Each of these asset containers has its draggable property set to true, i.e. the container can be dragged onto other elements and data can be transferred this way. In this instance, the element the asset container has been dropped over receives the asset's ID.

    Parameters

    Returns Element

Const EmptyTrack

  • EmptyTrack is a component created for convenience when one wants to render a track which does not contain any timeline elements yet. It is simply a wrapper around TimelineTrack wich a couple defaults for certain props such as the callbacks, which are empty functions or the list of elements, which is also empty. All other props are simply passed through to the inner TimelineTrack.

    Parameters

    Returns Element

Const ErrorMessage

  • This component is intended to render HTTP error messages. It accepts a HTTP status code and text as props. Optionally also a document ID and a more descriptive error message can be passed in.

    Parameters

    Returns Element

Const EventList

  • Renders a list of events by arranging them on a grid, where each event is placed inside a box displaying event title, thumbnail and a button for launching configuring the event. The exact events that are rendered from the list passed in via props depends on the given trigger mode.

    Parameters

    Returns Element

Const LandingPage

  • LandingPage(): Element
  • Provides a landing page, from which the user can access all other parts of the application. These other parts of the application are connected via standard hyperlinks, whereas the link to the configuration page and the viewer are realised through separate components.

    Returns Element

Const Layout

  • Layout(props: object): Element
  • A layout ties together multiple preview screens and regions. The regions are associated to devices through areas by means of unique IDs. Layout provides a wrapper around the application and renders components which are displayed throughout the entire application, such as the MenuBar component.

    Parameters

    • props: object

      Props for rendering children

      • Optional children?: ReactNode

    Returns Element

devices

devices: Array<Device>

regions

regions: Array<Region>

Const LoadingSpinner

  • LoadingSpinner(): Element
  • Renders a CSS-based spinner which can be used to indicate to the user that the application is in the process of loading data, e.g. from a server.

    Returns Element

Const NodeConnectors

  • This component renders connectors between the current node and nodes above, to the left and right potentially child nodes.

    Parameters

    Returns Element

Const ParamInputField

  • Renders an input field for an event parameter. The exact type of input field rendered is determined by the event type passed in through the props. If the event type is unknown, an error message is rendered.

    Parameters

    Returns Element

Const ProgramStructure

  • This component renders a chapter tree as a list, starting from the level passed in the chapters prop. Child levels are indented by the amount given in the prop levelIndent. Optionally, the access path of a selected chapter can be passed in, which will be highlighted in the list. Finally, a callback triggered when one of the entries is clicked must be provided.

    Parameters

    Returns Element

Const QueuedEventContainer

  • Renders a single event as part of a QueuedEventList. Based on the type of event, border and background colours change. Moreover, for active events, a close icon is rendered which can be used to dequeue the events.

    Parameters

    Returns Element

Const QueuedEventList

  • Renders a list of already queued events, filtering out abstract ones and replacing ready events with their active counterparts where available by matching them using their productionId.

    Parameters

    Returns Element

Const Screen

  • This is a generic component for rendering preview screens and its associated regions. Based on the screen type (communal or personal) it also renders a corresponding device frame (i.e. a TV screen or a mobile phone). One can specify the height of the screen while the width is then calculated based on that and the aspect ratio of the device frame. This component also provides callbacks for when a comonent is dropped onto one of the regions or when the user attempts to open a context menu by right-clicking on a screen region. These callbacks are used by DroppableScreen and SplittableScreen correspondingly.

    Parameters

    Returns Element

constructor

Const ScreenContainer

  • General container for grouping a type of preview screens (e.g. all personal devices). Has a title and label for number of devices at the very top and then renders all preview screens passed in one after the other from top to bottom. The container also forwards a series of callbacks for removing devices, splitting regions and undoing splits to the preview screens within the container.

    Parameters

    Returns Element

Const SelectInputField

  • Renders an input field for a dropdown with the given label, an optional initial value for the selected item and list of options. Accepts a callback onChange which is invoked when the user updates the field.

    Parameters

    Returns Element

Const SessionSettings

  • This component renders various buttons which give the user access to functionality such as saving the document and clearing or deleting the current session. If the fetchError prop is given, it is implied that an error has occured elsewhere in the application and that certain functionality is not available anymore, such as saving the document. Thus, the presence of fetchError disabled some controls. The component also offers two controls for interacting with the session, namely "Clear Session" and "Delete session". The former one deletes the session on the client side, whereas the latter one deletes it both on the client and on the server.

    Parameters

    Returns Element

Const TextInputField

  • Renders an input field for plain text with the given label and an optional initial value. Accepts a callback onChange which is invoked when the user updates the field.

    Parameters

    Returns Element

Const TimeConverter

  • TimeConverter takes a numeric value for seconds and uses it to render a timecode consisting of hours, minutes and seconds. All values are padded to the left with zeroes. So for instance, passing the value 345 for the prop seconds will result in a timecode 00:05:45 to be generated.

    Parameters

    Returns Element

Const URLInputField

  • Renders an input field for a URL with the given label and an optional initial value. Accepts a callback onChange which is invoked when the user updates the field.

    Parameters

    Returns Element

addAsset

  • addAsset(id: string, name: string, description: string, previewUrl: string, duration?: undefined | number): ADD_ASSET
  • Creates an action for adding a new asset.

    Parameters

    • id: string

      ID of the asset to add

    • name: string

      Name of the asset

    • description: string

      Description of the asset

    • previewUrl: string

      URL pointing to a preview image

    • Optional duration: undefined | number

      Duration of the asset. Optional

    Returns ADD_ASSET

addChapterAfter

  • addChapterAfter(accessPath: Array<number>, id?: undefined | string): ADD_CHAPTER_AFTER
  • Creates an action for creating a new chapter after the chapter given by the access path.

    Parameters

    • accessPath: Array<number>

      Access path of the chapter after which the new chapter shall be created

    • Optional id: undefined | string

      ID of the new chapter. Optional

    Returns ADD_CHAPTER_AFTER

addChapterBefore

  • addChapterBefore(accessPath: Array<number>, id?: undefined | string): ADD_CHAPTER_BEFORE
  • Creates an action for creating a new chapter before the chapter given by the access path.

    Parameters

    • accessPath: Array<number>

      Access path of the chapter before which the new chapter shall be created

    • Optional id: undefined | string

      ID of the new chapter. Optional

    Returns ADD_CHAPTER_BEFORE

addChapterChild

  • addChapterChild(accessPath: Array<number>, id?: undefined | string): ADD_CHAPTER_CHILD
  • Creates an action for creating a new chapter as a child of the chapter given by the access path.

    Parameters

    • accessPath: Array<number>

      Access path of the chapter under which the new chapter shall be created

    • Optional id: undefined | string

      ID of the new chapter. Optional

    Returns ADD_CHAPTER_CHILD

addDevice

  • addDevice(type: "personal" | "communal", name?: undefined | string, orientation?: "landscape" | "portrait", createRootRegion?: boolean): ADD_DEVICE
  • Creates an action for adding a new preview screen with the given parameters.

    Parameters

    • type: "personal" | "communal"

      Type of screen to add. One of personal or communal

    • Optional name: undefined | string

      Name of the device to be added. Optional

    • Optional orientation: "landscape" | "portrait"

      Orientation of the device to be added, one of landscape or portrait. Optional

    • Default value createRootRegion: boolean = true

      Whether a root regions that covers the entire screen should be created. Optional, default true

    Returns ADD_DEVICE

addDeviceAndPlaceRegions

  • This asynchronous action creator first dispatches an action for creating a new preview device with the given parameters and then iterates the given list of screen regions and adds them to the newly created screen region by dispatching the action for placing regions on a screen.

    Parameters

    • type: "personal" | "communal"

      Type of preview screen to be added. One of personal or communal

    • name: string

      Name of the screen to be added

    • orientation: "landscape" | "portrait"

      Orientation of the screen. One of landscape or portrait

    • areas: Array<Area & Region>

      List of screen regions to be placed on the new screen

    Returns AsyncAction<void, ADD_DEVICE | PLACE_REGION_ON_SCREEN>

addElementToTimelineTrack

  • addElementToTimelineTrack(timelineId: string, trackId: string, componentId: string, duration: number, offset?: number, insertPosition?: number, previewUrl?: undefined | string, elementId?: undefined | string): ADD_ELEMENT_TO_TIMELINE_TRACK
  • Creates an action for adding a new element to an existing timeline track on a timeline. The new element must be given a duration. By default, the new element is inserted at the end of the track, but a specific insert index can be specified, where the new element is inserted at the given index and all following elements are shifted right by on position.

    Parameters

    • timelineId: string

      ID of the timeline the element should be added to

    • trackId: string

      ID of the track on the timeline the element should be added to

    • componentId: string

      ID of the component to be added

    • duration: number

      Duration of the element on the track

    • Default value offset: number = 0

      Offset of the element from the previous element. Optional, default 0

    • Default value insertPosition: number = -1

      Index at which the element should be inserted. Optional, default -1 (end of track)

    • Optional previewUrl: undefined | string

      Preview URL for the element. Optional

    • Optional elementId: undefined | string

      Predefined ID for the new element. Optional

    Returns ADD_ELEMENT_TO_TIMELINE_TRACK

addMasterLayout

  • Creates an action for adding a new master layout with the given name.

    Parameters

    • name: string

      The name of the new master layout

    Returns ADD_MASTER_LAYOUT

addMasterLayoutAndUpdateCurrent

  • Dispatches the action for creating a new master layout and immediately selects the newly created layout as current layout.

    Parameters

    • name: string

      Name of the layout to be created

    Returns AsyncAction<void, ADD_MASTER_LAYOUT | SELECT_NEWEST_LAYOUT>

addTimeline

  • Creates an action for adding a new timeline for the chapter given by the ID.

    Parameters

    • chapterId: string

      Chapter for which a new timeline is to be added

    Returns ADD_TIMELINE

addTimelineTrack

  • addTimelineTrack(timelineId: string, regionId: string, locked?: boolean, trackId?: undefined | string): ADD_TIMELINE_TRACK
  • Creates an action for adding a new timeline track to the timeline given by the ID for the given region.

    Parameters

    • timelineId: string

      ID of the timeline to be removed

    • regionId: string

      ID of the region for the new track

    • Default value locked: boolean = false

      Whether the new track should be locked. Optional, default false

    • Optional trackId: undefined | string

      ID of the new track. Optional

    Returns ADD_TIMELINE_TRACK

addTimelineTrackAndAddElement

  • addTimelineTrackAndAddElement(timelineId: string, regionId: string, componentId: string, duration: number, offset: number, previewUrl?: undefined | string, trackId?: undefined | string, elementId?: undefined | string): AsyncAction<void, ADD_TIMELINE_TRACK | ADD_ELEMENT_TO_TIMELINE_TRACK>
  • Asynchronous action which first dispatches an action for adding a new track to an existing timeline based on ID and immediately afterwards dispatches an action for adding a new element to the created timeline track.

    Parameters

    • timelineId: string

      Timeline to which the track and element should be added

    • regionId: string

      Region for which the track should be created

    • componentId: string

      Component to add to the new track

    • duration: number

      Duration of the element on the track

    • offset: number

      Offset of the element to its previous element

    • Optional previewUrl: undefined | string

      Preview URL for the element

    • Optional trackId: undefined | string

      Predefined ID for the new timeline track. Optional

    • Optional elementId: undefined | string

      Predefined ID the new element. Optional

    Returns AsyncAction<void, ADD_TIMELINE_TRACK | ADD_ELEMENT_TO_TIMELINE_TRACK>

arraysEqual

  • arraysEqual<T>(a: Array<T>, b: Array<T>): boolean
  • Compares two arrays element by element and returns whether they are equal or not.

    Type parameters

    • T

      Type of the elements inside the array

    Parameters

    • a: Array<T>

      First array

    • b: Array<T>

      Second array

    Returns boolean

    True if the arrays are equal, false otherwise

asBackButton

  • asBackButton<P>(WrappedComponent: React.ComponentType<P> | string): BackButton
  • Takes the passed component and add children to it which render a left-pointing arrow. This is intended to be used with elements such as the HTML anchor a or Link from react-router, thereby creating a convenient way to instantiate back-links.

    Type parameters

    • P

    Parameters

    • WrappedComponent: React.ComponentType<P> | string

      Component to be wrapped

    Returns BackButton

assignComponentToMaster

  • Creates an action for assigning a given component to a screen region within a master layout.

    Parameters

    • masterId: string

      The ID of the master layout the component is to be assigned to

    • screenId: string

      The ID of the screen the component is to be assigned to

    • regionId: string

      The ID of the region within the screen the component is to be assigned to

    • componentId: string

      The ID of the component we want to assign to the given master layout

    Returns ASSIGN_COMPONENT_TO_MASTER

assignDocumentId

  • Creates an action for setting a new document, effectively starting a new editing session. The action also takes a base URL which is prepended to all relative URLs in the document such as preview image.

    Parameters

    • documentId: string

      Document ID to set

    • baseUrl: string

      Base URL associated to the document

    Returns ASSIGN_DOCUMENT_ID

between

  • between(x: number, lowerBound: number, higherBound: number, inclusive?: boolean): boolean
  • Checks if a given value is between the given bounds. The check can either be performed inclusive or exclusive.

    Parameters

    • x: number

      The number to be checked

    • lowerBound: number

      The lower bound

    • higherBound: number

      The upper bound

    • Default value inclusive: boolean = false

      Whether the check should include the bounds or not

    Returns boolean

    True or false

blink

  • blink(blinkOn: function, blinkOff: function, frequency?: number): function
  • Parameters

    • blinkOn: function
        • (): void
        • Returns void

    • blinkOff: function
        • (): void
        • Returns void

    • Default value frequency: number = 500

    Returns function

      • (): void
      • Returns void

capitalize

  • capitalize(str: string): string
  • Transforms a string by capitalising its first letter. If the first character is not a letter or the string is empty, the input will be returned unchanged.

    Parameters

    • str: string

      Input string

    Returns string

    The input string with the first letter capitalised

countLeafNodes

  • countLeafNodes(chapter: Chapter): number
  • Takes a node in a chapter tree and counts leaf nodes reachable from it.

    Parameters

    • chapter: Chapter

      Chapter node from which to start counting

    Returns number

    Number of leaf nodes

createNewScreen

  • createNewScreen(type: "communal" | "personal", name?: undefined | string, orientation?: "landscape" | "portrait", createRootRegion?: boolean): Screen
  • Parameters

    • type: "communal" | "personal"
    • Optional name: undefined | string
    • Optional orientation: "landscape" | "portrait"
    • Default value createRootRegion: boolean = true

    Returns Screen

Const createRootReducer

  • createRootReducer(history: History): function
  • Parameters

    • history: History

    Returns function

      • (state: S | undefined, action: A): S
      • Parameters

        • state: S | undefined
        • action: A

        Returns S

findById

  • findById<T, U>(collection: Indexed<T>, search: U): [number, T]
  • Finds an object in a given collection by investigating each entry's key 'id' and checking it against the given search value.

    Type parameters

    • T: object

      Type of the items inside collection. Must have a key named id

    • U

      Type of the values inside an object of type T and type of the value to search for

    Parameters

    • collection: Indexed<T>

      Collection to search

    • search: U

      Value to search for

    Returns [number, T]

    The index the entry was found at and the entry itself as a tuple

findByKey

  • findByKey<T, U, V>(collection: Indexed<T>, search: U, key: V): [number, T] | undefined
  • Finds an object in a given collection by investigating each entry's key given by the parameter key and checking it against the given search value. This is a more generic version of findById()

    Type parameters

    • T: object

    • U

    • V: keyof T

    Parameters

    • collection: Indexed<T>

      Collection to search

    • search: U

      Value to search for

    • key: V

      The key which shall be checked

    Returns [number, T] | undefined

    The index the entry was found at and the entry itself as a tuple

Const findOptimalContainerWidth

  • findOptimalContainerWidth(blockWidth?: number): number
  • Calculates the optimal width of the wrapper container hosting the individual event blocks. Starting from the full screen width, it is decreased until an exact multiple of the event block width is found, which is then returned as the optimal width. If no such width could be found, the event block width is returned.

    Parameters

    • Default value blockWidth: number = 400

      The width of individual event blocks

    Returns number

    The optimal width for the container based on screen width

generateChapterKeyPath

  • generateChapterKeyPath(accessPath: Array<number>): List<number | string>
  • Generates an array containing indices to accessing nodes in a tree data structure. Its input parameter is simply a list of indices. This list is transformed in such a way, that it can be used to access tree data structures the way they have been implemented in this project.

    Parameters

    • accessPath: Array<number>

      An array of numbers specifying indices to index a tree

    Returns List<number | string>

    A modified access path to navigate the actual data structure

getAncestorOffsets

  • getAncestorOffsets(chapters: List<Chapter>, timelines: List<Timeline>, accessPath: Array<number>, partialOffset?: number): List<[Array<number>, string, number]>
  • Calculates for each ancestor of the chapter accessible by accessPath the offset that needs to be subtracted from the front of the timeline of said ancestor to align it with the chapter given by accessPath. Returns a list of tuples containing for each ancestor its access path, id and offset in seconds.

    Parameters

    • chapters: List<Chapter>

      Complete chapter tree

    • timelines: List<Timeline>

      List of timelines associated to the chapter tree

    • accessPath: Array<number>

      Acces path of the node to be investigates

    • Default value partialOffset: number = 0

    Returns List<[Array<number>, string, number]>

    A list containing a tuple for each ancestor with id and offset

getAngle

  • getAngle(time: number, startTime: number): number
  • Parameters

    • time: number
    • startTime: number

    Returns number

getCanvasDropPosition

  • getCanvasDropPosition(stageWrapper: Nullable<Stage>, pageX: number, pageY: number): number[]
  • Takes a ref to a Konva Stage component and two numbers representing absolute positions on the screen and returns the coordinates for the same point but relative to the top-left corner of the Stage instead of the screen. Throws an error if the Stage ref is null.

    Parameters

    • stageWrapper: Nullable<Stage>

      Ref to a Stage component

    • pageX: number

      Absolute x position on screen

    • pageY: number

      Absolute y position on screen

    Returns number[]

    The [x,y] coordinates relative to the top-left corner of the given Stage

getChapterAccessPath

  • getChapterAccessPath(chapters: List<Chapter>, chapterId: string): List<number>
  • Returns a list of indices for accessing the chapter node identified by the given id in a tree-like data structure of chapter nodes.

    Parameters

    • chapters: List<Chapter>

      A tree-like data structure containing chapter nodes

    • chapterId: string

      The id of the chapter we want the path for

    Returns List<number>

    A list of indices for locating the chapter with the given id in the tree

getChapterByPath

  • getChapterByPath(chapters: List<Chapter>, accessPath: Array<number>): Chapter
  • Returns the chapter that is obtained by navigating the tree using the values in accessPath as indices.

    Parameters

    • chapters: List<Chapter>

      Complete chapter tree

    • accessPath: Array<number>

      Access path of the chapter to retrieve

    Returns Chapter

    The chapter found using the access path

getChapterDuration

  • Returns the total duration of the given chapter. This is calculated by getting the timeline length of the current chapter and then recursively visiting all children and summing up their timeline lengths. The result is the duration of the chapter taking the durations or its descendants into account.

    Parameters

    • chapter: Chapter

      The chapter for which we want to get the duration

    • timelines: List<Timeline>

      Timelines associated to the given chapter nodes

    Returns number

    The duration of a chapter taking into account durations of descendants

getDescendantChapters

  • Returns a flattened list of all descendants of the given chapter node. This function either accepts a single chapter node or a list or chapters (i.e. a level of a chapter tree).

    Parameters

    • chapters: List<Chapter> | Chapter

      Single chapter or list of chapters

    Returns List<Chapter>

    A flattened list of all descendants of the given chapter

getLeafNodes

  • Takes a node in a chapter tree and returns leaf nodes reachable from it.

    Parameters

    • chapter: Chapter

      Chapter node from which to start

    Returns List<Chapter>

    Leaf nodes as a flat list

getRandomInt

  • getRandomInt(min?: number, max?: number): number
  • Returns a random integer between the given bounds, or between 0 and 10 if no bounds are given. The values for the bounds are rounded to integers.

    Parameters

    • Default value min: number = 0

      Lower bound for random number

    • Default value max: number = 10

      Upper bound for random number

    Returns number

    A random number within the given bounds

getRegionForArea

  • Scans a layout document retrieved from the API for a region corresponding to the given area ID and returns it. Returns undefined otherwise

    Parameters

    • id: string

      Area ID to search for

    • layout: Layout

      Layout document where we want to find the region corresponding to the area

    Returns Region

    The region for the given area ID or undefined

getTimecode

  • getTimecode(time: number): string
  • Parameters

    • time: number

    Returns string

getTimelineLength

  • getTimelineLength(timeline: Timeline | undefined): number
  • Returns the length of a timeline by summing up durations and offsets of all its timeline elements on all its tracks. The function thenreturns the length of its longest track

    Parameters

    • timeline: Timeline | undefined

      The timeline for which we went to know the length of

    Returns number

    The duration of the longest track in the timeline

getTimestamp

  • getTimestamp(): number
  • Returns number

getTreeHeight

  • getTreeHeight(chapters: List<Chapter>): number
  • Returns the number of levels in a tree of chapters starting from the given level.

    Parameters

    • chapters: List<Chapter>

      List of tree nodes from which to start

    Returns number

    The number of levels in the tree

loadChapterTree

  • Creates an action for loading and parsing an entire hierarchical chapter structure received from the API.

    Parameters

    • tree: ChapterTree

      A tree-like data structure for chapters obtained from the API

    Returns LOAD_CHAPTER_TREE

loadTimelines

  • Creates an action for allocating timelines found in a chapter tree data structure retrieved from the API. The data structure is processed recursively and a timeline object is created for every timeline encountered.

    Parameters

    Returns LOAD_TIMELINES

makeRequest

  • makeRequest(method: HTTPMethods, url: string, data?: any, contentType?: undefined | string): Promise<string>
  • Launches a HTTP request for the given URL and method. Returns a promise which resolves to a string containing the response text on success.

    Parameters

    • method: HTTPMethods

      HTTP method. One of GET, POST, PUT or DELETE

    • url: string

      The target URL for the request

    • Optional data: any

      Data to send with the request

    • Optional contentType: undefined | string

      Content type of the request data

    Returns Promise<string>

    A promise which resolves to the response body

mapDispatchToProps

  • Wraps action creators with the dispatch function and maps them to props.

    Parameters

    • dispatch: Dispatch<any>

      Dispatch function for the configured store

    Returns LayoutDesignerActionProps

mapStateToProps

mergeTimelines

  • Takes a chapter node and visits all its children, investigating their timelines, merging them along the way, resulting in a single timeline which represents the global timeline view seen from the given chapter as it would be rendered in a standard non-linear video editor.

    Parameters

    • chapter: Chapter

      Chapter to merge the timelines for

    • timelines: List<Timeline>

      A list of timelines associated to the chapter nodes

    Returns Timeline

    The current chapter's timeline merged with all descendant timelines

navigate

  • navigate(route: string, state?: any): RouterAction
  • Allows navigation to a different part of the application by dispatching a push() action on the store with the given route descriptor and optional state as parameters.

    Parameters

    • route: string

      Route to navigate to

    • Optional state: any

      State to pass to the route. Optional

    Returns RouterAction

padStart

  • padStart(s: any, targetLength: number, pad?: string): any
  • Pads a string on the left side with a given character to a specified length. If the input string is longer than the target length or the padding string is longer than one character, the input string will be returned unchanged.

    Parameters

    • s: any

      The object to pad. Will be converted to string first

    • targetLength: number

      The target length of the desired string

    • Default value pad: string = "0"

      The character the string should be padded with. Must be a single char

    Returns any

    The padded string

parseQueryString

  • parseQueryString(query: string): Map<string, string | undefined>
  • Parses a query string returns the parsed values in a map.

    Parameters

    • query: string

      The query string to parse

    Returns Map<string, string | undefined>

    A map containing the parsed values as key-value pairs

placeRegionOnScreen

  • placeRegionOnScreen(screenId: string, position: Coords, size: Coords, regionId?: undefined | string, name?: undefined | string, color?: undefined | string): PLACE_REGION_ON_SCREEN
  • Creates an action for freely placing a new region on the screen. All sizes and coordinates are relative to the screen size and are therefore float values between 0 and 1. The region can optionally have a predefined ID. If left empty, a random ID is generated. Values for name and background colour are also optional but default to empty values.

    Parameters

    • screenId: string

      ID of screen region should be placed on

    • position: Coords

      Position of the new region. Given as [x, y]

    • size: Coords

      Size of the new region. Given as [w, h]

    • Optional regionId: undefined | string

      ID of the new region. Optional

    • Optional name: undefined | string

      Name of the new region. Optional

    • Optional color: undefined | string

      Background colour of the new region. Optional

    Returns PLACE_REGION_ON_SCREEN

pluck

  • pluck<T>(obj: T, keys: Array<keyof T>): Partial<T>
  • Selects a subset of key-value pairs from an object and returns a new object containing only the selected keys.

    Type parameters

    • T

      Type of the obj parameter

    Parameters

    • obj: T

      Object to pluck keys from

    • keys: Array<keyof T>

      Names of keys that should be plucked

    Returns Partial<T>

    A new object with the given subset of keys

removeChapter

  • Creates an action for deleting the chapter given by the access path.

    Parameters

    • accessPath: Array<number>

      Access path of the chapter to be deleted

    Returns REMOVE_CHAPTER

removeComponentFromMaster

  • Creates an action for removing a given component from a screen region within a master layout.

    Parameters

    • masterId: string

      The ID of the master layout the component should be removed from

    • screenId: string

      The ID of the screen the component should be removed from

    • regionId: string

      The ID of the region within the screen the component should be removed from

    • componentId: string

      The ID of the component we want to remove from the master layout

    Returns REMOVE_COMPONENT_FROM_MASTER

removeDevice

  • Creates an action for removing an existing preview screen.

    Parameters

    • id: string

      ID of the screen to be removed

    Returns REMOVE_DEVICE

removeElement

  • removeElement(timelineId: string, trackId: string, elementId: string): REMOVE_ELEMENT
  • Creates an action for removing the given element located on the given track and timeline.

    Parameters

    • timelineId: string

      ID of the timeline the element is located on

    • trackId: string

      ID of the track on the timeline the element is located on

    • elementId: string

      ID of the element to remove

    Returns REMOVE_ELEMENT

removeElementAndUpdateTrack

  • Asynchronous action which first dispatches an action for removing an element from the given timeline track on the given timeline. After the removal, the updated timeline track is received and checked if it still contains any more elements. If it has become empty, another action id dispatched for removing the entire track. If there are still elements left, nothing more is done.

    Parameters

    • timelineId: string

      ID of the timeline the track is located on

    • trackId: string

      ID of the track the element should be removed from

    • elementId: string

      ID of the element to be removed

    Returns AsyncAction<void, REMOVE_ELEMENT | REMOVE_TIMELINE_TRACK>

removeMasterLayout

  • Creates an action for deleting the master layout with the given ID.

    Parameters

    • masterId: string

      The ID of the master layout to be deleted

    Returns REMOVE_MASTER_LAYOUT

removeRegionFromLayouts

  • Creates an action for removing all references to a screen region in all master layouts. This should be called after removing a screen region to avoid inconsistencies.

    Parameters

    • regionId: string

      The ID of the screen region we want to remove from master layouts

    Returns REMOVE_REGION_FROM_LAYOUTS

removeScreenFromLayouts

  • Creates an action for removing all references to a screen in all master layouts. This should be called after removing a preview screen to avoid inconsistencies.

    Parameters

    • screenId: string

      The ID of the screen we want to remove from master layouts

    Returns REMOVE_SCREEN_FROM_LAYOUTS

removeTimeline

  • Creates an action for removing a timeline given by the ID.

    Parameters

    • timelineId: string

      ID of the timeline to be removed

    Returns REMOVE_TIMELINE

removeTimelineTrack

  • Creates an action for removing a timeline track given by it ID, located on the given timeline.

    Parameters

    • timelineId: string

      ID of the timeline the track is located on

    • trackId: string

      ID of the timeline track to be removed

    Returns REMOVE_TIMELINE_TRACK

renameChapter

  • renameChapter(accessPath: Array<number>, name: string): RENAME_CHAPTER
  • Creates an action for renaming the chapter given by the access path.

    Parameters

    • accessPath: Array<number>

      Access path of the chapter to be renamed

    • name: string

      The new name of the chapter

    Returns RENAME_CHAPTER

selectNewestLayout

  • Creates an action for selecting the newest layout as current layout. Should be invoked when the master manager is first loaded and no current layout is set yet.

    Returns SELECT_NEWEST_LAYOUT

shortenUrl

  • shortenUrl(originalUrl: string): Promise<string>
  • Shortens a given URL and returns a promise for the shortened URL.

    Parameters

    • originalUrl: string

      URL to shorten

    Returns Promise<string>

    A promise which should resovle to the shortened URL

splitRegion

  • splitRegion(screenId: string, regionId: string, orientation: "horizontal" | "vertical", position: number): SPLIT_REGION
  • Creates an action for splitting a region within a preview screen given by their IDs. The split is created horizontally or vertically and a float value between 0 and 1 determines the location of the split, where 0 is the very left/top of the screen and 1 the very right/bottom of the screen for vertical and horizontal splits respectively.

    Parameters

    • screenId: string

      ID of the screen where the region is located

    • regionId: string

      ID of the region to be split

    • orientation: "horizontal" | "vertical"

      Orientation of the split, one of horizontal or vertical

    • position: number

      Position of the split within the region, must be between 0 and 1

    Returns SPLIT_REGION

toggleTrackLock

  • Creates an action for toggleing the track lock for the the given track and timeline.

    Parameters

    • timelineId: string

      ID of the timeline the element is located on

    • trackId: string

      ID of the track on the timeline the element is located on

    Returns TOGGLE_TRACK_LOCK

trimBack

  • Cut a specified amount of seconds from the end of a given timeline track. This is done by adjusting the durations and/or offsets of the elements contained in the track. An empty track is returned unchanged.

    Parameters

    • track: TimelineTrack

      Timeline track to be trimmed

    • end: number

      Time in seconds that should be trimmed off the end

    Returns TimelineTrack

    The timeline track trimmed to the given length

trimFront

  • Cut a specified amount of seconds from the beginning of a given timeline track. This is done by adjusting the durations and/or offsets of the elements contained in the track. An empty track is returned unchanged.

    Parameters

    • track: TimelineTrack

      Timeline track to be trimmed

    • start: number

      Time in seconds that should be trimmed from the beginning

    Returns TimelineTrack

    The timeline track trimmed to the given length

trimTimelineTrack

  • Cut a specified amount of seconds from the beginning and end of a given timeline track. This is done by adjusting the durations and/or offsets of the * elements contained in the track. An empty track is returned unchanged.

    Parameters

    • track: TimelineTrack

      Timeline track to be trimmed

    • start: number

      Time in seconds that should be trimmed at the end

    • end: number

    Returns TimelineTrack

    The timeline track trimmed to the given length

undoLastSplit

  • Creates an action for undoing the last split that occurred on the screen given by the ID. If there haven't been any splits on the screen, this is a no-op.

    Parameters

    • screenId: string

      ID of screen for which the last split shall be undone

    Returns UNDO_LAST_SPLIT

updateElementLength

  • updateElementLength(timelineId: string, trackId: string, elementId: string, length: number): UPDATE_ELEMENT_LENGTH
  • Creates an action for updating the duration of the given element located on the given track and timeline.

    Parameters

    • timelineId: string

      ID of the timeline the element is located on

    • trackId: string

      ID of the track on the timeline the element is located on

    • elementId: string

      ID of the element to update

    • length: number

      New duration value

    Returns UPDATE_ELEMENT_LENGTH

updateElementOffset

  • updateElementOffset(timelineId: string, trackId: string, elementId: string, offset: number): UPDATE_ELEMENT_OFFSET
  • Creates an action for updating the offset of the given element located on the given track and timeline.

    Parameters

    • timelineId: string

      ID of the timeline the element is located on

    • trackId: string

      ID of the track on the timeline the element is located on

    • elementId: string

      ID of the element to update

    • offset: number

      New offset value

    Returns UPDATE_ELEMENT_OFFSET

updateSelectedLayout

  • Creates an action for updating the currently selected master layout.

    Parameters

    • masterId: string

      The ID of the master layout to be selected

    Returns UPDATE_SELECTED_LAYOUT

updateSelectedScreen

  • Creates a action to update the currently selected screen. The value undefined can be passed or the parameter omitted altogether to clear the currently selected screen.

    Parameters

    • Optional screenId: undefined | string

      The ID of the screen which shall be selected. Optional

    Returns UPDATE_SELECTED_SCREEN

validateLayout

  • validateLayout(layout: any): Promise<void>
  • Validates a layout document against a schema. If the layout validates correctly, the function returns void, otherwise it will throw an error.

    Parameters

    • layout: any

      The layout to validate

    Returns Promise<void>

Object literals

Const actionCreators

actionCreators: object

addAsset

addAsset: addAsset

addChapterAfter

addChapterAfter: addChapterAfter

addChapterBefore

addChapterBefore: addChapterBefore

addChapterChild

addChapterChild: addChapterChild

addDevice

addDevice: addDevice

addDeviceAndPlaceRegions

addDeviceAndPlaceRegions: addDeviceAndPlaceRegions

addElementToTimelineTrack

addElementToTimelineTrack: addElementToTimelineTrack

addMasterLayout

addMasterLayout: addMasterLayout

addMasterLayoutAndUpdateCurrent

addMasterLayoutAndUpdateCurrent: addMasterLayoutAndUpdateCurrent

addTimeline

addTimeline: addTimeline

addTimelineTrack

addTimelineTrack: addTimelineTrack

addTimelineTrackAndAddElement

addTimelineTrackAndAddElement: addTimelineTrackAndAddElement

assignComponentToMaster

assignComponentToMaster: assignComponentToMaster

assignDocumentId

assignDocumentId: assignDocumentId

loadChapterTree

loadChapterTree: loadChapterTree

loadTimelines

loadTimelines: loadTimelines

placeRegionOnScreen

placeRegionOnScreen: placeRegionOnScreen

removeChapter

removeChapter: removeChapter

removeComponentFromMaster

removeComponentFromMaster: removeComponentFromMaster

removeDevice

removeDevice: removeDevice

removeElement

removeElement: removeElement

removeElementAndUpdateTrack

removeElementAndUpdateTrack: removeElementAndUpdateTrack

removeMasterLayout

removeMasterLayout: removeMasterLayout

removeRegionFromLayouts

removeRegionFromLayouts: removeRegionFromLayouts

removeScreenFromLayouts

removeScreenFromLayouts: removeScreenFromLayouts

removeTimeline

removeTimeline: removeTimeline

removeTimelineTrack

removeTimelineTrack: removeTimelineTrack

renameChapter

renameChapter: renameChapter

selectNewestLayout

selectNewestLayout: selectNewestLayout

splitRegion

splitRegion: splitRegion

toggleTrackLock

toggleTrackLock: toggleTrackLock

undoLastSplit

undoLastSplit: undoLastSplit

updateElementLength

updateElementLength: updateElementLength

updateElementOffset

updateElementOffset: updateElementOffset

updateSelectedLayout

updateSelectedLayout: updateSelectedLayout

updateSelectedScreen

updateSelectedScreen: updateSelectedScreen

Const defaultScreenParams

defaultScreenParams: object

id

id: string = ""

name

name: string = ""

orientation

orientation: "landscape" = "landscape"

regions

regions: List<any> = List()

type

type: "communal" = "communal"

Const deviceFrames

deviceFrames: object

communal

communal: object

aspect

aspect: number = 1964 / 1366

screenOffset

screenOffset: [number, number] = [127 / 1964, 107 / 1366]

screenSize

screenSize: [number, number] = [1708 / 1964, 1144 / 1366]

url

url: string = "/static/img/tv_frame.png"

personal

personal: object

aspect

aspect: number = 970 / 1756

screenOffset

screenOffset: [number, number] = [80 / 970, 155 / 1756]

screenSize

screenSize: [number, number] = [805 / 970, 1429 / 1756]

url

url: string = "/static/img/phone_frame.png"

Const initialState

initialState: object = List([])

baseUrl

baseUrl: string = ""

documentId

documentId: string = ""

Const paramDefaults

paramDefaults: object

duration

duration: string = "0"

string

string: string = ""

time

time: string = "0"

url

url: string = ""

Generated using TypeDoc