UNPKG

rizzo-next

Version:

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

1,733 lines (1,732 loc) 942 kB
{ "type": "Program", "start": 0, "end": 5864, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 160, "column": 0 } }, "sourceType": "module", "body": [ { "type": "VariableDeclaration", "start": 0, "end": 263, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 6, "column": 34 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, "end": 44, "loc": { "start": { "line": 1, "column": 4 }, "end": { "line": 1, "column": 44 } }, "id": { "type": "Identifier", "start": 4, "end": 8, "loc": { "start": { "line": 1, "column": 4 }, "end": { "line": 1, "column": 8 } }, "name": "each" }, "init": { "type": "CallExpression", "start": 11, "end": 44, "loc": { "start": { "line": 1, "column": 11 }, "end": { "line": 1, "column": 44 } }, "callee": { "type": "Identifier", "start": 11, "end": 18, "loc": { "start": { "line": 1, "column": 11 }, "end": { "line": 1, "column": 18 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 19, "end": 43, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 43 } }, "value": "lodash/collection/each", "rawValue": "lodash/collection/each", "raw": "\"lodash/collection/each\"" } ] } }, { "type": "VariableDeclarator", "start": 50, "end": 88, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 42 } }, "id": { "type": "Identifier", "start": 50, "end": 54, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 8 } }, "name": "once" }, "init": { "type": "CallExpression", "start": 57, "end": 88, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 42 } }, "callee": { "type": "Identifier", "start": 57, "end": 64, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 18 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 65, "end": 87, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 41 } }, "value": "lodash/function/once", "rawValue": "lodash/function/once", "raw": "\"lodash/function/once\"" } ] } }, { "type": "VariableDeclarator", "start": 94, "end": 130, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 40 } }, "id": { "type": "Identifier", "start": 94, "end": 98, "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 8 } }, "name": "keys" }, "init": { "type": "CallExpression", "start": 101, "end": 130, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 40 } }, "callee": { "type": "Identifier", "start": 101, "end": 108, "loc": { "start": { "line": 3, "column": 11 }, "end": { "line": 3, "column": 18 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 109, "end": 129, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 39 } }, "value": "lodash/object/keys", "rawValue": "lodash/object/keys", "raw": "\"lodash/object/keys\"" } ] } }, { "type": "VariableDeclarator", "start": 136, "end": 176, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 44 } }, "id": { "type": "Identifier", "start": 136, "end": 143, "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 11 } }, "name": "isEmpty" }, "init": { "type": "CallExpression", "start": 146, "end": 176, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 44 } }, "callee": { "type": "Identifier", "start": 146, "end": 153, "loc": { "start": { "line": 4, "column": 14 }, "end": { "line": 4, "column": 21 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 154, "end": 175, "loc": { "start": { "line": 4, "column": 22 }, "end": { "line": 4, "column": 43 } }, "value": "lodash/lang/isEmpty", "rawValue": "lodash/lang/isEmpty", "raw": "\"lodash/lang/isEmpty\"" } ] } }, { "type": "VariableDeclarator", "start": 182, "end": 227, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 49 } }, "id": { "type": "Identifier", "start": 182, "end": 190, "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 12 } }, "name": "uniqueId" }, "init": { "type": "CallExpression", "start": 193, "end": 227, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 5, "column": 49 } }, "callee": { "type": "Identifier", "start": 193, "end": 200, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 5, "column": 22 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 201, "end": 226, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 48 } }, "value": "lodash/utility/uniqueId", "rawValue": "lodash/utility/uniqueId", "raw": "\"lodash/utility/uniqueId\"" } ] } }, { "type": "VariableDeclarator", "start": 233, "end": 262, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 33 } }, "id": { "type": "Identifier", "start": 233, "end": 238, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 9 } }, "name": "slice" }, "init": { "type": "MemberExpression", "start": 241, "end": 262, "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 33 } }, "object": { "type": "MemberExpression", "start": 241, "end": 256, "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 27 } }, "object": { "type": "Identifier", "start": 241, "end": 246, "loc": { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 17 } }, "name": "Array" }, "property": { "type": "Identifier", "start": 247, "end": 256, "loc": { "start": { "line": 6, "column": 18 }, "end": { "line": 6, "column": 27 } }, "name": "prototype" }, "computed": false }, "property": { "type": "Identifier", "start": 257, "end": 262, "loc": { "start": { "line": 6, "column": 28 }, "end": { "line": 6, "column": 33 } }, "name": "slice" }, "computed": false } } ], "kind": "let", "trailingComments": [ { "type": "CommentLine", "value": " Regular expression used to split event strings.", "start": 265, "end": 315, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 50 } }, "range": [ 265, 315 ] } ] }, { "type": "VariableDeclaration", "start": 316, "end": 342, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 26 } }, "declarations": [ { "type": "VariableDeclarator", "start": 320, "end": 341, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 25 } }, "id": { "type": "Identifier", "start": 320, "end": 333, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 17 } }, "name": "eventSplitter", "leadingComments": null }, "init": { "type": "Literal", "start": 336, "end": 341, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 25 } }, "value": {}, "rawValue": {}, "raw": "/\\s+/", "regex": { "pattern": "\\s+", "flags": "" } }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentLine", "value": " Regular expression used to split event strings.", "start": 265, "end": 315, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 50 } }, "range": [ 265, 315 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " Implement fancy features of the Events API such as multiple event", "start": 344, "end": 412, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 11, "column": 68 } }, "range": [ 344, 412 ] }, { "type": "CommentLine", "value": " names `\"change blur\"` and jQuery-style event maps `{change: action}`", "start": 413, "end": 484, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 71 } }, "range": [ 413, 484 ] }, { "type": "CommentLine", "value": " in terms of the existing API.", "start": 485, "end": 517, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 32 } }, "range": [ 485, 517 ] } ] }, { "type": "FunctionDeclaration", "start": 518, "end": 1037, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 35, "column": 1 } }, "id": { "type": "Identifier", "start": 527, "end": 536, "loc": { "start": { "line": 14, "column": 9 }, "end": { "line": 14, "column": 18 } }, "name": "eventsApi", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 537, "end": 540, "loc": { "start": { "line": 14, "column": 19 }, "end": { "line": 14, "column": 22 } }, "name": "obj" }, { "type": "Identifier", "start": 542, "end": 548, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 30 } }, "name": "action" }, { "type": "Identifier", "start": 550, "end": 554, "loc": { "start": { "line": 14, "column": 32 }, "end": { "line": 14, "column": 36 } }, "name": "name" }, { "type": "Identifier", "start": 556, "end": 560, "loc": { "start": { "line": 14, "column": 38 }, "end": { "line": 14, "column": 42 } }, "name": "rest" } ], "body": { "type": "BlockStatement", "start": 562, "end": 1037, "loc": { "start": { "line": 14, "column": 44 }, "end": { "line": 35, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 566, "end": 589, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 25 } }, "test": { "type": "UnaryExpression", "start": 570, "end": 575, "loc": { "start": { "line": 15, "column": 6 }, "end": { "line": 15, "column": 11 } }, "operator": "!", "prefix": true, "argument": { "type": "Identifier", "start": 571, "end": 575, "loc": { "start": { "line": 15, "column": 7 }, "end": { "line": 15, "column": 11 } }, "name": "name" } }, "consequent": { "type": "ReturnStatement", "start": 577, "end": 589, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 25 } }, "argument": { "type": "Literal", "start": 584, "end": 588, "loc": { "start": { "line": 15, "column": 20 }, "end": { "line": 15, "column": 24 } }, "value": true, "rawValue": true, "raw": "true" }, "trailingComments": null }, "alternate": null, "trailingComments": [ { "type": "CommentLine", "value": " Handle event maps.", "start": 593, "end": 614, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 23 } }, "range": [ 593, 614 ] } ] }, { "type": "IfStatement", "start": 617, "end": 765, "loc": { "start": { "line": 18, "column": 2 }, "end": { "line": 23, "column": 3 } }, "test": { "type": "BinaryExpression", "start": 621, "end": 645, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 30 } }, "left": { "type": "UnaryExpression", "start": 621, "end": 632, "loc": { "start": { "line": 18, "column": 6 }, "end": { "line": 18, "column": 17 } }, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", "start": 628, "end": 632, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 17 } }, "name": "name", "leadingComments": null }, "leadingComments": null }, "operator": "===", "right": { "type": "Literal", "start": 637, "end": 645, "loc": { "start": { "line": 18, "column": 22 }, "end": { "line": 18, "column": 30 } }, "value": "object", "rawValue": "object", "raw": "\"object\"" }, "leadingComments": null }, "consequent": { "type": "BlockStatement", "start": 647, "end": 765, "loc": { "start": { "line": 18, "column": 32 }, "end": { "line": 23, "column": 3 } }, "body": [ { "type": "ForInStatement", "start": 653, "end": 743, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 21, "column": 5 } }, "left": { "type": "VariableDeclaration", "start": 658, "end": 665, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 16 } }, "declarations": [ { "type": "VariableDeclarator", "start": 662, "end": 665, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 16 } }, "id": { "type": "Identifier", "start": 662, "end": 665, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 16 } }, "name": "key" }, "init": null } ], "kind": "let" }, "right": { "type": "Identifier", "start": 669, "end": 673, "loc": { "start": { "line": 19, "column": 20 }, "end": { "line": 19, "column": 24 } }, "name": "name" }, "body": { "type": "BlockStatement", "start": 675, "end": 743, "loc": { "start": { "line": 19, "column": 26 }, "end": { "line": 21, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 683, "end": 737, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 60 } }, "expression": { "type": "CallExpression", "start": 683, "end": 736, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 59 } }, "callee": { "type": "MemberExpression", "start": 683, "end": 700, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 23 } }, "object": { "type": "MemberExpression", "start": 683, "end": 694, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 17 } }, "object": { "type": "Identifier", "start": 683, "end": 686, "loc": { "start": { "line": 20, "column": 6 }, "end": { "line": 20, "column": 9 } }, "name": "obj" }, "property": { "type": "Identifier", "start": 687, "end": 693, "loc": { "start": { "line": 20, "column": 10 }, "end": { "line": 20, "column": 16 } }, "name": "action" }, "computed": true }, "property": { "type": "Identifier", "start": 695, "end": 700, "loc": { "start": { "line": 20, "column": 18 }, "end": { "line": 20, "column": 23 } }, "name": "apply" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 701, "end": 704, "loc": { "start": { "line": 20, "column": 24 }, "end": { "line": 20, "column": 27 } }, "name": "obj" }, { "type": "CallExpression", "start": 706, "end": 735, "loc": { "start": { "line": 20, "column": 29 }, "end": { "line": 20, "column": 58 } }, "callee": { "type": "MemberExpression", "start": 706, "end": 729, "loc": { "start": { "line": 20, "column": 29 }, "end": { "line": 20, "column": 52 } }, "object": { "type": "ArrayExpression", "start": 706, "end": 722, "loc": { "start": { "line": 20, "column": 29 }, "end": { "line": 20, "column": 45 } }, "elements": [ { "type": "Identifier", "start": 707, "end": 710, "loc": { "start": { "line": 20, "column": 30 }, "end": { "line": 20, "column": 33 } }, "name": "key" }, { "type": "MemberExpression", "start": 712, "end": 721, "loc": { "start": { "line": 20, "column": 35 }, "end": { "line": 20, "column": 44 } }, "object": { "type": "Identifier", "start": 712, "end": 716, "loc": { "start": { "line": 20, "column": 35 }, "end": { "line": 20, "column": 39 } }, "name": "name" }, "property": { "type": "Identifier", "start": 717, "end": 720, "loc": { "start": { "line": 20, "column": 40 }, "end": { "line": 20, "column": 43 } }, "name": "key" }, "computed": true } ] }, "property": { "type": "Identifier", "start": 723, "end": 729, "loc": { "start": { "line": 20, "column": 46 }, "end": { "line": 20, "column": 52 } }, "name": "concat" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 730, "end": 734, "loc": { "start": { "line": 20, "column": 53 }, "end": { "line": 20, "column": 57 } }, "name": "rest" } ] } ] } } ] } }, { "type": "ReturnStatement", "start": 748, "end": 761, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 17 } }, "argument": { "type": "Literal", "start": 755, "end": 760, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 16 } }, "value": false, "rawValue": false, "raw": "false" } } ], "trailingComments": null }, "alternate": null, "leadingComments": [ { "type": "CommentLine", "value": " Handle event maps.", "start": 593, "end": 614, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 17, "column": 23 } }, "range": [ 593, 614 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " Handle space separated event names.", "start": 769, "end": 807, "loc": { "start": { "line": 25, "column": 2 }, "end": { "line": 25, "column": 40 } }, "range": [ 769, 807 ] } ] }, { "type": "IfStatement", "start": 810, "end": 1019, "loc": { "start": { "line": 26, "column": 2 }, "end": { "line": 32, "column": 3 } }, "test": { "type": "CallExpression", "start": 814, "end": 838, "loc": { "start": { "line": 26, "column": 6 }, "end": { "line": 26, "column": 30 } }, "callee": { "type": "MemberExpression", "start": 814, "end": 832, "loc": { "start": { "line": 26, "column": 6 }, "end": { "line": 26, "column": 24 } }, "object": { "type": "Identifier", "start": 814, "end": 827, "loc": { "start": { "line": 26, "column": 6 }, "end": { "line": 26, "column": 19 } }, "name": "eventSplitter", "leadingComments": null }, "property": { "type": "Identifier", "start": 828, "end": 832, "loc": { "start": { "line": 26, "column": 20 }, "end": { "line": 26, "column": 24 } }, "name": "test" }, "computed": false, "leadingComments": null }, "arguments": [ { "type": "Identifier", "start": 833, "end": 837, "loc": { "start": { "line": 26, "column": 25 }, "end": { "line": 26, "column": 29 } }, "name": "name" } ], "leadingComments": null }, "consequent": { "type": "BlockStatement", "start": 840, "end": 1019, "loc": { "start": { "line": 26, "column": 32 }, "end": { "line": 32, "column": 3 } }, "body": [ { "type": "VariableDeclaration", "start": 846, "end": 884, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 42 } }, "declarations": [ { "type": "VariableDeclarator", "start": 850, "end": 883, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 41 } }, "id": { "type": "Identifier", "start": 850, "end": 855, "loc": { "start": { "line": 27, "column": 8 }, "end": { "line": 27, "column": 13 } }, "name": "names" }, "init": { "type": "CallExpression", "start": 858, "end": 883, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 41 } }, "callee": { "type": "MemberExpression", "start": 858, "end": 868, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 26 } }, "object": { "type": "Identifier", "start": 858, "end": 862, "loc": { "start": { "line": 27, "column": 16 }, "end": { "line": 27, "column": 20 } }, "name": "name" }, "property": { "type": "Identifier", "start": 863, "end": 868, "loc": { "start": { "line": 27, "column": 21 }, "end": { "line": 27, "column": 26 } }, "name": "split" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 869, "end": 882,