UNPKG

rizzo-next

Version:

The next generation of Lonely Planet's style guide and pattern library.

1,399 lines 187 kB
{ "type": "Program", "start": 0, "end": 1581, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 52, "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\"" } }, { "type": "ImportDeclaration", "start": 64, "end": 103, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 71, "end": 77, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 71, "end": 77, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "name": "$clamp" } } ], "importKind": "value", "source": { "type": "Literal", "start": 83, "end": 102, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 38 } }, "value": "clamp-js/clamp.js", "rawValue": "clamp-js/clamp.js", "raw": "\"clamp-js/clamp.js\"" } }, { "type": "ExportDefaultDeclaration", "start": 105, "end": 1580, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 51, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 120, "end": 1580, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 51, "column": 1 } }, "id": { "type": "Identifier", "start": 126, "end": 144, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 39 } }, "name": "SidebarDetailsView" }, "superClass": { "type": "MemberExpression", "start": 153, "end": 168, "loc": { "start": { "line": 5, "column": 48 }, "end": { "line": 5, "column": 63 } }, "object": { "type": "Identifier", "start": 153, "end": 158, "loc": { "start": { "line": 5, "column": 48 }, "end": { "line": 5, "column": 53 } }, "name": "React" }, "property": { "type": "Identifier", "start": 159, "end": 168, "loc": { "start": { "line": 5, "column": 54 }, "end": { "line": 5, "column": 63 } }, "name": "Component" }, "computed": false }, "body": { "type": "ClassBody", "start": 168, "end": 1580, "loc": { "start": { "line": 5, "column": 63 }, "end": { "line": 51, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 172, "end": 274, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 10, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 172, "end": 189, "loc": { "start": { "line": 6, "column": 2 }, "end": { "line": 6, "column": 19 } }, "name": "componentDidMount" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 189, "end": 274, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 10, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 192, "end": 274, "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 10, "column": 3 } }, "body": [ { "type": "VariableDeclaration", "start": 198, "end": 239, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 45 } }, "declarations": [ { "type": "VariableDeclarator", "start": 202, "end": 238, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 44 } }, "id": { "type": "Identifier", "start": 202, "end": 204, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 10 } }, "name": "el" }, "init": { "type": "CallExpression", "start": 207, "end": 238, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 207, "end": 236, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 42 } }, "object": { "type": "MemberExpression", "start": 207, "end": 225, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 31 } }, "object": { "type": "MemberExpression", "start": 207, "end": 216, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 22 } }, "object": { "type": "ThisExpression", "start": 207, "end": 211, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 17 } } }, "property": { "type": "Identifier", "start": 212, "end": 216, "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 7, "column": 22 } }, "name": "refs" }, "computed": false }, "property": { "type": "Identifier", "start": 217, "end": 225, "loc": { "start": { "line": 7, "column": 23 }, "end": { "line": 7, "column": 31 } }, "name": "poiTitle" }, "computed": false }, "property": { "type": "Identifier", "start": 226, "end": 236, "loc": { "start": { "line": 7, "column": 32 }, "end": { "line": 7, "column": 42 } }, "name": "getDOMNode" }, "computed": false }, "arguments": [] } } ], "kind": "let" }, { "type": "ExpressionStatement", "start": 245, "end": 270, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 29 } }, "expression": { "type": "CallExpression", "start": 245, "end": 269, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 28 } }, "callee": { "type": "Identifier", "start": 245, "end": 251, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 10 } }, "name": "$clamp" }, "arguments": [ { "type": "Identifier", "start": 252, "end": 254, "loc": { "start": { "line": 9, "column": 11 }, "end": { "line": 9, "column": 13 } }, "name": "el" }, { "type": "ObjectExpression", "start": 256, "end": 268, "loc": { "start": { "line": 9, "column": 15 }, "end": { "line": 9, "column": 27 } }, "properties": [ { "type": "Property", "start": 258, "end": 266, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 25 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 258, "end": 263, "loc": { "start": { "line": 9, "column": 17 }, "end": { "line": 9, "column": 22 } }, "name": "clamp" }, "value": { "type": "Literal", "start": 265, "end": 266, "loc": { "start": { "line": 9, "column": 24 }, "end": { "line": 9, "column": 25 } }, "value": 2, "rawValue": 2, "raw": "2" }, "kind": "init" } ] } ] } } ] } } }, { "type": "MethodDefinition", "start": 277, "end": 1505, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 44, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 277, "end": 283, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 8 } }, "name": "render" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 283, "end": 1505, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 44, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 286, "end": 1505, "loc": { "start": { "line": 11, "column": 11 }, "end": { "line": 44, "column": 3 } }, "body": [ { "type": "VariableDeclaration", "start": 292, "end": 462, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 15, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", "start": 296, "end": 316, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 28 } }, "id": { "type": "Identifier", "start": 296, "end": 299, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 11 } }, "name": "poi" }, "init": { "type": "MemberExpression", "start": 302, "end": 316, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 28 } }, "object": { "type": "MemberExpression", "start": 302, "end": 312, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 24 } }, "object": { "type": "ThisExpression", "start": 302, "end": 306, "loc": { "start": { "line": 12, "column": 14 }, "end": { "line": 12, "column": 18 } } }, "property": { "type": "Identifier", "start": 307, "end": 312, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 24 } }, "name": "props" }, "computed": false }, "property": { "type": "Identifier", "start": 313, "end": 316, "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 28 } }, "name": "poi" }, "computed": false } }, { "type": "VariableDeclarator", "start": 326, "end": 336, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 18 } }, "id": { "type": "Identifier", "start": 326, "end": 331, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 13 } }, "name": "image" }, "init": { "type": "Literal", "start": 334, "end": 336, "loc": { "start": { "line": 13, "column": 16 }, "end": { "line": 13, "column": 18 } }, "value": "", "rawValue": "", "raw": "\"\"" } }, { "type": "VariableDeclarator", "start": 412, "end": 461, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 57 } }, "id": { "type": "Identifier", "start": 412, "end": 416, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 12 } }, "name": "slug", "leadingComments": null }, "init": { "type": "TemplateLiteral", "start": 419, "end": 461, "loc": { "start": { "line": 15, "column": 15 }, "end": { "line": 15, "column": 57 } }, "expressions": [ { "type": "MemberExpression", "start": 451, "end": 459, "loc": { "start": { "line": 15, "column": 47 }, "end": { "line": 15, "column": 55 } }, "object": { "type": "Identifier", "start": 451, "end": 454, "loc": { "start": { "line": 15, "column": 47 }, "end": { "line": 15, "column": 50 } }, "name": "poi" }, "property": { "type": "Identifier", "start": 455, "end": 459, "loc": { "start": { "line": 15, "column": 51 }, "end": { "line": 15, "column": 55 } }, "name": "slug" }, "computed": false } ], "quasis": [ { "type": "TemplateElement", "start": 420, "end": 449, "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 45 } }, "value": { "raw": "https://www.lonelyplanet.com/", "cooked": "https://www.lonelyplanet.com/" }, "tail": false }, { "type": "TemplateElement", "start": 460, "end": 460, "loc": { "start": { "line": 15, "column": 56 }, "end": { "line": 15, "column": 56 } }, "value": { "raw": "", "cooked": "" }, "tail": true } ] }, "leadingComments": [ { "type": "CommentLine", "value": " TODO Switch back to just ${poi.slug} once this is live", "start": 346, "end": 403, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 65 } }, "range": [ 346, 403 ] } ] } ], "kind": "let" }, { "type": "IfStatement", "start": 468, "end": 704, "loc": { "start": { "line": 17, "column": 4 }, "end": { "line": 22, "column": 5 } }, "test": { "type": "MemberExpression", "start": 472, "end": 496, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 32 } }, "object": { "type": "MemberExpression", "start": 472, "end": 490, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 26 } }, "object": { "type": "MemberExpression", "start": 472, "end": 479, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 15 } }, "object": { "type": "Identifier", "start": 472, "end": 475, "loc": { "start": { "line": 17, "column": 8 }, "end": { "line": 17, "column": 11 } }, "name": "poi" }, "property": { "type": "Identifier", "start": 476, "end": 479, "loc": { "start": { "line": 17, "column": 12 }, "end": { "line": 17, "column": 15 } }, "name": "geo" }, "computed": false }, "property": { "type": "Identifier", "start": 480, "end": 490, "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 17, "column": 26 } }, "name": "properties" }, "computed": false }, "property": { "type": "Identifier", "start": 491, "end": 496, "loc": { "start": { "line": 17, "column": 27 }, "end": { "line": 17, "column": 32 } }, "name": "image" }, "computed": false }, "consequent": { "type": "BlockStatement", "start": 498, "end": 704, "loc": { "start": { "line": 17, "column": 34 }, "end": { "line": 22, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 506, "end": 598, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 98 } }, "declarations": [ { "type": "VariableDeclarator", "start": 510, "end": 597, "loc": { "start": { "line": 18, "column": 10 }, "end": { "line": 18, "column": 97 } }, "id": { "type": "Identifier", "start": 510, "end": 516, "loc": { "start": { "line": 18, "column": 10 }, "end": { "line": 18, "column": 16 } }, "name": "imgSrc" }, "init": { "type": "TemplateLiteral", "start": 519, "end": 597, "loc": { "start": { "line": 18, "column": 19 }, "end": { "line": 18, "column": 97 } }, "expressions": [ { "type": "MemberExpression", "start": 571, "end": 595, "loc": { "start": { "line": 18, "column": 71 }, "end": { "line": 18, "column": 95 } }, "object": { "type": "MemberExpression", "start": 571, "end": 589, "loc": { "start": { "line": 18, "column": 71 }, "end": { "line": 18, "column": 89 } }, "object": { "type": "MemberExpression", "start": 571, "end": 578, "loc": { "start": { "line": 18, "column": 71 }, "end": { "line": 18, "column": 78 } }, "object": { "type": "Identifier", "start": 571, "end": 574, "loc": { "start": { "line": 18, "column": 71 }, "end": { "line": 18, "column": 74 } }, "name": "poi" }, "property": { "type": "Identifier", "start": 575, "end": 578, "loc": { "start": { "line": 18, "column": 75 }, "end": { "line": 18, "column": 78 } }, "name": "geo" }, "computed": false }, "property": { "type": "Identifier", "start": 579, "end": 589, "loc": { "start": { "line": 18, "column": 79 }, "end": { "line": 18, "col