UNPKG

rizzo-next

Version:

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

1,545 lines (1,544 loc) 314 kB
{ "type": "Program", "start": 0, "end": 3142, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 117, "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": 68, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 23 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 52, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 8 } }, "local": { "type": "Identifier", "start": 52, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 8 } }, "name": "$" } } ], "importKind": "value", "source": { "type": "Literal", "start": 59, "end": 67, "loc": { "start": { "line": 2, "column": 14 }, "end": { "line": 2, "column": 22 } }, "value": "jquery", "rawValue": "jquery", "raw": "\"jquery\"" } }, { "type": "ImportDeclaration", "start": 69, "end": 105, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 76, "end": 86, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "local": { "type": "Identifier", "start": 76, "end": 86, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 17 } }, "name": "PhotoSwipe" } } ], "importKind": "value", "source": { "type": "Literal", "start": 92, "end": 104, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 35 } }, "value": "photoswipe", "rawValue": "photoswipe", "raw": "\"photoswipe\"" } }, { "type": "ImportDeclaration", "start": 106, "end": 179, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 73 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 113, "end": 133, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 27 } }, "local": { "type": "Identifier", "start": 113, "end": 133, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 27 } }, "name": "PhotoSwipeUI_Default" } } ], "importKind": "value", "source": { "type": "Literal", "start": 139, "end": 178, "loc": { "start": { "line": 4, "column": 33 }, "end": { "line": 4, "column": 72 } }, "value": "photoswipe/dist/photoswipe-ui-default", "rawValue": "photoswipe/dist/photoswipe-ui-default", "raw": "\"photoswipe/dist/photoswipe-ui-default\"" }, "trailingComments": [ { "type": "CommentLine", "value": " Keep track of instance IDs", "start": 181, "end": 210, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 29 } }, "range": [ 181, 210 ] } ] }, { "type": "VariableDeclaration", "start": 211, "end": 230, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 19 } }, "declarations": [ { "type": "VariableDeclarator", "start": 215, "end": 229, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 18 } }, "id": { "type": "Identifier", "start": 215, "end": 225, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 14 } }, "name": "instanceId", "leadingComments": null }, "init": { "type": "Literal", "start": 228, "end": 229, "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 18 } }, "value": 0, "rawValue": 0, "raw": "0" }, "leadingComments": null } ], "kind": "let", "leadingComments": [ { "type": "CommentLine", "value": " Keep track of instance IDs", "start": 181, "end": 210, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 29 } }, "range": [ 181, 210 ] } ], "trailingComments": [ { "type": "Block", "value": "*\n * A component for creating an Image Gallery\n ", "start": 232, "end": 284, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 3 } }, "range": [ 232, 284 ] } ] }, { "type": "ExportDefaultDeclaration", "start": 285, "end": 3141, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 116, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 300, "end": 3141, "loc": { "start": { "line": 12, "column": 15 }, "end": { "line": 116, "column": 1 } }, "id": { "type": "Identifier", "start": 306, "end": 327, "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 42 } }, "name": "ImageGalleryComponent", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 336, "end": 345, "loc": { "start": { "line": 12, "column": 51 }, "end": { "line": 12, "column": 60 } }, "name": "Component" }, "body": { "type": "ClassBody", "start": 346, "end": 3141, "loc": { "start": { "line": 12, "column": 61 }, "end": { "line": 116, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 443, "end": 580, "loc": { "start": { "line": 17, "column": 2 }, "end": { "line": 23, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 447, "end": 452, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 11 } }, "name": "$pswp" }, "static": false, "kind": "get", "value": { "type": "FunctionExpression", "start": 452, "end": 580, "loc": { "start": { "line": 17, "column": 11 }, "end": { "line": 23, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 455, "end": 580, "loc": { "start": { "line": 17, "column": 14 }, "end": { "line": 23, "column": 3 } }, "body": [ { "type": "IfStatement", "start": 461, "end": 511, "loc": { "start": { "line": 18, "column": 4 }, "end": { "line": 20, "column": 5 } }, "test": { "type": "MemberExpression", "start": 465, "end": 476, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 19 } }, "object": { "type": "ThisExpression", "start": 465, "end": 469, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 12 } } }, "property": { "type": "Identifier", "start": 470, "end": 476, "loc": { "start": { "line": 18, "column": 13 }, "end": { "line": 18, "column": 19 } }, "name": "_$pswp" }, "computed": false }, "consequent": { "type": "BlockStatement", "start": 478, "end": 511, "loc": { "start": { "line": 18, "column": 21 }, "end": { "line": 20, "column": 5 } }, "body": [ { "type": "ReturnStatement", "start": 486, "end": 505, "loc": { "start": { "line": 19, "column": 6 }, "end": { "line": 19, "column": 25 } }, "argument": { "type": "MemberExpression", "start": 493, "end": 504, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 24 } }, "object": { "type": "ThisExpression", "start": 493, "end": 497, "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 17 } } }, "property": { "type": "Identifier", "start": 498, "end": 504, "loc": { "start": { "line": 19, "column": 18 }, "end": { "line": 19, "column": 24 } }, "name": "_$pswp" }, "computed": false } } ] }, "alternate": null }, { "type": "ReturnStatement", "start": 517, "end": 576, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 63 } }, "argument": { "type": "AssignmentExpression", "start": 524, "end": 575, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 62 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 524, "end": 535, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 22 } }, "object": { "type": "ThisExpression", "start": 524, "end": 528, "loc": { "start": { "line": 22, "column": 11 }, "end": { "line": 22, "column": 15 } } }, "property": { "type": "Identifier", "start": 529, "end": 535, "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 22, "column": 22 } }, "name": "_$pswp" }, "computed": false }, "right": { "type": "CallExpression", "start": 538, "end": 575, "loc": { "start": { "line": 22, "column": 25 }, "end": { "line": 22, "column": 62 } }, "callee": { "type": "MemberExpression", "start": 538, "end": 567, "loc": { "start": { "line": 22, "column": 25 }, "end": { "line": 22, "column": 54 } }, "object": { "type": "CallExpression", "start": 538, "end": 558, "loc": { "start": { "line": 22, "column": 25 }, "end": { "line": 22, "column": 45 } }, "callee": { "type": "Identifier", "start": 538, "end": 539, "loc": { "start": { "line": 22, "column": 25 }, "end": { "line": 22, "column": 26 } }, "name": "$" }, "arguments": [ { "type": "CallExpression", "start": 540, "end": 557, "loc": { "start": { "line": 22, "column": 27 }, "end": { "line": 22, "column": 44 } }, "callee": { "type": "MemberExpression", "start": 540, "end": 553, "loc": { "start": { "line": 22, "column": 27 }, "end": { "line": 22, "column": 40 } }, "object": { "type": "ThisExpression", "start": 540, "end": 544, "loc": { "start": { "line": 22, "column": 27 }, "end": { "line": 22, "column": 31 } } }, "property": { "type": "Identifier", "start": 545, "end": 553, "loc": { "start": { "line": 22, "column": 32 }, "end": { "line": 22, "column": 40 } }, "name": "template" }, "computed": false }, "arguments": [ { "type": "ObjectExpression", "start": 554, "end": 556, "loc": { "start": { "line": 22, "column": 41 }, "end": { "line": 22, "column": 43 } }, "properties": [] } ] } ] }, "property": { "type": "Identifier", "start": 559, "end": 567, "loc": { "start": { "line": 22, "column": 46 }, "end": { "line": 22, "column": 54 } }, "name": "appendTo" }, "computed": false }, "arguments": [ { "type": "Literal", "start": 568, "end": 574, "loc": { "start": { "line": 22, "column": 55 }, "end": { "line": 22, "column": 61 } }, "value": "body", "rawValue": "body", "raw": "\"body\"" } ] } } } ] } }, "leadingComments": [ { "type": "Block", "value": "*\n * Render the gallery viewer\n * @return {jQuery} Returns the gallery element\n ", "start": 350, "end": 440, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 16, "column": 5 } }, "range": [ 350, 440 ] } ] }, { "type": "MethodDefinition", "start": 583, "end": 961, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 39, "column": 3 } }, "computed": false, "key": { "type": "Identifier", "start": 583, "end": 593, "loc": { "start": { "line": 24, "column": 2 }, "end": { "line": 24, "column": 12 } }, "name": "initialize" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 593, "end": 961, "loc": { "start": { "line": 24, "column": 12 }, "end": { "line": 39, "column": 3 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "AssignmentPattern", "start": 594, "end": 666, "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 26, "column": 8 } }, "left": { "type": "ObjectPattern", "start": 594, "end": 661, "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 26, "column": 3 } }, "properties": [ { "type": "Property", "start": 600, "end": 657, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 61 } }, "method": false, "shorthand": true, "computed": false, "key": { "type": "Identifier", "start": 600, "end": 620, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 24 } }, "name": "galleryImageSelector" }, "kind": "init", "value": { "type": "AssignmentPattern", "start": 600, "end": 657, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 61 } }, "left": { "type": "Identifier", "start": 600, "end": 620, "loc": { "start": { "line": 25, "column": 4 }, "end": { "line": 25, "column": 24 } }, "name": "galleryImageSelector" }, "right": { "type": "Literal", "start": 623, "end": 657, "loc": { "start": { "line": 25, "column": 27 }, "end": { "line": 25, "column": 61 } }, "value": ".stack__article__image-container", "rawValue": ".stack__article__image-container", "raw": "\".stack__article__image-container\"" } } } ] }, "right": { "type": "ObjectExpression", "start": 664, "end": 666, "loc": { "start": { "line": 26, "column": 6 }, "end": { "line": 26, "column": 8 } }, "properties": [] } } ], "body": { "type": "BlockStatement", "start": 668, "end": 961, "loc": { "start": { "line": 26, "column": 10 }, "end": { "line": 39, "column": 3 } }, "body": [ { "type": "ExpressionStatement", "start": 674, "end": 721, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 51 } }, "expression": { "type": "AssignmentExpression", "start": 674, "end": 720, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 50 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 674, "end": 687, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 17 } }, "object": { "type": "ThisExpression", "start": 674, "end": 678, "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 8 } } }, "property": { "type": "Identifier", "start": 679, "end": 687, "loc": { "start": { "line": 27, "column": 9 }, "end": { "line": 27, "column": 17 } }, "name": "template" }, "computed": false }, "right": { "type": "CallExpression", "start": 690, "end": 720, "loc": { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 50 } }, "callee": { "type": "Identifier", "start": 690, "end": 697, "loc": { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 27 } }, "name": "require" }, "arguments": [ { "type": "Literal", "start": 698, "end": 719, "loc": { "start": { "line": 27, "column": 28 }, "end": { "line": 27, "column": 49 } }, "value": "./image_gallery.hbs", "rawValue": "./image_gallery.hbs", "raw": "\"./image_gallery.hbs\"" } ] } } }, { "type": "ExpressionStatement", "start": 727, "end": 778, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 55 } }, "expression": { "type": "AssignmentExpression", "start": 727, "end": 777, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 54 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 727, "end": 739, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 16 } }, "object": { "type": "ThisExpression", "start": 727, "end": 731, "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 8 } } }, "property": { "type": "Identifier", "start": 732, "end": 739, "loc": { "start": { "line": 29, "column": 9 }, "end": { "line": 29, "column": 16 } }, "name": "$images" }, "computed": false }, "right": { "type": "CallExpression", "start": 742, "end": 777, "loc": { "start": { "line": 29, "column": 19 }, "end": { "line": 29, "column": 54 } }, "callee": { "type": "MemberExpression", "start": 742, "end": 755, "loc": { "start": { "line": 29, "column": 19 }, "end": { "line": 29, "column": 32 } }, "object": { "type": "MemberExpression", "start": 742, "end": 750, "loc": { "start": { "line": 29, "column": 19 }, "end": { "line": 29, "column": 27 } }, "object": { "type": "ThisExpression", "start": 742, "end": 746, "loc": { "start": { "line": 29, "column": 19 }, "end": { "line": 29, "column": 23 } } }, "property": { "type": "Identifier", "start": 747, "end": 750, "loc": { "start": { "line": 29, "column": 24 }, "end": { "line": 29, "column": 27 } }, "name": "$el" }, "computed": false }, "property": { "type": "Identifier", "start": 751, "end": 755, "loc": { "start": { "line": 29, "column": 28 }, "end": { "line": 29, "column": 32 } }, "name": "find" }, "computed": false }, "arguments": [ { "type": "Identifier", "start": 756, "end": 776, "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 53 } }, "name": "galleryImageSelector" } ] } } }, { "type": "ExpressionStatement", "start": 784, "end": 864, "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 33, "column": 6 } }, "expression": { "type": "AssignmentExpression", "start": 784, "end": 863, "loc": { "start": { "line": 31,