TextElement

TextElement

TextElement is a fully collaborative text area where each of multiple users has a cursor, and can independently edit the content. The Element has a set of Croquet messages that it can send and receive.

Members

value :string

The string represents the content of the text area.

Type:
  • string

Methods

load(content)

Set the styled content. When content is a string, it is simply used as-is. When content is an array, it is assumed to contain styled-text runs of the following form:

   [{text: str<string>, style?: {font?: font<string>, size?: size<number>, color?: color<string>, bold?: bold<boolean>, italic?: italic<boolean>}}]
Parameters:
Name Type Description
content string | Array.<runs>

new content

Events

text

text Croquet message

When the content is "accepted" (by pressing Cmd-S or Ctrl-S in the view), a Croquet event of the form:

     this.publish(this.id, "text" {ref: <ElementRef>, text: <string>});

will be published.

Type:
  • object

changed

changed Croquet message

When the content changes, a Croquet event of the form:

     this.publish(this.id, "changed", {ref: this.asElementRef()});

will be published.

Type:
  • object