awv3
Version:
⚡ AWV3 embedded CAD
1,609 lines (1,608 loc) • 563 kB
JSON
{
"type": "File",
"start": 0,
"end": 5859,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 126,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 5859,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 126,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 9
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 9
},
"identifierName": "v4"
},
"name": "v4"
}
}
],
"source": {
"type": "StringLiteral",
"start": 15,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 24
}
},
"extra": {
"rawValue": "uuid-v4",
"raw": "'uuid-v4'"
},
"value": "uuid-v4"
}
},
{
"type": "ImportDeclaration",
"start": 26,
"end": 68,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 42
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 35,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
}
},
"imported": {
"type": "Identifier",
"start": 35,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
},
"identifierName": "queryDom"
},
"name": "queryDom"
},
"local": {
"type": "Identifier",
"start": 35,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
},
"identifierName": "queryDom"
},
"name": "queryDom"
}
},
{
"type": "ImportSpecifier",
"start": 45,
"end": 48,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 22
}
},
"imported": {
"type": "Identifier",
"start": 45,
"end": 48,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 22
},
"identifierName": "url"
},
"name": "url"
},
"local": {
"type": "Identifier",
"start": 45,
"end": 48,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 22
},
"identifierName": "url"
},
"name": "url"
}
}
],
"source": {
"type": "StringLiteral",
"start": 56,
"end": 67,
"loc": {
"start": {
"line": 2,
"column": 30
},
"end": {
"line": 2,
"column": 41
}
},
"extra": {
"rawValue": "./helpers",
"raw": "'./helpers'"
},
"value": "./helpers"
}
},
{
"type": "ImportDeclaration",
"start": 69,
"end": 99,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 76,
"end": 82,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 76,
"end": 82,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 13
},
"identifierName": "Parser"
},
"name": "Parser"
}
}
],
"source": {
"type": "StringLiteral",
"start": 88,
"end": 98,
"loc": {
"start": {
"line": 3,
"column": 19
},
"end": {
"line": 3,
"column": 29
}
},
"extra": {
"rawValue": "./parser",
"raw": "'./parser'"
},
"value": "./parser"
}
},
{
"type": "ImportDeclaration",
"start": 100,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 107,
"end": 113,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 107,
"end": 113,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 13
},
"identifierName": "Events"
},
"name": "Events"
}
}
],
"source": {
"type": "StringLiteral",
"start": 119,
"end": 129,
"loc": {
"start": {
"line": 4,
"column": 19
},
"end": {
"line": 4,
"column": 29
}
},
"extra": {
"rawValue": "./events",
"raw": "'./events'"
},
"value": "./events"
}
},
{
"type": "ImportDeclaration",
"start": 131,
"end": 165,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 34
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 138,
"end": 146,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
}
},
"local": {
"type": "Identifier",
"start": 138,
"end": 146,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "Renderer"
},
"name": "Renderer"
}
}
],
"source": {
"type": "StringLiteral",
"start": 152,
"end": 164,
"loc": {
"start": {
"line": 5,
"column": 21
},
"end": {
"line": 5,
"column": 33
}
},
"extra": {
"rawValue": "./renderer",
"raw": "'./renderer'"
},
"value": "./renderer"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "* Global awv3 version ",
"start": 167,
"end": 193,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 26
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 194,
"end": 224,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 30
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 201,
"end": 224,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 205,
"end": 223,
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 8,
"column": 29
}
},
"id": {
"type": "Identifier",
"start": 205,
"end": 212,
"loc": {
"start": {
"line": 8,
"column": 11
},
"end": {
"line": 8,
"column": 18
},
"identifierName": "version"
},
"name": "version",
"leadingComments": null
},
"init": {
"type": "StringLiteral",
"start": 215,
"end": 223,
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 29
}
},
"extra": {
"rawValue": "7.0.84",
"raw": "'7.0.84'"
},
"value": "7.0.84"
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentBlock",
"value": "* Global awv3 version ",
"start": 167,
"end": 193,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 26
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* last created canvas ",
"start": 225,
"end": 251,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 26
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* Global awv3 version ",
"start": 167,
"end": 193,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 26
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* last created canvas ",
"start": 225,
"end": 251,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 26
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 252,
"end": 287,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 35
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 259,
"end": 287,
"loc": {
"start": {
"line": 10,
"column": 7
},
"end": {
"line": 10,
"column": 35
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 263,
"end": 286,
"loc": {
"start": {
"line": 10,
"column": 11
},
"end": {
"line": 10,
"column": 34
}
},
"id": {
"type": "Identifier",
"start": 263,
"end": 274,
"loc": {
"start": {
"line": 10,
"column": 11
},
"end": {
"line": 10,
"column": 22
},
"identifierName": "lastCreated"
},
"name": "lastCreated",
"leadingComments": null
},
"init": {
"type": "Identifier",
"start": 277,
"end": 286,
"loc": {
"start": {
"line": 10,
"column": 25
},
"end": {
"line": 10,
"column": 34
},
"identifierName": "undefined"
},
"name": "undefined"
},
"leadingComments": null
}
],
"kind": "let",
"leadingComments": [
{
"type": "CommentBlock",
"value": "* last created canvas ",
"start": 225,
"end": 251,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 26
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* The Canvas class holds the webGL context and maps the underlying views.\n It initializes it's own renderer, event system and parser. ",
"start": 289,
"end": 430,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 13,
"column": 65
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* last created canvas ",
"start": 225,
"end": 251,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 26
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* The Canvas class holds the webGL context and maps the underlying views.\n It initializes it's own renderer, event system and parser. ",
"start": 289,
"end": 430,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 13,
"column": 65
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 431,
"end": 5858,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 125,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 446,
"end": 5858,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 125,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 452,
"end": 458,
"loc": {
"start": {
"line": 14,
"column": 21
},
"end": {
"line": 14,
"column": 27
},
"identifierName": "Canvas"
},
"name": "Canvas",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 459,
"end": 5858,
"loc": {
"start": {
"line": 14,
"column": 28
},
"end": {
"line": 125,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 2368,
"end": 5464,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 111,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 2368,
"end": 2379,
"loc": {
"start": {
"line": 38,
"column": 4
},
"end": {
"line": 38,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 2380,
"end": 2392,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 28
}
},
"left": {
"type": "Identifier",
"start": 2380,
"end": 2387,
"loc": {
"start": {
"line": 38,
"column": 16
},
"end": {
"line": 38,
"column": 23
},
"identifierName": "options"
},
"name": "options"
},
"right": {
"type": "ObjectExpression",
"start": 2390,
"end": 2392,
"loc": {
"start": {
"line": 38,
"column": 26
},
"end": {
"line": 38,
"column": 28
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 2394,
"end": 5464,
"loc": {
"start": {
"line": 38,
"column": 30
},
"end": {
"line": 111,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2432,
"end": 2455,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2432,
"end": 2454,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2432,
"end": 2444,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 20
}
},
"object": {
"type": "ThisExpression",
"start": 2432,
"end": 2436,
"loc": {
"start": {
"line": 40,
"column": 8
},
"end": {
"line": 40,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 2437,
"end": 2444,
"loc": {
"start": {
"line": 40,
"column": 13
},
"end": {
"line": 40,
"column": 20
},
"identifierName": "version"
},
"name": "version"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 2447,
"end": 2454,
"loc": {
"start": {
"line": 40,
"column": 23
},
"end": {
"line": 40,
"column": 30
},
"identifierName": "version"
},
"name": "version"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* awv3 version ",
"start": 2404,
"end": 2423,
"loc": {
"start": {
"line": 39,
"column": 8
},
"end": {
"line": 39,
"column": 27
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* GUID to help identify the canvas ",
"start": 2464,
"end": 2503,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 47
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 2512,
"end": 2527,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 23
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2512,
"end": 2526,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 22
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2512,
"end": 2519,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 15
}
},
"object": {
"type": "ThisExpression",
"start": 2512,
"end": 2516,
"loc": {
"start": {
"line": 42,
"column": 8
},
"end": {
"line": 42,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 2517,
"end": 2519,
"loc": {
"start": {
"line": 42,
"column": 13
},
"end": {
"line": 42,
"column": 15
},
"identifierName": "id"
},
"name": "id"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "CallExpression",
"start": 2522,
"end": 2526,
"loc": {
"start": {
"line": 42,
"column": 18
},
"end": {
"line": 42,
"column": 22
}
},
"callee": {
"type": "Identifier",
"start": 2522,
"end": 2524,
"loc": {
"start": {
"line": 42,
"column": 18
},
"end": {
"line": 42,
"column": 20
},
"identifierName": "v4"
},
"name": "v4"
},
"arguments": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* GUID to help identify the canvas ",
"start": 2464,
"end": 2503,
"loc": {
"start": {
"line": 41,
"column": 8
},
"end": {
"line": 41,
"column": 47
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "* List of managed views ",
"start": 2536,
"end": 2564,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 36
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 2573,
"end": 2589,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 24
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2573,
"end": 2588,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 23
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2573,
"end": 2583,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 2573,
"end": 2577,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 2578,
"end": 2583,
"loc": {
"start": {
"line": 44,
"column": 13
},
"end": {
"line": 44,
"column": 18
},
"identifierName": "views"
},
"name": "views"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "ArrayExpression",
"start": 2586,
"end": 2588,
"loc": {
"start": {
"line": 44,
"column": 21
},
"end": {
"line": 44,
"column": 23
}
},
"elements": []
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "* List of managed views ",
"start": 2536,
"end": 2564,
"loc": {
"start": {
"line": 43,
"column": 8
},
"end": {
"line": 43,
"column": 36
}
}
}
]
},
{
"type": "IfStatement",
"start": 2599,
"end": 2908,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 49,
"column": 9
}
},
"test": {
"type": "UnaryExpression",
"start": 2603,
"end": 2615,
"loc": {
"start": {
"line": 46,
"column": 12
},
"end": {
"line": 46,
"column": 24
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "MemberExpression",
"start": 2604,
"end": 2615,
"loc": {
"start": {
"line": 46,
"column": 13
},
"end": {
"line": 46,
"column": 24
}
},
"object": {
"type": "Identifier",
"start": 2604,
"end": 2611,
"loc": {
"start": {
"line": 46,
"column": 13
},
"end": {
"line": 46,
"column": 20
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 2612,
"end": 2615,
"loc": {
"start": {
"line": 46,
"column": 21
},
"end": {
"line": 46,
"column": 24
},
"identifierName": "dom"
},
"name": "dom"
},
"computed": false
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 2617,
"end": 2908,
"loc": {
"start": {
"line": 46,
"column": 26
},
"end": {
"line": 49,
"column": 9
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2631,
"end": 2675,
"loc": {
"start": {
"line": 47,
"column": 12
},
"end": {
"line": 47,
"column": 56
}
},
"expression": {
"type": "AssignmentExpression",
"start": 2631,
"end": 2674,
"loc": {
"start": {
"line": 47,
"column": 12
},
"end": {
"line": 47,
"column": 55
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 2631,
"end": 2642,
"loc": {
"start": {
"line": 47,
"column": 12
},
"end": {
"line": 47,
"column": 23
}
},
"object": {
"type": "Identifier",
"start": 2631,
"end": 2638,
"loc": {
"start": {
"line": 47,
"column": 12
},
"end": {
"line": 47,
"column": 19
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 2639,
"end": 2642,
"loc": {
"start": {
"line": 47,
"column": 20
},
"end": {
"line": 47,
"column": 23
},
"identifierName": "dom"
},
"name": "dom"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 2645,
"end": 2674,
"loc": {
"start": {
"line": 47,
"column": 26
},
"end": {
"line": 47,
"column": 55
}
},
"callee": {
"type": "MemberExpression",
"start": 2645,
"end": 2667,
"loc": {
"start": {
"line": 47,
"column": 26
},
"end": {
"line": 47,
"column": 48
}
},
"object": {
"type": "Identifier",
"start": 2645,
"end": 2653,
"loc": {
"start": {
"line": 47,
"column": 26
},
"end": {
"line": 47,
"column": 34
},
"identifierName": "document"
},
"name": "document"
},
"property": {
"type": "Identifier",
"start": 2654,
"end": 2667,
"loc": {
"start": {
"line": 47,
"column": 35
},
"end": {
"line": 47,
"column": 48
},
"identifierName": "createElement"
},
"name": "createElement"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 2668,
"end": 2673,
"loc": {
"start": {
"line": 47,
"column": 49
},
"end": {
"line": 47,
"column": 54
}
},
"extra": {
"rawValue": "div",
"raw": "'div'"
},
"value": "div"