rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,329 lines (1,328 loc) • 269 kB
JSON
{
"type": "Program",
"start": 0,
"end": 2140,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 74,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 12
}
},
"name": "React"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 18,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 25
}
},
"value": "react",
"rawValue": "react",
"raw": "\"react\""
}
},
{
"type": "ImportDeclaration",
"start": 27,
"end": 63,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 34,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 34,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 17
}
},
"name": "MapActions"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 50,
"end": 62,
"loc": {
"start": {
"line": 2,
"column": 23
},
"end": {
"line": 2,
"column": 35
}
},
"value": "../actions",
"rawValue": "../actions",
"raw": "\"../actions\""
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Items on the map, or in the sidebar\n * @type {*|Function}x\n ",
"start": 65,
"end": 134,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 7,
"column": 3
}
},
"range": [
65,
134
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 135,
"end": 2139,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 73,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 150,
"end": 2139,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 73,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 156,
"end": 164,
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 29
}
},
"name": "ItemView",
"leadingComments": null
},
"superClass": {
"type": "MemberExpression",
"start": 173,
"end": 188,
"loc": {
"start": {
"line": 8,
"column": 38
},
"end": {
"line": 8,
"column": 53
}
},
"object": {
"type": "Identifier",
"start": 173,
"end": 178,
"loc": {
"start": {
"line": 8,
"column": 38
},
"end": {
"line": 8,
"column": 43
}
},
"name": "React"
},
"property": {
"type": "Identifier",
"start": 179,
"end": 188,
"loc": {
"start": {
"line": 8,
"column": 44
},
"end": {
"line": 8,
"column": 53
}
},
"name": "Component"
},
"computed": false
},
"body": {
"type": "ClassBody",
"start": 189,
"end": 2139,
"loc": {
"start": {
"line": 8,
"column": 54
},
"end": {
"line": 73,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 193,
"end": 1682,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 57,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 193,
"end": 199,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 8
}
},
"name": "render"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 199,
"end": 1682,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 57,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 202,
"end": 1682,
"loc": {
"start": {
"line": 9,
"column": 11
},
"end": {
"line": 57,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 208,
"end": 346,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 14,
"column": 17
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 212,
"end": 234,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 212,
"end": 216,
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 12
}
},
"name": "item"
},
"init": {
"type": "MemberExpression",
"start": 219,
"end": 234,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 30
}
},
"object": {
"type": "MemberExpression",
"start": 219,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 219,
"end": 223,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"start": 224,
"end": 229,
"loc": {
"start": {
"line": 10,
"column": 20
},
"end": {
"line": 10,
"column": 25
}
},
"name": "props"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 230,
"end": 234,
"loc": {
"start": {
"line": 10,
"column": 26
},
"end": {
"line": 10,
"column": 30
}
},
"name": "item"
},
"computed": false
}
},
{
"type": "VariableDeclarator",
"start": 244,
"end": 262,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 26
}
},
"id": {
"type": "Identifier",
"start": 244,
"end": 249,
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 13
}
},
"name": "title"
},
"init": {
"type": "MemberExpression",
"start": 252,
"end": 262,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 26
}
},
"object": {
"type": "Identifier",
"start": 252,
"end": 256,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 20
}
},
"name": "item"
},
"property": {
"type": "Identifier",
"start": 257,
"end": 262,
"loc": {
"start": {
"line": 11,
"column": 21
},
"end": {
"line": 11,
"column": 26
}
},
"name": "title"
},
"computed": false
}
},
{
"type": "VariableDeclarator",
"start": 272,
"end": 294,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 272,
"end": 283,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 19
}
},
"name": "classString"
},
"init": {
"type": "Literal",
"start": 286,
"end": 294,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 30
}
},
"value": "place ",
"rawValue": "place ",
"raw": "\"place \""
}
},
{
"type": "VariableDeclarator",
"start": 304,
"end": 327,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 31
}
},
"id": {
"type": "Identifier",
"start": 304,
"end": 312,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 16
}
},
"name": "picClass"
},
"init": {
"type": "Literal",
"start": 315,
"end": 327,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 31
}
},
"value": "place__pic",
"rawValue": "place__pic",
"raw": "\"place__pic\""
}
},
{
"type": "VariableDeclarator",
"start": 337,
"end": 345,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 16
}
},
"id": {
"type": "Identifier",
"start": 337,
"end": 345,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 16
}
},
"name": "imgStyle"
},
"init": null
}
],
"kind": "let"
},
{
"type": "IfStatement",
"start": 352,
"end": 714,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 29,
"column": 5
}
},
"test": {
"type": "MemberExpression",
"start": 356,
"end": 366,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 18
}
},
"object": {
"type": "Identifier",
"start": 356,
"end": 360,
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 16,
"column": 12
}
},
"name": "item"
},
"property": {
"type": "Identifier",
"start": 361,
"end": 366,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 18
}
},
"name": "onMap"
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"start": 368,
"end": 512,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 21,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 376,
"end": 422,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 52
}
},
"expression": {
"type": "AssignmentExpression",
"start": 376,
"end": 421,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 51
}
},
"operator": "+=",
"left": {
"type": "Identifier",
"start": 376,
"end": 387,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 17
}
},
"name": "classString"
},
"right": {
"type": "Literal",
"start": 391,
"end": 421,
"loc": {
"start": {
"line": 17,
"column": 21
},
"end": {
"line": 17,
"column": 51
}
},
"value": "pin icon icon--chevron-right",
"rawValue": "pin icon icon--chevron-right",
"raw": "\"pin icon icon--chevron-right\""
}
}
},
{
"type": "IfStatement",
"start": 429,
"end": 506,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 20,
"column": 7
}
},
"test": {
"type": "BinaryExpression",
"start": 433,
"end": 450,
"loc": {
"start": {
"line": 18,
"column": 10
},
"end": {
"line": 18,
"column": 27
}
},
"left": {
"type": "MemberExpression",
"start": 433,
"end": 445,
"loc": {
"start": {
"line": 18,
"column": 10
},
"end": {
"line": 18,
"column": 22
}
},
"object": {
"type": "Identifier",
"start": 433,
"end": 438,
"loc": {
"start": {
"line": 18,
"column": 10
},
"end": {
"line": 18,
"column": 15
}
},
"name": "title"
},
"property": {
"type": "Identifier",
"start": 439,
"end": 445,
"loc": {
"start": {
"line": 18,
"column": 16
},
"end": {
"line": 18,
"column": 22
}
},
"name": "length"
},
"computed": false
},
"operator": ">",
"right": {
"type": "Literal",
"start": 448,
"end": 450,
"loc": {
"start": {
"line": 18,
"column": 25
},
"end": {
"line": 18,
"column": 27
}
},
"value": 23,
"rawValue": 23,
"raw": "23"
}
},
"consequent": {
"type": "BlockStatement",
"start": 452,
"end": 506,
"loc": {
"start": {
"line": 18,
"column": 29
},
"end": {
"line": 20,
"column": 7
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 462,
"end": 498,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 44
}
},
"expression": {
"type": "AssignmentExpression",
"start": 462,
"end": 497,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 43
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 462,
"end": 467,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 13
}
},
"name": "title"
},
"right": {
"type": "BinaryExpression",
"start": 470,
"end": 497,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 43
}
},
"left": {
"type": "CallExpression",
"start": 470,
"end": 489,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 470,
"end": 482,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 28
}
},
"object": {
"type": "Identifier",
"start": 470,
"end": 475,
"loc": {
"start": {
"line": 19,
"column": 16
},
"end": {
"line": 19,
"column": 21
}
},
"name": "title"
},
"property": {
"type": "Identifier",
"start": 476,
"end": 482,
"loc": {
"start": {
"line": 19,
"column": 22
},
"end": {
"line": 19,
"column": 28
}
},
"name": "substr"
},
"computed": false
},
"arguments": [
{
"type": "Literal",
"start": 483,
"end": 484,
"loc": {
"start": {
"line": 19,
"column": 29
},
"end": {
"line": 19,
"column": 30
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
},
{
"type": "Literal",
"start": 486,
"end": 488,
"loc": {
"start": {
"line": 19,
"column": 32
},
"end": {
"line": 19,
"column": 34
}
},
"value": 22,
"rawValue": 22,
"raw": "22"
}
]
},
"operator": "+",
"right": {
"type": "Literal",
"start": 492,
"end": 497,
"loc": {
"start": {
"line": 19,
"column": 38
},
"end": {
"line": 19,
"column": 43
}
},
"value": "...",
"rawValue": "...",
"raw": "\"...\""
}
}
}
}
]
},
"alternate": null
}
]
},
"alternate": {
"type": "BlockStatement",
"start": 518,
"end": 714,
"loc": {
"start": {
"line": 21,
"column": 11
},
"end": {
"line": 29,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 526,
"end": 548,
"loc": {
"start": {
"line": 22,
"column": 6
},
"end": {
"line": 22,
"column": 28
}
},
"expression": {
"type": "AssignmentExpression",
"start": 526,
"end": 547,
"loc": {
"start": {
"line": 22,
"column": 6
},
"end": {
"line": 22,
"column": 27
}
},
"operator": "+=",
"left": {
"type": "Identifier",
"start": 526,
"end": 537,
"loc": {
"start": {
"line": 22,
"column": 6
},
"end": {
"line": 22,
"column": 17
}
},
"name": "classString"
},
"right": {
"type": "Literal",
"start": 541,
"end": 547,
"loc": {
"start": {
"line": 22,
"column": 21
},
"end": {
"line": 22,
"column": 27
}
},
"value": "list",
"rawValue": "list",
"raw": "\"list\""
}
}
},
{
"type": "IfStatement",
"start": 555,
"end": 624,
"loc": {
"start": {
"line": 23,
"column": 6
},
"end": {
"line": 25,
"column": 7
}
},
"test": {
"type": "MemberExpression",
"start": 559,
"end": 575,
"loc": {
"start": {
"line": 23,
"column": 10
},
"end": {
"line": 23,
"column": 26
}
},
"object": {
"type": "Identifier",
"start": 559,
"end": 563,
"loc": {
"start": {
"line": 23,
"column": 10
},
"end": {
"line": 23,
"column": 14
}
},
"name": "item"
},
"property": {
"type": "Identifier",
"start": 564,
"end": 575,
"loc": {
"start": {
"line": 23,
"column": 15
},
"end": {
"line": 23,
"column": 26
}
},
"name": "highlighted"
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"start": 577,
"end": 624,
"loc": {
"start": {
"line": 23,
"column": 28
},
"end": {
"line": 25,
"column": 7
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 587,
"end": 616,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 587,
"end": 615,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 36
}
},
"operator": "+=",
"left": {
"type": "Identifier",
"start": 587,
"end": 598,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 19
}
},
"name": "classString"
},
"right": {