rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,183 lines (1,182 loc) • 191 kB
JSON
{
"type": "Program",
"start": 0,
"end": 1716,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 64,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 928,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 26,
"column": 2
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 927,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 26,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 13
}
},
"name": "highlight"
},
"init": {
"type": "ArrowFunctionExpression",
"start": 16,
"end": 927,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 26,
"column": 1
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 17,
"end": 21,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 21
}
},
"name": "node"
},
{
"type": "Identifier",
"start": 23,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 25
}
},
"name": "re"
},
{
"type": "Identifier",
"start": 27,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 35
}
},
"name": "nodeName"
},
{
"type": "Identifier",
"start": 37,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 37
},
"end": {
"line": 1,
"column": 46
}
},
"name": "className"
}
],
"body": {
"type": "BlockStatement",
"start": 51,
"end": 927,
"loc": {
"start": {
"line": 1,
"column": 51
},
"end": {
"line": 26,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 55,
"end": 913,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 24,
"column": 3
}
},
"test": {
"type": "BinaryExpression",
"start": 59,
"end": 78,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 25
}
},
"left": {
"type": "MemberExpression",
"start": 59,
"end": 72,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 19
}
},
"object": {
"type": "Identifier",
"start": 59,
"end": 63,
"loc": {
"start": {
"line": 2,
"column": 6
},
"end": {
"line": 2,
"column": 10
}
},
"name": "node"
},
"property": {
"type": "Identifier",
"start": 64,
"end": 72,
"loc": {
"start": {
"line": 2,
"column": 11
},
"end": {
"line": 2,
"column": 19
}
},
"name": "nodeType"
},
"computed": false
},
"operator": "===",
"right": {
"type": "Literal",
"start": 77,
"end": 78,
"loc": {
"start": {
"line": 2,
"column": 24
},
"end": {
"line": 2,
"column": 25
}
},
"value": 3,
"rawValue": 3,
"raw": "3"
}
},
"consequent": {
"type": "BlockStatement",
"start": 80,
"end": 583,
"loc": {
"start": {
"line": 2,
"column": 27
},
"end": {
"line": 18,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 86,
"end": 118,
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 36
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 90,
"end": 117,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 35
}
},
"id": {
"type": "Identifier",
"start": 90,
"end": 95,
"loc": {
"start": {
"line": 3,
"column": 8
},
"end": {
"line": 3,
"column": 13
}
},
"name": "match"
},
"init": {
"type": "CallExpression",
"start": 98,
"end": 117,
"loc": {
"start": {
"line": 3,
"column": 16
},
"end": {
"line": 3,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 98,
"end": 113,
"loc": {
"start": {
"line": 3,
"column": 16
},
"end": {
"line": 3,
"column": 31
}
},
"object": {
"type": "MemberExpression",
"start": 98,
"end": 107,
"loc": {
"start": {
"line": 3,
"column": 16
},
"end": {
"line": 3,
"column": 25
}
},
"object": {
"type": "Identifier",
"start": 98,
"end": 102,
"loc": {
"start": {
"line": 3,
"column": 16
},
"end": {
"line": 3,
"column": 20
}
},
"name": "node"
},
"property": {
"type": "Identifier",
"start": 103,
"end": 107,
"loc": {
"start": {
"line": 3,
"column": 21
},
"end": {
"line": 3,
"column": 25
}
},
"name": "data"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 108,
"end": 113,
"loc": {
"start": {
"line": 3,
"column": 26
},
"end": {
"line": 3,
"column": 31
}
},
"name": "match"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 114,
"end": 116,
"loc": {
"start": {
"line": 3,
"column": 32
},
"end": {
"line": 3,
"column": 34
}
},
"name": "re"
}
]
}
}
],
"kind": "let"
},
{
"type": "IfStatement",
"start": 124,
"end": 579,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 17,
"column": 5
}
},
"test": {
"type": "Identifier",
"start": 128,
"end": 133,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
}
},
"name": "match"
},
"consequent": {
"type": "BlockStatement",
"start": 135,
"end": 579,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 17,
"column": 5
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 143,
"end": 209,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 72
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 147,
"end": 208,
"loc": {
"start": {
"line": 6,
"column": 10
},
"end": {
"line": 6,
"column": 71
}
},
"id": {
"type": "Identifier",
"start": 147,
"end": 163,
"loc": {
"start": {
"line": 6,
"column": 10
},
"end": {
"line": 6,
"column": 26
}
},
"name": "highlightElement"
},
"init": {
"type": "CallExpression",
"start": 166,
"end": 208,
"loc": {
"start": {
"line": 6,
"column": 29
},
"end": {
"line": 6,
"column": 71
}
},
"callee": {
"type": "MemberExpression",
"start": 166,
"end": 188,
"loc": {
"start": {
"line": 6,
"column": 29
},
"end": {
"line": 6,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 166,
"end": 174,
"loc": {
"start": {
"line": 6,
"column": 29
},
"end": {
"line": 6,
"column": 37
}
},
"name": "document"
},
"property": {
"type": "Identifier",
"start": 175,
"end": 188,
"loc": {
"start": {
"line": 6,
"column": 38
},
"end": {
"line": 6,
"column": 51
}
},
"name": "createElement"
},
"computed": false
},
"arguments": [
{
"type": "LogicalExpression",
"start": 189,
"end": 207,
"loc": {
"start": {
"line": 6,
"column": 52
},
"end": {
"line": 6,
"column": 70
}
},
"left": {
"type": "Identifier",
"start": 189,
"end": 197,
"loc": {
"start": {
"line": 6,
"column": 52
},
"end": {
"line": 6,
"column": 60
}
},
"name": "nodeName"
},
"operator": "||",
"right": {
"type": "Literal",
"start": 201,
"end": 207,
"loc": {
"start": {
"line": 6,
"column": 64
},
"end": {
"line": 6,
"column": 70
}
},
"value": "span",
"rawValue": "span",
"raw": "\"span\""
}
}
]
}
}
],
"kind": "let"
},
{
"type": "ExpressionStatement",
"start": 216,
"end": 270,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 60
}
},
"expression": {
"type": "AssignmentExpression",
"start": 216,
"end": 269,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 59
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 216,
"end": 242,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 216,
"end": 232,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 22
}
},
"name": "highlightElement"
},
"property": {
"type": "Identifier",
"start": 233,
"end": 242,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 32
}
},
"name": "className"
},
"computed": false
},
"right": {
"type": "LogicalExpression",
"start": 245,
"end": 269,
"loc": {
"start": {
"line": 7,
"column": 35
},
"end": {
"line": 7,
"column": 59
}
},
"left": {
"type": "Identifier",
"start": 245,
"end": 254,
"loc": {
"start": {
"line": 7,
"column": 35
},
"end": {
"line": 7,
"column": 44
}
},
"name": "className"
},
"operator": "||",
"right": {
"type": "Literal",
"start": 258,
"end": 269,
"loc": {
"start": {
"line": 7,
"column": 48
},
"end": {
"line": 7,
"column": 59
}
},
"value": "highlight",
"rawValue": "highlight",
"raw": "\"highlight\""
}
}
}
},
{
"type": "VariableDeclaration",
"start": 278,
"end": 321,
"loc": {
"start": {
"line": 9,
"column": 6
},
"end": {
"line": 9,
"column": 49
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 282,
"end": 320,
"loc": {
"start": {
"line": 9,
"column": 10
},
"end": {
"line": 9,
"column": 48
}
},
"id": {
"type": "Identifier",
"start": 282,
"end": 290,
"loc": {
"start": {
"line": 9,
"column": 10
},
"end": {
"line": 9,
"column": 18
}
},
"name": "wordNode"
},
"init": {
"type": "CallExpression",
"start": 293,
"end": 320,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 48
}
},
"callee": {
"type": "MemberExpression",
"start": 293,
"end": 307,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 293,
"end": 297,
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 25
}
},
"name": "node"
},
"property": {
"type": "Identifier",
"start": 298,
"end": 307,
"loc": {
"start": {
"line": 9,
"column": 26
},
"end": {
"line": 9,
"column": 35
}
},
"name": "splitText"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 308,
"end": 319,
"loc": {
"start": {
"line": 9,
"column": 36
},
"end": {
"line": 9,
"column": 47
}
},
"object": {
"type": "Identifier",
"start": 308,
"end": 313,
"loc": {
"start": {
"line": 9,
"column": 36
},
"end": {
"line": 9,
"column": 41
}
},
"name": "match"
},
"property": {
"type": "Identifier",
"start": 314,
"end": 319,
"loc": {
"start": {
"line": 9,
"column": 42
},
"end": {
"line": 9,
"column": 47
}
},
"name": "index"
},
"computed": false
}
]
}
}
],
"kind": "let"
},
{
"type": "ExpressionStatement",
"start": 328,
"end": 364,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 42
}
},
"expression": {
"type": "CallExpression",
"start": 328,
"end": 363,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 328,
"end": 346,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 24
}
},
"object": {
"type": "Identifier",
"start": 328,
"end": 336,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 14
}
},
"name": "wordNode"
},
"property": {
"type": "Identifier",
"start": 337,
"end": 346,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 24
}
},
"name": "splitText"
},
"computed": false
},
"arguments": [
{
"type": "MemberExpression",
"start": 347,
"end": 362,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 40
}
},
"object": {
"type": "MemberExpression",
"start": 347,
"end": 355,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 33
}
},
"object": {
"type": "Identifier",
"start": 347,
"end": 352,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 30
}
},
"name": "match"
},
"property": {
"type": "Literal",
"start": 353,
"end": 354,
"loc": {
"start": {
"line": 10,
"column": 31
},
"end": {
"line": 10,
"column": 32
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
},
"computed": true
},
"property": {
"type": "Identifier",
"start": 356,
"end": 362,
"loc": {
"start": {
"line": 10,
"column": 34
},
"end": {
"line": 10,
"column": 40
}
},
"name": "length"
},
"computed": false
}
]
}
},
{
"type": "VariableDeclaration",
"start": 372,
"end": 413,
"loc": {
"start": {
"line": 12,
"column": 6
},
"end": {
"line": 12,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 376,
"end": 412,
"loc": {
"start": {
"line": 12,
"column": 10
},
"end": {
"line": 12,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 376,
"end": 385,
"loc": {
"start": {
"line": 12,
"column": 10
},
"end": {
"line": 12,
"column": 19
}
},
"name": "wordClone"
},
"init": {
"type": "CallExpression",
"start": 388,
"end": 412,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 46
}
},
"callee": {
"type": "MemberExpression",
"start": 388,
"end": 406,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 40
}
},
"object": {
"type": "Identifier",
"start": 388,
"end": 396,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 30
}
},