Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Views: 39598
1
# 3rd Party Libraries
2
immutable = require('immutable')
3
4
# Internal Libraries
5
misc = require('smc-util/misc')
6
{types} = misc
7
8
exports.get_store_def = (name) ->
9
name: name
10
11
stateTypes:
12
height : types.number # 0 means not rendered; otherwise is the height of the chat editor
13
input : types.string # content of the input box
14
is_preview : types.bool # currently displaying preview of the main input chat
15
last_sent : types.string # last sent message
16
messages : types.immutable.Map # Map of all messages
17
offset : types.number # information about where on screen the chat editor is located
18
position : types.number # more info about where chat editor is located
19
saved_mesg : types.string # The message state before saving and edited message. Potentially broken with mutiple edits
20
use_saved_position : types.bool # whether or not to maintain last saved scroll position (used when unmounting then remounting, e.g., due to tab change)
21
saved_position : types.number
22
23
getInitialState: =>
24
height : 0
25
input : ''
26
is_preview : undefined
27
last_sent : undefined
28
messages : undefined
29
offset : undefined
30
position : undefined
31
saved_mesg : undefined
32
use_saved_position : undefined
33
saved_position : undefined
34
35
36