rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,713 lines (1,712 loc) • 352 kB
JSON
{
"type": "Program",
"start": 0,
"end": 5129,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 190,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 23
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 8
}
},
"name": "$"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 14,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 22
}
},
"value": "jquery",
"rawValue": "jquery",
"raw": "\"jquery\""
}
},
{
"type": "ImportDeclaration",
"start": 24,
"end": 61,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 37
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 31,
"end": 37,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 31,
"end": 37,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"name": "Events"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 43,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 36
}
},
"value": "./mixins/events",
"rawValue": "./mixins/events",
"raw": "\"./mixins/events\""
}
},
{
"type": "ImportDeclaration",
"start": 62,
"end": 104,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 42
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 69,
"end": 75,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 69,
"end": 75,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 13
}
},
"name": "assign"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 81,
"end": 103,
"loc": {
"start": {
"line": 3,
"column": 19
},
"end": {
"line": 3,
"column": 41
}
},
"value": "lodash/object/assign",
"rawValue": "lodash/object/assign",
"raw": "\"lodash/object/assign\""
}
},
{
"type": "ImportDeclaration",
"start": 105,
"end": 143,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 38
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 112,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 112,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 11
}
},
"name": "pick"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 122,
"end": 142,
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 37
}
},
"value": "lodash/object/pick",
"rawValue": "lodash/object/pick",
"raw": "\"lodash/object/pick\""
}
},
{
"type": "ImportDeclaration",
"start": 144,
"end": 184,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 40
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 151,
"end": 155,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 151,
"end": 155,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 11
}
},
"name": "bind"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 161,
"end": 183,
"loc": {
"start": {
"line": 5,
"column": 17
},
"end": {
"line": 5,
"column": 39
}
},
"value": "lodash/function/bind",
"rawValue": "lodash/function/bind",
"raw": "\"lodash/function/bind\""
}
},
{
"type": "ImportDeclaration",
"start": 185,
"end": 227,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 42
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 192,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 192,
"end": 196,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 11
}
},
"name": "each"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 202,
"end": 226,
"loc": {
"start": {
"line": 6,
"column": 17
},
"end": {
"line": 6,
"column": 41
}
},
"value": "lodash/collection/each",
"rawValue": "lodash/collection/each",
"raw": "\"lodash/collection/each\""
}
},
{
"type": "ImportDeclaration",
"start": 228,
"end": 275,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 235,
"end": 243,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 235,
"end": 243,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 15
}
},
"name": "uniqueId"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 249,
"end": 274,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 46
}
},
"value": "lodash/utility/uniqueId",
"rawValue": "lodash/utility/uniqueId",
"raw": "\"lodash/utility/uniqueId\""
}
},
{
"type": "ImportDeclaration",
"start": 276,
"end": 322,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 46
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 283,
"end": 289,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 283,
"end": 289,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 13
}
},
"name": "postal"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 295,
"end": 321,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 45
}
},
"value": "postal/lib/postal.lodash",
"rawValue": "postal/lib/postal.lodash",
"raw": "\"postal/lib/postal.lodash\""
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Can pass in options that contains these keys. They will automatically be added to `this`",
"start": 324,
"end": 415,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 91
}
},
"range": [
324,
415
]
}
]
},
{
"type": "VariableDeclaration",
"start": 416,
"end": 468,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 52
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 420,
"end": 467,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 51
}
},
"id": {
"type": "Identifier",
"start": 420,
"end": 433,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 17
}
},
"name": "listOfOptions",
"leadingComments": null
},
"init": {
"type": "ArrayExpression",
"start": 436,
"end": 467,
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 51
}
},
"elements": [
{
"type": "Literal",
"start": 438,
"end": 442,
"loc": {
"start": {
"line": 11,
"column": 22
},
"end": {
"line": 11,
"column": 26
}
},
"value": "el",
"rawValue": "el",
"raw": "\"el\""
},
{
"type": "Literal",
"start": 444,
"end": 452,
"loc": {
"start": {
"line": 11,
"column": 28
},
"end": {
"line": 11,
"column": 36
}
},
"value": "events",
"rawValue": "events",
"raw": "\"events\""
},
{
"type": "Literal",
"start": 454,
"end": 465,
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 49
}
},
"value": "container",
"rawValue": "container",
"raw": "\"container\""
}
]
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentLine",
"value": " Can pass in options that contains these keys. They will automatically be added to `this`",
"start": 324,
"end": 415,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 91
}
},
"range": [
324,
415
]
}
],
"trailingComments": [
{
"type": "CommentLine",
"value": " Regex for the \"click .foo .bar\" in the events",
"start": 469,
"end": 517,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 12,
"column": 48
}
},
"range": [
469,
517
]
}
]
},
{
"type": "VariableDeclaration",
"start": 518,
"end": 563,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 45
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 522,
"end": 562,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 44
}
},
"id": {
"type": "Identifier",
"start": 522,
"end": 543,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 25
}
},
"name": "delegateEventSplitter",
"leadingComments": null
},
"init": {
"type": "Literal",
"start": 546,
"end": 562,
"loc": {
"start": {
"line": 13,
"column": 28
},
"end": {
"line": 13,
"column": 44
}
},
"value": {},
"rawValue": {},
"raw": "/^(\\S+)\\s*(.*)$/",
"regex": {
"pattern": "^(\\S+)\\s*(.*)$",
"flags": ""
}
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentLine",
"value": " Regex for the \"click .foo .bar\" in the events",
"start": 469,
"end": 517,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 12,
"column": 48
}
},
"range": [
469,
517
]
}
],
"trailingComments": [
{
"type": "Block",
"value": "*\n* The main class that will be extended when a new componenet is created.\n* Extend this class with es6 syntax.\n* @example\n* import { Component } from \"./core/bane\"\n* \n* class ArticlesComponent extends Component {\n* initialize() {\n* this.events = {\n* \"click .foo\": \"fooClicked\"\n* }\n* }\n* render() {\n* //...\n* }\n* fooClicked() {\n* //...\n* }\n* }\n",
"start": 565,
"end": 947,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 34,
"column": 2
}
},
"range": [
565,
947
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 948,
"end": 5090,
"loc": {
"start": {
"line": 35,
"column": 0
},
"end": {
"line": 187,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 963,
"end": 5090,
"loc": {
"start": {
"line": 35,
"column": 15
},
"end": {
"line": 187,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 969,
"end": 978,
"loc": {
"start": {
"line": 35,
"column": 21
},
"end": {
"line": 35,
"column": 30
}
},
"name": "Component",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 979,
"end": 5090,
"loc": {
"start": {
"line": 35,
"column": 31
},
"end": {
"line": 187,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 1210,
"end": 1511,
"loc": {
"start": {
"line": 42,
"column": 2
},
"end": {
"line": 54,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 1210,
"end": 1221,
"loc": {
"start": {
"line": 42,
"column": 2
},
"end": {
"line": 42,
"column": 13
}
},
"name": "constructor",
"leadingComments": null
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 1221,
"end": 1511,
"loc": {
"start": {
"line": 42,
"column": 13
},
"end": {
"line": 54,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 1222,
"end": 1229,
"loc": {
"start": {
"line": 42,
"column": 14
},
"end": {
"line": 42,
"column": 21
}
},
"name": "options"
}
],
"body": {
"type": "BlockStatement",
"start": 1231,
"end": 1511,
"loc": {
"start": {
"line": 42,
"column": 23
},
"end": {
"line": 54,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 1237,
"end": 1265,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 32
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1237,
"end": 1264,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 31
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1237,
"end": 1245,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 12
}
},
"object": {
"type": "ThisExpression",
"start": 1237,
"end": 1241,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 1242,
"end": 1245,
"loc": {
"start": {
"line": 43,
"column": 9
},
"end": {
"line": 43,
"column": 12
}
},
"name": "cid"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 1248,
"end": 1264,
"loc": {
"start": {
"line": 43,
"column": 15
},
"end": {
"line": 43,
"column": 31
}
},
"callee": {
"type": "Identifier",
"start": 1248,
"end": 1256,
"loc": {
"start": {
"line": 43,
"column": 15
},
"end": {
"line": 43,
"column": 23
}
},
"name": "uniqueId"
},
"arguments": [
{
"type": "Literal",
"start": 1257,
"end": 1263,
"loc": {
"start": {
"line": 43,
"column": 24
},
"end": {
"line": 43,
"column": 30
}
},
"value": "comp",
"rawValue": "comp",
"raw": "\"comp\""
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 1270,
"end": 1298,
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 44,
"column": 32
}
},
"expression": {
"type": "AssignmentExpression",
"start": 1270,
"end": 1297,
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 44,
"column": 31
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 1270,
"end": 1282,
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 44,
"column": 16
}
},
"object": {
"type": "ThisExpression",
"start": 1270,
"end": 1274,
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 44,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 1275,
"end": 1282,
"loc": {
"start": {
"line": 44,
"column": 9
},
"end": {
"line": 44,
"column": 16
}
},
"name": "channel"
},
"computed": false
},
"right": {
"type": "Literal",
"start": 1285,
"end": 1297,
"loc": {
"start": {
"line": 44,
"column": 19
},
"end": {
"line": 44,
"column": 31
}
},
"value": "components",
"rawValue": "components",
"raw": "\"components\""
}
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Assign things from the passed in options to `this`",
"start": 1304,
"end": 1357,
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 57
}
},
"range": [
1304,
1357
]
}
]
},
{
"type": "ExpressionStatement",
"start": 1362,
"end": 1405,
"loc": {
"start": {
"line": 47,
"column": 4
},
"end": {
"line": 47,
"column": 47
}
},
"expression": {
"type": "CallExpression",
"start": 1362,
"end": 1404,
"loc": {
"start": {
"line": 47,
"column": 4
},
"end": {
"line": 47,
"column": 46
}
},
"callee": {
"type": "Identifier",
"start": 1362,
"end": 1368,
"loc": {
"start": {
"line": 47,
"column": 4
},
"end": {
"line": 47,
"column": 10
}
},
"name": "assign",
"leadingComments": null
},
"arguments": [
{
"type": "ThisExpression",
"start": 1369,
"end": 1373,
"loc": {
"start": {
"line": 47,
"column": 11
},
"end": {
"line": 47,
"column": 15
}
}
},
{
"type": "CallExpression",
"start": 1375,
"end": 1403,
"loc": {
"start": {
"line": 47,
"column": 17
},
"end": {
"line": 47,
"column": 45
}
},
"callee": {
"type": "Identifier",
"start": 1375,
"end": 1379,
"loc": {
"start": {
"line": 47,
"column": 17
},
"end": {
"line": 47,
"column": 21
}
},
"name": "pick"
},
"arguments": [
{
"type": "Identifier",
"start": 1380,
"end": 1387,
"loc": {
"start": {
"line": 47,
"column": 22
},
"end": {
"line": 47,
"column": 29
}
},
"name": "options"
},
{
"type": "Identifier",
"start": 1389,
"end": 1402,
"loc": {
"start": {
"line": 47,
"column": 31
},
"end": {
"line": 47,
"column": 44
}
},
"name": "listOfOptions"
}
]
}
],
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Assign things from the passed in options to `this`",
"start": 1304,
"end": 1357,
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 57
}
},
"range": [
1304,
1357
]
}
]
},
{
"type": "ExpressionStatement",
"start": 1411,
"end": 1433,
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 49,
"column": 26
}
},
"expression": {
"type": "CallExpression",
"start": 1411,
"end": 1432,
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 49,
"column": 25
}
},
"callee": {
"type": "MemberExpression",
"start": 1411,
"end": 1430,
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 49,
"column": 23
}
},
"object": {
"type": "ThisExpression",
"start": 1411,
"end": 1415,
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 49,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 1416,
"end": 1430,
"loc": {
"start": {
"line": 49,
"column": 9
},
"end": {
"line": 49,
"column": 23
}
},
"name": "_ensureElement"
},
"computed": false
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 1439,
"end": 1478,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 43
}
},
"expression": {
"type": "CallExpression",
"start": 1439,
"end": 1477,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 1439,
"end": 1460,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 25
}
},
"object": {
"type": "MemberExpression",
"start": 1439,
"end": 1454,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 1439,
"end": 1443,
"loc": {
"start": {
"line": 51,
"column": 4
},
"end": {
"line": 51,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 1444,
"end": 1454,
"loc": {
"start": {
"line": 51,
"column": 9
},
"end": {
"line": 51,
"column": 19
}
},
"name": "initialize"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 1455,
"end": 1460,
"loc": {
"start": {
"line": 51,
"column": 20
},
"end": {
"line": 51,
"column": 25
}
},
"name": "apply"
},
"computed": false
},
"arguments": [
{
"type": "ThisExpression",
"start": 1461,
"end": 1465,
"loc": {
"start": {
"line": 51,
"column": 26
},
"end": {
"line": 51,
"column": 30
}
}
},
{
"type": "Identifier",
"start": 1467,
"end": 1476,
"loc": {
"start": {
"line": 51,
"column": 32
},
"end": {
"line": 51,
"column": 41
}
},
"name": "arguments"
}
]
}
},
{
"type": "ExpressionStatement",
"start": 1484,
"end": 1507,
"loc": {
"start": {
"line": 53,
"column": 4
},
"end": {
"line": 53,
"column": 27
}
},
"expression": {
"type": "CallExpression",
"start": 1484,
"end": 1506,
"loc": {
"start": {
"line": 53,
"column": 4
},
"end": {
"line": 53,
"column": 26
}
},
"callee": {
"type": "MemberExpression",
"start": 1484,
"end": 1504,
"loc": {
"start": {
"line": 53,
"column": 4
},
"end": {
"line": 53,
"column": 24
}
},
"object": {
"type": "ThisExpression",
"start": 1484,
"end": 1488,
"loc": {
"start": {
"line": 53,
"column": 4
},
"end": {
"line": 53,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 1489,
"end": 1504,
"loc": {
"start": {
"line": 53,
"column": 9
},
"end": {
"line": 53,
"column": 24
}
},
"name": "_delegateEvents"
},
"computed": false
},
"arguments": []
}
}
]
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Constructs a component\n * @param {[Options]} options An options object\n * @param {Element} options.el An element to attatch this component to\n * @param {Object} options.events A key value pair of events\n ",
"start": 983,
"end": 1207,
"loc": {
"start": {
"line": 36,