UNPKG

rizzo-next

Version:

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

1,363 lines (1,362 loc) 459 kB
{ "type": "Program", "start": 0, "end": 4029, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 143, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 44, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 44 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 9, "end": 18, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 18 } }, "imported": { "type": "Identifier", "start": 9, "end": 18, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 18 } }, "name": "Component" }, "local": { "type": "Identifier", "start": 9, "end": 18, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 18 } }, "name": "Component" } } ], "importKind": "value", "source": { "type": "Literal", "start": 26, "end": 43, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 43 } }, "value": "../../core/bane", "rawValue": "../../core/bane", "raw": "\"../../core/bane\"" } }, { "type": "ImportDeclaration", "start": 45, "end": 95, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 50 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 52, "end": 63, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 } }, "local": { "type": "Identifier", "start": 52, "end": 63, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 18 } }, "name": "RizzoEvents" } } ], "importKind": "value", "source": { "type": "Literal", "start": 69, "end": 94, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 49 } }, "value": "../../core/rizzo_events", "rawValue": "../../core/rizzo_events", "raw": "\"../../core/rizzo_events\"" } }, { "type": "ImportDeclaration", "start": 96, "end": 152, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 56 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 103, "end": 112, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "local": { "type": "Identifier", "start": 103, "end": 112, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 16 } }, "name": "subscribe" } } ], "importKind": "value", "source": { "type": "Literal", "start": 118, "end": 151, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 55 } }, "value": "../../core/decorators/subscribe", "rawValue": "../../core/decorators/subscribe", "raw": "\"../../core/decorators/subscribe\"" } }, { "type": "ImportDeclaration", "start": 153, "end": 201, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 48 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 160, "end": 168, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "local": { "type": "Identifier", "start": 160, "end": 168, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 15 } }, "name": "debounce" } } ], "importKind": "value", "source": { "type": "Literal", "start": 174, "end": 200, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 47 } }, "value": "lodash/function/debounce", "rawValue": "lodash/function/debounce", "raw": "\"lodash/function/debounce\"" } }, { "type": "ExpressionStatement", "start": 202, "end": 229, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 27 } }, "expression": { "type": "CallExpression", "start": 202, "end": 228, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 26 } }, "callee": { "type": "Identifier", "start": 202, "end": 209, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 7 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 210, "end": 227, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 25 } }, "value": "./_sub_nav.scss", "rawValue": "./_sub_nav.scss", "raw": "\"./_sub_nav.scss\"" } ] } }, { "type": "ExportDefaultDeclaration", "start": 231, "end": 4028, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 142, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 246, "end": 4028, "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 142, "column": 1 } }, "id": { "type": "Identifier", "start": 252, "end": 258, "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 27 } }, "name": "SubNav" }, "superClass": { "type": "Identifier", "start": 267, "end": 276, "loc": { "start": { "line": 7, "column": 36 }, "end": { "line": 7, "column": 45 } }, "name": "Component" }, "body": { "type": "ClassBody", "start": 277, "end": 4028, "loc": { "start": { "line": 7, "column": 46 }, "end": { "line": 142, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 281, "end": 3317, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 120, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 281, "end": 291, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 8, "column": 12 } }, "name": "initialize" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 291, "end": 3317, "loc": { "start": { "line": 8, "column": 12 }, "end": { "line": 120, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 294, "end": 3317, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 120, "column": 3 } }, "body": [ { "type": "VariableDeclaration", "start": 300, "end": 419, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 11, "column": 28 } }, "declarations": [ { "type": "VariableDeclarator", "start": 304, "end": 330, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 34 } }, "id": { "type": "Identifier", "start": 304, "end": 311, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 15 } }, "name": "$subNav" }, "init": { "type": "CallExpression", "start": 314, "end": 330, "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 9, "column": 34 } }, "callee": { "type": "Identifier", "start": 314, "end": 315, "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 9, "column": 19 } }, "name": "$" }, "arguments": [ { "type": "Literal", "start": 316, "end": 329, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 33 } }, "value": ".js-sub-nav", "rawValue": ".js-sub-nav", "raw": "\".js-sub-nav\"" } ] } }, { "type": "VariableDeclarator", "start": 340, "end": 389, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 57 } }, "id": { "type": "Identifier", "start": 340, "end": 358, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 26 } }, "name": "$subNavPlaceholder" }, "init": { "type": "CallExpression", "start": 361, "end": 389, "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 57 } }, "callee": { "type": "Identifier", "start": 361, "end": 362, "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 30 } }, "name": "$" }, "arguments": [ { "type": "Literal", "start": 363, "end": 388, "loc": { "start": { "line": 10, "column": 31 }, "end": { "line": 10, "column": 56 } }, "value": ".js-sub-nav-placeholder", "rawValue": ".js-sub-nav-placeholder", "raw": "\".js-sub-nav-placeholder\"" } ] } }, { "type": "VariableDeclarator", "start": 399, "end": 418, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 27 } }, "id": { "type": "Identifier", "start": 399, "end": 406, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 15 } }, "name": "$window" }, "init": { "type": "CallExpression", "start": 409, "end": 418, "loc": { "start": { "line": 11, "column": 18 }, "end": { "line": 11, "column": 27 } }, "callee": { "type": "Identifier", "start": 409, "end": 410, "loc": { "start": { "line": 11, "column": 18 }, "end": { "line": 11, "column": 19 } }, "name": "$" }, "arguments": [ { "type": "Identifier", "start": 411, "end": 417, "loc": { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 26 } }, "name": "window" } ] } } ], "kind": "let" }, { "type": "ExpressionStatement", "start": 425, "end": 448, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 425, "end": 447, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 425, "end": 443, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 22 } }, "object": { "type": "ThisExpression", "start": 425, "end": 429, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 8 } } }, "property": { "type": "Identifier", "start": 430, "end": 443, "loc": { "start": { "line": 13, "column": 9 }, "end": { "line": 13, "column": 22 } }, "name": "contentHeight" }, "computed": false }, "right": { "type": "Literal", "start": 446, "end": 447, "loc": { "start": { "line": 13, "column": 25 }, "end": { "line": 13, "column": 26 } }, "value": 0, "rawValue": 0, "raw": "0" } }, "trailingComments": [ { "type": "Block", "value": "*\n * Checks to see if a given element has been scrolled into view\n * @param {Object} element Element to check\n * @return {Boolean} Is the element in view or not?\n ", "start": 454, "end": 647, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 19, "column": 7 } }, "range": [ 454, 647 ] } ] }, { "type": "VariableDeclaration", "start": 652, "end": 921, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 27, "column": 6 } }, "declarations": [ { "type": "VariableDeclarator", "start": 656, "end": 920, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 27, "column": 5 } }, "id": { "type": "Identifier", "start": 656, "end": 674, "loc": { "start": { "line": 20, "column": 8 }, "end": { "line": 20, "column": 26 } }, "name": "isScrolledIntoView", "leadingComments": null }, "init": { "type": "ArrowFunctionExpression", "start": 677, "end": 920, "loc": { "start": { "line": 20, "column": 29 }, "end": { "line": 27, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 678, "end": 685, "loc": { "start": { "line": 20, "column": 30 }, "end": { "line": 20, "column": 37 } }, "name": "element" } ], "body": { "type": "BlockStatement", "start": 690, "end": 920, "loc": { "start": { "line": 20, "column": 42 }, "end": { "line": 27, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 698, "end": 873, "loc": { "start": { "line": 21, "column": 6 }, "end": { "line": 24, "column": 59 } }, "declarations": [ { "type": "VariableDeclarator", "start": 702, "end": 723, "loc": { "start": { "line": 21, "column": 10 }, "end": { "line": 21, "column": 31 } }, "id": { "type": "Identifier", "start": 702, "end": 710, "loc": { "start": { "line": 21, "column": 10 }, "end": { "line": 21, "column": 18 } }, "name": "$element" }, "init": { "type": "CallExpression", "start": 713, "end": 723, "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 21, "column": 31 } }, "callee": { "type": "Identifier", "start": 713, "end": 714, "loc": { "start": { "line": 21, "column": 21 }, "end": { "line": 21, "column": 22 } }, "name": "$" }, "arguments": [ { "type": "Identifier", "start": 715, "end": 722, "loc": { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 30 } }, "name": "element" } ] } }, { "type": "VariableDeclarator", "start": 735, "end": 766, "loc": { "start": { "line": 22, "column": 10 }, "end": { "line": 22, "column": 41 } }, "id": { "type": "Identifier", "start": 735, "end": 744, "loc": { "start": { "line": 22, "column": 10 }, "end": { "line": 22, "column": 19 } }, "name": "windowTop" }, "init": { "type": "CallExpression", "start": 747, "end": 766, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 41 } }, "callee": { "type": "MemberExpression", "start": 747, "end": 764, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 39 } }, "object": { "type": "Identifier", "start": 747, "end": 754, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 29 } }, "name": "$window" }, "property": { "type": "Identifier", "start": 755, "end": 764, "loc": { "start": { "line": 22, "column": 30 }, "end": { "line": 22, "column": 39 } }, "name": "scrollTop" }, "computed": false }, "arguments": [] } }, { "type": "VariableDeclarator", "start": 778, "end": 812, "loc": { "start": { "line": 23, "column": 10 }, "end": { "line": 23, "column": 44 } }, "id": { "type": "Identifier", "start": 778, "end": 788, "loc": { "start": { "line": 23, "column": 10 }, "end": { "line": 23, "column": 20 } }, "name": "elementTop" }, "init": { "type": "MemberExpression", "start": 791, "end": 812, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 44 } }, "object": { "type": "CallExpression", "start": 791, "end": 808, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 40 } }, "callee": { "type": "MemberExpression", "start": 791, "end": 806, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 38 } }, "object": { "type": "Identifier", "start": 791, "end": 799, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 31 } }, "name": "$element" }, "property": { "type": "Identifier", "start": 800, "end": 806, "loc": { "start": { "line": 23, "column": 32 }, "end": { "line": 23, "column": 38 } }, "name": "offset" }, "computed": false }, "arguments": [] }, "property": { "type": "Identifier", "start": 809, "end": 812, "loc": { "start": { "line": 23, "column": 41 }, "end": { "line": 23, "column": 44 } }, "name": "top" }, "computed": false } }, { "type": "VariableDeclarator", "start": 824, "end": 872, "loc": { "start": { "line": 24, "column": 10 }, "end": { "line": 24, "column": 58 } }, "id": { "type": "Identifier", "start": 824, "end": 835, "loc": { "start": { "line": 24, "column": 10 }, "end": { "line": 24, "column": 21 } }, "name": "viewportTop" }, "init": { "type": "BinaryExpression", "start": 838, "end": 872, "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 58 } }, "left": { "type": "Identifier", "start": 838, "end": 847, "loc": { "start": { "line": 24, "column": 24 }, "end": { "line": 24, "column": 33 } }, "name": "windowTop" },