rizzo-next
Version:
The next generation of Lonely Planet's style guide and pattern library.
1,447 lines (1,446 loc) • 62.7 kB
JSON
{
"type": "Program",
"start": 0,
"end": 925,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 41,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 46
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"name": "postal"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 19,
"end": 45,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 45
}
},
"value": "postal/lib/postal.lodash",
"rawValue": "postal/lib/postal.lodash",
"raw": "\"postal/lib/postal.lodash\""
}
},
{
"type": "ImportDeclaration",
"start": 47,
"end": 83,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 54,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 54,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"name": "events"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 66,
"end": 82,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 35
}
},
"value": "./rizzo_events",
"rawValue": "./rizzo_events",
"raw": "\"./rizzo_events\""
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Rizzo thing\n ",
"start": 85,
"end": 107,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 6,
"column": 3
}
},
"range": [
85,
107
]
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 108,
"end": 924,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 40,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 123,
"end": 924,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 40,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 129,
"end": 134,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 26
}
},
"name": "Rizzo",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 135,
"end": 924,
"loc": {
"start": {
"line": 7,
"column": 27
},
"end": {
"line": 40,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 141,
"end": 290,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 13,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 141,
"end": 152,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 13
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 152,
"end": 290,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 13,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "ObjectPattern",
"start": 153,
"end": 179,
"loc": {
"start": {
"line": 8,
"column": 14
},
"end": {
"line": 8,
"column": 40
}
},
"properties": [
{
"type": "Property",
"start": 155,
"end": 163,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 24
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 155,
"end": 163,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 24
}
},
"name": "registry"
},
"kind": "init",
"value": {
"type": "Identifier",
"start": 155,
"end": 163,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 24
}
},
"name": "registry"
}
},
{
"type": "Property",
"start": 165,
"end": 171,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 32
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 165,
"end": 171,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 32
}
},
"name": "logger"
},
"kind": "init",
"value": {
"type": "Identifier",
"start": 165,
"end": 171,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 32
}
},
"name": "logger"
}
},
{
"type": "Property",
"start": 173,
"end": 177,
"loc": {
"start": {
"line": 8,
"column": 34
},
"end": {
"line": 8,
"column": 38
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 173,
"end": 177,
"loc": {
"start": {
"line": 8,
"column": 34
},
"end": {
"line": 8,
"column": 38
}
},
"name": "perf"
},
"kind": "init",
"value": {
"type": "Identifier",
"start": 173,
"end": 177,
"loc": {
"start": {
"line": 8,
"column": 34
},
"end": {
"line": 8,
"column": 38
}
},
"name": "perf"
}
}
]
}
],
"body": {
"type": "BlockStatement",
"start": 181,
"end": 290,
"loc": {
"start": {
"line": 8,
"column": 42
},
"end": {
"line": 13,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 187,
"end": 212,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 187,
"end": 211,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 28
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 187,
"end": 200,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 187,
"end": 191,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 192,
"end": 200,
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 17
}
},
"name": "registry"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 203,
"end": 211,
"loc": {
"start": {
"line": 9,
"column": 20
},
"end": {
"line": 9,
"column": 28
}
},
"name": "registry"
}
}
},
{
"type": "ExpressionStatement",
"start": 217,
"end": 238,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 217,
"end": 237,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 217,
"end": 228,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 217,
"end": 221,
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 222,
"end": 228,
"loc": {
"start": {
"line": 10,
"column": 9
},
"end": {
"line": 10,
"column": 15
}
},
"name": "logger"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 231,
"end": 237,
"loc": {
"start": {
"line": 10,
"column": 18
},
"end": {
"line": 10,
"column": 24
}
},
"name": "logger"
}
}
},
{
"type": "ExpressionStatement",
"start": 243,
"end": 260,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 21
}
},
"expression": {
"type": "AssignmentExpression",
"start": 243,
"end": 259,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 20
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 243,
"end": 252,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 13
}
},
"object": {
"type": "ThisExpression",
"start": 243,
"end": 247,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 248,
"end": 252,
"loc": {
"start": {
"line": 11,
"column": 9
},
"end": {
"line": 11,
"column": 13
}
},
"name": "perf"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 255,
"end": 259,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 20
}
},
"name": "perf"
}
}
},
{
"type": "ExpressionStatement",
"start": 265,
"end": 286,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 265,
"end": 285,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 265,
"end": 276,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 265,
"end": 269,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 270,
"end": 276,
"loc": {
"start": {
"line": 12,
"column": 9
},
"end": {
"line": 12,
"column": 15
}
},
"name": "events"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 279,
"end": 285,
"loc": {
"start": {
"line": 12,
"column": 18
},
"end": {
"line": 12,
"column": 24
}
},
"name": "events"
}
}
}
],
"trailingComments": null
},
"trailingComments": null
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Render a component\n * @param {Component} Component The component to register\n * @param {Object} options Options to pass into instance creation\n * @return {Object} Instance of the component\n * @example\n * rizzo.renderComponent(MastheadComponent, {});\n * \n ",
"start": 293,
"end": 575,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 22,
"column": 5
}
},
"range": [
293,
575
]
}
]
},
{
"type": "MethodDefinition",
"start": 578,
"end": 810,
"loc": {
"start": {
"line": 23,
"column": 2
},
"end": {
"line": 33,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 578,
"end": 593,
"loc": {
"start": {
"line": 23,
"column": 2
},
"end": {
"line": 23,
"column": 17
}
},
"name": "renderComponent",
"leadingComments": null
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 593,
"end": 810,
"loc": {
"start": {
"line": 23,
"column": 17
},
"end": {
"line": 33,
"column": 3
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 594,
"end": 603,
"loc": {
"start": {
"line": 23,
"column": 18
},
"end": {
"line": 23,
"column": 27
}
},
"name": "Component"
},
{
"type": "AssignmentPattern",
"start": 605,
"end": 617,
"loc": {
"start": {
"line": 23,
"column": 29
},
"end": {
"line": 23,
"column": 41
}
},
"left": {
"type": "Identifier",
"start": 605,
"end": 612,
"loc": {
"start": {
"line": 23,
"column": 29
},
"end": {
"line": 23,
"column": 36
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 615,
"end": 617,
"loc": {
"start": {
"line": 23,
"column": 39
},
"end": {
"line": 23,
"column": 41
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 619,
"end": 810,
"loc": {
"start": {
"line": 23,
"column": 43
},
"end": {
"line": 33,
"column": 3
}
},
"body": [
{
"type": "IfStatement",
"start": 625,
"end": 712,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 28,
"column": 5
}
},
"test": {
"type": "BinaryExpression",
"start": 629,
"end": 656,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 35
}
},
"left": {
"type": "UnaryExpression",
"start": 629,
"end": 643,
"loc": {
"start": {
"line": 24,
"column": 8
},
"end": {
"line": 24,
"column": 22
}
},
"operator": "typeof",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 636,
"end": 643,
"loc": {
"start": {
"line": 24,
"column": 15
},
"end": {
"line": 24,
"column": 22
}
},
"name": "options"
}
},
"operator": "===",
"right": {
"type": "Literal",
"start": 648,
"end": 656,
"loc": {
"start": {
"line": 24,
"column": 27
},
"end": {
"line": 24,
"column": 35
}
},
"value": "string",
"rawValue": "string",
"raw": "\"string\""
}
},
"consequent": {
"type": "BlockStatement",
"start": 658,
"end": 712,
"loc": {
"start": {
"line": 24,
"column": 37
},
"end": {
"line": 28,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 666,
"end": 706,
"loc": {
"start": {
"line": 25,
"column": 6
},
"end": {
"line": 27,
"column": 8
}
},
"expression": {
"type": "AssignmentExpression",
"start": 666,
"end": 705,
"loc": {
"start": {
"line": 25,
"column": 6
},
"end": {
"line": 27,
"column": 7
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 666,
"end": 673,
"loc": {
"start": {
"line": 25,
"column": 6
},
"end": {
"line": 25,
"column": 13
}
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 676,
"end": 705,
"loc": {
"start": {
"line": 25,
"column": 16
},
"end": {
"line": 27,
"column": 7
}
},
"properties": [
{
"type": "Property",
"start": 686,
"end": 697,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 19
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 686,
"end": 688,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 10
}
},
"name": "el"
},
"value": {
"type": "Identifier",
"start": 690,
"end": 697,
"loc": {
"start": {
"line": 26,
"column": 12
},
"end": {
"line": 26,
"column": 19
}
},
"name": "options"
},
"kind": "init"
}
]
}
}
}
]
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 718,
"end": 784,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 70
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 722,
"end": 783,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 69
}
},
"id": {
"type": "Identifier",
"start": 722,
"end": 730,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 16
}
},
"name": "instance"
},
"init": {
"type": "CallExpression",
"start": 733,
"end": 783,
"loc": {
"start": {
"line": 30,
"column": 19
},
"end": {
"line": 30,
"column": 69
}
},
"callee": {
"type": "MemberExpression",
"start": 733,
"end": 763,
"loc": {
"start": {
"line": 30,
"column": 19
},
"end": {
"line": 30,
"column": 49
}
},
"object": {
"type": "MemberExpression",
"start": 733,
"end": 746,
"loc": {
"start": {
"line": 30,
"column": 19
},
"end": {
"line": 30,
"column": 32
}
},
"object": {
"type": "ThisExpression",
"start": 733,
"end": 737,
"loc": {
"start": {
"line": 30,
"column": 19
},
"end": {
"line": 30,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"start": 738,
"end": 746,
"loc": {
"start": {
"line": 30,
"column": 24
},
"end": {
"line": 30,
"column": 32
}
},
"name": "registry"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 747,
"end": 763,
"loc": {
"start": {
"line": 30,
"column": 33
},
"end": {
"line": 30,
"column": 49
}
},
"name": "createInstanceOf"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 764,
"end": 773,
"loc": {
"start": {
"line": 30,
"column": 50
},
"end": {
"line": 30,
"column": 59
}
},
"name": "Component"
},
{
"type": "Identifier",
"start": 775,
"end": 782,
"loc": {
"start": {
"line": 30,
"column": 61
},
"end": {
"line": 30,
"column": 68
}
},
"name": "options"
}
]
}
}
],
"kind": "let"
},
{
"type": "ReturnStatement",
"start": 790,
"end": 806,
"loc": {
"start": {
"line": 32,
"column": 4
},
"end": {
"line": 32,
"column": 20
}
},
"argument": {
"type": "Identifier",
"start": 797,
"end": 805,
"loc": {
"start": {
"line": 32,
"column": 11
},
"end": {
"line": 32,
"column": 19
}
},
"name": "instance"
}
}
],
"trailingComments": null
},
"trailingComments": null
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Render a component\n * @param {Component} Component The component to register\n * @param {Object} options Options to pass into instance creation\n * @return {Object} Instance of the component\n * @example\n * rizzo.renderComponent(MastheadComponent, {});\n * \n ",
"start": 293,
"end": 575,
"loc": {
"start": {
"line": 14,
"column": 2
},