Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LayoutDesigner<SS>

TimelineEditor is a Redux-connected component responsible for rendering and manipulating preview screens. The user can add personal or communal preview devices and design layouts by splitting screen regions horizontally or vertically. For more complex layouts, the components has the option to upload existing layouts and parse them. It receives all its props via the Redux state tree.

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

Private communalColumn

communalColumn: HTMLDivElement

context

context: any

Private personalColumn

personalColumn: HTMLDivElement

props

props: Readonly<object> & Readonly<LayoutDesignerProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<LayoutDesignerState>

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<LayoutDesignerProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void
  • Invoked after the component has mounted. Sets the preview screen width based on the actual width of the divs containing the screens in the DOM.

    Returns void

Optional componentDidUpdate

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

Optional componentWillUnmount

  • componentWillUnmount(): void
  • 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.

    Returns void

Optional componentWillUpdate

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

Optional getSnapshotBeforeUpdate

  • 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.

    Parameters

    Returns SS | null

Private loadTemplate

  • loadTemplate(e: ChangeEvent<HTMLInputElement>): void
  • Retrieves a layout file from the event that is passed, reads it, validates the loaded file against a schema and attempts to parse the file and allocate preview screens and regions for it. If any step along the way fails, an error message is shown.

    Parameters

    • e: ChangeEvent<HTMLInputElement>

      Event fired in response to a file upload

    Returns void

Private parseLayoutTemplates

  • Parses a list of layout templates and creates the necessary preview screens and regions in the Redux state tree.

    Parameters

    Returns void

Private parseTemplateRegions

  • parseTemplateRegions(regions: object, name: string, type: "communal" | "personal"): void
  • Parses a data structure containing screen regions obtained from a valid layout document and creates preview devices for it containing the specified regions. The function also requires the name and type of preview device to be passed in.

    Parameters

    • regions: object

      A data structure containing template regions retrieved from a layout document

    • name: string

      The name for the preview device

    • type: "communal" | "personal"

      The type of preview device. One of personal or communal

    Returns void

render

  • render(): Element
  • Renders the component.

    Returns Element

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof LayoutDesignerState

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

Optional shouldComponentUpdate

  • 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.

    Parameters

    Returns boolean

Generated using TypeDoc