diff --git a/dist/pixi-inspector.js b/dist/pixi-inspector.js index d15e523..db28971 100644 --- a/dist/pixi-inspector.js +++ b/dist/pixi-inspector.js @@ -1,6 +1,6 @@ /*! - * pixi-inspector - v1.0.3 - * Compiled Thu, 28 Feb 2019 09:05:07 UTC + * pixi-inspector - v1.0.4 + * Compiled Mon, 04 Mar 2019 09:01:57 UTC * * pixi-inspector is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license @@ -384,14 +384,14 @@ var PointAttributeParser = (function () { }; PointAttributeParser.prototype.stringify = function (value) { if (value) { - var x = value.x.toFixed(this.numberPrecision); - var y = value.y.toFixed(this.numberPrecision); + var x = (value.x || 0).toFixed(this.numberPrecision); + var y = (value.y || 0).toFixed(this.numberPrecision); return x == y ? x : x + ',' + y; } return ''; }; PointAttributeParser.prototype.visible = function (value) { - return value != null; + return value != null && !isNaN(value.x) && !isNaN(value.y); }; return PointAttributeParser; }()); diff --git a/dist/pixi-inspector.js.map b/dist/pixi-inspector.js.map index 004c0eb..cf8e63f 100644 --- a/dist/pixi-inspector.js.map +++ b/dist/pixi-inspector.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","bin/PixiInspector.js","bin/attributes/ArrayAttributeParser.js","bin/attributes/AutoAttributeParser.js","bin/attributes/ColorAttributeParser.js","bin/attributes/PointAttributeParser.js","bin/attributes/PrimitiveAttributeParser.js","bin/attributes/TextureAttributeParser.js","bin/decorators/domAttr.js","bin/decorators/domHidden.js","bin/decorators/domLeaf.js","bin/getDefault.js","bin/inspector.js","bin"],"names":[],"mappings":";;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-inspector.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i n) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n n = node.children.length;\r\n for (; i < n; i++) {\r\n element.appendChild(this.buildElement(node.children[i]));\r\n }\r\n }\r\n return element;\r\n };\r\n PixiInspector.prototype.releaseElement = function (element) {\r\n element.pixiTarget = null;\r\n while (element.attributes.length > 1) {\r\n element.removeAttributeNode(element.attributes[1]);\r\n }\r\n while (element.childNodes.length > 0) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n this._elementPool.release(element);\r\n };\r\n PixiInspector.prototype.setElementStyle = function (node, element) {\r\n var bounds = node.getBounds(false, this._tempRect);\r\n if (!element.pixiStyle) {\r\n var index = PixiInspector.styleSheet.cssRules.length;\r\n PixiInspector.styleSheet.insertRule(\"#px\" + index + \" {position:fixed;top:0;left:0;width:0;height:0}\", index);\r\n element.pixiStyle = PixiInspector.styleSheet.cssRules[index].style;\r\n element.id = \"px\" + index;\r\n }\r\n var style = element.pixiStyle;\r\n if (node['__pixi_inspector_is_hidden__']) {\r\n style.display = 'none';\r\n }\r\n style.top = (bounds.top + this._canvas.offsetTop).toFixed(2) + \"px\";\r\n style.left = (bounds.left + this._canvas.offsetLeft).toFixed(2) + \"px\";\r\n style.width = (bounds.width).toFixed(2) + \"px\";\r\n style.height = (bounds.height).toFixed(2) + \"px\";\r\n };\r\n PixiInspector.prototype.setElementAttributes = function (node, element) {\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\r\n var attribute = attributes_1[_i];\r\n var value = void 0;\r\n try {\r\n value = node[attribute.name];\r\n }\r\n catch (e) {\r\n continue;\r\n }\r\n if (attribute.parser.visible(value)) {\r\n element.setAttribute(attribute.name, attribute.parser.stringify(value));\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.onDomChange = function (mutations) {\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n if (mutation.type == 'attributes') {\r\n var element = mutation.target;\r\n var node = element.pixiTarget;\r\n if (node) {\r\n var value = element.getAttribute(mutation.attributeName);\r\n var name_1 = mutation.attributeName.toLowerCase();\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _a = 0, attributes_2 = attributes; _a < attributes_2.length; _a++) {\r\n var attribute = attributes_2[_a];\r\n if (attribute.name.toLowerCase() == name_1) {\r\n node[attribute.name] = attribute.parser.parse(value, node[attribute.name]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.createStyleSheet = function () {\r\n if (!PixiInspector.styleSheet) {\r\n var style = document.createElement('style');\r\n style.appendChild(document.createTextNode('' +\r\n '[id^=\"px\"] {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty:hover {background:rgba(255,255,255,0.2);border:solid 1px #fff}'));\r\n document.head.appendChild(style);\r\n PixiInspector.styleSheet = style.sheet;\r\n }\r\n };\r\n PixiInspector.prototype.addDocumentListeners = function () {\r\n var _this = this;\r\n var ctrl = 17;\r\n var style = PixiInspector.styleSheet.cssRules[1].style;\r\n document.addEventListener('keydown', function (event) {\r\n if (event.which == ctrl && !_this._pointerEvents) {\r\n _this._pointerEvents = true;\r\n style.pointerEvents = 'auto';\r\n }\r\n });\r\n document.addEventListener('keyup', function (event) {\r\n if (event.which == ctrl && _this._pointerEvents) {\r\n _this._pointerEvents = false;\r\n style.pointerEvents = 'none';\r\n }\r\n });\r\n document.addEventListener('click', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n document.addEventListener('contextmenu', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n };\r\n return PixiInspector;\r\n}());\r\nexports.PixiInspector = PixiInspector;\r\nvar ElementPool = (function () {\r\n function ElementPool() {\r\n this.pools = {};\r\n }\r\n ElementPool.prototype.get = function (obj) {\r\n var tagName = 'px-' + this.getTagName(obj).toLowerCase();\r\n if (!Array.isArray(this.pools[tagName])) {\r\n this.pools[tagName] = [];\r\n if (!customElements.get(tagName)) {\r\n customElements.define(tagName, function () {\r\n }, { extends: 'div' });\r\n }\r\n }\r\n return this.pools[tagName].pop() || document.createElement(tagName);\r\n };\r\n ElementPool.prototype.release = function (element) {\r\n if (this.pools[element.localName].indexOf(element) < 0) {\r\n this.pools[element.localName].push(element);\r\n }\r\n };\r\n ElementPool.prototype.getTagName = function (obj) {\r\n var className = null;\r\n if (obj.constructor) {\r\n var exec = /function\\s+(\\w{2,})\\(/.exec(obj.constructor.toString());\r\n className = exec ? exec[1] : null;\r\n }\r\n if (className) {\r\n return className;\r\n }\r\n for (var _i = 0, _a = ElementPool.defaultConstructors; _i < _a.length; _i++) {\r\n var defaultConstructor = _a[_i];\r\n if (obj instanceof defaultConstructor[0]) {\r\n return defaultConstructor[1];\r\n }\r\n }\r\n return 'DisplayObject';\r\n };\r\n ElementPool.defaultConstructors = [\r\n [PIXI.mesh.NineSlicePlane, 'NineSlicePlane'],\r\n [PIXI.mesh.Plane, 'Plane'],\r\n [PIXI.mesh.Rope, 'Rope'],\r\n [PIXI.Text, 'Text'],\r\n [PIXI.extras.BitmapText, 'BitmapText'],\r\n [PIXI.extras.AnimatedSprite, 'AnimatedSprite'],\r\n [PIXI.extras.TilingSprite, 'TilingSprite'],\r\n [PIXI.Sprite, 'Sprite'],\r\n [PIXI.Graphics, 'Graphics'],\r\n [PIXI.Container, 'Container'],\r\n ];\r\n return ElementPool;\r\n}());\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser = (function () {\r\n function ArrayAttributeParser(elementParser, delimiter) {\r\n if (delimiter === void 0) { delimiter = ','; }\r\n this.delimiter = delimiter;\r\n this.elementParser = typeof elementParser == 'function'\r\n ? new elementParser()\r\n : (elementParser || (new PrimitiveAttributeParser_1.PrimitiveAttributeParser()));\r\n }\r\n ArrayAttributeParser.prototype.parse = function (str, value) {\r\n if (!Array.isArray(value)) {\r\n value = [];\r\n }\r\n var i = 0;\r\n var a = str.split(this.delimiter);\r\n var n = Math.min(value.length, a.length);\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i], value[i]);\r\n }\r\n n = a.length;\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i]);\r\n }\r\n while (value.length > n) {\r\n value.pop();\r\n }\r\n return value;\r\n };\r\n ArrayAttributeParser.prototype.stringify = function (value) {\r\n var _this = this;\r\n if (Array.isArray(value)) {\r\n return value.map(function (it) { return _this.elementParser.stringify(it); }).join(this.delimiter);\r\n }\r\n return '';\r\n };\r\n ArrayAttributeParser.prototype.visible = function (value) {\r\n return Array.isArray(value);\r\n };\r\n return ArrayAttributeParser;\r\n}());\r\nexports.ArrayAttributeParser = ArrayAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser_1 = require(\"./ArrayAttributeParser\");\r\nvar AutoAttributeParser = (function () {\r\n function AutoAttributeParser() {\r\n this.arrayAttributeParser = new ArrayAttributeParser_1.ArrayAttributeParser();\r\n this.primitiveAttributeParser = new PrimitiveAttributeParser_1.PrimitiveAttributeParser();\r\n }\r\n AutoAttributeParser.prototype.parse = function (str, value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.parse(str, value);\r\n }\r\n return this.primitiveAttributeParser.parse(str, value);\r\n };\r\n AutoAttributeParser.prototype.stringify = function (value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.stringify(value);\r\n }\r\n return this.primitiveAttributeParser.stringify(value);\r\n };\r\n AutoAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return AutoAttributeParser;\r\n}());\r\nexports.AutoAttributeParser = AutoAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar ColorAttributeParser = (function () {\r\n function ColorAttributeParser() {\r\n }\r\n ColorAttributeParser.prototype.parse = function (str, value) {\r\n return parseInt(str.replace('#', '0x'));\r\n };\r\n ColorAttributeParser.prototype.stringify = function (value) {\r\n if (!value) {\r\n return '#000000';\r\n }\r\n return '#' + value.toString(16).replace('0x', '');\r\n };\r\n ColorAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return ColorAttributeParser;\r\n}());\r\nexports.ColorAttributeParser = ColorAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PointAttributeParser = (function () {\r\n function PointAttributeParser(numberPrecision, factory) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n this.factory = factory;\r\n }\r\n PointAttributeParser.prototype.parse = function (str, value) {\r\n if (!value) {\r\n if (this.factory) {\r\n value = this.factory();\r\n }\r\n else {\r\n console.error('Cannot parse attribute from \"' + str + '\" because factory is not defined.');\r\n return value;\r\n }\r\n }\r\n var n = str.split(',');\r\n if (n.length > 1) {\r\n value.x = parseFloat(n[0]);\r\n value.y = parseFloat(n[1]);\r\n }\r\n else {\r\n value.x = value.y = parseFloat(n[0]);\r\n }\r\n return value;\r\n };\r\n PointAttributeParser.prototype.stringify = function (value) {\r\n if (value) {\r\n var x = value.x.toFixed(this.numberPrecision);\r\n var y = value.y.toFixed(this.numberPrecision);\r\n return x == y ? x : x + ',' + y;\r\n }\r\n return '';\r\n };\r\n PointAttributeParser.prototype.visible = function (value) {\r\n return value != null;\r\n };\r\n return PointAttributeParser;\r\n}());\r\nexports.PointAttributeParser = PointAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser = (function () {\r\n function PrimitiveAttributeParser(numberPrecision) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n }\r\n PrimitiveAttributeParser.prototype.parse = function (str, value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return parseFloat(str);\r\n case 'boolean':\r\n return str == 'true';\r\n case 'string':\r\n return str;\r\n }\r\n if (str == 'true' || str == 'false') {\r\n return str == 'true';\r\n }\r\n var n = parseFloat(str);\r\n if (!isNaN(n)) {\r\n return n;\r\n }\r\n return str;\r\n };\r\n PrimitiveAttributeParser.prototype.stringify = function (value) {\r\n if (typeof value == 'number') {\r\n return value.toFixed(this.numberPrecision);\r\n }\r\n if (value === false || value) {\r\n return value.toString();\r\n }\r\n return '';\r\n };\r\n PrimitiveAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return PrimitiveAttributeParser;\r\n}());\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar TextureAttributeParser = (function () {\r\n function TextureAttributeParser() {\r\n }\r\n TextureAttributeParser.prototype.parse = function (str, value) {\r\n var texture = PIXI.utils.TextureCache[str];\r\n if (texture instanceof PIXI.Texture) {\r\n return texture;\r\n }\r\n return value;\r\n };\r\n TextureAttributeParser.prototype.stringify = function (value) {\r\n return value.textureCacheIds[0];\r\n };\r\n TextureAttributeParser.prototype.visible = function (value) {\r\n return !!value.textureCacheIds;\r\n };\r\n return TextureAttributeParser;\r\n}());\r\nexports.TextureAttributeParser = TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar AutoAttributeParser_1 = require(\"../attributes/AutoAttributeParser\");\r\nfunction domAttr(parser) {\r\n return function (target, propertyName) {\r\n if (!target.hasOwnProperty('__pixi_inspector_class_attributes__')) {\r\n target['__pixi_inspector_class_attributes__'] = [];\r\n }\r\n var classAttributes = target['__pixi_inspector_class_attributes__'];\r\n if (!classAttributes.some(function (it) { return it.name == propertyName; })) {\r\n classAttributes.push({\r\n name: propertyName,\r\n parser: typeof parser == 'function' ? new parser() : (parser || new AutoAttributeParser_1.AutoAttributeParser())\r\n });\r\n }\r\n if (!target.hasOwnProperty('__pixi_inspector_attributes__')) {\r\n Object.defineProperty(target, '__pixi_inspector_attributes__', {\r\n get: function () {\r\n var superClassAttributes = Object.getPrototypeOf(target)['__pixi_inspector_attributes__'];\r\n if (Array.isArray(superClassAttributes)) {\r\n return superClassAttributes.concat(classAttributes);\r\n }\r\n return classAttributes;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nexports.domAttr = domAttr;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domHidden() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_hidden__'] = true;\r\n };\r\n}\r\nexports.domHidden = domHidden;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domLeaf() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_leaf__'] = true;\r\n };\r\n}\r\nexports.domLeaf = domLeaf;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nvar ColorAttributeParser_1 = require(\"./attributes/ColorAttributeParser\");\r\nfunction getDefault(rootNode, canvas) {\r\n return new PixiInspector_1.PixiInspector(rootNode, canvas)\r\n .domAttr(PIXI.DisplayObject, 'x')\r\n .domAttr(PIXI.DisplayObject, 'y')\r\n .domAttr(PIXI.DisplayObject, 'scale', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.DisplayObject, 'rotation')\r\n .domAttr(PIXI.DisplayObject, 'alpha')\r\n .domAttr(PIXI.Sprite, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.Sprite, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.Sprite, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.Text, 'text')\r\n .domAttr(PIXI.Text, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'text')\r\n .domAttr(PIXI.extras.BitmapText, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'tint', ColorAttributeParser_1.ColorAttributeParser);\r\n}\r\nexports.getDefault = getDefault;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nexports.PixiInspector = PixiInspector_1.PixiInspector;\r\nvar getDefault_1 = require(\"./getDefault\");\r\nexports.getDefault = getDefault_1.getDefault;\r\nvar domAttr_1 = require(\"./decorators/domAttr\");\r\nexports.domAttr = domAttr_1.domAttr;\r\nvar domLeaf_1 = require(\"./decorators/domLeaf\");\r\nexports.domLeaf = domLeaf_1.domLeaf;\r\nvar domHidden_1 = require(\"./decorators/domHidden\");\r\nexports.domHidden = domHidden_1.domHidden;\r\nvar PrimitiveAttributeParser_1 = require(\"./attributes/PrimitiveAttributeParser\");\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser_1.PrimitiveAttributeParser;\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nexports.PointAttributeParser = PointAttributeParser_1.PointAttributeParser;\r\nvar ArrayAttributeParser_1 = require(\"./attributes/ArrayAttributeParser\");\r\nexports.ArrayAttributeParser = ArrayAttributeParser_1.ArrayAttributeParser;\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nexports.TextureAttributeParser = TextureAttributeParser_1.TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nif (typeof PIXI === 'undefined') {\r\n throw \"pixi-inspector requires pixi.js to be loaded first\";\r\n}\r\nvar inspector = require(\"./inspector\");\r\nif (!PIXI.inspector) {\r\n PIXI.inspector = inspector;\r\n}\r\nelse {\r\n for (var prop in inspector) {\r\n PIXI.inspector[prop] = inspector[prop];\r\n }\r\n}\r\nif (typeof module !== \"undefined\" && module.exports) {\r\n module.exports = inspector;\r\n}\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","bin/PixiInspector.js","bin/attributes/ArrayAttributeParser.js","bin/attributes/AutoAttributeParser.js","bin/attributes/ColorAttributeParser.js","bin/attributes/PointAttributeParser.js","bin/attributes/PrimitiveAttributeParser.js","bin/attributes/TextureAttributeParser.js","bin/decorators/domAttr.js","bin/decorators/domHidden.js","bin/decorators/domLeaf.js","bin/getDefault.js","bin/inspector.js","bin"],"names":[],"mappings":";;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pixi-inspector.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i n) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n n = node.children.length;\r\n for (; i < n; i++) {\r\n element.appendChild(this.buildElement(node.children[i]));\r\n }\r\n }\r\n return element;\r\n };\r\n PixiInspector.prototype.releaseElement = function (element) {\r\n element.pixiTarget = null;\r\n while (element.attributes.length > 1) {\r\n element.removeAttributeNode(element.attributes[1]);\r\n }\r\n while (element.childNodes.length > 0) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n this._elementPool.release(element);\r\n };\r\n PixiInspector.prototype.setElementStyle = function (node, element) {\r\n var bounds = node.getBounds(false, this._tempRect);\r\n if (!element.pixiStyle) {\r\n var index = PixiInspector.styleSheet.cssRules.length;\r\n PixiInspector.styleSheet.insertRule(\"#px\" + index + \" {position:fixed;top:0;left:0;width:0;height:0}\", index);\r\n element.pixiStyle = PixiInspector.styleSheet.cssRules[index].style;\r\n element.id = \"px\" + index;\r\n }\r\n var style = element.pixiStyle;\r\n if (node['__pixi_inspector_is_hidden__']) {\r\n style.display = 'none';\r\n }\r\n style.top = (bounds.top + this._canvas.offsetTop).toFixed(2) + \"px\";\r\n style.left = (bounds.left + this._canvas.offsetLeft).toFixed(2) + \"px\";\r\n style.width = (bounds.width).toFixed(2) + \"px\";\r\n style.height = (bounds.height).toFixed(2) + \"px\";\r\n };\r\n PixiInspector.prototype.setElementAttributes = function (node, element) {\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\r\n var attribute = attributes_1[_i];\r\n var value = void 0;\r\n try {\r\n value = node[attribute.name];\r\n }\r\n catch (e) {\r\n continue;\r\n }\r\n if (attribute.parser.visible(value)) {\r\n element.setAttribute(attribute.name, attribute.parser.stringify(value));\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.onDomChange = function (mutations) {\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n if (mutation.type == 'attributes') {\r\n var element = mutation.target;\r\n var node = element.pixiTarget;\r\n if (node) {\r\n var value = element.getAttribute(mutation.attributeName);\r\n var name_1 = mutation.attributeName.toLowerCase();\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _a = 0, attributes_2 = attributes; _a < attributes_2.length; _a++) {\r\n var attribute = attributes_2[_a];\r\n if (attribute.name.toLowerCase() == name_1) {\r\n node[attribute.name] = attribute.parser.parse(value, node[attribute.name]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.createStyleSheet = function () {\r\n if (!PixiInspector.styleSheet) {\r\n var style = document.createElement('style');\r\n style.appendChild(document.createTextNode('' +\r\n '[id^=\"px\"] {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty:hover {background:rgba(255,255,255,0.2);border:solid 1px #fff}'));\r\n document.head.appendChild(style);\r\n PixiInspector.styleSheet = style.sheet;\r\n }\r\n };\r\n PixiInspector.prototype.addDocumentListeners = function () {\r\n var _this = this;\r\n var ctrl = 17;\r\n var style = PixiInspector.styleSheet.cssRules[1].style;\r\n document.addEventListener('keydown', function (event) {\r\n if (event.which == ctrl && !_this._pointerEvents) {\r\n _this._pointerEvents = true;\r\n style.pointerEvents = 'auto';\r\n }\r\n });\r\n document.addEventListener('keyup', function (event) {\r\n if (event.which == ctrl && _this._pointerEvents) {\r\n _this._pointerEvents = false;\r\n style.pointerEvents = 'none';\r\n }\r\n });\r\n document.addEventListener('click', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n document.addEventListener('contextmenu', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n };\r\n return PixiInspector;\r\n}());\r\nexports.PixiInspector = PixiInspector;\r\nvar ElementPool = (function () {\r\n function ElementPool() {\r\n this.pools = {};\r\n }\r\n ElementPool.prototype.get = function (obj) {\r\n var tagName = 'px-' + this.getTagName(obj).toLowerCase();\r\n if (!Array.isArray(this.pools[tagName])) {\r\n this.pools[tagName] = [];\r\n if (!customElements.get(tagName)) {\r\n customElements.define(tagName, function () {\r\n }, { extends: 'div' });\r\n }\r\n }\r\n return this.pools[tagName].pop() || document.createElement(tagName);\r\n };\r\n ElementPool.prototype.release = function (element) {\r\n if (this.pools[element.localName].indexOf(element) < 0) {\r\n this.pools[element.localName].push(element);\r\n }\r\n };\r\n ElementPool.prototype.getTagName = function (obj) {\r\n var className = null;\r\n if (obj.constructor) {\r\n var exec = /function\\s+(\\w{2,})\\(/.exec(obj.constructor.toString());\r\n className = exec ? exec[1] : null;\r\n }\r\n if (className) {\r\n return className;\r\n }\r\n for (var _i = 0, _a = ElementPool.defaultConstructors; _i < _a.length; _i++) {\r\n var defaultConstructor = _a[_i];\r\n if (obj instanceof defaultConstructor[0]) {\r\n return defaultConstructor[1];\r\n }\r\n }\r\n return 'DisplayObject';\r\n };\r\n ElementPool.defaultConstructors = [\r\n [PIXI.mesh.NineSlicePlane, 'NineSlicePlane'],\r\n [PIXI.mesh.Plane, 'Plane'],\r\n [PIXI.mesh.Rope, 'Rope'],\r\n [PIXI.Text, 'Text'],\r\n [PIXI.extras.BitmapText, 'BitmapText'],\r\n [PIXI.extras.AnimatedSprite, 'AnimatedSprite'],\r\n [PIXI.extras.TilingSprite, 'TilingSprite'],\r\n [PIXI.Sprite, 'Sprite'],\r\n [PIXI.Graphics, 'Graphics'],\r\n [PIXI.Container, 'Container'],\r\n ];\r\n return ElementPool;\r\n}());\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser = (function () {\r\n function ArrayAttributeParser(elementParser, delimiter) {\r\n if (delimiter === void 0) { delimiter = ','; }\r\n this.delimiter = delimiter;\r\n this.elementParser = typeof elementParser == 'function'\r\n ? new elementParser()\r\n : (elementParser || (new PrimitiveAttributeParser_1.PrimitiveAttributeParser()));\r\n }\r\n ArrayAttributeParser.prototype.parse = function (str, value) {\r\n if (!Array.isArray(value)) {\r\n value = [];\r\n }\r\n var i = 0;\r\n var a = str.split(this.delimiter);\r\n var n = Math.min(value.length, a.length);\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i], value[i]);\r\n }\r\n n = a.length;\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i]);\r\n }\r\n while (value.length > n) {\r\n value.pop();\r\n }\r\n return value;\r\n };\r\n ArrayAttributeParser.prototype.stringify = function (value) {\r\n var _this = this;\r\n if (Array.isArray(value)) {\r\n return value.map(function (it) { return _this.elementParser.stringify(it); }).join(this.delimiter);\r\n }\r\n return '';\r\n };\r\n ArrayAttributeParser.prototype.visible = function (value) {\r\n return Array.isArray(value);\r\n };\r\n return ArrayAttributeParser;\r\n}());\r\nexports.ArrayAttributeParser = ArrayAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser_1 = require(\"./ArrayAttributeParser\");\r\nvar AutoAttributeParser = (function () {\r\n function AutoAttributeParser() {\r\n this.arrayAttributeParser = new ArrayAttributeParser_1.ArrayAttributeParser();\r\n this.primitiveAttributeParser = new PrimitiveAttributeParser_1.PrimitiveAttributeParser();\r\n }\r\n AutoAttributeParser.prototype.parse = function (str, value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.parse(str, value);\r\n }\r\n return this.primitiveAttributeParser.parse(str, value);\r\n };\r\n AutoAttributeParser.prototype.stringify = function (value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.stringify(value);\r\n }\r\n return this.primitiveAttributeParser.stringify(value);\r\n };\r\n AutoAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return AutoAttributeParser;\r\n}());\r\nexports.AutoAttributeParser = AutoAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar ColorAttributeParser = (function () {\r\n function ColorAttributeParser() {\r\n }\r\n ColorAttributeParser.prototype.parse = function (str, value) {\r\n return parseInt(str.replace('#', '0x'));\r\n };\r\n ColorAttributeParser.prototype.stringify = function (value) {\r\n if (!value) {\r\n return '#000000';\r\n }\r\n return '#' + value.toString(16).replace('0x', '');\r\n };\r\n ColorAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return ColorAttributeParser;\r\n}());\r\nexports.ColorAttributeParser = ColorAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PointAttributeParser = (function () {\r\n function PointAttributeParser(numberPrecision, factory) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n this.factory = factory;\r\n }\r\n PointAttributeParser.prototype.parse = function (str, value) {\r\n if (!value) {\r\n if (this.factory) {\r\n value = this.factory();\r\n }\r\n else {\r\n console.error('Cannot parse attribute from \"' + str + '\" because factory is not defined.');\r\n return value;\r\n }\r\n }\r\n var n = str.split(',');\r\n if (n.length > 1) {\r\n value.x = parseFloat(n[0]);\r\n value.y = parseFloat(n[1]);\r\n }\r\n else {\r\n value.x = value.y = parseFloat(n[0]);\r\n }\r\n return value;\r\n };\r\n PointAttributeParser.prototype.stringify = function (value) {\r\n if (value) {\r\n var x = (value.x || 0).toFixed(this.numberPrecision);\r\n var y = (value.y || 0).toFixed(this.numberPrecision);\r\n return x == y ? x : x + ',' + y;\r\n }\r\n return '';\r\n };\r\n PointAttributeParser.prototype.visible = function (value) {\r\n return value != null && !isNaN(value.x) && !isNaN(value.y);\r\n };\r\n return PointAttributeParser;\r\n}());\r\nexports.PointAttributeParser = PointAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser = (function () {\r\n function PrimitiveAttributeParser(numberPrecision) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n }\r\n PrimitiveAttributeParser.prototype.parse = function (str, value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return parseFloat(str);\r\n case 'boolean':\r\n return str == 'true';\r\n case 'string':\r\n return str;\r\n }\r\n if (str == 'true' || str == 'false') {\r\n return str == 'true';\r\n }\r\n var n = parseFloat(str);\r\n if (!isNaN(n)) {\r\n return n;\r\n }\r\n return str;\r\n };\r\n PrimitiveAttributeParser.prototype.stringify = function (value) {\r\n if (typeof value == 'number') {\r\n return value.toFixed(this.numberPrecision);\r\n }\r\n if (value === false || value) {\r\n return value.toString();\r\n }\r\n return '';\r\n };\r\n PrimitiveAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return PrimitiveAttributeParser;\r\n}());\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar TextureAttributeParser = (function () {\r\n function TextureAttributeParser() {\r\n }\r\n TextureAttributeParser.prototype.parse = function (str, value) {\r\n var texture = PIXI.utils.TextureCache[str];\r\n if (texture instanceof PIXI.Texture) {\r\n return texture;\r\n }\r\n return value;\r\n };\r\n TextureAttributeParser.prototype.stringify = function (value) {\r\n return value.textureCacheIds[0];\r\n };\r\n TextureAttributeParser.prototype.visible = function (value) {\r\n return !!value.textureCacheIds;\r\n };\r\n return TextureAttributeParser;\r\n}());\r\nexports.TextureAttributeParser = TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar AutoAttributeParser_1 = require(\"../attributes/AutoAttributeParser\");\r\nfunction domAttr(parser) {\r\n return function (target, propertyName) {\r\n if (!target.hasOwnProperty('__pixi_inspector_class_attributes__')) {\r\n target['__pixi_inspector_class_attributes__'] = [];\r\n }\r\n var classAttributes = target['__pixi_inspector_class_attributes__'];\r\n if (!classAttributes.some(function (it) { return it.name == propertyName; })) {\r\n classAttributes.push({\r\n name: propertyName,\r\n parser: typeof parser == 'function' ? new parser() : (parser || new AutoAttributeParser_1.AutoAttributeParser())\r\n });\r\n }\r\n if (!target.hasOwnProperty('__pixi_inspector_attributes__')) {\r\n Object.defineProperty(target, '__pixi_inspector_attributes__', {\r\n get: function () {\r\n var superClassAttributes = Object.getPrototypeOf(target)['__pixi_inspector_attributes__'];\r\n if (Array.isArray(superClassAttributes)) {\r\n return superClassAttributes.concat(classAttributes);\r\n }\r\n return classAttributes;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nexports.domAttr = domAttr;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domHidden() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_hidden__'] = true;\r\n };\r\n}\r\nexports.domHidden = domHidden;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domLeaf() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_leaf__'] = true;\r\n };\r\n}\r\nexports.domLeaf = domLeaf;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nvar ColorAttributeParser_1 = require(\"./attributes/ColorAttributeParser\");\r\nfunction getDefault(rootNode, canvas) {\r\n return new PixiInspector_1.PixiInspector(rootNode, canvas)\r\n .domAttr(PIXI.DisplayObject, 'x')\r\n .domAttr(PIXI.DisplayObject, 'y')\r\n .domAttr(PIXI.DisplayObject, 'scale', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.DisplayObject, 'rotation')\r\n .domAttr(PIXI.DisplayObject, 'alpha')\r\n .domAttr(PIXI.Sprite, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.Sprite, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.Sprite, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.Text, 'text')\r\n .domAttr(PIXI.Text, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'text')\r\n .domAttr(PIXI.extras.BitmapText, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'tint', ColorAttributeParser_1.ColorAttributeParser);\r\n}\r\nexports.getDefault = getDefault;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nexports.PixiInspector = PixiInspector_1.PixiInspector;\r\nvar getDefault_1 = require(\"./getDefault\");\r\nexports.getDefault = getDefault_1.getDefault;\r\nvar domAttr_1 = require(\"./decorators/domAttr\");\r\nexports.domAttr = domAttr_1.domAttr;\r\nvar domLeaf_1 = require(\"./decorators/domLeaf\");\r\nexports.domLeaf = domLeaf_1.domLeaf;\r\nvar domHidden_1 = require(\"./decorators/domHidden\");\r\nexports.domHidden = domHidden_1.domHidden;\r\nvar PrimitiveAttributeParser_1 = require(\"./attributes/PrimitiveAttributeParser\");\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser_1.PrimitiveAttributeParser;\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nexports.PointAttributeParser = PointAttributeParser_1.PointAttributeParser;\r\nvar ArrayAttributeParser_1 = require(\"./attributes/ArrayAttributeParser\");\r\nexports.ArrayAttributeParser = ArrayAttributeParser_1.ArrayAttributeParser;\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nexports.TextureAttributeParser = TextureAttributeParser_1.TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nif (typeof PIXI === 'undefined') {\r\n throw \"pixi-inspector requires pixi.js to be loaded first\";\r\n}\r\nvar inspector = require(\"./inspector\");\r\nif (!PIXI.inspector) {\r\n PIXI.inspector = inspector;\r\n}\r\nelse {\r\n for (var prop in inspector) {\r\n PIXI.inspector[prop] = inspector[prop];\r\n }\r\n}\r\nif (typeof module !== \"undefined\" && module.exports) {\r\n module.exports = inspector;\r\n}\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/dist/pixi-inspector.min.js b/dist/pixi-inspector.min.js index 248fcfc..a8f8402 100644 --- a/dist/pixi-inspector.min.js +++ b/dist/pixi-inspector.min.js @@ -1,9 +1,9 @@ /*! - * pixi-inspector - v1.0.3 - * Compiled Thu, 28 Feb 2019 09:05:08 UTC + * pixi-inspector - v1.0.4 + * Compiled Mon, 04 Mar 2019 09:01:57 UTC * * pixi-inspector is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pixiInspector=t()}}(function(){return function(){function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){return n(e[s][1][t]||t)},c,c.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;si;)this.releaseElement(e.lastChild),e.lastChild.remove();for(i=t.children.length;r1;)t.removeAttributeNode(t.attributes[1]);for(;t.childNodes.length>0;)this.releaseElement(t.lastChild),t.lastChild.remove();this._elementPool.release(t)},t.prototype.setElementStyle=function(e,r){var i=e.getBounds(!1,this._tempRect);if(!r.pixiStyle){var n=t.styleSheet.cssRules.length;t.styleSheet.insertRule("#px"+n+" {position:fixed;top:0;left:0;width:0;height:0}",n),r.pixiStyle=t.styleSheet.cssRules[n].style,r.id="px"+n}var o=r.pixiStyle;e.__pixi_inspector_is_hidden__&&(o.display="none"),o.top=(i.top+this._canvas.offsetTop).toFixed(2)+"px",o.left=(i.left+this._canvas.offsetLeft).toFixed(2)+"px",o.width=i.width.toFixed(2)+"px",o.height=i.height.toFixed(2)+"px"},t.prototype.setElementAttributes=function(t,e){var r=t.__pixi_inspector_attributes__;if(r)for(var i=0,n=r;in;)e.pop();return e},t.prototype.stringify=function(t){var e=this;return Array.isArray(t)?t.map(function(t){return e.elementParser.stringify(t)}).join(this.delimiter):""},t.prototype.visible=function(t){return Array.isArray(t)},t}();r.ArrayAttributeParser=n},{"./PrimitiveAttributeParser":6}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./PrimitiveAttributeParser"),n=t("./ArrayAttributeParser"),o=function(){function t(){this.arrayAttributeParser=new n.ArrayAttributeParser,this.primitiveAttributeParser=new i.PrimitiveAttributeParser}return t.prototype.parse=function(t,e){return Array.isArray(e)?this.arrayAttributeParser.parse(t,e):this.primitiveAttributeParser.parse(t,e)},t.prototype.stringify=function(t){return Array.isArray(t)?this.arrayAttributeParser.stringify(t):this.primitiveAttributeParser.stringify(t)},t.prototype.visible=function(t){return!0},t}();r.AutoAttributeParser=o},{"./ArrayAttributeParser":2,"./PrimitiveAttributeParser":6}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.parse=function(t,e){return parseInt(t.replace("#","0x"))},t.prototype.stringify=function(t){return t?"#"+t.toString(16).replace("0x",""):"#000000"},t.prototype.visible=function(t){return!0},t}();r.ColorAttributeParser=i},{}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){void 0===t&&(t=2),this.numberPrecision=t,this.factory=e}return t.prototype.parse=function(t,e){if(!e){if(!this.factory)return console.error('Cannot parse attribute from "'+t+'" because factory is not defined.'),e;e=this.factory()}var r=t.split(",");return r.length>1?(e.x=parseFloat(r[0]),e.y=parseFloat(r[1])):e.x=e.y=parseFloat(r[0]),e},t.prototype.stringify=function(t){if(t){var e=t.x.toFixed(this.numberPrecision),r=t.y.toFixed(this.numberPrecision);return e==r?e:e+","+r}return""},t.prototype.visible=function(t){return null!=t},t}();r.PointAttributeParser=i},{}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=2),this.numberPrecision=t}return t.prototype.parse=function(t,e){switch(typeof e){case"number":return parseFloat(t);case"boolean":return"true"==t;case"string":return t}if("true"==t||"false"==t)return"true"==t;var r=parseFloat(t);return isNaN(r)?t:r},t.prototype.stringify=function(t){return"number"==typeof t?t.toFixed(this.numberPrecision):!1===t||t?t.toString():""},t.prototype.visible=function(t){return!0},t}();r.PrimitiveAttributeParser=i},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.parse=function(t,e){var r=PIXI.utils.TextureCache[t];return r instanceof PIXI.Texture?r:e},t.prototype.stringify=function(t){return t.textureCacheIds[0]},t.prototype.visible=function(t){return!!t.textureCacheIds},t}();r.TextureAttributeParser=i},{}],8:[function(t,e,r){"use strict";function i(t){return function(e,r){e.hasOwnProperty("__pixi_inspector_class_attributes__")||(e.__pixi_inspector_class_attributes__=[]);var i=e.__pixi_inspector_class_attributes__;i.some(function(t){return t.name==r})||i.push({name:r,parser:"function"==typeof t?new t:t||new n.AutoAttributeParser}),e.hasOwnProperty("__pixi_inspector_attributes__")||Object.defineProperty(e,"__pixi_inspector_attributes__",{get:function(){var t=Object.getPrototypeOf(e).__pixi_inspector_attributes__;return Array.isArray(t)?t.concat(i):i}})}}Object.defineProperty(r,"__esModule",{value:!0});var n=t("../attributes/AutoAttributeParser");r.domAttr=i},{"../attributes/AutoAttributeParser":3}],9:[function(t,e,r){"use strict";function i(){return function(t){t.prototype.__pixi_inspector_is_hidden__=!0}}Object.defineProperty(r,"__esModule",{value:!0}),r.domHidden=i},{}],10:[function(t,e,r){"use strict";function i(){return function(t){t.prototype.__pixi_inspector_is_leaf__=!0}}Object.defineProperty(r,"__esModule",{value:!0}),r.domLeaf=i},{}],11:[function(t,e,r){"use strict";function i(t,e){return new n.PixiInspector(t,e).domAttr(PIXI.DisplayObject,"x").domAttr(PIXI.DisplayObject,"y").domAttr(PIXI.DisplayObject,"scale",o.PointAttributeParser).domAttr(PIXI.DisplayObject,"rotation").domAttr(PIXI.DisplayObject,"alpha").domAttr(PIXI.Sprite,"texture",s.TextureAttributeParser).domAttr(PIXI.Sprite,"anchor",o.PointAttributeParser).domAttr(PIXI.Sprite,"tint",a.ColorAttributeParser).domAttr(PIXI.mesh.Mesh,"texture",s.TextureAttributeParser).domAttr(PIXI.mesh.Mesh,"tint",a.ColorAttributeParser).domAttr(PIXI.Text,"text").domAttr(PIXI.Text,"anchor",o.PointAttributeParser).domAttr(PIXI.extras.BitmapText,"text").domAttr(PIXI.extras.BitmapText,"anchor",o.PointAttributeParser).domAttr(PIXI.extras.BitmapText,"tint",a.ColorAttributeParser)}Object.defineProperty(r,"__esModule",{value:!0});var n=t("./PixiInspector"),o=t("./attributes/PointAttributeParser"),s=t("./attributes/TextureAttributeParser"),a=t("./attributes/ColorAttributeParser");r.getDefault=i},{"./PixiInspector":1,"./attributes/ColorAttributeParser":4,"./attributes/PointAttributeParser":5,"./attributes/TextureAttributeParser":7}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./PixiInspector");r.PixiInspector=i.PixiInspector;var n=t("./getDefault");r.getDefault=n.getDefault;var o=t("./decorators/domAttr");r.domAttr=o.domAttr;var s=t("./decorators/domLeaf");r.domLeaf=s.domLeaf;var a=t("./decorators/domHidden");r.domHidden=a.domHidden;var u=t("./attributes/PrimitiveAttributeParser");r.PrimitiveAttributeParser=u.PrimitiveAttributeParser;var p=t("./attributes/PointAttributeParser");r.PointAttributeParser=p.PointAttributeParser;var c=t("./attributes/ArrayAttributeParser");r.ArrayAttributeParser=c.ArrayAttributeParser;var d=t("./attributes/TextureAttributeParser");r.TextureAttributeParser=d.TextureAttributeParser},{"./PixiInspector":1,"./attributes/ArrayAttributeParser":2,"./attributes/PointAttributeParser":5,"./attributes/PrimitiveAttributeParser":6,"./attributes/TextureAttributeParser":7,"./decorators/domAttr":8,"./decorators/domHidden":9,"./decorators/domLeaf":10,"./getDefault":11}],13:[function(t,e,r){"use strict";if(Object.defineProperty(r,"__esModule",{value:!0}),"undefined"==typeof PIXI)throw"pixi-inspector requires pixi.js to be loaded first";var i=t("./inspector");if(PIXI.inspector)for(var n in i)PIXI.inspector[n]=i[n];else PIXI.inspector=i;void 0!==e&&e.exports&&(e.exports=i)},{"./inspector":12}]},{},[13])(13)}); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pixiInspector=t()}}(function(){return function(){function t(e,r,i){function n(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){return n(e[s][1][t]||t)},c,c.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;si;)this.releaseElement(e.lastChild),e.lastChild.remove();for(i=t.children.length;r1;)t.removeAttributeNode(t.attributes[1]);for(;t.childNodes.length>0;)this.releaseElement(t.lastChild),t.lastChild.remove();this._elementPool.release(t)},t.prototype.setElementStyle=function(e,r){var i=e.getBounds(!1,this._tempRect);if(!r.pixiStyle){var n=t.styleSheet.cssRules.length;t.styleSheet.insertRule("#px"+n+" {position:fixed;top:0;left:0;width:0;height:0}",n),r.pixiStyle=t.styleSheet.cssRules[n].style,r.id="px"+n}var o=r.pixiStyle;e.__pixi_inspector_is_hidden__&&(o.display="none"),o.top=(i.top+this._canvas.offsetTop).toFixed(2)+"px",o.left=(i.left+this._canvas.offsetLeft).toFixed(2)+"px",o.width=i.width.toFixed(2)+"px",o.height=i.height.toFixed(2)+"px"},t.prototype.setElementAttributes=function(t,e){var r=t.__pixi_inspector_attributes__;if(r)for(var i=0,n=r;in;)e.pop();return e},t.prototype.stringify=function(t){var e=this;return Array.isArray(t)?t.map(function(t){return e.elementParser.stringify(t)}).join(this.delimiter):""},t.prototype.visible=function(t){return Array.isArray(t)},t}();r.ArrayAttributeParser=n},{"./PrimitiveAttributeParser":6}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./PrimitiveAttributeParser"),n=t("./ArrayAttributeParser"),o=function(){function t(){this.arrayAttributeParser=new n.ArrayAttributeParser,this.primitiveAttributeParser=new i.PrimitiveAttributeParser}return t.prototype.parse=function(t,e){return Array.isArray(e)?this.arrayAttributeParser.parse(t,e):this.primitiveAttributeParser.parse(t,e)},t.prototype.stringify=function(t){return Array.isArray(t)?this.arrayAttributeParser.stringify(t):this.primitiveAttributeParser.stringify(t)},t.prototype.visible=function(t){return!0},t}();r.AutoAttributeParser=o},{"./ArrayAttributeParser":2,"./PrimitiveAttributeParser":6}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.parse=function(t,e){return parseInt(t.replace("#","0x"))},t.prototype.stringify=function(t){return t?"#"+t.toString(16).replace("0x",""):"#000000"},t.prototype.visible=function(t){return!0},t}();r.ColorAttributeParser=i},{}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t,e){void 0===t&&(t=2),this.numberPrecision=t,this.factory=e}return t.prototype.parse=function(t,e){if(!e){if(!this.factory)return console.error('Cannot parse attribute from "'+t+'" because factory is not defined.'),e;e=this.factory()}var r=t.split(",");return r.length>1?(e.x=parseFloat(r[0]),e.y=parseFloat(r[1])):e.x=e.y=parseFloat(r[0]),e},t.prototype.stringify=function(t){if(t){var e=(t.x||0).toFixed(this.numberPrecision),r=(t.y||0).toFixed(this.numberPrecision);return e==r?e:e+","+r}return""},t.prototype.visible=function(t){return null!=t&&!isNaN(t.x)&&!isNaN(t.y)},t}();r.PointAttributeParser=i},{}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(t){void 0===t&&(t=2),this.numberPrecision=t}return t.prototype.parse=function(t,e){switch(typeof e){case"number":return parseFloat(t);case"boolean":return"true"==t;case"string":return t}if("true"==t||"false"==t)return"true"==t;var r=parseFloat(t);return isNaN(r)?t:r},t.prototype.stringify=function(t){return"number"==typeof t?t.toFixed(this.numberPrecision):!1===t||t?t.toString():""},t.prototype.visible=function(t){return!0},t}();r.PrimitiveAttributeParser=i},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.parse=function(t,e){var r=PIXI.utils.TextureCache[t];return r instanceof PIXI.Texture?r:e},t.prototype.stringify=function(t){return t.textureCacheIds[0]},t.prototype.visible=function(t){return!!t.textureCacheIds},t}();r.TextureAttributeParser=i},{}],8:[function(t,e,r){"use strict";function i(t){return function(e,r){e.hasOwnProperty("__pixi_inspector_class_attributes__")||(e.__pixi_inspector_class_attributes__=[]);var i=e.__pixi_inspector_class_attributes__;i.some(function(t){return t.name==r})||i.push({name:r,parser:"function"==typeof t?new t:t||new n.AutoAttributeParser}),e.hasOwnProperty("__pixi_inspector_attributes__")||Object.defineProperty(e,"__pixi_inspector_attributes__",{get:function(){var t=Object.getPrototypeOf(e).__pixi_inspector_attributes__;return Array.isArray(t)?t.concat(i):i}})}}Object.defineProperty(r,"__esModule",{value:!0});var n=t("../attributes/AutoAttributeParser");r.domAttr=i},{"../attributes/AutoAttributeParser":3}],9:[function(t,e,r){"use strict";function i(){return function(t){t.prototype.__pixi_inspector_is_hidden__=!0}}Object.defineProperty(r,"__esModule",{value:!0}),r.domHidden=i},{}],10:[function(t,e,r){"use strict";function i(){return function(t){t.prototype.__pixi_inspector_is_leaf__=!0}}Object.defineProperty(r,"__esModule",{value:!0}),r.domLeaf=i},{}],11:[function(t,e,r){"use strict";function i(t,e){return new n.PixiInspector(t,e).domAttr(PIXI.DisplayObject,"x").domAttr(PIXI.DisplayObject,"y").domAttr(PIXI.DisplayObject,"scale",o.PointAttributeParser).domAttr(PIXI.DisplayObject,"rotation").domAttr(PIXI.DisplayObject,"alpha").domAttr(PIXI.Sprite,"texture",s.TextureAttributeParser).domAttr(PIXI.Sprite,"anchor",o.PointAttributeParser).domAttr(PIXI.Sprite,"tint",a.ColorAttributeParser).domAttr(PIXI.mesh.Mesh,"texture",s.TextureAttributeParser).domAttr(PIXI.mesh.Mesh,"tint",a.ColorAttributeParser).domAttr(PIXI.Text,"text").domAttr(PIXI.Text,"anchor",o.PointAttributeParser).domAttr(PIXI.extras.BitmapText,"text").domAttr(PIXI.extras.BitmapText,"anchor",o.PointAttributeParser).domAttr(PIXI.extras.BitmapText,"tint",a.ColorAttributeParser)}Object.defineProperty(r,"__esModule",{value:!0});var n=t("./PixiInspector"),o=t("./attributes/PointAttributeParser"),s=t("./attributes/TextureAttributeParser"),a=t("./attributes/ColorAttributeParser");r.getDefault=i},{"./PixiInspector":1,"./attributes/ColorAttributeParser":4,"./attributes/PointAttributeParser":5,"./attributes/TextureAttributeParser":7}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./PixiInspector");r.PixiInspector=i.PixiInspector;var n=t("./getDefault");r.getDefault=n.getDefault;var o=t("./decorators/domAttr");r.domAttr=o.domAttr;var s=t("./decorators/domLeaf");r.domLeaf=s.domLeaf;var a=t("./decorators/domHidden");r.domHidden=a.domHidden;var u=t("./attributes/PrimitiveAttributeParser");r.PrimitiveAttributeParser=u.PrimitiveAttributeParser;var p=t("./attributes/PointAttributeParser");r.PointAttributeParser=p.PointAttributeParser;var c=t("./attributes/ArrayAttributeParser");r.ArrayAttributeParser=c.ArrayAttributeParser;var d=t("./attributes/TextureAttributeParser");r.TextureAttributeParser=d.TextureAttributeParser},{"./PixiInspector":1,"./attributes/ArrayAttributeParser":2,"./attributes/PointAttributeParser":5,"./attributes/PrimitiveAttributeParser":6,"./attributes/TextureAttributeParser":7,"./decorators/domAttr":8,"./decorators/domHidden":9,"./decorators/domLeaf":10,"./getDefault":11}],13:[function(t,e,r){"use strict";if(Object.defineProperty(r,"__esModule",{value:!0}),"undefined"==typeof PIXI)throw"pixi-inspector requires pixi.js to be loaded first";var i=t("./inspector");if(PIXI.inspector)for(var n in i)PIXI.inspector[n]=i[n];else PIXI.inspector=i;void 0!==e&&e.exports&&(e.exports=i)},{"./inspector":12}]},{},[13])(13)}); //# sourceMappingURL=pixi-inspector.min.js.map diff --git a/dist/pixi-inspector.min.js.map b/dist/pixi-inspector.min.js.map index 94950af..903a477 100644 --- a/dist/pixi-inspector.min.js.map +++ b/dist/pixi-inspector.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","bin/PixiInspector.js","bin/attributes/ArrayAttributeParser.js","bin/attributes/AutoAttributeParser.js","bin/attributes/ColorAttributeParser.js","bin/attributes/PointAttributeParser.js","bin/attributes/PrimitiveAttributeParser.js","bin/attributes/TextureAttributeParser.js","bin/decorators/domAttr.js","bin/decorators/domHidden.js","bin/decorators/domLeaf.js","bin/getDefault.js","bin/inspector.js","bin"],"names":["f","exports","module","define","amd","g","window","global","self","this","pixiInspector","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","Object","defineProperty","value","domAttr_1","domLeaf_1","domHidden_1","PixiInspector","_rootNode","_canvas","_this","_elementPool","ElementPool","_tempRect","PIXI","Rectangle","_mutationObserver","MutationObserver","mutations","onDomChange","_updateInterval","createStyleSheet","update","parentNode","insertBefore","_rootElement","nextSibling","addDocumentListeners","startUpdateInterval","prototype","domAttr","nodeType","propertyName","parser","domLeaf","domHidden","get","set","enumerable","configurable","clearInterval","_updateIntervalId","setInterval","styleSheet","disabled","disconnect","buildElement","observe","subtree","attributes","node","element","pixiTarget","setElementStyle","setElementAttributes","Container","Math","min","children","childNodes","childElement","childNode","replaceChild","releaseElement","lastChild","remove","appendChild","removeAttributeNode","release","bounds","getBounds","pixiStyle","index","cssRules","insertRule","style","id","display","top","offsetTop","toFixed","left","offsetLeft","width","height","_i","attributes_1","attribute","name","visible","setAttribute","stringify","mutations_1","mutation","type","target","getAttribute","attributeName","name_1","toLowerCase","_a","attributes_2","parse","document","createElement","createTextNode","head","sheet","addEventListener","event","which","_pointerEvents","pointerEvents","$pixi","pools","obj","tagName","getTagName","Array","isArray","customElements","extends","pop","localName","indexOf","push","className","constructor","exec","toString","defaultConstructors","defaultConstructor","mesh","NineSlicePlane","Plane","Rope","Text","extras","BitmapText","AnimatedSprite","TilingSprite","Sprite","Graphics","PrimitiveAttributeParser_1","ArrayAttributeParser","elementParser","delimiter","PrimitiveAttributeParser","str","split","map","it","join","ArrayAttributeParser_1","AutoAttributeParser","arrayAttributeParser","primitiveAttributeParser","ColorAttributeParser","parseInt","replace","PointAttributeParser","numberPrecision","factory","console","error","x","parseFloat","y","isNaN","TextureAttributeParser","texture","utils","TextureCache","Texture","textureCacheIds","hasOwnProperty","classAttributes","some","AutoAttributeParser_1","superClassAttributes","getPrototypeOf","concat","getDefault","rootNode","canvas","PixiInspector_1","DisplayObject","PointAttributeParser_1","TextureAttributeParser_1","ColorAttributeParser_1","Mesh","getDefault_1","inspector","prop"],"mappings":";;;;;;;CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,KAAAJ,EAAAK,cAAAV,MAAA,WAAA,MAAA,YAAA,QAAAW,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAhB,GAAA,IAAAa,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAC,GAAA,kBAAAC,UAAAA,OAAA,KAAAlB,GAAAiB,EAAA,MAAAA,GAAAD,GAAA,EAAA,IAAAG,EAAA,MAAAA,GAAAH,GAAA,EAAA,IAAAI,GAAA,GAAAC,OAAA,uBAAAL,EAAA,IAAA,MAAAI,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAV,EAAAG,IAAAf,WAAAW,GAAAI,GAAA,GAAAQ,KAAAD,EAAAtB,QAAA,SAAAU,GAAA,MAAAI,GAAAH,EAAAI,GAAA,GAAAL,IAAAA,IAAAY,EAAAA,EAAAtB,QAAAU,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAf,QAAA,IAAA,GAAAkB,GAAA,kBAAAD,UAAAA,QAAAF,EAAA,EAAAA,EAAAF,EAAAW,OAAAT,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,GAAA,MAAAJ,OAAAe,GAAA,SAAAR,EAAAhB,EAAAD,GCAA,YACA0B,QAAAC,eAAA3B,EAAA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A,OAAAmD,EAAAhC,sBArBA5J,OAAAC,eAAA3B,EAAA,cAAA4B,OAAA,GACA,IAAAsL,GAAAjM,EAAA,mBACAmM,EAAAnM,EAAA,qCACAoM,EAAApM,EAAA,uCACAqM,EAAArM,EAAA,oCAmBAjB,GAAA+M,WAAAA,kKCxBA,YACArL,QAAAC,eAAA3B,EAAA,cAAA4B,OAAA,GACA,IAAAsL,GAAAjM,EAAA,kBACAjB,GAAAgC,cAAAkL,EAAAlL,aACA,IAAAwL,GAAAvM,EAAA,eACAjB,GAAA+M,WAAAS,EAAAT,UACA,IAAAlL,GAAAZ,EAAA,uBACAjB,GAAAuD,QAAA1B,EAAA0B,OACA,IAAAzB,GAAAb,EAAA,uBACAjB,GAAA2D,QAAA7B,EAAA6B,OACA,IAAA5B,GAAAd,EAAA,yBACAjB,GAAA4D,UAAA7B,EAAA6B,SACA,IAAA4G,GAAAvJ,EAAA,wCACAjB,GAAA4K,yBAAAJ,EAAAI,wBACA,IAAAwC,GAAAnM,EAAA,oCACAjB,GAAAyL,qBAAA2B,EAAA3B,oBACA,IAAAP,GAAAjK,EAAA,oCACAjB,GAAAyK,qBAAAS,EAAAT,oBACA,IAAA4C,GAAApM,EAAA,sCACAjB,GAAAkM,uBAAAmB,EAAAnB,iUCnBA,YAEA,IADAxK,OAAAC,eAAA3B,EAAA,cAAA4B,OAAA,IACA,mBAAAW,MACA,KAAA,oDAEA,IAAAkL,GAAAxM,EAAA,cACA,IAAAsB,KAAAkL,UAIA,IAAA,GAAAC,KAAAD,GACAlL,KAAAkL,UAAAC,GAAAD,EAAAC,OAJAnL,MAAAkL,UAAAA,MAOA,KAAAxN,GAAAA,EAAAD,UACAC,EAAAD,QAAAyN","file":"pixi-inspector.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i n) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n n = node.children.length;\r\n for (; i < n; i++) {\r\n element.appendChild(this.buildElement(node.children[i]));\r\n }\r\n }\r\n return element;\r\n };\r\n PixiInspector.prototype.releaseElement = function (element) {\r\n element.pixiTarget = null;\r\n while (element.attributes.length > 1) {\r\n element.removeAttributeNode(element.attributes[1]);\r\n }\r\n while (element.childNodes.length > 0) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n this._elementPool.release(element);\r\n };\r\n PixiInspector.prototype.setElementStyle = function (node, element) {\r\n var bounds = node.getBounds(false, this._tempRect);\r\n if (!element.pixiStyle) {\r\n var index = PixiInspector.styleSheet.cssRules.length;\r\n PixiInspector.styleSheet.insertRule(\"#px\" + index + \" {position:fixed;top:0;left:0;width:0;height:0}\", index);\r\n element.pixiStyle = PixiInspector.styleSheet.cssRules[index].style;\r\n element.id = \"px\" + index;\r\n }\r\n var style = element.pixiStyle;\r\n if (node['__pixi_inspector_is_hidden__']) {\r\n style.display = 'none';\r\n }\r\n style.top = (bounds.top + this._canvas.offsetTop).toFixed(2) + \"px\";\r\n style.left = (bounds.left + this._canvas.offsetLeft).toFixed(2) + \"px\";\r\n style.width = (bounds.width).toFixed(2) + \"px\";\r\n style.height = (bounds.height).toFixed(2) + \"px\";\r\n };\r\n PixiInspector.prototype.setElementAttributes = function (node, element) {\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\r\n var attribute = attributes_1[_i];\r\n var value = void 0;\r\n try {\r\n value = node[attribute.name];\r\n }\r\n catch (e) {\r\n continue;\r\n }\r\n if (attribute.parser.visible(value)) {\r\n element.setAttribute(attribute.name, attribute.parser.stringify(value));\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.onDomChange = function (mutations) {\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n if (mutation.type == 'attributes') {\r\n var element = mutation.target;\r\n var node = element.pixiTarget;\r\n if (node) {\r\n var value = element.getAttribute(mutation.attributeName);\r\n var name_1 = mutation.attributeName.toLowerCase();\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _a = 0, attributes_2 = attributes; _a < attributes_2.length; _a++) {\r\n var attribute = attributes_2[_a];\r\n if (attribute.name.toLowerCase() == name_1) {\r\n node[attribute.name] = attribute.parser.parse(value, node[attribute.name]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.createStyleSheet = function () {\r\n if (!PixiInspector.styleSheet) {\r\n var style = document.createElement('style');\r\n style.appendChild(document.createTextNode('' +\r\n '[id^=\"px\"] {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty:hover {background:rgba(255,255,255,0.2);border:solid 1px #fff}'));\r\n document.head.appendChild(style);\r\n PixiInspector.styleSheet = style.sheet;\r\n }\r\n };\r\n PixiInspector.prototype.addDocumentListeners = function () {\r\n var _this = this;\r\n var ctrl = 17;\r\n var style = PixiInspector.styleSheet.cssRules[1].style;\r\n document.addEventListener('keydown', function (event) {\r\n if (event.which == ctrl && !_this._pointerEvents) {\r\n _this._pointerEvents = true;\r\n style.pointerEvents = 'auto';\r\n }\r\n });\r\n document.addEventListener('keyup', function (event) {\r\n if (event.which == ctrl && _this._pointerEvents) {\r\n _this._pointerEvents = false;\r\n style.pointerEvents = 'none';\r\n }\r\n });\r\n document.addEventListener('click', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n document.addEventListener('contextmenu', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n };\r\n return PixiInspector;\r\n}());\r\nexports.PixiInspector = PixiInspector;\r\nvar ElementPool = (function () {\r\n function ElementPool() {\r\n this.pools = {};\r\n }\r\n ElementPool.prototype.get = function (obj) {\r\n var tagName = 'px-' + this.getTagName(obj).toLowerCase();\r\n if (!Array.isArray(this.pools[tagName])) {\r\n this.pools[tagName] = [];\r\n if (!customElements.get(tagName)) {\r\n customElements.define(tagName, function () {\r\n }, { extends: 'div' });\r\n }\r\n }\r\n return this.pools[tagName].pop() || document.createElement(tagName);\r\n };\r\n ElementPool.prototype.release = function (element) {\r\n if (this.pools[element.localName].indexOf(element) < 0) {\r\n this.pools[element.localName].push(element);\r\n }\r\n };\r\n ElementPool.prototype.getTagName = function (obj) {\r\n var className = null;\r\n if (obj.constructor) {\r\n var exec = /function\\s+(\\w{2,})\\(/.exec(obj.constructor.toString());\r\n className = exec ? exec[1] : null;\r\n }\r\n if (className) {\r\n return className;\r\n }\r\n for (var _i = 0, _a = ElementPool.defaultConstructors; _i < _a.length; _i++) {\r\n var defaultConstructor = _a[_i];\r\n if (obj instanceof defaultConstructor[0]) {\r\n return defaultConstructor[1];\r\n }\r\n }\r\n return 'DisplayObject';\r\n };\r\n ElementPool.defaultConstructors = [\r\n [PIXI.mesh.NineSlicePlane, 'NineSlicePlane'],\r\n [PIXI.mesh.Plane, 'Plane'],\r\n [PIXI.mesh.Rope, 'Rope'],\r\n [PIXI.Text, 'Text'],\r\n [PIXI.extras.BitmapText, 'BitmapText'],\r\n [PIXI.extras.AnimatedSprite, 'AnimatedSprite'],\r\n [PIXI.extras.TilingSprite, 'TilingSprite'],\r\n [PIXI.Sprite, 'Sprite'],\r\n [PIXI.Graphics, 'Graphics'],\r\n [PIXI.Container, 'Container'],\r\n ];\r\n return ElementPool;\r\n}());\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser = (function () {\r\n function ArrayAttributeParser(elementParser, delimiter) {\r\n if (delimiter === void 0) { delimiter = ','; }\r\n this.delimiter = delimiter;\r\n this.elementParser = typeof elementParser == 'function'\r\n ? new elementParser()\r\n : (elementParser || (new PrimitiveAttributeParser_1.PrimitiveAttributeParser()));\r\n }\r\n ArrayAttributeParser.prototype.parse = function (str, value) {\r\n if (!Array.isArray(value)) {\r\n value = [];\r\n }\r\n var i = 0;\r\n var a = str.split(this.delimiter);\r\n var n = Math.min(value.length, a.length);\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i], value[i]);\r\n }\r\n n = a.length;\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i]);\r\n }\r\n while (value.length > n) {\r\n value.pop();\r\n }\r\n return value;\r\n };\r\n ArrayAttributeParser.prototype.stringify = function (value) {\r\n var _this = this;\r\n if (Array.isArray(value)) {\r\n return value.map(function (it) { return _this.elementParser.stringify(it); }).join(this.delimiter);\r\n }\r\n return '';\r\n };\r\n ArrayAttributeParser.prototype.visible = function (value) {\r\n return Array.isArray(value);\r\n };\r\n return ArrayAttributeParser;\r\n}());\r\nexports.ArrayAttributeParser = ArrayAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser_1 = require(\"./ArrayAttributeParser\");\r\nvar AutoAttributeParser = (function () {\r\n function AutoAttributeParser() {\r\n this.arrayAttributeParser = new ArrayAttributeParser_1.ArrayAttributeParser();\r\n this.primitiveAttributeParser = new PrimitiveAttributeParser_1.PrimitiveAttributeParser();\r\n }\r\n AutoAttributeParser.prototype.parse = function (str, value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.parse(str, value);\r\n }\r\n return this.primitiveAttributeParser.parse(str, value);\r\n };\r\n AutoAttributeParser.prototype.stringify = function (value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.stringify(value);\r\n }\r\n return this.primitiveAttributeParser.stringify(value);\r\n };\r\n AutoAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return AutoAttributeParser;\r\n}());\r\nexports.AutoAttributeParser = AutoAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar ColorAttributeParser = (function () {\r\n function ColorAttributeParser() {\r\n }\r\n ColorAttributeParser.prototype.parse = function (str, value) {\r\n return parseInt(str.replace('#', '0x'));\r\n };\r\n ColorAttributeParser.prototype.stringify = function (value) {\r\n if (!value) {\r\n return '#000000';\r\n }\r\n return '#' + value.toString(16).replace('0x', '');\r\n };\r\n ColorAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return ColorAttributeParser;\r\n}());\r\nexports.ColorAttributeParser = ColorAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PointAttributeParser = (function () {\r\n function PointAttributeParser(numberPrecision, factory) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n this.factory = factory;\r\n }\r\n PointAttributeParser.prototype.parse = function (str, value) {\r\n if (!value) {\r\n if (this.factory) {\r\n value = this.factory();\r\n }\r\n else {\r\n console.error('Cannot parse attribute from \"' + str + '\" because factory is not defined.');\r\n return value;\r\n }\r\n }\r\n var n = str.split(',');\r\n if (n.length > 1) {\r\n value.x = parseFloat(n[0]);\r\n value.y = parseFloat(n[1]);\r\n }\r\n else {\r\n value.x = value.y = parseFloat(n[0]);\r\n }\r\n return value;\r\n };\r\n PointAttributeParser.prototype.stringify = function (value) {\r\n if (value) {\r\n var x = value.x.toFixed(this.numberPrecision);\r\n var y = value.y.toFixed(this.numberPrecision);\r\n return x == y ? x : x + ',' + y;\r\n }\r\n return '';\r\n };\r\n PointAttributeParser.prototype.visible = function (value) {\r\n return value != null;\r\n };\r\n return PointAttributeParser;\r\n}());\r\nexports.PointAttributeParser = PointAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser = (function () {\r\n function PrimitiveAttributeParser(numberPrecision) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n }\r\n PrimitiveAttributeParser.prototype.parse = function (str, value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return parseFloat(str);\r\n case 'boolean':\r\n return str == 'true';\r\n case 'string':\r\n return str;\r\n }\r\n if (str == 'true' || str == 'false') {\r\n return str == 'true';\r\n }\r\n var n = parseFloat(str);\r\n if (!isNaN(n)) {\r\n return n;\r\n }\r\n return str;\r\n };\r\n PrimitiveAttributeParser.prototype.stringify = function (value) {\r\n if (typeof value == 'number') {\r\n return value.toFixed(this.numberPrecision);\r\n }\r\n if (value === false || value) {\r\n return value.toString();\r\n }\r\n return '';\r\n };\r\n PrimitiveAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return PrimitiveAttributeParser;\r\n}());\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar TextureAttributeParser = (function () {\r\n function TextureAttributeParser() {\r\n }\r\n TextureAttributeParser.prototype.parse = function (str, value) {\r\n var texture = PIXI.utils.TextureCache[str];\r\n if (texture instanceof PIXI.Texture) {\r\n return texture;\r\n }\r\n return value;\r\n };\r\n TextureAttributeParser.prototype.stringify = function (value) {\r\n return value.textureCacheIds[0];\r\n };\r\n TextureAttributeParser.prototype.visible = function (value) {\r\n return !!value.textureCacheIds;\r\n };\r\n return TextureAttributeParser;\r\n}());\r\nexports.TextureAttributeParser = TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar AutoAttributeParser_1 = require(\"../attributes/AutoAttributeParser\");\r\nfunction domAttr(parser) {\r\n return function (target, propertyName) {\r\n if (!target.hasOwnProperty('__pixi_inspector_class_attributes__')) {\r\n target['__pixi_inspector_class_attributes__'] = [];\r\n }\r\n var classAttributes = target['__pixi_inspector_class_attributes__'];\r\n if (!classAttributes.some(function (it) { return it.name == propertyName; })) {\r\n classAttributes.push({\r\n name: propertyName,\r\n parser: typeof parser == 'function' ? new parser() : (parser || new AutoAttributeParser_1.AutoAttributeParser())\r\n });\r\n }\r\n if (!target.hasOwnProperty('__pixi_inspector_attributes__')) {\r\n Object.defineProperty(target, '__pixi_inspector_attributes__', {\r\n get: function () {\r\n var superClassAttributes = Object.getPrototypeOf(target)['__pixi_inspector_attributes__'];\r\n if (Array.isArray(superClassAttributes)) {\r\n return superClassAttributes.concat(classAttributes);\r\n }\r\n return classAttributes;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nexports.domAttr = domAttr;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domHidden() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_hidden__'] = true;\r\n };\r\n}\r\nexports.domHidden = domHidden;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domLeaf() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_leaf__'] = true;\r\n };\r\n}\r\nexports.domLeaf = domLeaf;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nvar ColorAttributeParser_1 = require(\"./attributes/ColorAttributeParser\");\r\nfunction getDefault(rootNode, canvas) {\r\n return new PixiInspector_1.PixiInspector(rootNode, canvas)\r\n .domAttr(PIXI.DisplayObject, 'x')\r\n .domAttr(PIXI.DisplayObject, 'y')\r\n .domAttr(PIXI.DisplayObject, 'scale', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.DisplayObject, 'rotation')\r\n .domAttr(PIXI.DisplayObject, 'alpha')\r\n .domAttr(PIXI.Sprite, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.Sprite, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.Sprite, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.Text, 'text')\r\n .domAttr(PIXI.Text, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'text')\r\n .domAttr(PIXI.extras.BitmapText, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'tint', ColorAttributeParser_1.ColorAttributeParser);\r\n}\r\nexports.getDefault = getDefault;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nexports.PixiInspector = PixiInspector_1.PixiInspector;\r\nvar getDefault_1 = require(\"./getDefault\");\r\nexports.getDefault = getDefault_1.getDefault;\r\nvar domAttr_1 = require(\"./decorators/domAttr\");\r\nexports.domAttr = domAttr_1.domAttr;\r\nvar domLeaf_1 = require(\"./decorators/domLeaf\");\r\nexports.domLeaf = domLeaf_1.domLeaf;\r\nvar domHidden_1 = require(\"./decorators/domHidden\");\r\nexports.domHidden = domHidden_1.domHidden;\r\nvar PrimitiveAttributeParser_1 = require(\"./attributes/PrimitiveAttributeParser\");\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser_1.PrimitiveAttributeParser;\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nexports.PointAttributeParser = PointAttributeParser_1.PointAttributeParser;\r\nvar ArrayAttributeParser_1 = require(\"./attributes/ArrayAttributeParser\");\r\nexports.ArrayAttributeParser = ArrayAttributeParser_1.ArrayAttributeParser;\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nexports.TextureAttributeParser = TextureAttributeParser_1.TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nif (typeof PIXI === 'undefined') {\r\n throw \"pixi-inspector requires pixi.js to be loaded first\";\r\n}\r\nvar inspector = require(\"./inspector\");\r\nif (!PIXI.inspector) {\r\n PIXI.inspector = inspector;\r\n}\r\nelse {\r\n for (var prop in inspector) {\r\n PIXI.inspector[prop] = inspector[prop];\r\n }\r\n}\r\nif (typeof module !== \"undefined\" && module.exports) {\r\n module.exports = inspector;\r\n}\r\n"],"sourceRoot":"."} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","bin/PixiInspector.js","bin/attributes/ArrayAttributeParser.js","bin/attributes/AutoAttributeParser.js","bin/attributes/ColorAttributeParser.js","bin/attributes/PointAttributeParser.js","bin/attributes/PrimitiveAttributeParser.js","bin/attributes/TextureAttributeParser.js","bin/decorators/domAttr.js","bin/decorators/domHidden.js","bin/decorators/domLeaf.js","bin/getDefault.js","bin/inspector.js","bin"],"names":["f","exports","module","define","amd","g","window","global","self","this","pixiInspector","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","Object","defineProperty","value","domAttr_1","domLeaf_1","domHidden_1","PixiInspector","_rootNode","_canvas","_this","_elementPool","ElementPool","_tempRect","PIXI","Rectangle","_mutationObserver","MutationObserver","mutations","onDomChange","_updateInterval","createStyleSheet","update","parentNode","insertBefore","_rootElement","nextSibling","addDocumentListeners","startUpdateInterval","prototype","domAttr","nodeType","propertyName","parser","domLeaf","domHidden","get","set","enumerable","configurable","clearInterval","_updateIntervalId","setInterval","styleSheet","disabled","disconnect","buildElement","observe","subtree","attributes","node","element","pixiTarget","setElementStyle","setElementAttributes","Container","Math","min","children","childNodes","childElement","childNode","replaceChild","releaseElement","lastChild","remove","appendChild","removeAttributeNode","release","bounds","getBounds","pixiStyle","index","cssRules","insertRule","style","id","display","top","offsetTop","toFixed","left","offsetLeft","width","height","_i","attributes_1","attribute","name","visible","setAttribute","stringify","mutations_1","mutation","type","target","getAttribute","attributeName","name_1","toLowerCase","_a","attributes_2","parse","document","createElement","createTextNode","head","sheet","addEventListener","event","which","_pointerEvents","pointerEvents","$pixi","pools","obj","tagName","getTagName","Array","isArray","customElements","extends","pop","localName","indexOf","push","className","constructor","exec","toString","defaultConstructors","defaultConstructor","mesh","NineSlicePlane","Plane","Rope","Text","extras","BitmapText","AnimatedSprite","TilingSprite","Sprite","Graphics","PrimitiveAttributeParser_1","ArrayAttributeParser","elementParser","delimiter","PrimitiveAttributeParser","str","split","map","it","join","ArrayAttributeParser_1","AutoAttributeParser","arrayAttributeParser","primitiveAttributeParser","ColorAttributeParser","parseInt","replace","PointAttributeParser","numberPrecision","factory","console","error","x","parseFloat","y","isNaN","TextureAttributeParser","texture","utils","TextureCache","Texture","textureCacheIds","hasOwnProperty","classAttributes","some","AutoAttributeParser_1","superClassAttributes","getPrototypeOf","concat","getDefault","rootNode","canvas","PixiInspector_1","DisplayObject","PointAttributeParser_1","TextureAttributeParser_1","ColorAttributeParser_1","Mesh","getDefault_1","inspector","prop"],"mappings":";;;;;;;CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,KAAAJ,EAAAK,cAAAV,MAAA,WAAA,MAAA,YAAA,QAAAW,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAhB,GAAA,IAAAa,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAC,GAAA,kBAAAC,UAA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AA4K,yBAAAJ,EAAAI,wBACA,IAAAwC,GAAAnM,EAAA,oCACAjB,GAAAyL,qBAAA2B,EAAA3B,oBACA,IAAAP,GAAAjK,EAAA,oCACAjB,GAAAyK,qBAAAS,EAAAT,oBACA,IAAA4C,GAAApM,EAAA,sCACAjB,GAAAkM,uBAAAmB,EAAAnB,iUCnBA,YAEA,IADAxK,OAAAC,eAAA3B,EAAA,cAAA4B,OAAA,IACA,mBAAAW,MACA,KAAA,oDAEA,IAAAkL,GAAAxM,EAAA,cACA,IAAAsB,KAAAkL,UAIA,IAAA,GAAAC,KAAAD,GACAlL,KAAAkL,UAAAC,GAAAD,EAAAC,OAJAnL,MAAAkL,UAAAA,MAOA,KAAAxN,GAAAA,EAAAD,UACAC,EAAAD,QAAAyN","file":"pixi-inspector.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i n) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n n = node.children.length;\r\n for (; i < n; i++) {\r\n element.appendChild(this.buildElement(node.children[i]));\r\n }\r\n }\r\n return element;\r\n };\r\n PixiInspector.prototype.releaseElement = function (element) {\r\n element.pixiTarget = null;\r\n while (element.attributes.length > 1) {\r\n element.removeAttributeNode(element.attributes[1]);\r\n }\r\n while (element.childNodes.length > 0) {\r\n this.releaseElement(element.lastChild);\r\n element.lastChild.remove();\r\n }\r\n this._elementPool.release(element);\r\n };\r\n PixiInspector.prototype.setElementStyle = function (node, element) {\r\n var bounds = node.getBounds(false, this._tempRect);\r\n if (!element.pixiStyle) {\r\n var index = PixiInspector.styleSheet.cssRules.length;\r\n PixiInspector.styleSheet.insertRule(\"#px\" + index + \" {position:fixed;top:0;left:0;width:0;height:0}\", index);\r\n element.pixiStyle = PixiInspector.styleSheet.cssRules[index].style;\r\n element.id = \"px\" + index;\r\n }\r\n var style = element.pixiStyle;\r\n if (node['__pixi_inspector_is_hidden__']) {\r\n style.display = 'none';\r\n }\r\n style.top = (bounds.top + this._canvas.offsetTop).toFixed(2) + \"px\";\r\n style.left = (bounds.left + this._canvas.offsetLeft).toFixed(2) + \"px\";\r\n style.width = (bounds.width).toFixed(2) + \"px\";\r\n style.height = (bounds.height).toFixed(2) + \"px\";\r\n };\r\n PixiInspector.prototype.setElementAttributes = function (node, element) {\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {\r\n var attribute = attributes_1[_i];\r\n var value = void 0;\r\n try {\r\n value = node[attribute.name];\r\n }\r\n catch (e) {\r\n continue;\r\n }\r\n if (attribute.parser.visible(value)) {\r\n element.setAttribute(attribute.name, attribute.parser.stringify(value));\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.onDomChange = function (mutations) {\r\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\r\n var mutation = mutations_1[_i];\r\n if (mutation.type == 'attributes') {\r\n var element = mutation.target;\r\n var node = element.pixiTarget;\r\n if (node) {\r\n var value = element.getAttribute(mutation.attributeName);\r\n var name_1 = mutation.attributeName.toLowerCase();\r\n var attributes = node['__pixi_inspector_attributes__'];\r\n if (attributes) {\r\n for (var _a = 0, attributes_2 = attributes; _a < attributes_2.length; _a++) {\r\n var attribute = attributes_2[_a];\r\n if (attribute.name.toLowerCase() == name_1) {\r\n node[attribute.name] = attribute.parser.parse(value, node[attribute.name]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n PixiInspector.prototype.createStyleSheet = function () {\r\n if (!PixiInspector.styleSheet) {\r\n var style = document.createElement('style');\r\n style.appendChild(document.createTextNode('' +\r\n '[id^=\"px\"] {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty {pointer-events:none;}' +\r\n '[id^=\"px\"]:empty:hover {background:rgba(255,255,255,0.2);border:solid 1px #fff}'));\r\n document.head.appendChild(style);\r\n PixiInspector.styleSheet = style.sheet;\r\n }\r\n };\r\n PixiInspector.prototype.addDocumentListeners = function () {\r\n var _this = this;\r\n var ctrl = 17;\r\n var style = PixiInspector.styleSheet.cssRules[1].style;\r\n document.addEventListener('keydown', function (event) {\r\n if (event.which == ctrl && !_this._pointerEvents) {\r\n _this._pointerEvents = true;\r\n style.pointerEvents = 'auto';\r\n }\r\n });\r\n document.addEventListener('keyup', function (event) {\r\n if (event.which == ctrl && _this._pointerEvents) {\r\n _this._pointerEvents = false;\r\n style.pointerEvents = 'none';\r\n }\r\n });\r\n document.addEventListener('click', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n document.addEventListener('contextmenu', function (event) {\r\n var target = event.target.pixiTarget;\r\n if (target) {\r\n window.$pixi = target;\r\n }\r\n });\r\n };\r\n return PixiInspector;\r\n}());\r\nexports.PixiInspector = PixiInspector;\r\nvar ElementPool = (function () {\r\n function ElementPool() {\r\n this.pools = {};\r\n }\r\n ElementPool.prototype.get = function (obj) {\r\n var tagName = 'px-' + this.getTagName(obj).toLowerCase();\r\n if (!Array.isArray(this.pools[tagName])) {\r\n this.pools[tagName] = [];\r\n if (!customElements.get(tagName)) {\r\n customElements.define(tagName, function () {\r\n }, { extends: 'div' });\r\n }\r\n }\r\n return this.pools[tagName].pop() || document.createElement(tagName);\r\n };\r\n ElementPool.prototype.release = function (element) {\r\n if (this.pools[element.localName].indexOf(element) < 0) {\r\n this.pools[element.localName].push(element);\r\n }\r\n };\r\n ElementPool.prototype.getTagName = function (obj) {\r\n var className = null;\r\n if (obj.constructor) {\r\n var exec = /function\\s+(\\w{2,})\\(/.exec(obj.constructor.toString());\r\n className = exec ? exec[1] : null;\r\n }\r\n if (className) {\r\n return className;\r\n }\r\n for (var _i = 0, _a = ElementPool.defaultConstructors; _i < _a.length; _i++) {\r\n var defaultConstructor = _a[_i];\r\n if (obj instanceof defaultConstructor[0]) {\r\n return defaultConstructor[1];\r\n }\r\n }\r\n return 'DisplayObject';\r\n };\r\n ElementPool.defaultConstructors = [\r\n [PIXI.mesh.NineSlicePlane, 'NineSlicePlane'],\r\n [PIXI.mesh.Plane, 'Plane'],\r\n [PIXI.mesh.Rope, 'Rope'],\r\n [PIXI.Text, 'Text'],\r\n [PIXI.extras.BitmapText, 'BitmapText'],\r\n [PIXI.extras.AnimatedSprite, 'AnimatedSprite'],\r\n [PIXI.extras.TilingSprite, 'TilingSprite'],\r\n [PIXI.Sprite, 'Sprite'],\r\n [PIXI.Graphics, 'Graphics'],\r\n [PIXI.Container, 'Container'],\r\n ];\r\n return ElementPool;\r\n}());\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser = (function () {\r\n function ArrayAttributeParser(elementParser, delimiter) {\r\n if (delimiter === void 0) { delimiter = ','; }\r\n this.delimiter = delimiter;\r\n this.elementParser = typeof elementParser == 'function'\r\n ? new elementParser()\r\n : (elementParser || (new PrimitiveAttributeParser_1.PrimitiveAttributeParser()));\r\n }\r\n ArrayAttributeParser.prototype.parse = function (str, value) {\r\n if (!Array.isArray(value)) {\r\n value = [];\r\n }\r\n var i = 0;\r\n var a = str.split(this.delimiter);\r\n var n = Math.min(value.length, a.length);\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i], value[i]);\r\n }\r\n n = a.length;\r\n for (i; i < n; i++) {\r\n value[i] = this.elementParser.parse(a[i]);\r\n }\r\n while (value.length > n) {\r\n value.pop();\r\n }\r\n return value;\r\n };\r\n ArrayAttributeParser.prototype.stringify = function (value) {\r\n var _this = this;\r\n if (Array.isArray(value)) {\r\n return value.map(function (it) { return _this.elementParser.stringify(it); }).join(this.delimiter);\r\n }\r\n return '';\r\n };\r\n ArrayAttributeParser.prototype.visible = function (value) {\r\n return Array.isArray(value);\r\n };\r\n return ArrayAttributeParser;\r\n}());\r\nexports.ArrayAttributeParser = ArrayAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser_1 = require(\"./PrimitiveAttributeParser\");\r\nvar ArrayAttributeParser_1 = require(\"./ArrayAttributeParser\");\r\nvar AutoAttributeParser = (function () {\r\n function AutoAttributeParser() {\r\n this.arrayAttributeParser = new ArrayAttributeParser_1.ArrayAttributeParser();\r\n this.primitiveAttributeParser = new PrimitiveAttributeParser_1.PrimitiveAttributeParser();\r\n }\r\n AutoAttributeParser.prototype.parse = function (str, value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.parse(str, value);\r\n }\r\n return this.primitiveAttributeParser.parse(str, value);\r\n };\r\n AutoAttributeParser.prototype.stringify = function (value) {\r\n if (Array.isArray(value)) {\r\n return this.arrayAttributeParser.stringify(value);\r\n }\r\n return this.primitiveAttributeParser.stringify(value);\r\n };\r\n AutoAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return AutoAttributeParser;\r\n}());\r\nexports.AutoAttributeParser = AutoAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar ColorAttributeParser = (function () {\r\n function ColorAttributeParser() {\r\n }\r\n ColorAttributeParser.prototype.parse = function (str, value) {\r\n return parseInt(str.replace('#', '0x'));\r\n };\r\n ColorAttributeParser.prototype.stringify = function (value) {\r\n if (!value) {\r\n return '#000000';\r\n }\r\n return '#' + value.toString(16).replace('0x', '');\r\n };\r\n ColorAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return ColorAttributeParser;\r\n}());\r\nexports.ColorAttributeParser = ColorAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PointAttributeParser = (function () {\r\n function PointAttributeParser(numberPrecision, factory) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n this.factory = factory;\r\n }\r\n PointAttributeParser.prototype.parse = function (str, value) {\r\n if (!value) {\r\n if (this.factory) {\r\n value = this.factory();\r\n }\r\n else {\r\n console.error('Cannot parse attribute from \"' + str + '\" because factory is not defined.');\r\n return value;\r\n }\r\n }\r\n var n = str.split(',');\r\n if (n.length > 1) {\r\n value.x = parseFloat(n[0]);\r\n value.y = parseFloat(n[1]);\r\n }\r\n else {\r\n value.x = value.y = parseFloat(n[0]);\r\n }\r\n return value;\r\n };\r\n PointAttributeParser.prototype.stringify = function (value) {\r\n if (value) {\r\n var x = (value.x || 0).toFixed(this.numberPrecision);\r\n var y = (value.y || 0).toFixed(this.numberPrecision);\r\n return x == y ? x : x + ',' + y;\r\n }\r\n return '';\r\n };\r\n PointAttributeParser.prototype.visible = function (value) {\r\n return value != null && !isNaN(value.x) && !isNaN(value.y);\r\n };\r\n return PointAttributeParser;\r\n}());\r\nexports.PointAttributeParser = PointAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PrimitiveAttributeParser = (function () {\r\n function PrimitiveAttributeParser(numberPrecision) {\r\n if (numberPrecision === void 0) { numberPrecision = 2; }\r\n this.numberPrecision = numberPrecision;\r\n }\r\n PrimitiveAttributeParser.prototype.parse = function (str, value) {\r\n switch (typeof value) {\r\n case 'number':\r\n return parseFloat(str);\r\n case 'boolean':\r\n return str == 'true';\r\n case 'string':\r\n return str;\r\n }\r\n if (str == 'true' || str == 'false') {\r\n return str == 'true';\r\n }\r\n var n = parseFloat(str);\r\n if (!isNaN(n)) {\r\n return n;\r\n }\r\n return str;\r\n };\r\n PrimitiveAttributeParser.prototype.stringify = function (value) {\r\n if (typeof value == 'number') {\r\n return value.toFixed(this.numberPrecision);\r\n }\r\n if (value === false || value) {\r\n return value.toString();\r\n }\r\n return '';\r\n };\r\n PrimitiveAttributeParser.prototype.visible = function (value) {\r\n return true;\r\n };\r\n return PrimitiveAttributeParser;\r\n}());\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar TextureAttributeParser = (function () {\r\n function TextureAttributeParser() {\r\n }\r\n TextureAttributeParser.prototype.parse = function (str, value) {\r\n var texture = PIXI.utils.TextureCache[str];\r\n if (texture instanceof PIXI.Texture) {\r\n return texture;\r\n }\r\n return value;\r\n };\r\n TextureAttributeParser.prototype.stringify = function (value) {\r\n return value.textureCacheIds[0];\r\n };\r\n TextureAttributeParser.prototype.visible = function (value) {\r\n return !!value.textureCacheIds;\r\n };\r\n return TextureAttributeParser;\r\n}());\r\nexports.TextureAttributeParser = TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar AutoAttributeParser_1 = require(\"../attributes/AutoAttributeParser\");\r\nfunction domAttr(parser) {\r\n return function (target, propertyName) {\r\n if (!target.hasOwnProperty('__pixi_inspector_class_attributes__')) {\r\n target['__pixi_inspector_class_attributes__'] = [];\r\n }\r\n var classAttributes = target['__pixi_inspector_class_attributes__'];\r\n if (!classAttributes.some(function (it) { return it.name == propertyName; })) {\r\n classAttributes.push({\r\n name: propertyName,\r\n parser: typeof parser == 'function' ? new parser() : (parser || new AutoAttributeParser_1.AutoAttributeParser())\r\n });\r\n }\r\n if (!target.hasOwnProperty('__pixi_inspector_attributes__')) {\r\n Object.defineProperty(target, '__pixi_inspector_attributes__', {\r\n get: function () {\r\n var superClassAttributes = Object.getPrototypeOf(target)['__pixi_inspector_attributes__'];\r\n if (Array.isArray(superClassAttributes)) {\r\n return superClassAttributes.concat(classAttributes);\r\n }\r\n return classAttributes;\r\n }\r\n });\r\n }\r\n };\r\n}\r\nexports.domAttr = domAttr;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domHidden() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_hidden__'] = true;\r\n };\r\n}\r\nexports.domHidden = domHidden;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nfunction domLeaf() {\r\n return function (constructor) {\r\n constructor.prototype['__pixi_inspector_is_leaf__'] = true;\r\n };\r\n}\r\nexports.domLeaf = domLeaf;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nvar ColorAttributeParser_1 = require(\"./attributes/ColorAttributeParser\");\r\nfunction getDefault(rootNode, canvas) {\r\n return new PixiInspector_1.PixiInspector(rootNode, canvas)\r\n .domAttr(PIXI.DisplayObject, 'x')\r\n .domAttr(PIXI.DisplayObject, 'y')\r\n .domAttr(PIXI.DisplayObject, 'scale', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.DisplayObject, 'rotation')\r\n .domAttr(PIXI.DisplayObject, 'alpha')\r\n .domAttr(PIXI.Sprite, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.Sprite, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.Sprite, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'texture', TextureAttributeParser_1.TextureAttributeParser)\r\n .domAttr(PIXI.mesh.Mesh, 'tint', ColorAttributeParser_1.ColorAttributeParser)\r\n .domAttr(PIXI.Text, 'text')\r\n .domAttr(PIXI.Text, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'text')\r\n .domAttr(PIXI.extras.BitmapText, 'anchor', PointAttributeParser_1.PointAttributeParser)\r\n .domAttr(PIXI.extras.BitmapText, 'tint', ColorAttributeParser_1.ColorAttributeParser);\r\n}\r\nexports.getDefault = getDefault;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar PixiInspector_1 = require(\"./PixiInspector\");\r\nexports.PixiInspector = PixiInspector_1.PixiInspector;\r\nvar getDefault_1 = require(\"./getDefault\");\r\nexports.getDefault = getDefault_1.getDefault;\r\nvar domAttr_1 = require(\"./decorators/domAttr\");\r\nexports.domAttr = domAttr_1.domAttr;\r\nvar domLeaf_1 = require(\"./decorators/domLeaf\");\r\nexports.domLeaf = domLeaf_1.domLeaf;\r\nvar domHidden_1 = require(\"./decorators/domHidden\");\r\nexports.domHidden = domHidden_1.domHidden;\r\nvar PrimitiveAttributeParser_1 = require(\"./attributes/PrimitiveAttributeParser\");\r\nexports.PrimitiveAttributeParser = PrimitiveAttributeParser_1.PrimitiveAttributeParser;\r\nvar PointAttributeParser_1 = require(\"./attributes/PointAttributeParser\");\r\nexports.PointAttributeParser = PointAttributeParser_1.PointAttributeParser;\r\nvar ArrayAttributeParser_1 = require(\"./attributes/ArrayAttributeParser\");\r\nexports.ArrayAttributeParser = ArrayAttributeParser_1.ArrayAttributeParser;\r\nvar TextureAttributeParser_1 = require(\"./attributes/TextureAttributeParser\");\r\nexports.TextureAttributeParser = TextureAttributeParser_1.TextureAttributeParser;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nif (typeof PIXI === 'undefined') {\r\n throw \"pixi-inspector requires pixi.js to be loaded first\";\r\n}\r\nvar inspector = require(\"./inspector\");\r\nif (!PIXI.inspector) {\r\n PIXI.inspector = inspector;\r\n}\r\nelse {\r\n for (var prop in inspector) {\r\n PIXI.inspector[prop] = inspector[prop];\r\n }\r\n}\r\nif (typeof module !== \"undefined\" && module.exports) {\r\n module.exports = inspector;\r\n}\r\n"],"sourceRoot":"."} \ No newline at end of file diff --git a/package.json b/package.json index f12a26c..3a0df33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pixi-inspector", "description": "Browsing and changing attributes of PixiJS display objects in DOM inspector.", - "version": "1.0.3", + "version": "1.0.4", "license": "MIT", "repository": { "type": "git", diff --git a/src/attributes/PointAttributeParser.ts b/src/attributes/PointAttributeParser.ts index 3b5825f..a62caaa 100644 --- a/src/attributes/PointAttributeParser.ts +++ b/src/attributes/PointAttributeParser.ts @@ -26,14 +26,14 @@ export class PointAttributeParser implements AttributeParser<{ x: number, y: num stringify(value: { x: number, y: number }): string { if (value) { - let x = value.x.toFixed(this.numberPrecision); - let y = value.y.toFixed(this.numberPrecision); + let x = (value.x || 0).toFixed(this.numberPrecision); + let y = (value.y || 0).toFixed(this.numberPrecision); return x == y ? x : x + ',' + y; } return ''; } visible(value: { x: number, y: number }): boolean { - return value != null; + return value != null && !isNaN(value.x) && !isNaN(value.y); } } \ No newline at end of file