soocrate-core
Version:
this is the core of soocrate application
1,454 lines • 985 kB
JSON
{
"type": "File",
"start": 0,
"end": 5366,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 156,
"column": 22
}
},
"program": {
"type": "Program",
"start": 0,
"end": 5366,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 156,
"column": 22
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
},
"identifierName": "animals"
},
"name": "animals"
}
}
],
"source": {
"type": "StringLiteral",
"start": 20,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 29
}
},
"extra": {
"rawValue": "animals",
"raw": "'animals'"
},
"value": "animals"
}
},
{
"type": "ImportDeclaration",
"start": 32,
"end": 63,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 31
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 39,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 39,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
},
"identifierName": "hash"
},
"name": "hash"
}
}
],
"source": {
"type": "StringLiteral",
"start": 49,
"end": 62,
"loc": {
"start": {
"line": 2,
"column": 17
},
"end": {
"line": 2,
"column": 30
}
},
"extra": {
"rawValue": "string-hash",
"raw": "'string-hash'"
},
"value": "string-hash"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\r\n * [Marker Module manages the Carets, avatars, pseudonames for the different users of the document]\r\n * @param {[string]} origin [the id of the the user]\r\n * @param {Number} lifeTime [After this time, if no ping or Caret position is received => remove caret and avatar. if lifetime is -1 we didn't add the avatar]\r\n * @param {[{index: index,length: 0}]} range [range stars from index with the specified length]\r\n * @param {[cursor module]} cursorsp [the used cursor module for quilljs]\r\n * @param {[Boolean]} cursor [create the caret or not. If it is from ping, it will be false else true]\r\n * @param {Boolean} isItME [is it my caret ? true or false to disable the time if it is true]\r\n ",
"start": 71,
"end": 779,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"start": 781,
"end": 1649,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 37,
"column": 2
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 785,
"end": 1648,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 37,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 785,
"end": 791,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 10
},
"identifierName": "Marker"
},
"name": "Marker",
"leadingComments": null
},
"init": {
"type": "FunctionExpression",
"start": 794,
"end": 1648,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 37,
"column": 1
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 803,
"end": 809,
"loc": {
"start": {
"line": 15,
"column": 22
},
"end": {
"line": 15,
"column": 28
},
"identifierName": "origin"
},
"name": "origin"
},
{
"type": "AssignmentPattern",
"start": 811,
"end": 824,
"loc": {
"start": {
"line": 15,
"column": 30
},
"end": {
"line": 15,
"column": 43
}
},
"left": {
"type": "Identifier",
"start": 811,
"end": 819,
"loc": {
"start": {
"line": 15,
"column": 30
},
"end": {
"line": 15,
"column": 38
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
},
"right": {
"type": "UnaryExpression",
"start": 822,
"end": 824,
"loc": {
"start": {
"line": 15,
"column": 41
},
"end": {
"line": 15,
"column": 43
}
},
"operator": "-",
"prefix": true,
"argument": {
"type": "NumericLiteral",
"start": 823,
"end": 824,
"loc": {
"start": {
"line": 15,
"column": 42
},
"end": {
"line": 15,
"column": 43
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"extra": {
"parenthesizedArgument": false
}
}
},
{
"type": "Identifier",
"start": 826,
"end": 831,
"loc": {
"start": {
"line": 15,
"column": 45
},
"end": {
"line": 15,
"column": 50
},
"identifierName": "range"
},
"name": "range"
},
{
"type": "Identifier",
"start": 833,
"end": 841,
"loc": {
"start": {
"line": 15,
"column": 52
},
"end": {
"line": 15,
"column": 60
},
"identifierName": "cursorsp"
},
"name": "cursorsp"
},
{
"type": "Identifier",
"start": 843,
"end": 849,
"loc": {
"start": {
"line": 15,
"column": 62
},
"end": {
"line": 15,
"column": 68
},
"identifierName": "cursor"
},
"name": "cursor"
},
{
"type": "AssignmentPattern",
"start": 851,
"end": 865,
"loc": {
"start": {
"line": 15,
"column": 70
},
"end": {
"line": 15,
"column": 84
}
},
"left": {
"type": "Identifier",
"start": 851,
"end": 857,
"loc": {
"start": {
"line": 15,
"column": 70
},
"end": {
"line": 15,
"column": 76
},
"identifierName": "isItME"
},
"name": "isItME"
},
"right": {
"type": "BooleanLiteral",
"start": 860,
"end": 865,
"loc": {
"start": {
"line": 15,
"column": 79
},
"end": {
"line": 15,
"column": 84
}
},
"value": false
}
}
],
"body": {
"type": "BlockStatement",
"start": 867,
"end": 1648,
"loc": {
"start": {
"line": 15,
"column": 86
},
"end": {
"line": 37,
"column": 1
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 872,
"end": 893,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 23
}
},
"expression": {
"type": "AssignmentExpression",
"start": 872,
"end": 892,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 22
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 872,
"end": 883,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 13
}
},
"object": {
"type": "ThisExpression",
"start": 872,
"end": 876,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 877,
"end": 883,
"loc": {
"start": {
"line": 16,
"column": 7
},
"end": {
"line": 16,
"column": 13
},
"identifierName": "origin"
},
"name": "origin"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 886,
"end": 892,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 16,
"column": 22
},
"identifierName": "origin"
},
"name": "origin"
}
}
},
{
"type": "ExpressionStatement",
"start": 897,
"end": 922,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 27
}
},
"expression": {
"type": "AssignmentExpression",
"start": 897,
"end": 921,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 897,
"end": 910,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 897,
"end": 901,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 902,
"end": 910,
"loc": {
"start": {
"line": 17,
"column": 7
},
"end": {
"line": 17,
"column": 15
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 913,
"end": 921,
"loc": {
"start": {
"line": 17,
"column": 18
},
"end": {
"line": 17,
"column": 26
},
"identifierName": "lifeTime"
},
"name": "lifeTime"
}
}
},
{
"type": "ExpressionStatement",
"start": 926,
"end": 959,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 35
}
},
"expression": {
"type": "AssignmentExpression",
"start": 926,
"end": 958,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 34
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 926,
"end": 935,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 11
}
},
"object": {
"type": "ThisExpression",
"start": 926,
"end": 930,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 931,
"end": 935,
"loc": {
"start": {
"line": 18,
"column": 7
},
"end": {
"line": 18,
"column": 11
},
"identifierName": "time"
},
"name": "time"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 938,
"end": 958,
"loc": {
"start": {
"line": 18,
"column": 14
},
"end": {
"line": 18,
"column": 34
}
},
"callee": {
"type": "MemberExpression",
"start": 938,
"end": 956,
"loc": {
"start": {
"line": 18,
"column": 14
},
"end": {
"line": 18,
"column": 32
}
},
"object": {
"type": "NewExpression",
"start": 938,
"end": 948,
"loc": {
"start": {
"line": 18,
"column": 14
},
"end": {
"line": 18,
"column": 24
}
},
"callee": {
"type": "Identifier",
"start": 942,
"end": 946,
"loc": {
"start": {
"line": 18,
"column": 18
},
"end": {
"line": 18,
"column": 22
},
"identifierName": "Date"
},
"name": "Date"
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 949,
"end": 956,
"loc": {
"start": {
"line": 18,
"column": 25
},
"end": {
"line": 18,
"column": 32
},
"identifierName": "getTime"
},
"name": "getTime"
},
"computed": false
},
"arguments": []
}
}
},
{
"type": "ExpressionStatement",
"start": 963,
"end": 1003,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 963,
"end": 1002,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 963,
"end": 973,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 12
}
},
"object": {
"type": "ThisExpression",
"start": 963,
"end": 967,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 968,
"end": 973,
"loc": {
"start": {
"line": 19,
"column": 7
},
"end": {
"line": 19,
"column": 12
},
"identifierName": "color"
},
"name": "color"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 976,
"end": 1002,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 976,
"end": 989,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 976,
"end": 980,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"start": 981,
"end": 989,
"loc": {
"start": {
"line": 19,
"column": 20
},
"end": {
"line": 19,
"column": 28
},
"identifierName": "getColor"
},
"name": "getColor"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 990,
"end": 1001,
"loc": {
"start": {
"line": 19,
"column": 29
},
"end": {
"line": 19,
"column": 40
}
},
"object": {
"type": "ThisExpression",
"start": 990,
"end": 994,
"loc": {
"start": {
"line": 19,
"column": 29
},
"end": {
"line": 19,
"column": 33
}
}
},
"property": {
"type": "Identifier",
"start": 995,
"end": 1001,
"loc": {
"start": {
"line": 19,
"column": 34
},
"end": {
"line": 19,
"column": 40
},
"identifierName": "origin"
},
"name": "origin"
},
"computed": false
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 1007,
"end": 1049,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 20,
"column": 44
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1007,
"end": 1048,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 20,
"column": 43
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1007,
"end": 1020,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 20,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 1007,
"end": 1011,
"loc": {
"start": {
"line": 20,
"column": 2
},
"end": {
"line": 20,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 1012,
"end": 1020,
"loc": {
"start": {
"line": 20,
"column": 7
},
"end": {
"line": 20,
"column": 15
},
"identifierName": "colorRGB"
},
"name": "colorRGB"
},
"computed": false
},
"right": {
"type": "BinaryExpression",
"start": 1023,
"end": 1048,
"loc": {
"start": {
"line": 20,
"column": 18
},
"end": {
"line": 20,
"column": 43
}
},
"left": {
"type": "BinaryExpression",
"start": 1023,
"end": 1042,
"loc": {
"start": {
"line": 20,
"column": 18
},
"end": {
"line": 20,
"column": 37
}
},
"left": {
"type": "StringLiteral",
"start": 1023,
"end": 1029,
"loc": {
"start": {
"line": 20,
"column": 18
},
"end": {
"line": 20,
"column": 24
}
},
"extra": {
"rawValue": "rgb(",
"raw": "'rgb('"
},
"value": "rgb("
},
"operator": "+",
"right": {
"type": "MemberExpression",
"start": 1032,
"end": 1042,
"loc": {
"start": {
"line": 20,
"column": 27
},
"end": {
"line": 20,
"column": 37
}
},
"object": {
"type": "ThisExpression",
"start": 1032,
"end": 1036,
"loc": {
"start": {
"line": 20,
"column": 27
},
"end": {
"line": 20,
"column": 31
}
}
},
"property": {
"type": "Identifier",
"start": 1037,
"end": 1042,
"loc": {
"start": {
"line": 20,
"column": 32
},
"end": {
"line": 20,
"column": 37
},
"identifierName": "color"
},
"name": "color"
},
"computed": false
}
},
"operator": "+",
"right": {
"type": "StringLiteral",
"start": 1045,
"end": 1048,
"loc": {
"start": {
"line": 20,
"column": 40
},
"end": {
"line": 20,
"column": 43
}
},
"extra": {
"rawValue": ")",
"raw": "')'"
},
"value": ")"
}
}
}
},
{
"type": "ExpressionStatement",
"start": 1053,
"end": 1106,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 55
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1053,
"end": 1105,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 54
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1053,
"end": 1071,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 1053,
"end": 1057,
"loc": {
"start": {
"line": 21,
"column": 2
},
"end": {
"line": 21,
"column": 6
}
}
},
"property": {
"type": "Identifier",
"start": 1058,
"end": 1071,
"loc": {
"start": {
"line": 21,
"column": 7
},
"end": {
"line": 21,
"column": 20
},
"identifierName": "colorRGBLight"
},
"name": "colorRGBLight"
},
"computed": false
},
"right": {
"type": "BinaryExpression",
"start": 1074,
"end": 1105,
"loc": {
"start": {
"line": 21,
"column": 23
},
"end": {
"line": 21,
"column": 54
}
},
"left": {
"type": "BinaryExpression",
"start": 1074,
"end": 1094,
"loc": {
"start": {
"line": 21,
"column": 23
},
"end": {
"line": 21,
"column": 43
}
},
"left": {
"type": "StringLiteral",
"start": 1074,
"end": 1081,
"loc": {
"start": {
"line": 21,
"column": 23
},
"end": {
"line": 21,
"column": 30
}
},
"extra": {
"rawValue": "rgba(",
"raw": "'rgba('"
},
"value": "rgba("
},
"operator": "+",
"right": {
"type": "MemberExpression",
"start": 1084,
"end": 1094,
"loc": {
"start": {
"line": 21,
"column": 33
},
"end": {
"line": 21,
"column": 43
}
},
"object": {
"type": "ThisExpression",
"start": 1084,
"end": 1088,
"loc": {
"start": {
"line": 21,
"column": 33
},
"end": {
"line": 21,
"column": 37
}
}
},
"property": {
"type": "Identifier",
"start": 1089,
"end": 1094,
"loc": {
"start": {
"line": 21,
"column": 38
},
"end": {
"line": 21,
"column": 43
},
"identifierName": "color"
},
"name": "color"
},
"computed": false
}
},
"operator": "+",
"right": {
"type": "StringLiteral",
"start": 1097,
"end": 1105,
"loc": {
"start": {
"line": 21,
"column": 46
},
"end": {
"line": 21,
"column": 54
}
},
"extra": {
"rawValue": ", 0.5)",
"raw": "', 0.5)'"
},
"value": ", 0.5)"
}
}
}
},
{
"type": "ExpressionStatement",
"start": 1110,
"end": 1180,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 22,
"column": 72
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1110,
"end": 1179,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 22,
"column": 71
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1110,
"end": 1121,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 22,
"column": 13
}
},
"object": {
"type": "ThisExpression",
"start": 1110,
"end": 1114,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 22,
"column":