From ddda46f4376cf696e623721d98e1c2eb3e799b73 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Wed, 25 Sep 2024 18:07:55 +0200 Subject: [PATCH] Bump dist --- dist/aframe-inspector.js | 57705 ++++++++++++++++++----------- dist/aframe-inspector.js.map | 2 +- dist/aframe-inspector.min.js | 24647 +++++------- dist/aframe-inspector.min.js.map | 2 +- 4 files changed, 47027 insertions(+), 35329 deletions(-) diff --git a/dist/aframe-inspector.js b/dist/aframe-inspector.js index f6eeec87..a8e76cf1 100644 --- a/dist/aframe-inspector.js +++ b/dist/aframe-inspector.js @@ -1558,90 +1558,86 @@ return null; }; - var Emotion = /* #__PURE__ */ withEmotionCache(function ( - props, - cache, - ref - ) { - var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works - // not passing the registered cache to serializeStyles because it would - // make certain babel optimisations not possible + var Emotion = /* #__PURE__ */ withEmotionCache( + function (props, cache, ref) { + var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works + // not passing the registered cache to serializeStyles because it would + // make certain babel optimisations not possible - if ( - typeof cssProp === 'string' && - cache.registered[cssProp] !== undefined - ) { - cssProp = cache.registered[cssProp]; - } + if ( + typeof cssProp === 'string' && + cache.registered[cssProp] !== undefined + ) { + cssProp = cache.registered[cssProp]; + } + + var WrappedComponent = props[typePropName]; + var registeredStyles = [cssProp]; + var className = ''; - var WrappedComponent = props[typePropName]; - var registeredStyles = [cssProp]; - var className = ''; + if (typeof props.className === 'string') { + className = (0, + _emotion_utils__WEBPACK_IMPORTED_MODULE_4__.getRegisteredStyles)( + cache.registered, + registeredStyles, + props.className + ); + } else if (props.className != null) { + className = props.className + ' '; + } - if (typeof props.className === 'string') { - className = (0, - _emotion_utils__WEBPACK_IMPORTED_MODULE_4__.getRegisteredStyles)( - cache.registered, + var serialized = (0, + _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)( registeredStyles, - props.className + undefined, + (0, react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ThemeContext) ); - } else if (props.className != null) { - className = props.className + ' '; - } - var serialized = (0, - _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)( - registeredStyles, - undefined, - (0, react__WEBPACK_IMPORTED_MODULE_0__.useContext)(ThemeContext) - ); - - if (true && serialized.name.indexOf('-') === -1) { - var labelFromStack = props[labelPropName]; + if (true && serialized.name.indexOf('-') === -1) { + var labelFromStack = props[labelPropName]; - if (labelFromStack) { - serialized = (0, - _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)([ - serialized, - 'label:' + labelFromStack + ';' - ]); + if (labelFromStack) { + serialized = (0, + _emotion_serialize__WEBPACK_IMPORTED_MODULE_5__.serializeStyles)( + [serialized, 'label:' + labelFromStack + ';'] + ); + } } - } - className += cache.key + '-' + serialized.name; - var newProps = {}; + className += cache.key + '-' + serialized.name; + var newProps = {}; - for (var key in props) { - if ( - hasOwnProperty.call(props, key) && - key !== 'css' && - key !== typePropName && - (false || key !== labelPropName) - ) { - newProps[key] = props[key]; + for (var key in props) { + if ( + hasOwnProperty.call(props, key) && + key !== 'css' && + key !== typePropName && + (false || key !== labelPropName) + ) { + newProps[key] = props[key]; + } } - } - newProps.ref = ref; - newProps.className = className; - return /*#__PURE__*/ (0, - react__WEBPACK_IMPORTED_MODULE_0__.createElement)( - react__WEBPACK_IMPORTED_MODULE_0__.Fragment, - null, - /*#__PURE__*/ (0, react__WEBPACK_IMPORTED_MODULE_0__.createElement)( - Insertion, - { + newProps.ref = ref; + newProps.className = className; + return /*#__PURE__*/ (0, + react__WEBPACK_IMPORTED_MODULE_0__.createElement)( + react__WEBPACK_IMPORTED_MODULE_0__.Fragment, + null, + /*#__PURE__*/ (0, + react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' - } - ), - /*#__PURE__*/ (0, react__WEBPACK_IMPORTED_MODULE_0__.createElement)( - WrappedComponent, - newProps - ) - ); - }); + }), + /*#__PURE__*/ (0, + react__WEBPACK_IMPORTED_MODULE_0__.createElement)( + WrappedComponent, + newProps + ) + ); + } + ); if (true) { Emotion.displayName = 'EmotionCssPropInternal'; @@ -2218,8 +2214,8 @@ typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef : isBrowser - ? window - : __webpack_require__.g; + ? window + : __webpack_require__.g; var globalKey = '__EMOTION_REACT_' + pkg.version.split('.')[0] + '__'; @@ -2284,13 +2280,13 @@ }; var processStyleName = /* #__PURE__ */ (0, - _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__['default'])(function ( - styleName - ) { - return isCustomProperty(styleName) - ? styleName - : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); - }); + _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__['default'])( + function (styleName) { + return isCustomProperty(styleName) + ? styleName + : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); + } + ); var processStyleValue = function processStyleValue(key, value) { switch (key) { @@ -3088,6 +3084,101 @@ styleSheet.flush() /***/ }, + /***/ './src/components/AwesomeIcon.js': + /*!***************************************!*\ + !*** ./src/components/AwesomeIcon.js ***! + \***************************************/ + /***/ ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__ + ) => { + 'use strict'; + __webpack_require__.r(__webpack_exports__); + /* harmony export */ __webpack_require__.d(__webpack_exports__, { + /* harmony export */ AwesomeIcon: () => /* binding */ AwesomeIcon + /* harmony export */ + }); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__(/*! react */ './node_modules/react/index.js'); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = + /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__( + /*! prop-types */ './node_modules/prop-types/index.js' + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = + /*#__PURE__*/ __webpack_require__.n( + prop_types__WEBPACK_IMPORTED_MODULE_2__ + ); + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' + ); + /* + Use instead of from @fortawesome/react-fontawesome + Using FontAwesomeIcon component adds 66 kB minified to the bundle. + Our AwesomeIcon does the same but less than 2 kB minified. + svg-inline--fa class has been added to lib.styl +*/ + + function asIcon(icon) { + const width = icon[0]; + const height = icon[1]; + const vectorData = icon[4]; + let element; + if (Array.isArray(vectorData)) { + element = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('g', { + children: vectorData.map((pathData, index) => + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( + 'path', + { + fill: 'currentColor', + d: pathData + }, + index + ) + ) + }); + } else { + element = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('path', { + fill: 'currentColor', + d: vectorData + }); + } + return { + width: width, + height: height, + icon: element + }; + } + class AwesomeIcon extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + icon: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object + .isRequired + }; + render() { + const { width, height, icon } = asIcon(this.props.icon.icon); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('svg', { + role: 'img', + className: `svg-inline--fa fa-${this.props.icon.iconName}`, + xmlns: 'http://www.w3.org/2000/svg', + viewBox: `0 0 ${width} ${height}`, + children: icon + }); + } + } + + /***/ + }, + /***/ './src/components/Collapsible.js': /*!***************************************!*\ !*** ./src/components/Collapsible.js ***! @@ -3117,271 +3208,257 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( prop_types__WEBPACK_IMPORTED_MODULE_3__ ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = - __webpack_require__( - /*! classnames */ './node_modules/classnames/index.js' - ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - classnames__WEBPACK_IMPORTED_MODULE_1__ - ); + /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__(/*! clsx */ './node_modules/clsx/dist/clsx.mjs'); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + + class Collapsible extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + className: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, + collapsed: prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool, + children: + prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([ + prop_types__WEBPACK_IMPORTED_MODULE_3___default().array, + prop_types__WEBPACK_IMPORTED_MODULE_3___default().element + ]).isRequired, + id: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; + static defaultProps = { + collapsed: false + }; + constructor(props) { + super(props); + this.state = { + collapsed: this.props.collapsed + }; } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + toggleVisibility = (event) => { + // Don't collapse if we click on actions like clipboard + if (event.target.nodeName === 'A') return; + this.setState({ + collapsed: !this.state.collapsed }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - var Collapsible = /*#__PURE__*/ (function (_React$Component) { - _inherits(Collapsible, _React$Component); - var _super = _createSuper(Collapsible); - function Collapsible(props) { - var _this; - _classCallCheck(this, Collapsible); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'toggleVisibility', - function (event) { - // Don't collapse if we click on actions like clipboard - if (event.target.nodeName === 'A') return; - _this.setState({ - collapsed: !_this.state.collapsed - }); - if (typeof ga !== 'undefined') { - ga('send', 'event', 'Components', 'collapse'); - } - } - ); - _this.state = { - collapsed: _this.props.collapsed + }; + render() { + const rootClassNames = { + collapsible: true, + component: true, + collapsed: this.state.collapsed }; - return _this; - } - _createClass(Collapsible, [ - { - key: 'render', - value: function render() { - var rootClassNames = { - collapsible: true, - component: true, - collapsed: this.state.collapsed - }; - if (this.props.className) { - rootClassNames[this.props.className] = true; - } - var rootClasses = - classnames__WEBPACK_IMPORTED_MODULE_1___default()( - rootClassNames - ); - var contentClasses = - classnames__WEBPACK_IMPORTED_MODULE_1___default()({ - content: true, - hide: this.state.collapsed - }); - return /*#__PURE__*/ (0, + if (this.props.className) { + rootClassNames[this.props.className] = true; + } + const rootClasses = (0, + clsx__WEBPACK_IMPORTED_MODULE_1__['default'])(rootClassNames); + const contentClasses = (0, + clsx__WEBPACK_IMPORTED_MODULE_1__['default'])({ + content: true, + hide: this.state.collapsed + }); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { + id: this.props.id, + className: rootClasses, + children: [ + /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { - id: this.props.id, - className: rootClasses, + className: 'static', + onClick: this.toggleVisibility, children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)( - 'div', - { - className: 'static', - onClick: this.toggleVisibility, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'div', - { - className: 'collapse-button' - } - ), - this.props.children[0] - ] - } - ), /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { - className: contentClasses, - children: this.props.children[1] - }) + className: 'collapse-button' + }), + this.props.children[0] ] - }); + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { + className: contentClasses, + children: this.props.children[1] + }) + ] + }); + } + } + + /***/ + }, + + /***/ './src/components/EntityRepresentation.js': + /*!************************************************!*\ + !*** ./src/components/EntityRepresentation.js ***! + \************************************************/ + /***/ ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__ + ) => { + 'use strict'; + __webpack_require__.r(__webpack_exports__); + /* harmony export */ __webpack_require__.d(__webpack_exports__, { + /* harmony export */ default: () => /* binding */ EntityRepresentation + /* harmony export */ + }); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__(/*! react */ './node_modules/react/index.js'); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = + /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = + __webpack_require__( + /*! prop-types */ './node_modules/prop-types/index.js' + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = + /*#__PURE__*/ __webpack_require__.n( + prop_types__WEBPACK_IMPORTED_MODULE_4__ + ); + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ./AwesomeIcon */ './src/components/AwesomeIcon.js' + ); + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__( + /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' + ); + + const ICONS = { + camera: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('i', { + title: 'camera', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faCamera + } + ) + }), + mesh: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('i', { + title: 'mesh', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faCube + } + ) + }), + light: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('i', { + title: 'light', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faLightbulb } + ) + }), + text: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('i', { + title: 'text', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_3__.faFont + } + ) + }) + }; + class EntityRepresentation extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, + onDoubleClick: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().func + }; + render() { + const entity = this.props.entity; + const onDoubleClick = this.props.onDoubleClick; + if (!entity) { + return null; } - ]); - return Collapsible; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Collapsible, 'propTypes', { - className: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, - collapsed: prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool, - children: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType( - [ - prop_types__WEBPACK_IMPORTED_MODULE_3___default().array, - prop_types__WEBPACK_IMPORTED_MODULE_3___default().element - ] - ).isRequired, - id: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string - }); - _defineProperty(Collapsible, 'defaultProps', { - collapsed: false - }); + + // Icons. + const icons = []; + for (let objType in ICONS) { + if (!entity.getObject3D(objType)) { + continue; + } + icons.push( + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)( + 'span', + { + children: ['\xA0', ICONS[objType]] + }, + objType + ) + ); + } + + // Name. + let entityName = entity.id; + let type = 'id'; + if ( + !entity.isScene && + !entityName && + entity.getAttribute('class') + ) { + entityName = entity.getAttribute('class').split(' ')[0]; + type = 'class'; + } else if ( + !entity.isScene && + !entityName && + entity.getAttribute('mixin') + ) { + entityName = entity.getAttribute('mixin').split(' ')[0]; + type = 'mixin'; + } + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { + className: 'entityPrint', + onDoubleClick: onDoubleClick, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + className: 'entityTagName', + children: '<' + entity.tagName.toLowerCase() + }), + entityName && + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { + className: 'entityName', + 'data-entity-name-type': type, + children: ['\xA0', entityName] + }), + icons.length > 0 && + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + className: 'entityIcons', + children: icons + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + className: 'entityCloseTag', + children: '>' + }) + ] + }); + } + } /***/ }, @@ -3407,279 +3484,55 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ./AwesomeIcon */ './src/components/AwesomeIcon.js' + ); + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var _components_Sidebar__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var _components_Sidebar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./components/Sidebar */ './src/components/components/Sidebar.js' ); - /* harmony import */ var _modals_ModalTextures__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var _modals_ModalTextures__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./modals/ModalTextures */ './src/components/modals/ModalTextures.js' ); - /* harmony import */ var _modals_ModalHelp__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var _modals_ModalHelp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ./modals/ModalHelp */ './src/components/modals/ModalHelp.js' ); - /* harmony import */ var _scenegraph_SceneGraph__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var _scenegraph_SceneGraph__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ./scenegraph/SceneGraph */ './src/components/scenegraph/SceneGraph.js' ); - /* harmony import */ var _viewport_CameraToolbar__WEBPACK_IMPORTED_MODULE_6__ = + /* harmony import */ var _viewport_CameraToolbar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! ./viewport/CameraToolbar */ './src/components/viewport/CameraToolbar.js' ); - /* harmony import */ var _viewport_TransformToolbar__WEBPACK_IMPORTED_MODULE_7__ = + /* harmony import */ var _viewport_TransformToolbar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( /*! ./viewport/TransformToolbar */ './src/components/viewport/TransformToolbar.js' ); - /* harmony import */ var _viewport_ViewportHUD__WEBPACK_IMPORTED_MODULE_8__ = + /* harmony import */ var _viewport_ViewportHUD__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__( /*! ./viewport/ViewportHUD */ './src/components/viewport/ViewportHUD.js' ); - /* harmony import */ var _lib_utils__WEBPACK_IMPORTED_MODULE_9__ = - __webpack_require__(/*! ../lib/utils */ './src/lib/utils.js'); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } THREE.ImageUtils.crossOrigin = ''; - - // Megahack to include font-awesome. - (0, _lib_utils__WEBPACK_IMPORTED_MODULE_9__.injectCSS)( - 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css' - ); - var Main = /*#__PURE__*/ (function (_React$Component) { - _inherits(Main, _React$Component); - var _super = _createSuper(Main); - function Main(props) { - var _this; - _classCallCheck(this, Main); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onCloseHelpModal', - function (value) { - _this.setState({ - isHelpOpen: false - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onModalTextureOnClose', - function (value) { - _this.setState({ - isModalTexturesOpen: false - }); - if (_this.state.textureOnClose) { - _this.state.textureOnClose(value); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'toggleEdit', - function () { - if (_this.state.inspectorEnabled) { - AFRAME.INSPECTOR.close(); - } else { - AFRAME.INSPECTOR.open(); - } - } - ); - _this.state = { + class Main extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + constructor(props) { + super(props); + this.state = { entity: null, inspectorEnabled: true, isModalTexturesOpen: false, @@ -3689,22 +3542,22 @@ styleSheet.flush() attributes: true } }; - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( 'togglesidebar', - function (event) { + (event) => { if (event.which === 'all') { if ( - _this.state.visible.scenegraph || - _this.state.visible.attributes + this.state.visible.scenegraph || + this.state.visible.attributes ) { - _this.setState({ + this.setState({ visible: { scenegraph: false, attributes: false } }); } else { - _this.setState({ + this.setState({ visible: { scenegraph: true, attributes: true @@ -3712,244 +3565,241 @@ styleSheet.flush() }); } } else if (event.which === 'attributes') { - _this.setState(function (prevState) { - return { - visible: _objectSpread( - _objectSpread({}, prevState.visible), - {}, - { - attributes: !prevState.visible.attributes - } - ) - }; - }); + this.setState((prevState) => ({ + visible: { + ...prevState.visible, + attributes: !prevState.visible.attributes + } + })); } else if (event.which === 'scenegraph') { - _this.setState(function (prevState) { - return { - visible: _objectSpread( - _objectSpread({}, prevState.visible), - {}, - { - scenegraph: !prevState.visible.scenegraph - } - ) - }; - }); + this.setState((prevState) => ({ + visible: { + ...prevState.visible, + scenegraph: !prevState.visible.scenegraph + } + })); } } ); - return _this; } - _createClass(Main, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'opentexturesmodal', - function (selectedTexture, textureOnClose) { - this.setState({ - selectedTexture: selectedTexture, - isModalTexturesOpen: true, - textureOnClose: textureOnClose - }); - }.bind(this) - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'entityselect', - function (entity) { - _this2.setState({ - entity: entity - }); - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'inspectortoggle', - function (enabled) { - _this2.setState({ - inspectorEnabled: enabled - }); - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'openhelpmodal', - function () { - _this2.setState({ - isHelpOpen: true - }); - } - ); + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'opentexturesmodal', + function (selectedTexture, textureOnClose) { + this.setState({ + selectedTexture: selectedTexture, + isModalTexturesOpen: true, + textureOnClose: textureOnClose + }); + }.bind(this) + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'entityselect', + (entity) => { + this.setState({ + entity: entity + }); } - }, - { - key: 'renderComponentsToggle', - value: function renderComponentsToggle() { - if ( - !this.state.inspectorEnabled || - !this.state.entity || - this.state.visible.attributes - ) { - return null; - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('div', { - className: 'toggle-sidebar right', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { - onClick: function onClick() { - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - 'togglesidebar', - { - which: 'attributes' - } - ); - }, - className: 'fa fa-plus', - title: 'Show components' - }) + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'inspectortoggle', + (enabled) => { + this.setState({ + inspectorEnabled: enabled }); } - }, - { - key: 'renderSceneGraphToggle', - value: function renderSceneGraphToggle() { - if ( - !this.state.inspectorEnabled || - this.state.visible.scenegraph - ) { - return null; - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('div', { - className: 'toggle-sidebar left', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { - onClick: function onClick() { - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - 'togglesidebar', - { - which: 'scenegraph' - } - ); - }, - className: 'fa fa-plus', - title: 'Show scenegraph' - }) + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'openhelpmodal', + () => { + this.setState({ + isHelpOpen: true }); } - }, - { - key: 'render', - value: function render() { - var scene = this.state.sceneEl; - var toggleButtonText = this.state.inspectorEnabled - ? 'Back to Scene' - : 'Inspect Scene'; - return /*#__PURE__*/ (0, + ); + } + onCloseHelpModal = (value) => { + this.setState({ + isHelpOpen: false + }); + }; + onModalTextureOnClose = (value) => { + this.setState({ + isModalTexturesOpen: false + }); + if (this.state.textureOnClose) { + this.state.textureOnClose(value); + } + }; + toggleEdit = () => { + if (this.state.inspectorEnabled) { + AFRAME.INSPECTOR.close(); + } else { + AFRAME.INSPECTOR.open(); + } + }; + renderComponentsToggle() { + if ( + !this.state.inspectorEnabled || + !this.state.entity || + this.state.visible.attributes + ) { + return null; + } + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('div', { + className: 'toggle-sidebar right', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { + onClick: () => { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( + 'togglesidebar', + { + which: 'attributes' + } + ); + }, + title: 'Show components', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faPlus + } + ) + }) + }); + } + renderSceneGraphToggle() { + if (!this.state.inspectorEnabled || this.state.visible.scenegraph) { + return null; + } + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('div', { + className: 'toggle-sidebar left', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { + onClick: () => { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( + 'togglesidebar', + { + which: 'scenegraph' + } + ); + }, + title: 'Show scenegraph', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_11__.faPlus + } + ) + }) + }); + } + render() { + const scene = this.state.sceneEl; + const toggleButtonText = this.state.inspectorEnabled + ? 'Back to Scene' + : 'Inspect Scene'; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)('div', { + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { + className: 'toggle-edit', + onClick: this.toggleEdit, + children: toggleButtonText + }), + this.renderSceneGraphToggle(), + this.renderComponentsToggle(), + /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)('div', { + id: 'inspectorContainer', + className: this.state.inspectorEnabled ? '' : 'hidden', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)('a', { - className: 'toggle-edit', - onClick: this.toggleEdit, - children: toggleButtonText - }), - this.renderSceneGraphToggle(), - this.renderComponentsToggle(), + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _scenegraph_SceneGraph__WEBPACK_IMPORTED_MODULE_6__[ + 'default' + ], + { + scene: scene, + selectedEntity: this.state.entity, + visible: this.state.visible.scenegraph + } + ), /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)( 'div', { - id: 'inspectorContainer', - className: this.state.inspectorEnabled ? '' : 'hidden', + id: 'viewportBar', children: [ /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _scenegraph_SceneGraph__WEBPACK_IMPORTED_MODULE_5__[ + _viewport_CameraToolbar__WEBPACK_IMPORTED_MODULE_7__[ 'default' ], - { - scene: scene, - selectedEntity: this.state.entity, - visible: this.state.visible.scenegraph - } + {} ), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)( - 'div', - { - id: 'viewportBar', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _viewport_CameraToolbar__WEBPACK_IMPORTED_MODULE_6__[ - 'default' - ], - {} - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _viewport_ViewportHUD__WEBPACK_IMPORTED_MODULE_8__[ - 'default' - ], - {} - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _viewport_TransformToolbar__WEBPACK_IMPORTED_MODULE_7__[ - 'default' - ], - {} - ) - ] - } + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _viewport_ViewportHUD__WEBPACK_IMPORTED_MODULE_9__[ + 'default' + ], + {} ), /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - 'div', - { - id: 'rightPanel', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _components_Sidebar__WEBPACK_IMPORTED_MODULE_2__[ - 'default' - ], - { - entity: this.state.entity, - visible: this.state.visible.attributes - } - ) - } + _viewport_TransformToolbar__WEBPACK_IMPORTED_MODULE_8__[ + 'default' + ], + {} ) ] } ), /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _modals_ModalHelp__WEBPACK_IMPORTED_MODULE_4__['default'], - { - isOpen: this.state.isHelpOpen, - onClose: this.onCloseHelpModal - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( - _modals_ModalTextures__WEBPACK_IMPORTED_MODULE_3__[ - 'default' - ], + 'div', { - isOpen: this.state.isModalTexturesOpen, - selectedTexture: this.state.selectedTexture, - onClose: this.onModalTextureOnClose + id: 'rightPanel', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _components_Sidebar__WEBPACK_IMPORTED_MODULE_3__[ + 'default' + ], + { + entity: this.state.entity, + visible: this.state.visible.attributes + } + ) } ) ] - }); - } - } - ]); - return Main; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _modals_ModalHelp__WEBPACK_IMPORTED_MODULE_5__['default'], + { + isOpen: this.state.isHelpOpen, + onClose: this.onCloseHelpModal + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)( + _modals_ModalTextures__WEBPACK_IMPORTED_MODULE_4__['default'], + { + isOpen: this.state.isModalTexturesOpen, + selectedTexture: this.state.selectedTexture, + onClose: this.onModalTextureOnClose + } + ) + ] + }); + } + } /***/ }, @@ -3975,17 +3825,17 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_4__ + prop_types__WEBPACK_IMPORTED_MODULE_3__ ); /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! react-select */ './node_modules/react-select/dist/react-select.esm.js' ); @@ -3993,319 +3843,119 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + + class AddComponent extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: prop_types__WEBPACK_IMPORTED_MODULE_3___default().object }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + + /** + * Add blank component. + * If component is instanced, generate an ID. + */ + addComponent = (value) => { + let componentName = value.value; + var entity = this.props.entity; + if (AFRAME.components[componentName].multiple) { + const id = prompt( + `Provide an ID for this component (e.g., 'foo' for ${componentName}__foo).` + ); + componentName = id ? `${componentName}__${id}` : componentName; + } + entity.setAttribute(componentName, ''); + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( + 'componentadd', + { + entity: entity, + component: componentName + } ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + }; + + /** + * Component dropdown options. + */ + getComponentsOptions() { + const usedComponents = Object.keys(this.props.entity.components); + var commonOptions = Object.keys(AFRAME.components) + .filter(function (componentName) { + return ( + AFRAME.components[componentName].multiple || + usedComponents.indexOf(componentName) === -1 + ); + }) + .sort() + .map(function (value) { + return { + value: value, + label: value, + origin: 'loaded' + }; + }); + this.options = commonOptions; + this.options = this.options.sort(function (a, b) { + return a.label === b.label ? 0 : a.label < b.label ? -1 : 1; }); - } else { - obj[key] = value; } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); + renderOption(option) { + var bullet = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + title: 'Component already loaded in the scene', + children: '\u25CF' + }); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('strong', { + className: 'option', + children: [ + option.label, + ' ', + option.origin === 'loaded' ? bullet : '' + ] + }); } - return (hint === 'string' ? String : Number)(input); - } - - var AddComponent = /*#__PURE__*/ (function (_React$Component) { - _inherits(AddComponent, _React$Component); - var _super = _createSuper(AddComponent); - function AddComponent() { - var _this; - _classCallCheck(this, AddComponent); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty( - _assertThisInitialized(_this), - 'addComponent', - function (value) { - var componentName = value.value; - var entity = _this.props.entity; - if (AFRAME.components[componentName].multiple) { - var id = prompt( - "Provide an ID for this component (e.g., 'foo' for ".concat( - componentName, - '__foo).' - ) - ); - componentName = id - ? ''.concat(componentName, '__').concat(id) - : componentName; - } - entity.setAttribute(componentName, ''); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - 'componentadd', + render() { + const entity = this.props.entity; + if (!entity) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', {}); + } + this.getComponentsOptions(); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { + id: 'addComponentContainer', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('p', { + id: 'addComponentHeader', + children: 'COMPONENTS' + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + react_select__WEBPACK_IMPORTED_MODULE_4__['default'], { - entity: entity, - component: componentName + id: 'addComponent', + className: 'addComponent', + classNamePrefix: 'select', + options: this.options, + simpleValue: true, + clearable: true, + placeholder: 'Add component...', + noResultsText: 'No components found', + onChange: this.addComponent, + optionRenderer: this.renderOption, + searchable: true } - ); - if (typeof ga !== 'undefined') { - ga( - 'send', - 'event', - 'Components', - 'addComponent', - componentName - ); - } - } - ); - return _this; + ) + ] + }); } - _createClass(AddComponent, [ - { - key: 'getComponentsOptions', - value: - /** - * Component dropdown options. - */ - function getComponentsOptions() { - var usedComponents = Object.keys( - this.props.entity.components - ); - var commonOptions = Object.keys(AFRAME.components) - .filter(function (componentName) { - return ( - AFRAME.components[componentName].multiple || - usedComponents.indexOf(componentName) === -1 - ); - }) - .sort() - .map(function (value) { - return { - value: value, - label: value, - origin: 'loaded' - }; - }); - this.options = commonOptions; - this.options = this.options.sort(function (a, b) { - return a.label === b.label ? 0 : a.label < b.label ? -1 : 1; - }); - } - }, - { - key: 'renderOption', - value: function renderOption(option) { - var bullet = /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { - title: 'Component already loaded in the scene', - children: '\u25CF' - }); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('strong', { - className: 'option', - children: [ - option.label, - ' ', - option.origin === 'loaded' ? bullet : '' - ] - }); - } - }, - { - key: 'render', - value: function render() { - var entity = this.props.entity; - if (!entity) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'div', - {} - ); - } - this.getComponentsOptions(); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { - id: 'addComponentContainer', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('p', { - id: 'addComponentHeader', - children: 'COMPONENTS' - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - react_select__WEBPACK_IMPORTED_MODULE_3__['default'], - { - id: 'addComponent', - className: 'addComponent', - classNamePrefix: 'select', - options: this.options, - simpleValue: true, - clearable: true, - placeholder: 'Add component...', - noResultsText: 'No components found', - onChange: this.addComponent, - optionRenderer: this.renderOption, - searchable: true - } - ) - ] - }); - } - } - ]); - return AddComponent; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); + } + /* eslint-disable no-unused-vars */ /** * Check if component has multiplicity. */ - _defineProperty(AddComponent, 'propTypes', { - entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object - }); - function isComponentInstanced(entity, componentName) { for (var component in entity.components) { if ( @@ -4340,475 +3990,302 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_12__ + prop_types__WEBPACK_IMPORTED_MODULE_14__ + ); + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_15__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' ); - /* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ../widgets */ './src/components/widgets/index.js' ); - /* harmony import */ var _DefaultComponents__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var _DefaultComponents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./DefaultComponents */ './src/components/components/DefaultComponents.js' ); - /* harmony import */ var _PropertyRow__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var _PropertyRow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./PropertyRow */ './src/components/components/PropertyRow.js' ); - /* harmony import */ var _Collapsible__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var _Collapsible__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ../Collapsible */ './src/components/Collapsible.js' ); - /* harmony import */ var _Mixins__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var _Mixins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ./Mixins */ './src/components/components/Mixins.js' ); - /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_6__ = + /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../lib/entity */ './src/lib/entity.js'); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_7__ = + /* harmony import */ var _EntityRepresentation__WEBPACK_IMPORTED_MODULE_8__ = + __webpack_require__( + /*! ../EntityRepresentation */ './src/components/EntityRepresentation.js' + ); + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_8__ = + /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__( - /*! clipboard */ './node_modules/clipboard/dist/clipboard.js' + /*! clipboard-copy */ './node_modules/clipboard-copy/index.js' ); - /* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_8___default = + /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/ __webpack_require__.n( - clipboard__WEBPACK_IMPORTED_MODULE_8__ + clipboard_copy__WEBPACK_IMPORTED_MODULE_10__ ); - /* harmony import */ var _lib_utils__WEBPACK_IMPORTED_MODULE_9__ = + /* harmony import */ var _lib_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../lib/utils */ './src/lib/utils.js'); - /* harmony import */ var _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_10__ = + /* harmony import */ var _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__( /*! ../../../assets/gltf.svg */ './assets/gltf.svg' ); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor + + // @todo Take this out and use updateEntity? + + function changeId(componentName, value) { + var entity = AFRAME.INSPECTOR.selectedEntity; + if (entity.id !== value) { + entity.id = value; + _lib_Events__WEBPACK_IMPORTED_MODULE_9__['default'].emit( + 'entityidchange', + entity ); } } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + class CommonComponents extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: prop_types__WEBPACK_IMPORTED_MODULE_14___default().object + }; + onEntityUpdate = (detail) => { + if (detail.entity !== this.props.entity) { + return; } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + if ( + _DefaultComponents__WEBPACK_IMPORTED_MODULE_3__[ + 'default' + ].indexOf(detail.component) !== -1 || + detail.component === 'mixin' + ) { + this.forceUpdate(); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_9__['default'].on( + 'entityupdate', + this.onEntityUpdate ); } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_9__['default'].off( + 'entityupdate', + this.onEntityUpdate ); } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - // @todo Take this out and use updateEntity? - - function changeId(componentName, value) { - var entity = AFRAME.INSPECTOR.selectedEntity; - if (entity.id !== value) { - entity.id = value; - _lib_Events__WEBPACK_IMPORTED_MODULE_7__['default'].emit( - 'entityidchange', - entity + renderCommonAttributes() { + const entity = this.props.entity; + return ['position', 'rotation', 'scale', 'visible'].map( + (componentName) => { + const schema = AFRAME.components[componentName].schema; + var data = entity.object3D[componentName]; + if (componentName === 'rotation') { + data = { + x: THREE.MathUtils.radToDeg(entity.object3D.rotation.x), + y: THREE.MathUtils.radToDeg(entity.object3D.rotation.y), + z: THREE.MathUtils.radToDeg(entity.object3D.rotation.z) + }; + } + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + _PropertyRow__WEBPACK_IMPORTED_MODULE_4__['default'], + { + name: componentName, + schema: schema, + data: data, + isSingle: true, + componentname: componentName, + entity: entity + }, + componentName + ); + } ); } - } - var CommonComponents = /*#__PURE__*/ (function (_React$Component) { - _inherits(CommonComponents, _React$Component); - var _super = _createSuper(CommonComponents); - function CommonComponents() { - _classCallCheck(this, CommonComponents); - return _super.apply(this, arguments); - } - _createClass(CommonComponents, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_7__['default'].on( - 'entityupdate', - function (detail) { - if (detail.entity !== _this.props.entity) { - return; - } - if ( - _DefaultComponents__WEBPACK_IMPORTED_MODULE_2__[ - 'default' - ].indexOf(detail.component) !== -1 - ) { - _this.forceUpdate(); - } - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_7__['default'].on( - 'refreshsidebarobject3d', - function () { - _this.forceUpdate(); - } - ); - var clipboard = - new (clipboard__WEBPACK_IMPORTED_MODULE_8___default())( - '[data-action="copy-entity-to-clipboard"]', - { - text: function text(trigger) { - return (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_6__.getEntityClipboardRepresentation)( - _this.props.entity - ); - } - } - ); - clipboard.on('error', function (e) { - // @todo Show the error on the UI + exportToGLTF() { + const entity = this.props.entity; + AFRAME.INSPECTOR.exporters.gltf.parse( + entity.object3D, + function (buffer) { + const blob = new Blob([buffer], { + type: 'application/octet-stream' }); - } - }, - { - key: 'renderCommonAttributes', - value: function renderCommonAttributes() { - var entity = this.props.entity; - return ['position', 'rotation', 'scale', 'visible'].map( - function (componentName) { - var schema = AFRAME.components[componentName].schema; - var data = entity.object3D[componentName]; - if (componentName === 'rotation') { - data = { - x: THREE.MathUtils.radToDeg(entity.object3D.rotation.x), - y: THREE.MathUtils.radToDeg(entity.object3D.rotation.y), - z: THREE.MathUtils.radToDeg(entity.object3D.rotation.z) - }; - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - _PropertyRow__WEBPACK_IMPORTED_MODULE_3__['default'], - { - onChange: - _lib_entity__WEBPACK_IMPORTED_MODULE_6__.updateEntity, - name: componentName, - showHelp: true, - schema: schema, - data: data, - isSingle: true, - componentname: componentName, - entity: entity - }, - componentName - ); - } + (0, _lib_utils__WEBPACK_IMPORTED_MODULE_11__.saveBlob)( + blob, + (entity.id || 'entity') + '.glb' ); + }, + function (error) { + console.error(error); + }, + { + binary: true } - }, - { - key: 'exportToGLTF', - value: function exportToGLTF() { - var entity = this.props.entity; - AFRAME.INSPECTOR.exporters.gltf.parse( - entity.object3D, - function (buffer) { - var blob = new Blob([buffer], { - type: 'application/octet-stream' - }); - (0, _lib_utils__WEBPACK_IMPORTED_MODULE_9__.saveBlob)( - blob, - (entity.id || 'entity') + '.glb' - ); + ); + } + render() { + const entity = this.props.entity; + if (!entity) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)('div', {}); + } + const entityButtons = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)('div', { + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)('a', { + title: 'Export entity to GLTF', + className: 'gltfIcon', + onClick: (event) => { + this.exportToGLTF(); + event.preventDefault(); + event.stopPropagation(); }, - function (error) { - console.error(error); + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)('img', { + src: _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_12__ + }) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)('a', { + title: 'Copy entity HTML to clipboard', + className: 'button', + onClick: (event) => { + event.preventDefault(); + event.stopPropagation(); + clipboard_copy__WEBPACK_IMPORTED_MODULE_10___default()( + (0, + _lib_entity__WEBPACK_IMPORTED_MODULE_7__.getEntityClipboardRepresentation)( + this.props.entity + ) + ); }, - { - binary: true - } - ); - } - }, - { - key: 'render', - value: function render() { - var _this2 = this; - var entity = this.props.entity; - if (!entity) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - 'div', - {} - ); - } - var entityButtons = /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)('div', { - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)('a', { - title: 'Export entity to GLTF', - className: 'gltfIcon', - onClick: function onClick(event) { - _this2.exportToGLTF(); - event.preventDefault(); - event.stopPropagation(); - }, - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - 'img', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_15__.faClipboard + } + ) + }) + ] + }); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)( + _Collapsible__WEBPACK_IMPORTED_MODULE_5__['default'], + { + id: 'componentEntityHeader', + className: 'commonComponents', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)('div', { + className: 'collapsible-header', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + _EntityRepresentation__WEBPACK_IMPORTED_MODULE_8__[ + 'default' + ], { - src: _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_10__ + entity: entity } - ) - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)('a', { - title: 'Copy entity HTML to clipboard', - 'data-action': 'copy-entity-to-clipboard', - className: 'button fa fa-clipboard' - }) - ] - }); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)( - _Collapsible__WEBPACK_IMPORTED_MODULE_4__['default'], - { - id: 'componentEntityHeader', - className: 'commonComponents', + ), + entityButtons + ] + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)('div', { + className: 'collapsible-content', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)( + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)( 'div', { - className: 'collapsible-header', + className: 'propertyRow', children: [ - (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_6__.printEntity)( - entity + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + 'label', + { + htmlFor: 'id', + className: 'text', + children: 'ID' + } ), - entityButtons + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + _widgets__WEBPACK_IMPORTED_MODULE_2__.InputWidget, + { + onChange: changeId, + entity: entity, + name: 'id', + value: entity.id + } + ) ] } ), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)( + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)( 'div', { - className: 'collapsible-content', + className: 'propertyRow', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)( - 'div', - { - className: 'propertyRow', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - 'label', - { - htmlFor: 'id', - className: 'text', - children: 'ID' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - _widgets__WEBPACK_IMPORTED_MODULE_1__.InputWidget, - { - onChange: changeId, - entity: entity, - name: 'id', - value: entity.id - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)( - 'div', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + 'label', { - className: 'propertyRow', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - 'label', - { - className: 'text', - children: 'class' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - 'span', - { - children: entity.getAttribute('class') - } - ) - ] + className: 'text', + children: 'class' } ), - this.renderCommonAttributes(), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)( - _Mixins__WEBPACK_IMPORTED_MODULE_5__['default'], + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + 'span', { - entity: entity + children: entity.getAttribute('class') } ) ] } + ), + this.renderCommonAttributes(), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)( + _Mixins__WEBPACK_IMPORTED_MODULE_6__['default'], + { + entity: entity + } ) ] - } - ); + }) + ] } - } - ]); - return CommonComponents; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(CommonComponents, 'propTypes', { - entity: prop_types__WEBPACK_IMPORTED_MODULE_12___default().object - }); + ); + } + } /***/ }, @@ -4834,451 +4311,262 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_7__ + prop_types__WEBPACK_IMPORTED_MODULE_8__ + ); + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' ); - /* harmony import */ var _PropertyRow__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _PropertyRow__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ./PropertyRow */ './src/components/components/PropertyRow.js' ); - /* harmony import */ var _Collapsible__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var _Collapsible__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ../Collapsible */ './src/components/Collapsible.js' ); - /* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( - /*! clipboard */ './node_modules/clipboard/dist/clipboard.js' + /*! clipboard-copy */ './node_modules/clipboard-copy/index.js' ); - /* harmony import */ var clipboard__WEBPACK_IMPORTED_MODULE_3___default = + /* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/ __webpack_require__.n( - clipboard__WEBPACK_IMPORTED_MODULE_3__ + clipboard_copy__WEBPACK_IMPORTED_MODULE_4__ ); - /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../lib/entity */ './src/lib/entity.js'); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + + const isSingleProperty = AFRAME.schema.isSingleProperty; + + /** + * Single component. + */ + class Component extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + component: prop_types__WEBPACK_IMPORTED_MODULE_8___default().any, + entity: prop_types__WEBPACK_IMPORTED_MODULE_8___default().object, + isCollapsed: prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool, + name: prop_types__WEBPACK_IMPORTED_MODULE_8___default().string + }; + constructor(props) { + super(props); + this.state = { + entity: this.props.entity, + name: this.props.name + }; } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + onEntityUpdate = (detail) => { + if (detail.entity !== this.props.entity) { + return; } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + if (detail.component === this.props.name) { + this.forceUpdate(); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_6__['default'].on( + 'entityupdate', + this.onEntityUpdate ); } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_6__['default'].off( + 'entityupdate', + this.onEntityUpdate ); - return true; - } catch (e) { - return false; } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); + static getDerivedStateFromProps(props, state) { + if (state.entity !== props.entity) { + return { + entity: props.entity }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); + } + if (state.name !== props.name) { + return { + name: props.name + }; + } + return null; } - return (hint === 'string' ? String : Number)(input); - } - - var isSingleProperty = AFRAME.schema.isSingleProperty; - - /** - * Single component. - */ - var Component = /*#__PURE__*/ (function (_React$Component) { - _inherits(Component, _React$Component); - var _super = _createSuper(Component); - function Component(props) { - var _this; - _classCallCheck(this, Component); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'removeComponent', - function (event) { - var componentName = _this.props.name; - event.stopPropagation(); - if ( - confirm( - 'Do you really want to remove component `' + - componentName + - '`?' - ) - ) { - _this.props.entity.removeAttribute(componentName); - _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].emit( - 'componentremove', - { - entity: _this.props.entity, - component: componentName - } - ); - if (typeof ga !== 'undefined') { - ga( - 'send', - 'event', - 'Components', - 'removeComponent', - componentName - ); - } - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'renderPropertyRows', - function () { - var componentData = _this.props.component; - if (isSingleProperty(componentData.schema)) { - var componentName = _this.props.name; - var schema = - AFRAME.components[componentName.split('__')[0]].schema; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - _PropertyRow__WEBPACK_IMPORTED_MODULE_1__['default'], - { - name: componentName, - schema: schema, - data: componentData.data, - componentname: componentName, - isSingle: true, - entity: _this.props.entity - }, - componentName - ); + removeComponent = (event) => { + var componentName = this.props.name; + event.stopPropagation(); + if ( + confirm( + 'Do you really want to remove component `' + + componentName + + '`?' + ) + ) { + this.props.entity.removeAttribute(componentName); + _lib_Events__WEBPACK_IMPORTED_MODULE_6__['default'].emit( + 'componentremove', + { + entity: this.props.entity, + component: componentName } - return Object.keys(componentData.schema) - .sort() - .map(function (propertyName) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - _PropertyRow__WEBPACK_IMPORTED_MODULE_1__['default'], - { - name: propertyName, - schema: componentData.schema[propertyName], - data: componentData.data[propertyName], - componentname: _this.props.name, - isSingle: false, - entity: _this.props.entity - }, - propertyName - ); - }); - } - ); - _this.state = { - entity: _this.props.entity, - name: _this.props.name - }; - return _this; - } - _createClass( - Component, - [ + ); + } + }; + + /** + * Render propert(ies) of the component. + */ + renderPropertyRows = () => { + const componentData = this.props.component; + if (isSingleProperty(componentData.schema)) { + const componentName = this.props.name; + const schema = + AFRAME.components[componentName.split('__')[0]].schema; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + _PropertyRow__WEBPACK_IMPORTED_MODULE_2__['default'], + { + name: componentName, + schema: schema, + data: componentData.data, + componentname: componentName, + isSingle: true, + entity: this.props.entity + }, + componentName + ); + } + return Object.keys(componentData.schema) + .sort() + .map((propertyName) => + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + _PropertyRow__WEBPACK_IMPORTED_MODULE_2__['default'], + { + name: propertyName, + schema: componentData.schema[propertyName], + data: componentData.data[propertyName], + componentname: this.props.name, + isSingle: false, + entity: this.props.entity + }, + propertyName + ) + ); + }; + render() { + let componentName = this.props.name; + let subComponentName = ''; + if (componentName.indexOf('__') !== -1) { + subComponentName = componentName; + componentName = componentName.substr( + 0, + componentName.indexOf('__') + ); + } + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)( + _Collapsible__WEBPACK_IMPORTED_MODULE_3__['default'], { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - var clipboard = - new (clipboard__WEBPACK_IMPORTED_MODULE_3___default())( - '[data-action="copy-component-to-clipboard"]', - { - text: function text(trigger) { - var componentName = trigger - .getAttribute('data-component') - .toLowerCase(); - if (typeof ga !== 'undefined') { - ga( - 'send', - 'event', - 'Components', - 'copyComponentToClipboard', - componentName - ); - } - return (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_4__.getComponentClipboardRepresentation)( - _this2.state.entity, - componentName - ); + collapsed: this.props.isCollapsed, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)('div', { + className: 'componentHeader collapsible-header', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + 'span', + { + className: 'componentTitle', + title: subComponentName || componentName, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + 'span', + { + children: subComponentName || componentName + } + ) } - } - ); - clipboard.on('error', function (e) { - // @todo Show the error in the UI - console.error(e); - }); - _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( - 'entityupdate', - function (detail) { - if (detail.entity !== _this2.props.entity) { - return; - } - if (detail.component === _this2.props.name) { - _this2.forceUpdate(); - } - } - ); - } - }, - { - key: 'render', - value: function render() { - var componentName = this.props.name; - var subComponentName = ''; - if (componentName.indexOf('__') !== -1) { - subComponentName = componentName; - componentName = componentName.substr( - 0, - componentName.indexOf('__') - ); - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)( - _Collapsible__WEBPACK_IMPORTED_MODULE_2__['default'], - { - collapsed: this.props.isCollapsed, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)( - 'div', - { - className: 'componentHeader collapsible-header', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - 'span', - { - className: 'componentTitle', - title: subComponentName || componentName, - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - 'span', - { - children: + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)( + 'div', + { + className: 'componentHeaderActions', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + 'a', + { + title: 'Copy to clipboard', + className: 'button', + onClick: (event) => { + event.preventDefault(); + event.stopPropagation(); + clipboard_copy__WEBPACK_IMPORTED_MODULE_4___default()( + (0, + _lib_entity__WEBPACK_IMPORTED_MODULE_5__.getComponentClipboardRepresentation)( + this.state.entity, + ( subComponentName || componentName - } - ) - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)( - 'div', - { - className: 'componentHeaderActions', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - 'a', - { - title: 'Copy to clipboard', - 'data-action': - 'copy-component-to-clipboard', - 'data-component': - subComponentName || componentName, - className: 'button fa fa-clipboard' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - 'a', - { - title: 'Remove component', - className: 'button fa fa-trash-o', - onClick: this.removeComponent - } + ).toLowerCase() ) - ] - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( - 'div', - { - className: 'collapsible-content', - children: this.renderPropertyRows() - } - ) - ] - } - ); - } - } - ], - [ - { - key: 'getDerivedStateFromProps', - value: function getDerivedStateFromProps(props, state) { - if (state.entity !== props.entity) { - return { - entity: props.entity - }; - } - if (state.name !== props.name) { - return { - name: props.name - }; - } - return null; - } + ); + }, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faClipboard + } + ) + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + 'a', + { + title: 'Remove component', + className: 'button', + onClick: this.removeComponent, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_9__.faTrashAlt + } + ) + } + ) + ] + } + ) + ] + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)('div', { + className: 'collapsible-content', + children: this.renderPropertyRows() + }) + ] } - ] - ); - return Component; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Component, 'propTypes', { - component: prop_types__WEBPACK_IMPORTED_MODULE_7___default().any, - entity: prop_types__WEBPACK_IMPORTED_MODULE_7___default().object, - isCollapsed: prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool, - name: prop_types__WEBPACK_IMPORTED_MODULE_7___default().string - }); + ); + } + } /***/ }, @@ -5304,13 +4592,13 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_6__ + prop_types__WEBPACK_IMPORTED_MODULE_7__ ); /* harmony import */ var _AddComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__( @@ -5328,250 +4616,89 @@ styleSheet.flush() __webpack_require__( /*! ./DefaultComponents */ './src/components/components/DefaultComponents.js' ); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_5__ = + __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + + class ComponentsContainer extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: prop_types__WEBPACK_IMPORTED_MODULE_7___default().object + }; + onEntityUpdate = (detail) => { + if (detail.entity !== this.props.entity) { + return; } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + if (detail.component === 'mixin') { + this.forceUpdate(); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( + 'entityupdate', + this.onEntityUpdate ); } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].off( + 'entityupdate', + this.onEntityUpdate ); } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + render() { + const entity = this.props.entity; + const components = entity ? entity.components : {}; + const definedComponents = Object.keys(components).filter( + function (key) { + return ( + _DefaultComponents__WEBPACK_IMPORTED_MODULE_4__[ + 'default' + ].indexOf(key) === -1 + ); + } ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + const renderedComponents = definedComponents + .sort() + .map(function (key) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _Component__WEBPACK_IMPORTED_MODULE_2__['default'], + { + isCollapsed: definedComponents.length > 2, + component: components[key], + entity: entity, + name: key + }, + key + ); + }); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('div', { + className: 'components', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _CommonComponents__WEBPACK_IMPORTED_MODULE_3__['default'], + { + entity: entity + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AddComponent__WEBPACK_IMPORTED_MODULE_1__['default'], + { + entity: entity + } + ), + renderedComponents + ] }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); } - var ComponentsContainer = /*#__PURE__*/ (function (_React$Component) { - _inherits(ComponentsContainer, _React$Component); - var _super = _createSuper(ComponentsContainer); - function ComponentsContainer() { - var _this; - _classCallCheck(this, ComponentsContainer); - for ( - var _len = arguments.length, args = new Array(_len), _key = 0; - _key < _len; - _key++ - ) { - args[_key] = arguments[_key]; - } - _this = _super.call.apply(_super, [this].concat(args)); - _defineProperty( - _assertThisInitialized(_this), - 'refresh', - function () { - _this.forceUpdate(); - } - ); - return _this; - } - _createClass(ComponentsContainer, [ - { - key: 'render', - value: function render() { - var entity = this.props.entity; - var components = entity ? entity.components : {}; - var definedComponents = Object.keys(components).filter( - function (key) { - return ( - _DefaultComponents__WEBPACK_IMPORTED_MODULE_4__[ - 'default' - ].indexOf(key) === -1 - ); - } - ); - var renderedComponents = definedComponents - .sort() - .map(function (key) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - _Component__WEBPACK_IMPORTED_MODULE_2__['default'], - { - isCollapsed: definedComponents.length > 2, - component: components[key], - entity: entity, - name: key - }, - key - ); - }); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)('div', { - className: 'components', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - _CommonComponents__WEBPACK_IMPORTED_MODULE_3__['default'], - { - entity: entity - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - _AddComponent__WEBPACK_IMPORTED_MODULE_1__['default'], - { - entity: entity - } - ), - renderedComponents - ] - }); - } - } - ]); - return ComponentsContainer; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(ComponentsContainer, 'propTypes', { - entity: prop_types__WEBPACK_IMPORTED_MODULE_6___default().object - }); - /***/ }, @@ -5621,15 +4748,15 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_4__ + prop_types__WEBPACK_IMPORTED_MODULE_3__ ); - /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! react-select */ './node_modules/react-select/dist/react-select.esm.js' ); @@ -5639,308 +4766,108 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + + class Mixin extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: + prop_types__WEBPACK_IMPORTED_MODULE_3___default().object + .isRequired }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; + constructor(props) { + super(props); + this.state = { + mixins: this.getMixinValue() + }; } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + componentDidUpdate(prevProps, prevState) { + if (this.props.entity === prevProps.entity) { + return; + } + this.setState({ + mixins: this.getMixinValue() }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); - } - - var Mixin = /*#__PURE__*/ (function (_React$Component) { - _inherits(Mixin, _React$Component); - var _super = _createSuper(Mixin); - function Mixin(props) { - var _this; - _classCallCheck(this, Mixin); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'getMixinOptions', - function () { - var mixinIds = _this.props.entity.mixinEls.map(function ( - mixin - ) { - return mixin.id; - }); - return Array.prototype.slice - .call(document.querySelectorAll('a-mixin')) - .filter(function (mixin) { - return mixinIds.indexOf(mixin.id) === -1; - }) - .sort() - .map(function (mixin) { - return { - value: mixin.id, - label: mixin.id - }; - }); + getMixinValue() { + return (this.props.entity.getAttribute('mixin') || '') + .split(/\s+/g) + .filter((v) => !!v) + .map((v) => ({ + label: v, + value: v + })); + } + getMixinOptions = () => { + const mixinIds = this.props.entity.mixinEls.map(function (mixin) { + return mixin.id; + }); + return Array.prototype.slice + .call(document.querySelectorAll('a-mixin')) + .filter(function (mixin) { + return mixinIds.indexOf(mixin.id) === -1; + }) + .sort() + .map(function (mixin) { + return { + value: mixin.id, + label: mixin.id + }; + }); + }; + updateMixins = (value) => { + const entity = this.props.entity; + this.setState({ + mixins: value + }); + const mixinStr = value.map((v) => v.value).join(' '); + entity.setAttribute('mixin', mixinStr); + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( + 'entityupdate', + { + component: 'mixin', + entity: entity, + property: '', + value: mixinStr } ); - _defineProperty( - _assertThisInitialized(_this), - 'updateMixins', - function (value) { - var entity = _this.props.entity; - _this.setState({ - mixins: value - }); - var mixinStr = value - .map(function (v) { - return v.value; + }; + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { + className: 'mixinOptions', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { + className: 'propertyRow', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + className: 'text', + children: 'mixins' + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { + className: 'mixinValue', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + react_select__WEBPACK_IMPORTED_MODULE_4__['default'], + { + id: 'mixinSelect', + classNamePrefix: 'select', + options: this.getMixinOptions(), + isMulti: true, + placeholder: 'Add mixin...', + noResultsText: 'No mixins found', + onChange: this.updateMixins.bind(this), + simpleValue: true, + value: this.state.mixins + } + ) }) - .join(' '); - entity.setAttribute('mixin', mixinStr); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - 'entityupdate', - { - component: 'mixin', - entity: entity, - property: '', - value: mixinStr - } - ); - if (typeof ga !== 'undefined') { - ga('send', 'event', 'Components', 'addMixin'); - } - } - ); - _this.state = { - mixins: _this.getMixinValue() - }; - return _this; + ] + }) + }); } - _createClass(Mixin, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps, prevState) { - if (this.props.entity === prevProps.entity) { - return; - } - this.setState({ - mixins: this.getMixinValue() - }); - } - }, - { - key: 'getMixinValue', - value: function getMixinValue() { - return (this.props.entity.getAttribute('mixin') || '') - .split(/\s+/g) - .filter(function (v) { - return !!v; - }) - .map(function (v) { - return { - label: v, - value: v - }; - }); - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { - className: 'mixinOptions', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('div', { - className: 'propertyRow', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'span', - { - className: 'text', - children: 'mixins' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'span', - { - className: 'mixinValue', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - react_select__WEBPACK_IMPORTED_MODULE_3__[ - 'default' - ], - { - id: 'mixinSelect', - classNamePrefix: 'select', - options: this.getMixinOptions(), - isMulti: true, - placeholder: 'Add mixin...', - noResultsText: 'No mixins found', - onChange: this.updateMixins.bind(this), - simpleValue: true, - value: this.state.mixins - } - ) - } - ) - ] - }) - }); - } - } - ]); - return Mixin; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Mixin, 'propTypes', { - entity: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().object.isRequired - }); + } /***/ }, @@ -5966,524 +4893,271 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = - __webpack_require__( - /*! classnames */ './node_modules/classnames/index.js' - ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - classnames__WEBPACK_IMPORTED_MODULE_1__ - ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_15__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_15___default = - /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_15__ - ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__( - /*! lodash.debounce */ './node_modules/lodash.debounce/index.js' - ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/ __webpack_require__.n( - lodash_debounce__WEBPACK_IMPORTED_MODULE_2__ + prop_types__WEBPACK_IMPORTED_MODULE_13__ ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_3__ = - __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var _widgets_BooleanWidget__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__(/*! clsx */ './node_modules/clsx/dist/clsx.mjs'); + /* harmony import */ var _widgets_BooleanWidget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! ../widgets/BooleanWidget */ './src/components/widgets/BooleanWidget.js' ); - /* harmony import */ var _widgets_ColorWidget__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var _widgets_ColorWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ../widgets/ColorWidget */ './src/components/widgets/ColorWidget.js' ); - /* harmony import */ var _widgets_InputWidget__WEBPACK_IMPORTED_MODULE_6__ = + /* harmony import */ var _widgets_InputWidget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ../widgets/InputWidget */ './src/components/widgets/InputWidget.js' ); - /* harmony import */ var _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_7__ = + /* harmony import */ var _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! ../widgets/NumberWidget */ './src/components/widgets/NumberWidget.js' ); - /* harmony import */ var _widgets_SelectWidget__WEBPACK_IMPORTED_MODULE_8__ = + /* harmony import */ var _widgets_SelectWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! ../widgets/SelectWidget */ './src/components/widgets/SelectWidget.js' ); - /* harmony import */ var _widgets_TextureWidget__WEBPACK_IMPORTED_MODULE_9__ = + /* harmony import */ var _widgets_TextureWidget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! ../widgets/TextureWidget */ './src/components/widgets/TextureWidget.js' ); - /* harmony import */ var _widgets_Vec4Widget__WEBPACK_IMPORTED_MODULE_10__ = + /* harmony import */ var _widgets_Vec4Widget__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( /*! ../widgets/Vec4Widget */ './src/components/widgets/Vec4Widget.js' ); - /* harmony import */ var _widgets_Vec3Widget__WEBPACK_IMPORTED_MODULE_11__ = + /* harmony import */ var _widgets_Vec3Widget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__( /*! ../widgets/Vec3Widget */ './src/components/widgets/Vec3Widget.js' ); - /* harmony import */ var _widgets_Vec2Widget__WEBPACK_IMPORTED_MODULE_12__ = + /* harmony import */ var _widgets_Vec2Widget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__( /*! ../widgets/Vec2Widget */ './src/components/widgets/Vec2Widget.js' ); - /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_13__ = + /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../lib/entity */ './src/lib/entity.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } /* eslint-disable no-prototype-builtins */ - var PropertyRow = /*#__PURE__*/ (function (_React$Component) { - _inherits(PropertyRow, _React$Component); - var _super = _createSuper(PropertyRow); - function PropertyRow(props) { - var _this; - _classCallCheck(this, PropertyRow); - _this = _super.call(this, props); - _this.id = props.componentname + ':' + props.name; - if ( - ['position', 'rotation', 'scale'].indexOf( - _this.props.componentname - ) !== -1 - ) { - _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( - 'entitytransformed', - lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default()( - function (entity) { - if (entity === props.entity) { - _this.forceUpdate(); - } - }, - 250 - ) + class PropertyRow extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_13___default().string + .isRequired, + data: prop_types__WEBPACK_IMPORTED_MODULE_13___default().oneOfType([ + prop_types__WEBPACK_IMPORTED_MODULE_13___default().array + .isRequired, + prop_types__WEBPACK_IMPORTED_MODULE_13___default().bool + .isRequired, + prop_types__WEBPACK_IMPORTED_MODULE_13___default().number + .isRequired, + prop_types__WEBPACK_IMPORTED_MODULE_13___default().object + .isRequired, + prop_types__WEBPACK_IMPORTED_MODULE_13___default().string + .isRequired + ]), + entity: + prop_types__WEBPACK_IMPORTED_MODULE_13___default().object + .isRequired, + isSingle: + prop_types__WEBPACK_IMPORTED_MODULE_13___default().bool + .isRequired, + name: prop_types__WEBPACK_IMPORTED_MODULE_13___default().string + .isRequired, + schema: + prop_types__WEBPACK_IMPORTED_MODULE_13___default().object + .isRequired + }; + constructor(props) { + super(props); + this.id = props.componentname + ':' + props.name; + } + getWidget() { + const props = this.props; + const isMap = + props.componentname === 'material' && + (props.name === 'envMap' || props.name === 'src'); + let type = props.schema.type; + if (props.componentname === 'animation' && props.name === 'loop') { + // fix wrong number type for animation loop property + type = 'boolean'; + } + const value = + props.schema.type === 'selector' + ? props.entity.getDOMAttribute(props.componentname)?.[ + props.name + ] + : props.data; + const widgetProps = { + componentname: props.componentname, + entity: props.entity, + isSingle: props.isSingle, + name: props.name, + onChange: function (name, value) { + (0, _lib_entity__WEBPACK_IMPORTED_MODULE_11__.updateEntity)( + props.entity, + props.componentname, + !props.isSingle ? props.name : '', + value + ); + }, + value: value + }; + const numberWidgetProps = { + min: props.schema.hasOwnProperty('min') + ? props.schema.min + : -Infinity, + max: props.schema.hasOwnProperty('max') + ? props.schema.max + : Infinity + }; + if (props.schema.oneOf && props.schema.oneOf.length > 0) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_SelectWidget__WEBPACK_IMPORTED_MODULE_6__['default'], + { + ...widgetProps, + options: props.schema.oneOf + } ); } - return _this; - } - _createClass(PropertyRow, [ - { - key: 'getWidget', - value: function getWidget() { - var props = this.props; - var isMap = - props.componentname === 'material' && - (props.name === 'envMap' || props.name === 'src'); - var type = props.schema.type; - if ( - props.componentname === 'animation' && - props.name === 'loop' - ) { - // fix wrong number type for animation loop property - type = 'boolean'; - } - var value = - props.schema.type === 'selector' - ? props.entity.getDOMAttribute(props.componentname)[ - props.name - ] - : props.data; - var widgetProps = { - componentname: props.componentname, - entity: props.entity, - isSingle: props.isSingle, - name: props.name, - // Wrap updateEntity for tracking. - onChange: function onChange(name, value) { - var propertyName = props.componentname; - if (!props.isSingle) { - propertyName += '.' + props.name; - } - _lib_entity__WEBPACK_IMPORTED_MODULE_13__.updateEntity.apply( - this, - [props.entity, propertyName, value] - ); - }, - value: value - }; - var numberWidgetProps = { - min: props.schema.hasOwnProperty('min') - ? props.schema.min - : -Infinity, - max: props.schema.hasOwnProperty('max') - ? props.schema.max - : Infinity - }; - if (props.schema.oneOf && props.schema.oneOf.length > 0) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_SelectWidget__WEBPACK_IMPORTED_MODULE_8__[ - 'default' - ], - _objectSpread( - _objectSpread({}, widgetProps), - {}, - { - options: props.schema.oneOf - } - ) - ); - } - if (type === 'map' || isMap) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_TextureWidget__WEBPACK_IMPORTED_MODULE_9__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + if (type === 'map' || isMap) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_TextureWidget__WEBPACK_IMPORTED_MODULE_7__['default'], + { + ...widgetProps } - switch (type) { - case 'number': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_7__[ - 'default' - ], - _objectSpread( - _objectSpread({}, widgetProps), - numberWidgetProps - ) - ); - } - case 'int': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_7__[ - 'default' - ], - _objectSpread( - _objectSpread( - _objectSpread({}, widgetProps), - numberWidgetProps - ), - {}, - { - precision: 0 - } - ) - ); + ); + } + switch (type) { + case 'number': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_5__['default'], + { + ...widgetProps, + ...numberWidgetProps } - case 'vec2': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_Vec2Widget__WEBPACK_IMPORTED_MODULE_12__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'int': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_NumberWidget__WEBPACK_IMPORTED_MODULE_5__['default'], + { + ...widgetProps, + ...numberWidgetProps, + precision: 0 } - case 'vec3': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_Vec3Widget__WEBPACK_IMPORTED_MODULE_11__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'vec2': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_Vec2Widget__WEBPACK_IMPORTED_MODULE_10__['default'], + { + ...widgetProps } - case 'vec4': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_Vec4Widget__WEBPACK_IMPORTED_MODULE_10__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'vec3': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_Vec3Widget__WEBPACK_IMPORTED_MODULE_9__['default'], + { + ...widgetProps } - case 'color': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_ColorWidget__WEBPACK_IMPORTED_MODULE_5__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'vec4': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_Vec4Widget__WEBPACK_IMPORTED_MODULE_8__['default'], + { + ...widgetProps } - case 'boolean': { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_BooleanWidget__WEBPACK_IMPORTED_MODULE_4__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'color': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_ColorWidget__WEBPACK_IMPORTED_MODULE_3__['default'], + { + ...widgetProps } - default: { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - _widgets_InputWidget__WEBPACK_IMPORTED_MODULE_6__[ - 'default' - ], - _objectSpread({}, widgetProps) - ); + ); + } + case 'boolean': { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_BooleanWidget__WEBPACK_IMPORTED_MODULE_2__[ + 'default' + ], + { + ...widgetProps } - } + ); } - }, - { - key: 'render', - value: function render() { - var props = this.props; - var value = - props.schema.type === 'selector' - ? props.entity.getDOMAttribute(props.componentname)[ - props.name - ] - : JSON.stringify(props.data); - var title = - props.name + - '\n - type: ' + - props.schema.type + - '\n - value: ' + - value; - var className = - classnames__WEBPACK_IMPORTED_MODULE_1___default()({ - propertyRow: true, - propertyRowDefined: props.isSingle - ? !!props.entity.getDOMAttribute(props.componentname) - : props.name in - (props.entity.getDOMAttribute(props.componentname) || - {}) - }); + default: { return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)('div', { - className: className, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)( - 'label', - { - htmlFor: this.id, - className: 'text', - title: title, - children: props.name - } - ), - this.getWidget(props.schema.type) - ] - }); + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)( + _widgets_InputWidget__WEBPACK_IMPORTED_MODULE_4__['default'], + { + ...widgetProps + } + ); } } - ]); - return PropertyRow; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(PropertyRow, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_15___default().string - .isRequired, - data: prop_types__WEBPACK_IMPORTED_MODULE_15___default().oneOfType([ - prop_types__WEBPACK_IMPORTED_MODULE_15___default().array.isRequired, - prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool.isRequired, - prop_types__WEBPACK_IMPORTED_MODULE_15___default().number - .isRequired, - prop_types__WEBPACK_IMPORTED_MODULE_15___default().object - .isRequired, - prop_types__WEBPACK_IMPORTED_MODULE_15___default().string.isRequired - ]), - entity: - prop_types__WEBPACK_IMPORTED_MODULE_15___default().object - .isRequired, - id: prop_types__WEBPACK_IMPORTED_MODULE_15___default().string, - isSingle: - prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool.isRequired, - name: prop_types__WEBPACK_IMPORTED_MODULE_15___default().string - .isRequired, - schema: - prop_types__WEBPACK_IMPORTED_MODULE_15___default().object.isRequired - }); + } + render() { + const props = this.props; + const value = + props.schema.type === 'selector' + ? props.entity.getDOMAttribute(props.componentname)?.[ + props.name + ] + : JSON.stringify(props.data); + const title = + props.name + + '\n - type: ' + + props.schema.type + + '\n - value: ' + + value; + const className = (0, clsx__WEBPACK_IMPORTED_MODULE_1__['default'])( + { + propertyRow: true, + propertyRowDefined: props.isSingle + ? !!props.entity.getDOMAttribute(props.componentname) + : props.name in + (props.entity.getDOMAttribute(props.componentname) || {}) + } + ); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)('div', { + className: className, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)('label', { + htmlFor: this.id, + className: 'text', + title: title, + children: props.name + }), + this.getWidget(props.schema.type) + ] + }); + } + } /***/ }, @@ -6527,242 +5201,67 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + + class Sidebar extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, + visible: prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool + }; + onComponentRemove = (detail) => { + if (detail.entity !== this.props.entity) { + return; } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + this.forceUpdate(); + }; + onComponentAdd = (detail) => { + if (detail.entity !== this.props.entity) { + return; } - return _possibleConstructorReturn(this, result); + this.forceUpdate(); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'componentremove', + this.onComponentRemove ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'componentadd', + this.onComponentAdd ); } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].off( + 'componentremove', + this.onComponentRemove + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].off( + 'componentadd', + this.onComponentAdd ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); + render() { + const entity = this.props.entity; + const visible = this.props.visible; + if (entity && visible) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('div', { + id: 'sidebar', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _ComponentsContainer__WEBPACK_IMPORTED_MODULE_1__['default'], + { + entity: entity + } + ) + }); + } else { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('div', {}); + } } - return (hint === 'string' ? String : Number)(input); } - var Sidebar = /*#__PURE__*/ (function (_React$Component) { - _inherits(Sidebar, _React$Component); - var _super = _createSuper(Sidebar); - function Sidebar(props) { - var _this; - _classCallCheck(this, Sidebar); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'handleToggle', - function () { - _this.setState({ - open: !_this.state.open - }); - if (typeof ga !== 'undefined') { - ga('send', 'event', 'Components', 'toggleSidebar'); - } - } - ); - _this.state = { - open: false - }; - return _this; - } - _createClass(Sidebar, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( - 'componentremove', - function (event) { - _this2.forceUpdate(); - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( - 'componentadd', - function (event) { - _this2.forceUpdate(); - } - ); - } - }, - { - key: 'render', - value: function render() { - var entity = this.props.entity; - var visible = this.props.visible; - if (entity && visible) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('div', { - id: 'sidebar', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _ComponentsContainer__WEBPACK_IMPORTED_MODULE_1__[ - 'default' - ], - { - entity: entity - } - ) - }); - } else { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - 'div', - {} - ); - } - } - } - ]); - return Sidebar; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Sidebar, 'propTypes', { - entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, - visible: prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool - }); - /***/ }, @@ -6799,356 +5298,144 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); + + class Modal extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + id: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, + children: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([ + prop_types__WEBPACK_IMPORTED_MODULE_2___default().array, + prop_types__WEBPACK_IMPORTED_MODULE_2___default().element + ]).isRequired, + isOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool, + extraCloseKeyCode: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, + closeOnClickOutside: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool, + onClose: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + title: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + }; + static defaultProps = { + closeOnClickOutside: true + }; + constructor(props) { + super(props); + this.state = { + isOpen: this.props.isOpen + }; + this.self = + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + componentDidMount() { + document.addEventListener('keyup', this.handleGlobalKeydown); + document.addEventListener('mousedown', this.handleGlobalMousedown); } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + handleGlobalKeydown = (event) => { + if ( + this.state.isOpen && + (event.keyCode === 27 || + (this.props.extraCloseKeyCode && + event.keyCode === this.props.extraCloseKeyCode)) + ) { + this.close(); + + // Prevent closing the inspector + event.stopPropagation(); } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + }; + shouldClickDismiss = (event) => { + var target = event.target; + // This piece of code isolates targets which are fake clicked by things + // like file-drop handlers + if (target.tagName === 'INPUT' && target.type === 'file') { + return false; + } + if ( + target === this.self.current || + this.self.current.contains(target) + ) { + return false; } - return _possibleConstructorReturn(this, result); + return true; }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + handleGlobalMousedown = (event) => { + if ( + this.props.closeOnClickOutside && + this.state.isOpen && + this.shouldClickDismiss(event) + ) { + if (typeof this.props.onClose === 'function') { + this.props.onClose(); + } + } + }; + componentWillUnmount() { + document.removeEventListener('keyup', this.handleGlobalKeydown); + document.removeEventListener( + 'mousedown', + this.handleGlobalMousedown ); - return true; - } catch (e) { - return false; } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); + static getDerivedStateFromProps(props, state) { + if (state.isOpen !== props.isOpen) { + return { + isOpen: props.isOpen }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; + } + return null; } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); + close = () => { + this.setState({ + isOpen: false + }); + if (this.props.onClose) { + this.props.onClose(); + } + }; + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('div', { + id: this.props.id, + className: this.state.isOpen ? 'modal' : 'modal hide', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)('div', { + className: 'modal-content', + ref: this.self, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)('div', { + className: 'modal-header', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( + 'span', + { + className: 'close', + onClick: this.close, + children: '\xD7' + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( + 'h3', + { + children: this.props.title + } + ) + ] + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('div', { + className: 'modal-body', + children: this.props.children + }) + ] + }) + }); } - return (hint === 'string' ? String : Number)(input); } - var Modal = /*#__PURE__*/ (function (_React$Component) { - _inherits(Modal, _React$Component); - var _super = _createSuper(Modal); - function Modal(props) { - var _this; - _classCallCheck(this, Modal); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'handleGlobalKeydown', - function (event) { - if ( - _this.state.isOpen && - (event.keyCode === 27 || - (_this.props.extraCloseKeyCode && - event.keyCode === _this.props.extraCloseKeyCode)) - ) { - _this.close(); - - // Prevent closing the inspector - event.stopPropagation(); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'shouldClickDismiss', - function (event) { - var target = event.target; - // This piece of code isolates targets which are fake clicked by things - // like file-drop handlers - if (target.tagName === 'INPUT' && target.type === 'file') { - return false; - } - if ( - target === _this.self.current || - _this.self.current.contains(target) - ) { - return false; - } - return true; - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'handleGlobalMousedown', - function (event) { - if ( - _this.props.closeOnClickOutside && - _this.state.isOpen && - _this.shouldClickDismiss(event) - ) { - if (typeof _this.props.onClose === 'function') { - _this.props.onClose(); - } - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'close', - function () { - _this.setState({ - isOpen: false - }); - if (_this.props.onClose) { - _this.props.onClose(); - } - } - ); - _this.state = { - isOpen: _this.props.isOpen - }; - _this.self = - /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - return _this; - } - _createClass( - Modal, - [ - { - key: 'componentDidMount', - value: function componentDidMount() { - document.addEventListener('keyup', this.handleGlobalKeydown); - document.addEventListener( - 'mousedown', - this.handleGlobalMousedown - ); - } - }, - { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - document.removeEventListener( - 'keyup', - this.handleGlobalKeydown - ); - document.removeEventListener( - 'mousedown', - this.handleGlobalMousedown - ); - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('div', { - id: this.props.id, - className: this.state.isOpen ? 'modal' : 'modal hide', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)( - 'div', - { - className: 'modal-content', - ref: this.self, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)( - 'div', - { - className: 'modal-header', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - 'span', - { - className: 'close', - onClick: this.close, - children: '\xD7' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - 'h3', - { - children: this.props.title - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - 'div', - { - className: 'modal-body', - children: this.props.children - } - ) - ] - } - ) - }); - } - } - ], - [ - { - key: 'getDerivedStateFromProps', - value: function getDerivedStateFromProps(props, state) { - if (state.isOpen !== props.isOpen) { - return { - isOpen: props.isOpen - }; - } - return null; - } - } - ] - ); - return Modal; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Modal, 'propTypes', { - id: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, - children: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType( - [ - prop_types__WEBPACK_IMPORTED_MODULE_2___default().array, - prop_types__WEBPACK_IMPORTED_MODULE_2___default().element - ] - ).isRequired, - isOpen: prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool, - extraCloseKeyCode: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, - closeOnClickOutside: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool, - onClose: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, - title: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string - }); - _defineProperty(Modal, 'defaultProps', { - closeOnClickOutside: true - }); - /***/ }, @@ -7189,375 +5476,190 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + + class ModalHelp extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + isOpen: prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool, + onClose: prop_types__WEBPACK_IMPORTED_MODULE_3___default().func }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; + constructor(props) { + super(props); + this.state = { + isOpen: this.props.isOpen + }; } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); + static getDerivedStateFromProps(props, state) { + if (state.isOpen !== props.isOpen) { + return { + isOpen: props.isOpen }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); + } + return null; } - return (hint === 'string' ? String : Number)(input); - } - - var ModalHelp = /*#__PURE__*/ (function (_React$Component) { - _inherits(ModalHelp, _React$Component); - var _super = _createSuper(ModalHelp); - function ModalHelp(props) { - var _this; - _classCallCheck(this, ModalHelp); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onClose', - function () { - if (_this.props.onClose) { - _this.props.onClose(); + onClose = () => { + if (this.props.onClose) { + this.props.onClose(); + } + }; + render() { + let shortcuts = [ + [ + { + key: ['w'], + description: 'Translate' + }, + { + key: ['e'], + description: 'Rotate' + }, + { + key: ['r'], + description: 'Scale' + }, + { + key: ['d'], + description: 'Duplicate selected entity' + }, + { + key: ['f'], + description: 'Focus on selected entity' + }, + { + key: ['g'], + description: 'Toggle grid visibility' + }, + { + key: ['n'], + description: 'Add new entity' + }, + { + key: ['o'], + description: 'Toggle local between global transform' + }, + { + key: ['delete | backspace'], + description: 'Delete selected entity' } - } - ); - _this.state = { - isOpen: _this.props.isOpen - }; - return _this; - } - _createClass( - ModalHelp, - [ + ], + [ + { + key: ['0'], + description: 'Toggle panels' + }, + { + key: ['1'], + description: 'Perspective view' + }, + { + key: ['2'], + description: 'Left view' + }, + { + key: ['3'], + description: 'Right view' + }, + { + key: ['4'], + description: 'Top view' + }, + { + key: ['5'], + description: 'Bottom view' + }, + { + key: ['6'], + description: 'Back view' + }, + { + key: ['7'], + description: 'Front view' + }, + { + key: ['ctrl | cmd', 'c'], + description: 'Copy selected entity' + }, + { + key: ['ctrl | cmd', 'v'], + description: 'Paste entity' + }, + { + key: ['h'], + description: 'Show this help' + }, + { + key: ['esc'], + description: 'Unselect entity' + }, + { + key: ['ctrl', 'alt', 'i'], + description: 'Switch Edit and VR Modes' + } + ] + ]; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + _Modal__WEBPACK_IMPORTED_MODULE_1__['default'], { - key: 'render', - value: function render() { - var shortcuts = [ - [ - { - key: ['w'], - description: 'Translate' - }, - { - key: ['e'], - description: 'Rotate' - }, - { - key: ['r'], - description: 'Scale' - }, - { - key: ['d'], - description: 'Duplicate selected entity' - }, - { - key: ['f'], - description: 'Focus on selected entity' - }, - { - key: ['g'], - description: 'Toggle grid visibility' - }, - { - key: ['n'], - description: 'Add new entity' - }, - { - key: ['o'], - description: 'Toggle local between global transform' - }, - { - key: ['supr | backspace'], - description: 'Delete selected entity' - } - ], - [ - { - key: ['0'], - description: 'Toggle panels' - }, - { - key: ['1'], - description: 'Perspective view' - }, - { - key: ['2'], - description: 'Left view' - }, - { - key: ['3'], - description: 'Right view' - }, - { - key: ['4'], - description: 'Top view' - }, - { - key: ['5'], - description: 'Bottom view' - }, - { - key: ['6'], - description: 'Back view' - }, - { - key: ['7'], - description: 'Front view' - }, - { - key: ['ctrl | cmd', 'x'], - description: 'Cut selected entity' - }, - { - key: ['ctrl | cmd', 'c'], - description: 'Copy selected entity' - }, - { - key: ['ctrl | cmd', 'v'], - description: 'Paste entity' - }, - { - key: ['h'], - description: 'Show this help' - }, - { - key: ['Esc'], - description: 'Unselect entity' - }, + title: 'Shortcuts', + isOpen: this.state.isOpen, + onClose: this.onClose, + extraCloseKeyCode: 72, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { + className: 'help-lists', + children: shortcuts.map(function (column, idx) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + 'ul', { - key: ['ctrl', 'alt', 'i'], - description: 'Switch Edit and VR Modes' - } - ] - ]; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - _Modal__WEBPACK_IMPORTED_MODULE_1__['default'], - { - title: 'Shortcuts', - isOpen: this.state.isOpen, - onClose: this.onClose, - extraCloseKeyCode: 72, - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'div', - { - className: 'help-lists', - children: shortcuts.map(function (column, idx) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'ul', - { - className: 'help-list', - children: column.map(function (shortcut) { + className: 'help-list', + children: column.map(function (shortcut) { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)( + 'li', + { + className: 'help-key-unit', + children: [ + shortcut.key.map(function (key) { return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)( - 'li', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + 'kbd', { - className: 'help-key-unit', - children: [ - shortcut.key.map(function (key) { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'kbd', - { - className: 'help-key', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'span', - { - children: key - } - ) - }, - key - ); - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'span', - { - className: 'help-key-def', - children: shortcut.description - } - ) - ] + className: 'help-key', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + 'span', + { + children: key + } + ) }, - shortcut.key + key ); - }) - }, - idx - ); - }) - } - ) - } - ); - } - } - ], - [ - { - key: 'getDerivedStateFromProps', - value: function getDerivedStateFromProps(props, state) { - if (state.isOpen !== props.isOpen) { - return { - isOpen: props.isOpen - }; - } - return null; - } + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + 'span', + { + className: 'help-key-def', + children: shortcut.description + } + ) + ] + }, + shortcut.key + ); + }) + }, + idx + ); + }) + }) } - ] - ); - return ModalHelp; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(ModalHelp, 'propTypes', { - isOpen: prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool, - onClose: prop_types__WEBPACK_IMPORTED_MODULE_3___default().func - }); + ); + } + } /***/ }, @@ -7583,398 +5685,72 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_5__ + prop_types__WEBPACK_IMPORTED_MODULE_6__ ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' + ); + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./Modal */ './src/components/modals/Modal.js' ); - /* harmony import */ var _lib_assetsUtils__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var _lib_assetsUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ../../lib/assetsUtils */ './src/lib/assetsUtils.js' ); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); + + function getFilename(url, converted = false) { + var filename = url.split('/').pop(); + if (converted) { + filename = getValidId(filename); } + return filename; } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); + function isValidId(id) { + // The correct re should include : and . but A-frame seems to fail while accessing them + var re = /^[A-Za-z]+[\w-]*$/; + return re.test(id); } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); + function getValidId(name) { + // info.name.replace(/\.[^/.]+$/, '').replace(/\s+/g, '') + return name + .split('.') + .shift() + .replace(/\s/, '-') + .replace(/^\d+\s*/, '') + .replace(/[\W]/, '') + .toLowerCase(); } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + class ModalTextures extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + isOpen: prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool, + onClose: prop_types__WEBPACK_IMPORTED_MODULE_6___default().func, + selectedTexture: + prop_types__WEBPACK_IMPORTED_MODULE_6___default().string }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - function getFilename(url) { - var converted = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : false; - var filename = url.split('/').pop(); - if (converted) { - filename = getValidId(filename); - } - return filename; - } - function isValidId(id) { - // The correct re should include : and . but A-frame seems to fail while accessing them - var re = /^[A-Za-z]+[\w-]*$/; - return re.test(id); - } - function getValidId(name) { - // info.name.replace(/\.[^/.]+$/, '').replace(/\s+/g, '') - return name - .split('.') - .shift() - .replace(/\s/, '-') - .replace(/^\d+\s*/, '') - .replace(/[\W]/, '') - .toLowerCase(); - } - var ModalTextures = /*#__PURE__*/ (function (_React$Component) { - _inherits(ModalTextures, _React$Component); - var _super = _createSuper(ModalTextures); - function ModalTextures(props) { - var _this; - _classCallCheck(this, ModalTextures); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onClose', - function (value) { - if (_this.props.onClose) { - _this.props.onClose(); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'selectTexture', - function (value) { - if (_this.props.onClose) { - _this.props.onClose(value); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'generateFromRegistry', - function () { - var self = _assertThisInitialized(_this); - AFRAME.INSPECTOR.assetsLoader.images.forEach(function ( - imageData - ) { - var image = new Image(); - image.addEventListener('load', function () { - self.state.registryImages.push({ - id: imageData.id, - src: imageData.fullPath, - width: imageData.width, - height: imageData.height, - name: imageData.id, - type: 'registry', - tags: imageData.tags, - value: 'url(' + imageData.fullPath + ')' - }); - self.setState({ - registryImages: self.state.registryImages.slice() - }); - }); - image.src = imageData.fullThumbPath; - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'generateFromAssets', - function () { - _this.setState({ - assetsImages: [] - }); - var self = _assertThisInitialized(_this); - Array.prototype.slice - .call(document.querySelectorAll('a-assets img')) - .forEach(function (asset) { - var image = new Image(); - image.addEventListener('load', function () { - self.state.assetsImages.push({ - id: asset.id, - src: image.src, - width: image.width, - height: image.height, - name: asset.id, - type: 'asset', - value: '#' + asset.id - }); - self.setState({ - assetsImages: self.state.assetsImages - }); - }); - image.src = asset.src; - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onNewUrl', - function (event) { - if (event.keyCode !== 13) { - return; - } - var self = _assertThisInitialized(_this); - function onImageLoaded(img) { - var src = self.preview.current.src; - self.setState({ - preview: { - width: self.preview.current.naturalWidth, - height: self.preview.current.naturalHeight, - src: src, - id: '', - name: getFilename(src, true), - filename: getFilename(src), - type: 'new', - loaded: true, - value: 'url(' + src + ')' - } - }); - self.preview.current.removeEventListener( - 'load', - onImageLoaded - ); - } - _this.preview.current.addEventListener('load', onImageLoaded); - _this.preview.current.src = event.target.value; - _this.imageName.current.focus(); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onNameKeyUp', - function (event) { - if (event.keyCode === 13 && _this.isValidAsset()) { - _this.addNewAsset(); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onNameChanged', - function (event) { - var state = _this.state.preview; - state.name = event.target.value; - _this.setState({ - preview: state - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'toggleNewDialog', - function () { - _this.setState({ - addNewDialogOpened: !_this.state.addNewDialogOpened - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onUrlChange', - function (e) { - _this.setState({ - newUrl: e.target.value - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'addNewAsset', - function () { - var self = _assertThisInitialized(_this); - (0, - _lib_assetsUtils__WEBPACK_IMPORTED_MODULE_3__.insertNewAsset)( - 'img', - _this.state.preview.name, - _this.state.preview.src, - true, - function () { - self.generateFromAssets(); - self.setState({ - addNewDialogOpened: false - }); - self.clear(); - } - ); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onChangeFilter', - function (e) { - _this.setState({ - filterText: e.target.value - }); - } - ); - _this.state = { + constructor(props) { + super(props); + this.state = { filterText: '', - isOpen: _this.props.isOpen, + isOpen: this.props.isOpen, loadedTextures: [], assetsImages: [], registryImages: [], @@ -7992,612 +5768,675 @@ styleSheet.flush() loaded: false } }; - _this.imageName = + this.imageName = /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - _this.preview = + this.preview = /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - _this.registryGallery = + this.registryGallery = /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - return _this; } - _createClass( - ModalTextures, - [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'assetsimagesload', - function (images) { - _this2.generateFromRegistry(); - } - ); - this.generateFromAssets(); - } - }, - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if ( - this.state.isOpen && - !AFRAME.INSPECTOR.assetsLoader.hasLoaded - ) { - AFRAME.INSPECTOR.assetsLoader.load(); - } - if ( - this.state.isOpen && - this.state.isOpen !== prevProps.isOpen - ) { - this.generateFromAssets(); - } - } - }, - { - key: 'clear', - value: function clear() { - this.setState({ - preview: { - width: 0, - height: 0, - src: '', - id: '', - filename: '', - name: '', - type: '', - loaded: false, - value: '' - }, - newUrl: '' + onAssetsImagesLoad = (images) => { + this.generateFromRegistry(); + }; + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'assetsimagesload', + this.onAssetsImagesLoad + ); + this.generateFromAssets(); + } + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].off( + 'assetsimagesload', + this.onAssetsImagesLoad + ); + } + componentDidUpdate(prevProps) { + if (this.state.isOpen && !AFRAME.INSPECTOR.assetsLoader.hasLoaded) { + AFRAME.INSPECTOR.assetsLoader.load(); + } + if (this.state.isOpen && this.state.isOpen !== prevProps.isOpen) { + this.generateFromAssets(); + } + } + static getDerivedStateFromProps(props, state) { + if (state.isOpen !== props.isOpen) { + return { + isOpen: props.isOpen + }; + } + return null; + } + onClose = (value) => { + if (this.props.onClose) { + this.props.onClose(); + } + }; + selectTexture = (value) => { + if (this.props.onClose) { + this.props.onClose(value); + } + }; + generateFromRegistry = () => { + var self = this; + AFRAME.INSPECTOR.assetsLoader.images.forEach((imageData) => { + var image = new Image(); + image.addEventListener('load', () => { + self.state.registryImages.push({ + id: imageData.id, + src: imageData.fullPath, + width: imageData.width, + height: imageData.height, + name: imageData.id, + type: 'registry', + tags: imageData.tags, + value: 'url(' + imageData.fullPath + ')' + }); + self.setState({ + registryImages: self.state.registryImages.slice() + }); + }); + image.src = imageData.fullThumbPath; + }); + }; + generateFromAssets = () => { + this.setState({ + assetsImages: [] + }); + var self = this; + Array.prototype.slice + .call(document.querySelectorAll('a-assets img')) + .forEach((asset) => { + var image = new Image(); + image.addEventListener('load', () => { + self.state.assetsImages.push({ + id: asset.id, + src: image.src, + width: image.width, + height: image.height, + name: asset.id, + type: 'asset', + value: '#' + asset.id + }); + self.setState({ + assetsImages: self.state.assetsImages }); + }); + image.src = asset.src; + }); + }; + onNewUrl = (event) => { + if (event.keyCode !== 13) { + return; + } + var self = this; + function onImageLoaded(img) { + var src = self.preview.current.src; + self.setState({ + preview: { + width: self.preview.current.naturalWidth, + height: self.preview.current.naturalHeight, + src: src, + id: '', + name: getFilename(src, true), + filename: getFilename(src), + type: 'new', + loaded: true, + value: 'url(' + src + ')' } + }); + self.preview.current.removeEventListener('load', onImageLoaded); + } + this.preview.current.addEventListener('load', onImageLoaded); + this.preview.current.src = event.target.value; + this.imageName.current.focus(); + }; + onNameKeyUp = (event) => { + if (event.keyCode === 13 && this.isValidAsset()) { + this.addNewAsset(); + } + }; + onNameChanged = (event) => { + var state = this.state.preview; + state.name = event.target.value; + this.setState({ + preview: state + }); + }; + toggleNewDialog = () => { + this.setState({ + addNewDialogOpened: !this.state.addNewDialogOpened + }); + }; + clear() { + this.setState({ + preview: { + width: 0, + height: 0, + src: '', + id: '', + filename: '', + name: '', + type: '', + loaded: false, + value: '' }, - { - key: 'isValidAsset', - value: function isValidAsset() { - var validUrl = isValidId(this.state.preview.name); - var validAsset = this.state.preview.loaded && validUrl; - return validAsset; + newUrl: '' + }); + } + onUrlChange = (e) => { + this.setState({ + newUrl: e.target.value + }); + }; + isValidAsset() { + let validUrl = isValidId(this.state.preview.name); + let validAsset = this.state.preview.loaded && validUrl; + return validAsset; + } + addNewAsset = () => { + var self = this; + (0, _lib_assetsUtils__WEBPACK_IMPORTED_MODULE_4__.insertNewAsset)( + 'img', + this.state.preview.name, + this.state.preview.src, + true, + function () { + self.generateFromAssets(); + self.setState({ + addNewDialogOpened: false + }); + self.clear(); + } + ); + }; + onChangeFilter = (e) => { + this.setState({ + filterText: e.target.value + }); + }; + renderRegistryImages() { + var self = this; + let selectSample = function (image) { + self.setState({ + preview: { + width: image.width, + height: image.height, + src: image.src, + id: '', + name: getFilename(image.name, true), + filename: getFilename(image.src), + type: 'registry', + loaded: true, + value: 'url(' + image.src + ')' } - }, - { - key: 'renderRegistryImages', - value: function renderRegistryImages() { - var self = this; - var selectSample = function selectSample(image) { - self.setState({ - preview: { - width: image.width, - height: image.height, - src: image.src, - id: '', - name: getFilename(image.name, true), - filename: getFilename(image.src), - type: 'registry', - loaded: true, - value: 'url(' + image.src + ')' - } - }); - self.imageName.current.focus(); - }; - var filterText = this.state.filterText.toUpperCase(); - return this.state.registryImages - .filter(function (image) { - return ( - image.id.toUpperCase().indexOf(filterText) > -1 || - image.name.toUpperCase().indexOf(filterText) > -1 || - image.tags.indexOf(filterText) > -1 - ); - }) - .map(function (image) { - var imageClick = selectSample.bind(this, image); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'li', + }); + self.imageName.current.focus(); + }; + var filterText = this.state.filterText.toUpperCase(); + return this.state.registryImages + .filter((image) => { + return ( + image.id.toUpperCase().indexOf(filterText) > -1 || + image.name.toUpperCase().indexOf(filterText) > -1 || + image.tags.indexOf(filterText) > -1 + ); + }) + .map(function (image) { + let imageClick = selectSample.bind(this, image); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'li', + { + onClick: imageClick, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'img', + { + width: '155px', + height: '155px', + src: image.src + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', { - onClick: imageClick, + className: 'detail', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'img', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', { - width: '155px', - height: '155px', - src: image.src + className: 'title', + children: image.name } ), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', { - className: 'detail', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: 'title', - children: image.name - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: getFilename(image.src) - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'span', - { - children: [ - image.width, - ' x ', - image.height - ] - } - ) - ] + children: getFilename(image.src) + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'span', + { + children: [image.width, ' x ', image.height] } ) ] - }, - image.src - ); - }); - } - }, + } + ) + ] + }, + image.src + ); + }); + } + render() { + let isOpen = this.state.isOpen; + let loadedTextures = this.state.loadedTextures; + let preview = this.state.preview; + let validUrl = isValidId(this.state.preview.name); + let validAsset = this.isValidAsset(); + let addNewAssetButton = this.state.addNewDialogOpened + ? 'BACK' + : 'LOAD TEXTURE'; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + _Modal__WEBPACK_IMPORTED_MODULE_3__['default'], { - key: 'render', - value: function render() { - var isOpen = this.state.isOpen; - var loadedTextures = this.state.loadedTextures; - var preview = this.state.preview; - var validUrl = isValidId(this.state.preview.name); - var validAsset = this.isValidAsset(); - var addNewAssetButton = this.state.addNewDialogOpened - ? 'BACK' - : 'LOAD TEXTURE'; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - _Modal__WEBPACK_IMPORTED_MODULE_2__['default'], + id: 'textureModal', + title: 'Textures', + isOpen: isOpen, + onClose: this.onClose, + closeOnClickOutside: false, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'button', { - id: 'textureModal', - title: 'Textures', - isOpen: isOpen, - onClose: this.onClose, - closeOnClickOutside: false, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'button', - { - onClick: this.toggleNewDialog, - children: addNewAssetButton - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'div', - { - className: this.state.addNewDialogOpened - ? '' - : 'hide', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', - { - className: 'newimage', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', - { - className: 'new_asset_options', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: - 'Load a new texture from one of these sources:' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'ul', - { - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'li', - { - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: - 'From URL (and press Enter):' - } - ), - ' ', - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'input', - { - type: 'text', - className: 'imageUrl', - value: - this.state.newUrl, - onChange: - this.onUrlChange, - onKeyUp: this.onNewUrl - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'li', - { - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: - 'From assets registry: ' - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', - { - className: - 'assets search', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'input', - { - placeholder: - 'Filter...', - value: - this.state - .filterText, - onChange: - this - .onChangeFilter - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: - 'fa fa-search' - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'ul', - { - ref: this - .registryGallery, - className: 'gallery', - children: - this.renderRegistryImages() - } - ) - ] - } - ) - ] - } - ) - ] - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', - { - className: 'preview', - children: [ - 'Name:', - ' ', - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'input', - { - ref: this.imageName, - className: - this.state.preview.name.length > - 0 && !validUrl - ? 'error' - : '', - type: 'text', - value: this.state.preview.name, - onChange: this.onNameChanged, - onKeyUp: this.onNameKeyUp - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'img', - { - ref: this.preview, - width: '155px', - height: '155px', - src: preview.src - } - ), - this.state.preview.loaded - ? /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( + onClick: this.toggleNewDialog, + children: addNewAssetButton + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { + className: this.state.addNewDialogOpened ? '' : 'hide', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', + { + className: 'newimage', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', + { + className: 'new_asset_options', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + children: + 'Load a new texture from one of these sources:' + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'ul', + { + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'li', + { + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + children: + 'From URL (and press Enter):' + } + ), + ' ', + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'input', + { + type: 'text', + className: 'imageUrl', + value: this.state.newUrl, + onChange: this.onUrlChange, + onKeyUp: this.onNewUrl + } + ) + ] + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'li', + { + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + children: + 'From assets registry: ' + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( 'div', { - className: 'detail', + className: 'assets search', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'input', { - className: 'title', - title: preview.filename, - children: preview.filename + placeholder: 'Filter...', + value: + this.state.filterText, + onChange: + this.onChangeFilter } ), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'br', - {} - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'span', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, { - children: [ - preview.width, - ' x ', - preview.height - ] + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_7__.faSearch } ) ] } - ) - : /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - {} ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'br', - {} - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'button', - { - disabled: !validAsset, - onClick: this.addNewAsset, - children: 'LOAD THIS TEXTURE' - } - ) - ] - } - ) - ] - } - ) - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'div', - { - className: this.state.addNewDialogOpened - ? 'hide' - : '', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'ul', - { - className: 'gallery', - children: [ - this.state.assetsImages - .sort(function (a, b) { - return a.id > b.id; - }) - .map( - function (image) { - var textureClick = - this.selectTexture.bind(this, image); - var selectedClass = - this.props.selectedTexture === - '#' + image.id - ? 'selected' - : ''; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'li', - { - onClick: textureClick, - className: selectedClass, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'img', - { - width: '155px', - height: '155px', - src: image.src - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', - { - className: 'detail', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: 'title', - children: image.name - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: getFilename( - image.src - ) - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'span', - { - children: [ - image.width, - ' x ', - image.height - ] - } - ) - ] - } - ) - ] - }, - image.id - ); - }.bind(this) + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'ul', + { + ref: this.registryGallery, + className: 'gallery', + children: + this.renderRegistryImages() + } + ) + ] + } + ) + ] + } + ) + ] + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', + { + className: 'preview', + children: [ + 'Name:', + ' ', + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'input', + { + ref: this.imageName, + className: + this.state.preview.name.length > 0 && + !validUrl + ? 'error' + : '', + type: 'text', + value: this.state.preview.name, + onChange: this.onNameChanged, + onKeyUp: this.onNameKeyUp + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'img', + { + ref: this.preview, + width: '155px', + height: '155px', + src: preview.src + } + ), + this.state.preview.loaded + ? /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', + { + className: 'detail', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + className: 'title', + title: preview.filename, + children: preview.filename + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'br', + {} + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'span', + { + children: [ + preview.width, + ' x ', + preview.height + ] + } + ) + ] + } + ) + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + {} + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'br', + {} + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'button', + { + disabled: !validAsset, + onClick: this.addNewAsset, + children: 'LOAD THIS TEXTURE' + } + ) + ] + } + ) + ] + } + ) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { + className: this.state.addNewDialogOpened ? 'hide' : '', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)('ul', { + className: 'gallery', + children: [ + this.state.assetsImages + .sort(function (a, b) { + return a.id > b.id; + }) + .map( + function (image) { + let textureClick = this.selectTexture.bind( + this, + image + ); + var selectedClass = + this.props.selectedTexture === '#' + image.id + ? 'selected' + : ''; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'li', + { + onClick: textureClick, + className: selectedClass, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'img', + { + width: '155px', + height: '155px', + src: image.src + } ), - loadedTextures.map(function (texture) { - var image = texture.image; - var textureClick = this.selectTexture.bind( - this, - texture - ); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'li', + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', { - onClick: textureClick, + className: 'detail', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'img', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + className: 'title', + children: image.name + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', { - width: '155px', - height: '155px', - src: image.src + children: getFilename(image.src) } ), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'div', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'span', { - className: 'detail', children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: 'title', - children: 'Name:' - } - ), - ' ', - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: image.name - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: 'title', - children: 'Filename:' - } - ), - ' ', - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - children: getFilename( - image.src - ) - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'span', - { - children: [ - image.width, - ' x ', - image.height - ] - } - ) + image.width, + ' x ', + image.height ] } ) ] - }, - texture.uuid - ); - }) - ] - } - ) - } - ) + } + ) + ] + }, + image.id + ); + }.bind(this) + ), + loadedTextures.map(function (texture) { + var image = texture.image; + let textureClick = this.selectTexture.bind( + this, + texture + ); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'li', + { + onClick: textureClick, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'img', + { + width: '155px', + height: '155px', + src: image.src + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'div', + { + className: 'detail', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + className: 'title', + children: 'Name:' + } + ), + ' ', + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + children: image.name + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + className: 'title', + children: 'Filename:' + } + ), + ' ', + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + 'span', + { + children: getFilename(image.src) + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + 'span', + { + children: [ + image.width, + ' x ', + image.height + ] + } + ) + ] + } + ) + ] + }, + texture.uuid + ); + }) ] - } - ); - } - } - ], - [ - { - key: 'getDerivedStateFromProps', - value: function getDerivedStateFromProps(props, state) { - if (state.isOpen !== props.isOpen) { - return { - isOpen: props.isOpen - }; - } - return null; - } + }) + }) + ] } - ] - ); - return ModalTextures; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(ModalTextures, 'propTypes', { - isOpen: prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool, - onClose: prop_types__WEBPACK_IMPORTED_MODULE_5___default().func, - selectedTexture: - prop_types__WEBPACK_IMPORTED_MODULE_5___default().string - }); + ); + } + } /***/ }, @@ -8623,363 +6462,223 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__( /*! prop-types */ './node_modules/prop-types/index.js' ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_5__ + prop_types__WEBPACK_IMPORTED_MODULE_7__ ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__( - /*! classnames */ './node_modules/classnames/index.js' + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - classnames__WEBPACK_IMPORTED_MODULE_1__ + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); + /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__(/*! clsx */ './node_modules/clsx/dist/clsx.mjs'); /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/entity */ './src/lib/entity.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var _EntityRepresentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( - /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' + /*! ../EntityRepresentation */ './src/components/EntityRepresentation.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_5__ = + __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = + __webpack_require__( + /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' + /* eslint-disable react/no-danger */ + + class Entity extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + id: prop_types__WEBPACK_IMPORTED_MODULE_7___default().string, + depth: prop_types__WEBPACK_IMPORTED_MODULE_7___default().number, + entity: prop_types__WEBPACK_IMPORTED_MODULE_7___default().object, + isExpanded: prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool, + isFiltering: prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool, + isSelected: prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool, + selectEntity: + prop_types__WEBPACK_IMPORTED_MODULE_7___default().func, + toggleExpandedCollapsed: + prop_types__WEBPACK_IMPORTED_MODULE_7___default().func + }; + onClick = () => this.props.selectEntity(this.props.entity); + onDoubleClick = () => + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].emit( + 'objectfocus', + this.props.entity.object3D ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); + toggleVisibility = () => { + const entity = this.props.entity; + const visible = + entity.tagName.toLowerCase() === 'a-scene' + ? entity.object3D.visible + : entity.getAttribute('visible'); + entity.setAttribute('visible', !visible); + }; + render() { + const isFiltering = this.props.isFiltering; + const isExpanded = this.props.isExpanded; + const entity = this.props.entity; + const tagName = entity.tagName.toLowerCase(); + + // Clone and remove buttons if not a-scene. + const cloneButton = + tagName === 'a-scene' + ? null + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('a', { + onClick: () => + (0, _lib_entity__WEBPACK_IMPORTED_MODULE_3__.cloneEntity)( + entity + ), + title: 'Clone entity', + className: 'button', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faClone + } + ) + }); + const removeButton = + tagName === 'a-scene' + ? null + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('a', { + onClick: (event) => { + event.stopPropagation(); + (0, + _lib_entity__WEBPACK_IMPORTED_MODULE_3__.removeEntity)( + entity + ); + }, + title: 'Remove entity', + className: 'button', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faTrashAlt + } + ) + }); + + // Add spaces depending on depth. + const pad = '    '.repeat(this.props.depth); + let collapse; + if (entity.children.length > 0 && !isFiltering) { + collapse = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('span', { + onClick: () => this.props.toggleExpandedCollapsed(entity), + className: 'collapsespace', + children: isExpanded + ? /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faCaretDown + } + ) + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faCaretRight + } + ) + }); } else { - result = Super.apply(this, arguments); + collapse = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('span', { + className: 'collapsespace' + }); } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + + // Visibility button. + const visible = + tagName === 'a-scene' + ? entity.object3D.visible + : entity.getAttribute('visible'); + const visibilityButton = /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('i', { + title: 'Toggle entity visibility', + onClick: this.toggleVisibility, + children: visible + ? /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faEye + } + ) + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faEyeSlash + } + ) }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - /* eslint-disable react/no-danger */ - var Entity = /*#__PURE__*/ (function (_React$Component) { - _inherits(Entity, _React$Component); - var _super = _createSuper(Entity); - function Entity(props) { - var _this; - _classCallCheck(this, Entity); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onClick', - function () { - return _this.props.selectEntity(_this.props.entity); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onDoubleClick', - function () { - return _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( - 'objectfocus', - _this.props.entity.object3D - ); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'toggleVisibility', - function () { - var entity = _this.props.entity; - var visible = - entity.tagName.toLowerCase() === 'a-scene' - ? entity.object3D.visible - : entity.getAttribute('visible'); - entity.setAttribute('visible', !visible); + // Class name. + const className = (0, clsx__WEBPACK_IMPORTED_MODULE_2__['default'])( + { + active: this.props.isSelected, + entity: true, + novisible: !visible, + option: true } ); - _this.state = {}; - return _this; - } - _createClass(Entity, [ - { - key: 'render', - value: function render() { - var _this2 = this; - var isFiltering = this.props.isFiltering; - var isExpanded = this.props.isExpanded; - var entity = this.props.entity; - var tagName = entity.tagName.toLowerCase(); - - // Clone and remove buttons if not a-scene. - var cloneButton = - tagName === 'a-scene' - ? null - : /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)('a', { - onClick: function onClick() { - return (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_3__.cloneEntity)( - entity - ); - }, - title: 'Clone entity', - className: 'button fa fa-clone' - }); - var removeButton = - tagName === 'a-scene' - ? null - : /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)('a', { - onClick: function onClick(event) { - event.stopPropagation(); - (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_3__.removeEntity)( - entity - ); - }, - title: 'Remove entity', - className: 'button fa fa-trash' - }); - - // Add spaces depending on depth. - var pad = '    '.repeat(this.props.depth); - var collapse; - if (entity.children.length > 0 && !isFiltering) { - collapse = /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)('span', { - onClick: function onClick() { - return _this2.props.toggleExpandedCollapsed(entity); - }, - className: 'collapsespace fa '.concat( - isExpanded ? 'fa-caret-down' : 'fa-caret-right' - ) - }); - } else { - collapse = /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)('span', { - className: 'collapsespace' - }); - } - - // Visibility button. - var visible = - tagName === 'a-scene' - ? entity.object3D.visible - : entity.getAttribute('visible'); - var visibilityButton = /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)('i', { - title: 'Toggle entity visibility', - className: 'fa ' + (visible ? 'fa-eye' : 'fa-eye-slash'), - onClick: this.toggleVisibility - }); - - // Class name. - var className = - classnames__WEBPACK_IMPORTED_MODULE_1___default()({ - active: this.props.isSelected, - entity: true, - novisible: !visible, - option: true - }); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)('div', { - className: className, - onClick: this.onClick, + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('div', { + className: className, + onClick: this.onClick, + id: this.props.id, + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('span', { children: [ + visibilityButton, /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( 'span', { - children: [ - visibilityButton, - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( - 'span', - { - className: 'entityChildPadding', - dangerouslySetInnerHTML: { - __html: pad - } - } - ), - collapse, - (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_3__.printEntity)( - entity, - this.onDoubleClick - ) - ] + className: 'entityChildPadding', + dangerouslySetInnerHTML: { + __html: pad + } } ), + collapse, /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)( - 'span', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _EntityRepresentation__WEBPACK_IMPORTED_MODULE_4__[ + 'default' + ], { - className: 'entityActions', - children: [cloneButton, removeButton] + entity: entity, + onDoubleClick: this.onDoubleClick } ) ] - }); - } - } - ]); - return Entity; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Entity, 'propTypes', { - depth: prop_types__WEBPACK_IMPORTED_MODULE_5___default().number, - entity: prop_types__WEBPACK_IMPORTED_MODULE_5___default().object, - isExpanded: prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool, - isFiltering: prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool, - isSelected: prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool, - selectEntity: prop_types__WEBPACK_IMPORTED_MODULE_5___default().func, - toggleExpandedCollapsed: - prop_types__WEBPACK_IMPORTED_MODULE_5___default().func - }); + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('span', { + className: 'entityActions', + children: [cloneButton, removeButton] + }) + ] + }); + } + } /***/ }, @@ -8999,688 +6698,437 @@ styleSheet.flush() /* harmony export */ default: () => /* binding */ SceneGraph /* harmony export */ }); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = - __webpack_require__( - /*! prop-types */ './node_modules/prop-types/index.js' - ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = - /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_6__ - ); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ './node_modules/react/index.js'); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = + __webpack_require__( + /*! prop-types */ './node_modules/prop-types/index.js' + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = + /*#__PURE__*/ __webpack_require__.n( + prop_types__WEBPACK_IMPORTED_MODULE_7__ + ); + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__ = + __webpack_require__( + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' + ); + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' + ); + /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__( /*! lodash.debounce */ './node_modules/lodash.debounce/index.js' ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = + /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/ __webpack_require__.n( - lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ + lodash_debounce__WEBPACK_IMPORTED_MODULE_2__ ); - /* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! ./Entity */ './src/components/scenegraph/Entity.js' ); - /* harmony import */ var _Toolbar__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var _Toolbar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! ./Toolbar */ './src/components/scenegraph/Toolbar.js' ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_4__ = + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + /* eslint-disable no-unused-vars, react/no-danger */ + + class SceneGraph extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + scene: prop_types__WEBPACK_IMPORTED_MODULE_7___default().object, + selectedEntity: + prop_types__WEBPACK_IMPORTED_MODULE_7___default().object, + visible: prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool + }; + static defaultProps = { + selectedEntity: '' + }; + constructor(props) { + super(props); + this.state = { + entities: [], + expandedElements: new WeakMap([[props.scene, true]]), + filter: '', + filteredEntities: [], + selectedIndex: -1 + }; + this.updateFilteredEntities = + lodash_debounce__WEBPACK_IMPORTED_MODULE_2___default()( + this.updateFilteredEntities.bind(this), + 100 + ); } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + onEntityUpdate = (detail) => { + if ( + detail.component === 'mixin' || + detail.component === 'visible' + ) { + this.rebuildEntityOptions(); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - /* eslint-disable no-unused-vars, react/no-danger */ - - var SceneGraph = /*#__PURE__*/ (function (_React$Component) { - _inherits(SceneGraph, _React$Component); - var _super = _createSuper(SceneGraph); - function SceneGraph(props) { - var _this; - _classCallCheck(this, SceneGraph); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'selectEntity', - function (entity) { - var found = false; - for (var i = 0; i < _this.state.filteredEntities.length; i++) { - var entityOption = _this.state.filteredEntities[i]; - if (entityOption.entity === entity) { - _this.setState({ - selectedEntity: entity, - selectedIndex: i - }); - // Make sure selected value is visible in scenegraph - _this.expandToRoot(entity); - if (_this.props.onChange) { - _this.props.onChange(entity); - } - _lib_Events__WEBPACK_IMPORTED_MODULE_4__['default'].emit( - 'entityselect', - entity, - true - ); - found = true; - } - } - if (!found) { - _this.setState({ - selectedEntity: null, - selectedIndex: -1 - }); - } - } + componentDidMount() { + this.rebuildEntityOptions(); + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( + 'entityidchange', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'rebuildEntityOptions', - function () { - var entities = [ - { - depth: 0, - entity: _this.props.scene - } - ]; - function treeIterate(element, depth) { - if (!element) { - return; - } - depth += 1; - for (var i = 0; i < element.children.length; i++) { - var entity = element.children[i]; - if ( - entity.dataset.isInspector || - !entity.isEntity || - entity.isInspector || - 'aframeInspector' in entity.dataset - ) { - continue; - } - entities.push({ - entity: entity, - depth: depth - }); - treeIterate(entity, depth); - } - } - treeIterate(_this.props.scene, 0); - _this.setState({ - entities: entities, - filteredEntities: _this.getFilteredEntities( - _this.state.filter, - entities - ) - }); - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( + 'entitycreated', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'selectIndex', - function (index) { - if (index >= 0 && index < _this.state.entities.length) { - _this.selectEntity(_this.state.entities[index].entity); - } - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( + 'entityclone', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'onFilterKeyUp', - function (event) { - if (event.keyCode === 27) { - _this.clearFilter(); - } - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].on( + 'entityupdate', + this.onEntityUpdate ); - _defineProperty( - _assertThisInitialized(_this), - 'onKeyDown', - function (event) { - switch (event.keyCode) { - case 37: // left - case 38: // up - case 39: // right - case 40: - // down - event.preventDefault(); - event.stopPropagation(); - break; - } - } + } + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].off( + 'entityidchange', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'onKeyUp', - function (event) { - if (_this.props.selectedEntity === null) { - return; - } - switch (event.keyCode) { - case 37: - // left - if (_this.isExpanded(_this.props.selectedEntity)) { - _this.toggleExpandedCollapsed(_this.props.selectedEntity); - } - break; - case 38: - // up - _this.selectIndex( - _this.previousExpandedIndexTo(_this.state.selectedIndex) - ); - break; - case 39: - // right - if (!_this.isExpanded(_this.props.selectedEntity)) { - _this.toggleExpandedCollapsed(_this.props.selectedEntity); - } - break; - case 40: - // down - _this.selectIndex( - _this.nextExpandedIndexTo(_this.state.selectedIndex) - ); - break; - } - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].off( + 'entitycreated', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'isVisibleInSceneGraph', - function (x) { - var curr = x.parentNode; - if (!curr) { - return false; - } - while (curr !== undefined && curr.isEntity) { - if (!_this.isExpanded(curr)) { - return false; - } - curr = curr.parentNode; - } - return true; - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].off( + 'entityclone', + this.rebuildEntityOptions ); - _defineProperty( - _assertThisInitialized(_this), - 'isExpanded', - function (x) { - return _this.state.expandedElements.get(x) === true; - } + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].off( + 'entityupdate', + this.onEntityUpdate ); - _defineProperty( - _assertThisInitialized(_this), - 'toggleExpandedCollapsed', - function (x) { - _this.setState({ - expandedElements: _this.state.expandedElements.set( - x, - !_this.isExpanded(x) - ) + } + + /** + * Selected entity updated from somewhere else in the app. + */ + componentDidUpdate(prevProps) { + if (prevProps.selectedEntity !== this.props.selectedEntity) { + this.selectEntity(this.props.selectedEntity); + } + } + selectEntity = (entity) => { + let found = false; + for (let i = 0; i < this.state.filteredEntities.length; i++) { + const entityOption = this.state.filteredEntities[i]; + if (entityOption.entity === entity) { + this.setState({ + selectedIndex: i }); + setTimeout(() => { + // wait 500ms to allow user to double click on entity + document.getElementById('sgnode' + i)?.scrollIntoView({ + behavior: 'smooth' + }); + }, 500); + // Make sure selected value is visible in scenegraph + this.expandToRoot(entity); + _lib_Events__WEBPACK_IMPORTED_MODULE_5__['default'].emit( + 'entityselect', + entity + ); + found = true; } - ); - _defineProperty( - _assertThisInitialized(_this), - 'expandToRoot', - function (x) { - // Expand element all the way to the scene element - var curr = x.parentNode; - while (curr !== undefined && curr.isEntity) { - _this.state.expandedElements.set(curr, true); - curr = curr.parentNode; - } - _this.setState({ - expandedElements: _this.state.expandedElements - }); + } + if (!found) { + this.setState({ + selectedIndex: -1 + }); + } + }; + rebuildEntityOptions = () => { + const entities = [ + { + depth: 0, + entity: this.props.scene } - ); - _defineProperty( - _assertThisInitialized(_this), - 'previousExpandedIndexTo', - function (i) { - for (var prevIter = i - 1; prevIter >= 0; prevIter--) { - var prevEl = _this.state.entities[prevIter].entity; - if (_this.isVisibleInSceneGraph(prevEl)) { - return prevIter; - } - } - return -1; + ]; + function treeIterate(element, depth) { + if (!element) { + return; } - ); - _defineProperty( - _assertThisInitialized(_this), - 'nextExpandedIndexTo', - function (i) { - for ( - var nextIter = i + 1; - nextIter < _this.state.entities.length; - nextIter++ + depth += 1; + for (let i = 0; i < element.children.length; i++) { + let entity = element.children[i]; + if ( + entity.dataset.isInspector || + !entity.isEntity || + entity.isInspector || + 'aframeInspector' in entity.dataset ) { - var nextEl = _this.state.entities[nextIter].entity; - if (_this.isVisibleInSceneGraph(nextEl)) { - return nextIter; - } + continue; } - return -1; - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onChangeFilter', - function (evt) { - var filter = evt.target.value; - _this.setState({ - filter: filter - }); - _this.updateFilteredEntities(filter); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'clearFilter', - function () { - _this.setState({ - filter: '' - }); - _this.updateFilteredEntities(''); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'renderEntities', - function () { - return _this.state.filteredEntities.map(function ( - entityOption, - idx - ) { - if ( - !_this.isVisibleInSceneGraph(entityOption.entity) && - !_this.state.filter - ) { - return null; - } - return /*#__PURE__*/ (0, - react__WEBPACK_IMPORTED_MODULE_0__.createElement)( - _Entity__WEBPACK_IMPORTED_MODULE_2__['default'], - _objectSpread( - _objectSpread({}, entityOption), - {}, - { - key: idx, - isFiltering: !!_this.state.filter, - isExpanded: _this.isExpanded(entityOption.entity), - isSelected: - _this.props.selectedEntity === entityOption.entity, - selectEntity: _this.selectEntity, - toggleExpandedCollapsed: _this.toggleExpandedCollapsed - } - ) - ); + entities.push({ + entity: entity, + depth: depth, + id: 'sgnode' + entities.length }); + treeIterate(entity, depth); } - ); - _this.state = { - entities: [], - expandedElements: new WeakMap([[props.scene, true]]), - filter: '', - filteredEntities: [], - selectedIndex: -1 - }; - _this.rebuildEntityOptions = - lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()( - _this.rebuildEntityOptions.bind(_assertThisInitialized(_this)), - 1000 - ); - _this.updateFilteredEntities = - lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()( - _this.updateFilteredEntities.bind( - _assertThisInitialized(_this) - ), - 500 - ); - return _this; - } - _createClass(SceneGraph, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - this.rebuildEntityOptions(); - _lib_Events__WEBPACK_IMPORTED_MODULE_4__['default'].on( - 'entityidchange', - this.rebuildEntityOptions - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_4__['default'].on( - 'entitycreated', - this.rebuildEntityOptions + } + treeIterate(this.props.scene, 0); + this.setState({ + entities: entities, + filteredEntities: this.getFilteredEntities( + this.state.filter, + entities + ) + }); + }; + selectIndex = (index) => { + if (index >= 0 && index < this.state.entities.length) { + this.selectEntity(this.state.entities[index].entity); + } + }; + onFilterKeyUp = (event) => { + if (event.keyCode === 27) { + this.clearFilter(); + } + }; + onKeyDown = (event) => { + switch (event.keyCode) { + case 37: // left + case 38: // up + case 39: // right + case 40: + // down + event.preventDefault(); + event.stopPropagation(); + break; + } + }; + onKeyUp = (event) => { + if (this.props.selectedEntity === null) { + return; + } + switch (event.keyCode) { + case 37: + // left + if (this.isExpanded(this.props.selectedEntity)) { + this.toggleExpandedCollapsed(this.props.selectedEntity); + } + break; + case 38: + // up + this.selectIndex( + this.previousExpandedIndexTo(this.state.selectedIndex) ); - _lib_Events__WEBPACK_IMPORTED_MODULE_4__['default'].on( - 'entityclone', - this.rebuildEntityOptions + break; + case 39: + // right + if (!this.isExpanded(this.props.selectedEntity)) { + this.toggleExpandedCollapsed(this.props.selectedEntity); + } + break; + case 40: + // down + this.selectIndex( + this.nextExpandedIndexTo(this.state.selectedIndex) ); + break; + } + }; + getFilteredEntities(filter, entities) { + entities = entities || this.state.entities; + if (!filter) { + return entities; + } + return entities.filter((entityOption) => { + return filterEntity( + entityOption.entity, + filter || this.state.filter + ); + }); + } + isVisibleInSceneGraph = (x) => { + let curr = x.parentNode; + if (!curr) { + return false; + } + while (curr?.isEntity) { + if (!this.isExpanded(curr)) { + return false; } - - /** - * Selected entity updated from somewhere else in the app. - */ - }, - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (prevProps.selectedEntity !== this.props.selectedEntity) { - this.selectEntity(this.props.selectedEntity); - } + curr = curr.parentNode; + } + return true; + }; + isExpanded = (x) => this.state.expandedElements.get(x) === true; + toggleExpandedCollapsed = (x) => { + this.setState({ + expandedElements: this.state.expandedElements.set( + x, + !this.isExpanded(x) + ) + }); + }; + expandToRoot = (x) => { + // Expand element all the way to the scene element + let curr = x.parentNode; + while (curr !== undefined && curr.isEntity) { + this.state.expandedElements.set(curr, true); + curr = curr.parentNode; + } + this.setState({ + expandedElements: this.state.expandedElements + }); + }; + previousExpandedIndexTo = (i) => { + for (let prevIter = i - 1; prevIter >= 0; prevIter--) { + const prevEl = this.state.entities[prevIter].entity; + if (this.isVisibleInSceneGraph(prevEl)) { + return prevIter; } - }, - { - key: 'getFilteredEntities', - value: function getFilteredEntities(filter, entities) { - var _this2 = this; - entities = entities || this.state.entities; - if (!filter) { - return entities; - } - return entities.filter(function (entityOption) { - return filterEntity( - entityOption.entity, - filter || _this2.state.filter - ); - }); + } + return -1; + }; + nextExpandedIndexTo = (i) => { + for ( + let nextIter = i + 1; + nextIter < this.state.entities.length; + nextIter++ + ) { + const nextEl = this.state.entities[nextIter].entity; + if (this.isVisibleInSceneGraph(nextEl)) { + return nextIter; } - }, - { - key: 'updateFilteredEntities', - value: function updateFilteredEntities(filter) { - this.setState({ - filteredEntities: this.getFilteredEntities(filter) - }); + } + return -1; + }; + onChangeFilter = (evt) => { + const filter = evt.target.value; + this.setState({ + filter: filter + }); + this.updateFilteredEntities(filter); + }; + updateFilteredEntities(filter) { + this.setState({ + filteredEntities: this.getFilteredEntities(filter) + }); + } + clearFilter = () => { + this.setState({ + filter: '' + }); + this.updateFilteredEntities(''); + }; + renderEntities = () => { + return this.state.filteredEntities.map((entityOption, idx) => { + if ( + !this.isVisibleInSceneGraph(entityOption.entity) && + !this.state.filter + ) { + return null; } - }, - { - key: 'render', - value: function render() { - // To hide the SceneGraph we have to hide its parent too (#left-sidebar). - if (!this.props.visible) { - return null; + return /*#__PURE__*/ (0, + react__WEBPACK_IMPORTED_MODULE_0__.createElement)( + _Entity__WEBPACK_IMPORTED_MODULE_3__['default'], + { + ...entityOption, + key: idx, + isFiltering: !!this.state.filter, + isExpanded: this.isExpanded(entityOption.entity), + isSelected: this.props.selectedEntity === entityOption.entity, + selectEntity: this.selectEntity, + toggleExpandedCollapsed: this.toggleExpandedCollapsed } - var clearFilter = this.state.filter - ? /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { - onClick: this.clearFilter, - className: 'button fa fa-times' - }) - : null; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)('div', { - id: 'scenegraph', - className: 'scenegraph', + ); + }); + }; + render() { + // To hide the SceneGraph we have to hide its parent too (#left-sidebar). + if (!this.props.visible) { + return null; + } + const clearFilter = this.state.filter + ? /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('a', { + onClick: this.clearFilter, + className: 'button', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faTimes + } + ) + }) + : null; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('div', { + id: 'scenegraph', + className: 'scenegraph', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)('div', { + className: 'scenegraph-toolbar', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _Toolbar__WEBPACK_IMPORTED_MODULE_4__['default'], + {} + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)( 'div', { - className: 'scenegraph-toolbar', + className: 'search', children: [ /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - _Toolbar__WEBPACK_IMPORTED_MODULE_3__['default'], - {} - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)( - 'div', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + 'input', { - className: 'search', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - 'input', - { - id: 'filter', - placeholder: 'Search...', - onChange: this.onChangeFilter, - onKeyUp: this.onFilterKeyUp, - value: this.state.filter - } - ), - clearFilter, - !this.state.filter && - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - 'span', - { - className: 'fa fa-search' - } - ) - ] + id: 'filter', + placeholder: 'Search...', + onChange: this.onChangeFilter, + onKeyUp: this.onFilterKeyUp, + value: this.state.filter } - ) + ), + clearFilter, + !this.state.filter && + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_8__.faSearch + } + ) ] } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { - className: 'outliner', - tabIndex: '0', - onKeyDown: this.onKeyDown, - onKeyUp: this.onKeyUp, - children: this.renderEntities() - }) + ) ] - }); - } - } - ]); - return SceneGraph; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(SceneGraph, 'propTypes', { - id: prop_types__WEBPACK_IMPORTED_MODULE_6___default().string, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_6___default().func, - scene: prop_types__WEBPACK_IMPORTED_MODULE_6___default().object, - selectedEntity: - prop_types__WEBPACK_IMPORTED_MODULE_6___default().object, - visible: prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool - }); - _defineProperty(SceneGraph, 'defaultProps', { - selectedEntity: '', - index: -1, - id: 'left-sidebar' - }); - + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)('div', { + className: 'outliner', + tabIndex: '0', + onKeyDown: this.onKeyDown, + onKeyUp: this.onKeyUp, + children: this.renderEntities() + }) + ] + }); + } + } function filterEntity(entity, filter) { if (!filter) { return true; @@ -9722,13 +7170,13 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__( - /*! classnames */ './node_modules/classnames/index.js' + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - classnames__WEBPACK_IMPORTED_MODULE_1__ + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' ); /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); @@ -9742,173 +7190,17 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; + + function filterHelpers(scene, visible) { + scene.traverse((o) => { + if (o.userData.source === 'INSPECTOR') { + o.visible = visible; + } + }); + } + function getSceneName(scene) { return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - function filterHelpers(scene, visible) { - scene.traverse(function (o) { - if (o.userData.source === 'INSPECTOR') { - o.visible = visible; - } - }); - } - function getSceneName(scene) { - return ( - scene.id || slugify(window.location.host + window.location.pathname) + scene.id || slugify(window.location.host + window.location.pathname) ); } @@ -9931,161 +7223,174 @@ styleSheet.flush() /** * Tools and actions. */ - var Toolbar = /*#__PURE__*/ (function (_React$Component) { - _inherits(Toolbar, _React$Component); - var _super = _createSuper(Toolbar); - function Toolbar(props) { - var _this; - _classCallCheck(this, Toolbar); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'writeChanges', - function () { - var xhr = new XMLHttpRequest(); - xhr.open('POST', 'http://localhost:51234/save'); - xhr.onerror = function () { - alert( - 'aframe-watcher not running. This feature requires a companion service running locally. npm install aframe-watcher to save changes back to file. Read more at https://github.com/supermedium/aframe-watcher' - ); - }; - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify(AFRAME.INSPECTOR.history.updates)); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'toggleScenePlaying', - function () { - if (_this.state.isPlaying) { - AFRAME.scenes[0].pause(); - _this.setState({ - isPlaying: false - }); - AFRAME.scenes[0].isPlaying = true; - document.getElementById('aframeInspectorMouseCursor').play(); - return; - } - AFRAME.scenes[0].isPlaying = false; - AFRAME.scenes[0].play(); - _this.setState({ - isPlaying: true - }); - } - ); - _this.state = { + class Toolbar extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + constructor(props) { + super(props); + this.state = { isPlaying: false }; - return _this; } - _createClass(Toolbar, [ - { - key: 'exportSceneToGLTF', - value: function exportSceneToGLTF() { - if (typeof ga !== 'undefined') { - ga('send', 'event', 'SceneGraph', 'exportGLTF'); - } - var sceneName = getSceneName(AFRAME.scenes[0]); - var scene = AFRAME.scenes[0].object3D; - filterHelpers(scene, false); - AFRAME.INSPECTOR.exporters.gltf.parse( - scene, - function (buffer) { - filterHelpers(scene, true); - var blob = new Blob([buffer], { - type: 'application/octet-stream' - }); - (0, _lib_utils__WEBPACK_IMPORTED_MODULE_3__.saveBlob)( - blob, - sceneName + '.glb' - ); - }, - function (error) { - console.error(error); - }, - { - binary: true - } + exportSceneToGLTF() { + const sceneName = getSceneName(AFRAME.scenes[0]); + const scene = AFRAME.scenes[0].object3D; + filterHelpers(scene, false); + AFRAME.INSPECTOR.exporters.gltf.parse( + scene, + function (buffer) { + filterHelpers(scene, true); + const blob = new Blob([buffer], { + type: 'application/octet-stream' + }); + (0, _lib_utils__WEBPACK_IMPORTED_MODULE_3__.saveBlob)( + blob, + sceneName + '.glb' ); + }, + function (error) { + console.error(error); + }, + { + binary: true } - }, - { - key: 'addEntity', - value: function addEntity() { - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( - 'entitycreate', - { - element: 'a-entity', - components: {} - } - ); + ); + } + addEntity() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( + 'entitycreate', + { + element: 'a-entity', + components: {} } + ); + } - /** - * Try to write changes with aframe-inspector-watcher. - */ - }, - { - key: 'render', - value: function render() { - var watcherClassNames = - classnames__WEBPACK_IMPORTED_MODULE_1___default()({ - button: true, - fa: true, - 'fa-save': true - }); - var watcherTitle = 'Write changes with aframe-watcher.'; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { - id: 'toolbar', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)('div', { - className: 'toolbarActions', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { - className: 'button fa fa-plus', - title: 'Add a new entity', - onClick: this.addEntity - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { - id: 'playPauseScene', - className: - 'button fa ' + - (this.state.isPlaying ? 'fa-pause' : 'fa-play'), - title: this.state.isPlaying - ? 'Pause scene' - : 'Resume scene', - onClick: this.toggleScenePlaying - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { - className: 'gltfIcon', - title: 'Export to GLTF', - onClick: this.exportSceneToGLTF, - children: /*#__PURE__*/ (0, + /** + * Try to write changes with aframe-inspector-watcher. + */ + writeChanges = () => { + const xhr = new XMLHttpRequest(); + xhr.open('POST', 'http://localhost:51234/save'); + xhr.onerror = () => { + alert( + 'aframe-watcher not running. This feature requires a companion service running locally. npm install aframe-watcher to save changes back to file. Read more at https://github.com/supermedium/aframe-watcher' + ); + }; + xhr.setRequestHeader('Content-Type', 'application/json'); + xhr.send(JSON.stringify(AFRAME.INSPECTOR.history.updates)); + }; + toggleScenePlaying = () => { + if (this.state.isPlaying) { + AFRAME.scenes[0].pause(); + this.setState({ + isPlaying: false + }); + AFRAME.scenes[0].isPlaying = true; + document.getElementById('aframeInspectorMouseCursor').play(); + return; + } + AFRAME.scenes[0].isPlaying = false; + AFRAME.scenes[0].play(); + this.setState({ + isPlaying: true + }); + }; + openHelpModal = () => { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( + 'openhelpmodal' + ); + }; + render() { + const watcherTitle = 'Write changes with aframe-watcher.'; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { + id: 'toolbar', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)('div', { + className: 'toolbarActions', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { + className: 'button', + title: 'Add a new entity', + onClick: this.addEntity, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPlus + } + ) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { + id: 'playPauseScene', + className: 'button', + title: this.state.isPlaying + ? 'Pause scene' + : 'Resume scene', + onClick: this.toggleScenePlaying, + children: this.state.isPlaying + ? /*#__PURE__*/ (0, react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( - 'img', + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, { - src: _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_4__ + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPause } ) - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { - className: watcherClassNames, - title: watcherTitle, - onClick: this.writeChanges - }) - ] + : /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faPlay + } + ) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { + className: 'gltfIcon', + title: 'Export to GLTF', + onClick: this.exportSceneToGLTF, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('img', { + src: _assets_gltf_svg__WEBPACK_IMPORTED_MODULE_4__ + }) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { + className: 'button', + title: watcherTitle, + onClick: this.writeChanges, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faFloppyDisk + } + ) + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('div', { + className: 'helpButtonContainer', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)('a', { + className: 'button', + title: 'Help', + onClick: this.openHelpModal, + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_6__.faQuestion + } + ) + }) }) - }); - } - } - ]); - return Toolbar; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); + ] + }) + }); + } + } /***/ }, @@ -10121,150 +7426,8 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - var options = [ + const options = [ { value: 'perspective', event: 'cameraperspectivetoggle', @@ -10309,82 +7472,69 @@ styleSheet.flush() } ]; function getOption(value) { - return options.filter(function (opt) { - return opt.value === value; - })[0]; + return options.filter((opt) => opt.value === value)[0]; } - var CameraToolbar = /*#__PURE__*/ (function (_React$Component) { - _inherits(CameraToolbar, _React$Component); - var _super = _createSuper(CameraToolbar); - function CameraToolbar(props) { - var _this; - _classCallCheck(this, CameraToolbar); - _this = _super.call(this, props); - _this.state = { + class CameraToolbar extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + constructor(props) { + super(props); + this.state = { selectedCamera: 'perspective' }; - _this.justChangedCamera = false; - return _this; + this.justChangedCamera = false; } - _createClass(CameraToolbar, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'cameratoggle', - function (data) { - if (_this2.justChangedCamera) { - // Prevent recursion. - _this2.justChangedCamera = false; - return; - } - _this2.setState({ - selectedCamera: data.value - }); - } - ); - } - }, - { - key: 'onChange', - value: function onChange(option) { - console.log(option); - this.justChangedCamera = true; - this.setState({ - selectedCamera: option.value - }); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - option.event, - option.payload - ); - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { - id: 'cameraToolbar', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - react_select__WEBPACK_IMPORTED_MODULE_3__['default'], - { - id: 'cameraSelect', - classNamePrefix: 'select', - options: options, - simpleValue: true, - value: getOption(this.state.selectedCamera), - isSearchable: false, - onChange: this.onChange.bind(this) - } - ) - }); - } + onCameraToggle = (data) => { + if (this.justChangedCamera) { + // Prevent recursion. + this.justChangedCamera = false; + return; } - ]); - return CameraToolbar; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); + this.setState({ + selectedCamera: data.value + }); + }; + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( + 'cameratoggle', + this.onCameraToggle + ); + } + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].off( + 'cameratoggle', + this.onCameraToggle + ); + } + onChange(option) { + this.justChangedCamera = true; + this.setState({ + selectedCamera: option.value + }); + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( + option.event, + option.payload + ); + } + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('div', { + id: 'cameraToolbar', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( + react_select__WEBPACK_IMPORTED_MODULE_3__['default'], + { + id: 'cameraSelect', + classNamePrefix: 'select', + options: options, + simpleValue: true, + value: getOption(this.state.selectedCamera), + isSearchable: false, + onChange: this.onChange.bind(this) + } + ) + }); + } + } /***/ }, @@ -10410,348 +7560,183 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__( - /*! classnames */ './node_modules/classnames/index.js' + /*! @fortawesome/free-solid-svg-icons */ './node_modules/@fortawesome/free-solid-svg-icons/index.mjs' ); - /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - classnames__WEBPACK_IMPORTED_MODULE_1__ + /* harmony import */ var _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../AwesomeIcon */ './src/components/AwesomeIcon.js' ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = + /* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__(/*! clsx */ './node_modules/clsx/dist/clsx.mjs'); + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } var TransformButtons = [ { value: 'translate', - icon: 'fa-arrows-alt' + icon: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faArrowsAlt + } + ) }, { value: 'rotate', - icon: 'fa-repeat' + icon: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faRotateRight + } + ) }, { value: 'scale', - icon: 'fa-expand' + icon: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + _AwesomeIcon__WEBPACK_IMPORTED_MODULE_1__.AwesomeIcon, + { + icon: _fortawesome_free_solid_svg_icons__WEBPACK_IMPORTED_MODULE_5__.faUpRightAndDownLeftFromCenter + } + ) } ]; - var TransformToolbar = /*#__PURE__*/ (function (_React$Component) { - _inherits(TransformToolbar, _React$Component); - var _super = _createSuper(TransformToolbar); - function TransformToolbar(props) { - var _this; - _classCallCheck(this, TransformToolbar); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'changeTransformMode', - function (mode) { - _this.setState({ - selectedTransform: mode - }); - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( - 'transformmodechange', - mode - ); - if (typeof ga !== 'undefined') { - ga('send', 'event', 'Toolbar', 'selectHelper', mode); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onLocalChange', - function (e) { - var local = e.target.checked; - _this.setState({ - localSpace: local - }); - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( - 'transformspacechanged', - local ? 'local' : 'world' - ); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'renderTransformButtons', - function () { - return TransformButtons.map( - function (option, i) { - var _classNames; - var selected = - option.value === this.state.selectedTransform; - var classes = - classnames__WEBPACK_IMPORTED_MODULE_1___default()( - ((_classNames = { - button: true, - fa: true - }), - _defineProperty(_classNames, option.icon, true), - _defineProperty(_classNames, 'active', selected), - _classNames) - ); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - 'a', - { - title: option.value, - onClick: this.changeTransformMode.bind( - this, - option.value - ), - className: classes - }, - i - ); - }.bind(_assertThisInitialized(_this)) - ); - } - ); - _this.state = { + class TransformToolbar extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + constructor(props) { + super(props); + this.state = { selectedTransform: 'translate', localSpace: false }; - return _this; } - _createClass(TransformToolbar, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( - 'transformmodechange', - function (mode) { - _this2.setState({ - selectedTransform: mode - }); - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( - 'transformspacechange', - function () { - _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].emit( - 'transformspacechanged', - _this2.state.localSpace ? 'world' : 'local' - ); - _this2.setState({ - localSpace: !_this2.state.localSpace - }); + onTransformModeChange = (mode) => { + this.setState({ + selectedTransform: mode + }); + }; + onTransformSpaceChange = () => { + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( + 'transformspacechanged', + this.state.localSpace ? 'world' : 'local' + ); + this.setState({ + localSpace: !this.state.localSpace + }); + }; + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( + 'transformmodechange', + this.onTransformModeChange + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( + 'transformspacechange', + this.onTransformSpaceChange + ); + } + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].off( + 'transformmodechange', + this.onTransformModeChange + ); + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].off( + 'transformspacechange', + this.onTransformSpaceChange + ); + } + changeTransformMode = (mode) => { + this.setState({ + selectedTransform: mode + }); + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( + 'transformmodechange', + mode + ); + }; + onLocalChange = (e) => { + const local = e.target.checked; + this.setState({ + localSpace: local + }); + _lib_Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( + 'transformspacechanged', + local ? 'local' : 'world' + ); + }; + renderTransformButtons = () => { + return TransformButtons.map( + function (option, i) { + var selected = option.value === this.state.selectedTransform; + var classes = (0, clsx__WEBPACK_IMPORTED_MODULE_2__['default'])( + { + button: true, + active: selected } ); - } - }, - { - key: 'render', - value: function render() { return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { - id: 'transformToolbar', - className: 'toolbarButtons', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + 'a', + { + title: option.value, + onClick: this.changeTransformMode.bind(this, option.value), + className: classes, + children: option.icon + }, + i + ); + }.bind(this) + ); + }; + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)('div', { + id: 'transformToolbar', + className: 'toolbarButtons', + children: [ + this.renderTransformButtons(), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)('span', { + className: 'local-transform', children: [ - this.renderTransformButtons(), /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)( - 'span', + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + 'input', { - className: 'local-transform', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - 'input', - { - id: 'local', - type: 'checkbox', - title: - 'Toggle between local and world space transforms', - checked: - this.state.localSpace || - this.state.selectedTransform === 'scale', - disabled: - this.state.selectedTransform === 'scale', - onChange: this.onLocalChange - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - 'label', - { - htmlFor: 'local', - title: - 'Toggle between local and world space transforms', - children: 'local' - } - ) - ] + id: 'local', + type: 'checkbox', + title: + 'Toggle between local and world space transforms', + checked: + this.state.localSpace || + this.state.selectedTransform === 'scale', + disabled: this.state.selectedTransform === 'scale', + onChange: this.onLocalChange + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)( + 'label', + { + htmlFor: 'local', + title: + 'Toggle between local and world space transforms', + children: 'local' } ) ] - }); - } - } - ]); - return TransformToolbar; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); + }) + ] + }); + } + } /***/ }, @@ -10777,212 +7762,72 @@ styleSheet.flush() /*#__PURE__*/ __webpack_require__.n( react__WEBPACK_IMPORTED_MODULE_0__ ); - /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_1__ = + /* harmony import */ var _EntityRepresentation__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../EntityRepresentation */ './src/components/EntityRepresentation.js' + ); + /* harmony import */ var _lib_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/Events */ './src/lib/Events.js'); - /* harmony import */ var _lib_entity__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__(/*! ../../lib/entity */ './src/lib/entity.js'); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); + + class ViewportHUD extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + constructor(props) { + super(props); + this.state = { + hoveredEntity: null + }; } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor + onRaycasterMouseEnter = (el) => { + this.setState({ + hoveredEntity: el + }); + }; + onRaycasterMouseLeave = (el) => { + this.setState({ + hoveredEntity: el + }); + }; + componentDidMount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'raycastermouseenter', + this.onRaycasterMouseEnter ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].on( + 'raycastermouseleave', + this.onRaycasterMouseLeave ); } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' + componentWillUnmount() { + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].off( + 'raycastermouseenter', + this.onRaycasterMouseEnter ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" + _lib_Events__WEBPACK_IMPORTED_MODULE_2__['default'].off( + 'raycastermouseleave', + this.onRaycasterMouseLeave ); } - return self; + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('div', { + id: 'viewportHud', + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('p', { + children: /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _EntityRepresentation__WEBPACK_IMPORTED_MODULE_1__['default'], + { + entity: this.state.hoveredEntity + } + ) + }) + }); + } } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - - var ViewportHUD = /*#__PURE__*/ (function (_React$Component) { - _inherits(ViewportHUD, _React$Component); - var _super = _createSuper(ViewportHUD); - function ViewportHUD(props) { - var _this; - _classCallCheck(this, ViewportHUD); - _this = _super.call(this, props); - _this.state = { - hoveredEntity: null, - selectedEntity: null - }; - return _this; - } - _createClass(ViewportHUD, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'raycastermouseenter', - function (el) { - _this2.setState({ - hoveredEntity: el - }); - } - ); - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].on( - 'raycastermouseleave', - function (el) { - _this2.setState({ - hoveredEntity: el - }); - } - ); - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('div', { - id: 'viewportHud', - children: /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)('p', { - children: (0, - _lib_entity__WEBPACK_IMPORTED_MODULE_2__.printEntity)( - this.state.hoveredEntity - ) - }) - }); - } - } - ]); - return ViewportHUD; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); /***/ }, @@ -11020,229 +7865,57 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + + class BooleanWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, + name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool + }; + static defaultProps = { + value: false + }; + constructor(props) { + super(props); + this.state = { + value: this.props.value + }; } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({ + value: this.props.value + }); } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + } + onChange = (e) => { + var value = e.target.checked; + this.setState({ + value: value + }); + if (this.props.onChange) { + this.props.onChange(this.props.name, value); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + render() { + var id = this.props.componentname + '.' + this.props.name; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { + id: id, + type: 'checkbox', + checked: this.state.value, + value: this.state.value, + onChange: this.onChange }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); } - var BooleanWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(BooleanWidget, _React$Component); - var _super = _createSuper(BooleanWidget); - function BooleanWidget(props) { - var _this; - _classCallCheck(this, BooleanWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (e) { - var value = e.target.checked; - _this.setState({ - value: value - }); - if (_this.props.onChange) { - _this.props.onChange(_this.props.name, value); - } - } - ); - _this.state = { - value: _this.props.value - }; - return _this; - } - _createClass(BooleanWidget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.value !== prevProps.value) { - this.setState({ - value: this.props.value - }); - } - } - }, - { - key: 'render', - value: function render() { - var id = this.props.componentname + '.' + this.props.name; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { - id: id, - type: 'checkbox', - checked: this.state.value, - value: this.state.value, - onChange: this.onChange - }); - } - } - ]); - return BooleanWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(BooleanWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().string.isRequired, - entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, - name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string - .isRequired, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, - value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool - }); - _defineProperty(BooleanWidget, 'defaultProps', { - value: false - }); - /***/ }, @@ -11279,283 +7952,91 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + + class ColorWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, + name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + }; + static defaultProps = { + value: '#ffffff' + }; + constructor(props) { + super(props); + var value = this.props.value; + this.color = new THREE.Color(); + this.state = { + value: value, + pickerValue: this.getHexString(value) + }; } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + setValue(value) { + var pickerValue = this.getHexString(value); + this.setState({ + value: value, + pickerValue: pickerValue + }); + if (this.props.onChange) { + this.props.onChange(this.props.name, value); } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({ + value: this.props.value, + pickerValue: this.getHexString(this.props.value) + }); + } } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; + getHexString(value) { + return '#' + this.color.set(value).getHexString(); } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + onChange = (e) => { + this.setValue(e.target.value); + }; + onKeyUp = (e) => { + e.stopPropagation(); + // if (e.keyCode === 13) + this.setValue(e.target.value); + }; + onChangeText = (e) => { + this.setState({ + value: e.target.value + }); + }; + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)('span', { + className: 'color-widget', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { + type: 'color', + className: 'color', + value: this.state.pickerValue, + title: this.state.value, + onChange: this.onChange + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { + type: 'text', + className: 'color_value', + value: this.state.value, + onKeyUp: this.onKeyUp, + onChange: this.onChangeText + }) + ] }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); } - var ColorWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(ColorWidget, _React$Component); - var _super = _createSuper(ColorWidget); - function ColorWidget(props) { - var _this; - _classCallCheck(this, ColorWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (e) { - _this.setValue(e.target.value); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onKeyUp', - function (e) { - e.stopPropagation(); - // if (e.keyCode === 13) - _this.setValue(e.target.value); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onChangeText', - function (e) { - _this.setState({ - value: e.target.value - }); - } - ); - var value = _this.props.value; - _this.color = new THREE.Color(); - _this.state = { - value: value, - pickerValue: _this.getHexString(value) - }; - return _this; - } - _createClass(ColorWidget, [ - { - key: 'setValue', - value: function setValue(value) { - var pickerValue = this.getHexString(value); - this.setState({ - value: value, - pickerValue: pickerValue - }); - if (this.props.onChange) { - this.props.onChange(this.props.name, value); - } - } - }, - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.value !== prevProps.value) { - this.setState({ - value: this.props.value, - pickerValue: this.getHexString(this.props.value) - }); - } - } - }, - { - key: 'getHexString', - value: function getHexString(value) { - return '#' + this.color.set(value).getHexString(); - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)('span', { - className: 'color-widget', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - 'input', - { - type: 'color', - className: 'color', - value: this.state.pickerValue, - title: this.state.value, - onChange: this.onChange - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - 'input', - { - type: 'text', - className: 'color_value', - value: this.state.value, - onKeyUp: this.onKeyUp, - onChange: this.onChangeText - } - ) - ] - }); - } - } - ]); - return ColorWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(ColorWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().string.isRequired, - entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, - name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string - .isRequired, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, - value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string - }); - _defineProperty(ColorWidget, 'defaultProps', { - value: '#ffffff' - }); - /***/ }, @@ -11592,224 +8073,51 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + + class InputWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, + name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().any + }; + constructor(props) { + super(props); + this.state = { + value: this.props.value || '' + }; } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + onChange = (e) => { + var value = e.target.value; + this.setState({ + value: value + }); + if (this.props.onChange) { + this.props.onChange(this.props.name, value); } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({ + value: this.props.value + }); + } } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { + type: 'text', + className: 'string', + value: this.state.value || '', + onChange: this.onChange }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); } - var InputWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(InputWidget, _React$Component); - var _super = _createSuper(InputWidget); - function InputWidget(props) { - var _this; - _classCallCheck(this, InputWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (e) { - var value = e.target.value; - _this.setState({ - value: value - }); - if (_this.props.onChange) { - _this.props.onChange(_this.props.name, value); - } - } - ); - _this.state = { - value: _this.props.value || '' - }; - return _this; - } - _createClass(InputWidget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.value !== prevProps.value) { - this.setState({ - value: this.props.value - }); - } - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { - type: 'text', - className: 'string', - value: this.state.value || '', - onChange: this.onChange - }); - } - } - ]); - return InputWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(InputWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, - name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string - .isRequired, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, - value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().any - }); - /***/ }, @@ -11846,670 +8154,286 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); + + class NumberWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, + max: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, + min: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, + name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + precision: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, + step: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, + value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number + }; + static defaultProps = { + min: -Infinity, + max: Infinity, + value: 0, + precision: 3, + step: 1 + }; + constructor(props) { + super(props); + this.state = { + value: this.props.value, + displayValue: + typeof this.props.value === 'number' + ? this.props.value.toFixed(this.props.precision) + : '' + }; + this.input = + /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); + componentDidMount() { + this.distance = 0; + this.onMouseDownValue = 0; + this.prevPointer = [0, 0]; + } + onMouseMove = (event) => { + const currentValue = parseFloat(this.state.value); + const pointer = [event.clientX, event.clientY]; + const delta = + pointer[0] - + this.prevPointer[0] - + (pointer[1] - this.prevPointer[1]); + this.distance += delta; + + // Add minimum tolerance to reduce unintentional drags when clicking on input. + // if (Math.abs(delta) <= 2) { return; } + + let value = + this.onMouseDownValue + + ((this.distance / (event.shiftKey ? 5 : 50)) * this.props.step) / + 2; + value = Math.min(this.props.max, Math.max(this.props.min, value)); + if (currentValue !== value) { + this.setValue(value); + } + this.prevPointer = [event.clientX, event.clientY]; + }; + onMouseDown = (event) => { + event.preventDefault(); + this.distance = 0; + this.onMouseDownValue = this.state.value; + this.prevPointer = [event.clientX, event.clientY]; + document.addEventListener('mousemove', this.onMouseMove, false); + document.addEventListener('mouseup', this.onMouseUp, false); + }; + onMouseUp = () => { + document.removeEventListener('mousemove', this.onMouseMove, false); + document.removeEventListener('mouseup', this.onMouseUp, false); + if (Math.abs(this.distance) < 2) { + this.input.current.focus(); + this.input.current.select(); + } + }; + setValue(value) { + if (value === this.state.value) return; + if (value !== undefined) { + if (this.props.precision === 0) { + value = parseInt(value); + } else { + value = parseFloat(value); + } + + // If we inadvertently typed a character in the field, set value to the previous value from props + if (isNaN(value)) { + value = this.props.value; + } + if (value < this.props.min) { + value = this.props.min; + } + if (value > this.props.max) { + value = this.props.max; + } + this.setState({ + value: value, + displayValue: value.toFixed(this.props.precision) + }); + if (this.props.onChange) { + this.props.onChange( + this.props.name, + parseFloat(value.toFixed(5)) + ); + } + } } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); + componentDidUpdate(prevProps) { + // This will be triggered typically when the element is changed directly with + // element.setAttribute. + + // We use Object.is instead of === for comparison here so that comparing two NaN doesn't trigger an infinite update. + // Object.is(NaN, NaN) is true, NaN === NaN is false + if (!Object.is(this.props.value, prevProps.value)) { + this.setState({ + value: this.props.value, + displayValue: this.props.value.toFixed(this.props.precision) + }); + } } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } + onBlur = () => { + this.setValue(parseFloat(this.input.current.value)); + }; + onChange = (e) => { + this.setState({ + value: e.target.value, + displayValue: e.target.value + }); + }; + onKeyDown = (event) => { + event.stopPropagation(); + + // enter. + if (event.keyCode === 13) { + this.input.current.blur(); + return; } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); + + // up. + if (event.keyCode === 38) { + this.setValue(parseFloat(this.state.value) + 0.01); + return; + } + + // down. + if (event.keyCode === 40) { + this.setValue(parseFloat(this.state.value) - 0.01); + return; } - return _possibleConstructorReturn(this, result); }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); + render() { + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { + ref: this.input, + className: 'number', + type: 'text', + value: this.state.displayValue, + onKeyDown: this.onKeyDown, + onChange: this.onChange, + onMouseDown: this.onMouseDown, + onBlur: this.onBlur + }); } - return _assertThisInitialized(self); } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); + + /***/ + }, + + /***/ './src/components/widgets/SelectWidget.js': + /*!************************************************!*\ + !*** ./src/components/widgets/SelectWidget.js ***! + \************************************************/ + /***/ ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__ + ) => { + 'use strict'; + __webpack_require__.r(__webpack_exports__); + /* harmony export */ __webpack_require__.d(__webpack_exports__, { + /* harmony export */ default: () => /* binding */ SelectWidget + /* harmony export */ + }); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__(/*! react */ './node_modules/react/index.js'); + /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = + /*#__PURE__*/ __webpack_require__.n( + react__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = + __webpack_require__( + /*! prop-types */ './node_modules/prop-types/index.js' + ); + /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = + /*#__PURE__*/ __webpack_require__.n( + prop_types__WEBPACK_IMPORTED_MODULE_2__ + ); + /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_3__ = + __webpack_require__( + /*! react-select */ './node_modules/react-select/dist/react-select.esm.js' + ); + /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' + ); + + class SelectWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, + name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + .isRequired, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, + options: + prop_types__WEBPACK_IMPORTED_MODULE_2___default().array + .isRequired, + value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string + }; + constructor(props) { + super(props); + const value = this.props.value || ''; + this.state = { + value: { + value: value, + label: value + } + }; } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + onChange = (value) => { + this.setState( + { + value: value + }, + () => { + if (this.props.onChange) { + this.props.onChange(this.props.name, value.value); + } + } ); - return true; - } catch (e) { - return false; + }; + componentDidUpdate(prevProps) { + const props = this.props; + if (props.value !== prevProps.value) { + this.setState({ + value: { + value: props.value, + label: props.value + } + }); + } } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); + render() { + const options = this.props.options.map((value) => { + return { + value: value, + label: value }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true }); - } else { - obj[key] = value; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( + react_select__WEBPACK_IMPORTED_MODULE_3__['default'], + { + className: 'select-widget', + classNamePrefix: 'select', + options: options, + simpleValue: true, + clearable: true, + placeholder: '', + value: this.state.value, + noResultsText: 'No value found', + onChange: this.onChange, + searchable: true + } + ); } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - var NumberWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(NumberWidget, _React$Component); - var _super = _createSuper(NumberWidget); - function NumberWidget(props) { - var _this; - _classCallCheck(this, NumberWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onMouseMove', - function (event) { - var currentValue = parseFloat(_this.state.value); - var pointer = [event.clientX, event.clientY]; - var delta = - pointer[0] - - _this.prevPointer[0] - - (pointer[1] - _this.prevPointer[1]); - _this.distance += delta; - - // Add minimum tolerance to reduce unintentional drags when clicking on input. - // if (Math.abs(delta) <= 2) { return; } - - var value = - _this.onMouseDownValue + - ((_this.distance / (event.shiftKey ? 5 : 50)) * - _this.props.step) / - 2; - value = Math.min( - _this.props.max, - Math.max(_this.props.min, value) - ); - if (currentValue !== value) { - _this.setValue(value); - } - _this.prevPointer = [event.clientX, event.clientY]; - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onMouseDown', - function (event) { - event.preventDefault(); - _this.distance = 0; - _this.onMouseDownValue = _this.state.value; - _this.prevPointer = [event.clientX, event.clientY]; - document.addEventListener( - 'mousemove', - _this.onMouseMove, - false - ); - document.addEventListener('mouseup', _this.onMouseUp, false); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onMouseUp', - function () { - document.removeEventListener( - 'mousemove', - _this.onMouseMove, - false - ); - document.removeEventListener('mouseup', _this.onMouseUp, false); - if (Math.abs(_this.distance) < 2) { - _this.input.current.focus(); - _this.input.current.select(); - } - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onBlur', - function () { - _this.setValue(parseFloat(_this.input.current.value)); - _this.setState({ - class: '' - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (e) { - _this.setState({ - value: e.target.value, - displayValue: e.target.value - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onKeyDown', - function (event) { - event.stopPropagation(); - - // enter. - if (event.keyCode === 13) { - _this.setValue(parseFloat(_this.input.current.value)); - _this.input.current.blur(); - return; - } - - // up. - if (event.keyCode === 38) { - _this.setValue(parseFloat(_this.state.value) + 0.01); - return; - } - - // down. - if (event.keyCode === 40) { - _this.setValue(parseFloat(_this.state.value) - 0.01); - return; - } - } - ); - _this.state = { - value: _this.props.value, - displayValue: - typeof _this.props.value === 'number' - ? _this.props.value.toFixed(_this.props.precision) - : '' - }; - _this.input = - /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - return _this; - } - _createClass(NumberWidget, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - this.distance = 0; - this.onMouseDownValue = 0; - this.prevPointer = [0, 0]; - this.setValue(this.props.value); - this.onBlur(); - } - }, - { - key: 'setValue', - value: function setValue(value) { - if (value === this.state.value) return; - if (value !== undefined) { - if (this.props.precision === 0) { - value = parseInt(value); - } else { - value = parseFloat(value); - } - if (value < this.props.min) { - value = this.props.min; - } - if (value > this.props.max) { - value = this.props.max; - } - this.setState({ - value: value, - displayValue: value.toFixed(this.props.precision) - }); - if (this.props.onChange) { - this.props.onChange( - this.props.name, - parseFloat(value.toFixed(5)) - ); - } - } - } - }, - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - // This will be triggered typically when the element is changed directly with - // element.setAttribute. - - // We use Object.is instead of === for comparison here so that comparing two NaN doesn't trigger an infinite update. - // Object.is(NaN, NaN) is true, NaN === NaN is false - if (!Object.is(this.props.value, prevProps.value)) { - this.setState({ - value: this.props.value, - displayValue: this.props.value.toFixed(this.props.precision) - }); - } - } - }, - { - key: 'render', - value: function render() { - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)('input', { - ref: this.input, - className: 'number', - type: 'text', - value: this.state.displayValue, - onKeyDown: this.onKeyDown, - onChange: this.onChange, - onMouseDown: this.onMouseDown, - onFocus: this.onFocus, - onBlur: this.onBlur - }); - } - } - ]); - return NumberWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(NumberWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_2___default().object, - max: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, - min: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, - name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().string, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_2___default().func, - precision: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, - step: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number, - value: prop_types__WEBPACK_IMPORTED_MODULE_2___default().number - }); - _defineProperty(NumberWidget, 'defaultProps', { - min: -Infinity, - max: Infinity, - value: 0, - precision: 3, - step: 1 - }); - - /***/ - }, - - /***/ './src/components/widgets/SelectWidget.js': - /*!************************************************!*\ - !*** ./src/components/widgets/SelectWidget.js ***! - \************************************************/ - /***/ ( - __unused_webpack_module, - __webpack_exports__, - __webpack_require__ - ) => { - 'use strict'; - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ default: () => /* binding */ SelectWidget - /* harmony export */ - }); - /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = - __webpack_require__(/*! react */ './node_modules/react/index.js'); - /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = - /*#__PURE__*/ __webpack_require__.n( - react__WEBPACK_IMPORTED_MODULE_0__ - ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = - __webpack_require__( - /*! prop-types */ './node_modules/prop-types/index.js' - ); - /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = - /*#__PURE__*/ __webpack_require__.n( - prop_types__WEBPACK_IMPORTED_MODULE_3__ - ); - /* harmony import */ var react_select__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__( - /*! react-select */ './node_modules/react-select/dist/react-select.esm.js' - ); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = - __webpack_require__( - /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' - ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - - var SelectWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(SelectWidget, _React$Component); - var _super = _createSuper(SelectWidget); - function SelectWidget(props) { - var _this; - _classCallCheck(this, SelectWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (value) { - _this.setState( - { - value: value - }, - function () { - if (_this.props.onChange) { - _this.props.onChange(_this.props.name, value.value); - } - } - ); - } - ); - var _value = _this.props.value || ''; - _this.state = { - value: { - value: _value, - label: _value - } - }; - return _this; - } - _createClass(SelectWidget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - var props = this.props; - if (props.value !== prevProps.value) { - this.setState({ - value: { - value: props.value, - label: props.value - } - }); - } - } - }, - { - key: 'render', - value: function render() { - var options = this.props.options.map(function (value) { - return { - value: value, - label: value - }; - }); - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)( - react_select__WEBPACK_IMPORTED_MODULE_2__['default'], - { - className: 'select-widget', - classNamePrefix: 'select', - options: options, - simpleValue: true, - clearable: true, - placeholder: '', - value: this.state.value, - noResultsText: 'No value found', - onChange: this.onChange, - searchable: true - } - ); - } - } - ]); - return SelectWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(SelectWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_3___default().string.isRequired, - entity: prop_types__WEBPACK_IMPORTED_MODULE_3___default().object, - name: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string - .isRequired, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_3___default().func, - options: - prop_types__WEBPACK_IMPORTED_MODULE_3___default().array.isRequired, - value: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string - }); /***/ }, @@ -12549,162 +8473,6 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } function getUrlFromId(assetId) { return ( @@ -12762,243 +8530,192 @@ styleSheet.flush() } return id; } - var TextureWidget = /*#__PURE__*/ (function (_React$Component) { - _inherits(TextureWidget, _React$Component); - var _super = _createSuper(TextureWidget); - function TextureWidget(props) { - var _this; - _classCallCheck(this, TextureWidget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'notifyChanged', - function (value) { - if (_this.props.onChange) { - _this.props.onChange(_this.props.name, value); - } - _this.setState({ - value: value - }); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (e) { - var value = e.target.value; - _this.setState({ - value: value - }); - _this.notifyChanged(value); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'removeMap', - function () { - _this.setValue(''); - _this.notifyChanged(''); - } - ); - _defineProperty( - _assertThisInitialized(_this), - 'openDialog', - function () { - _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( - 'opentexturesmodal', - _this.state.value, - function (image) { - if (!image) { - return; - } - var value = image.value; - if (image.type !== 'asset') { - var assetId = insertOrGetImageAsset(image.src); - value = '#' + assetId; - } - if (_this.props.onChange) { - _this.props.onChange(_this.props.name, value); - } - _this.setValue(value); - } - ); - } - ); - _this.state = { - value: _this.props.value || '' + class TextureWidget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_3___default().object, + mapName: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, + name: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string + .isRequired, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_3___default().func, + value: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([ + prop_types__WEBPACK_IMPORTED_MODULE_3___default().object, + prop_types__WEBPACK_IMPORTED_MODULE_3___default().string + ]) + }; + static defaultProps = { + value: '', + mapName: 'nomap', + dataURL: '' + }; + constructor(props) { + super(props); + this.state = { + value: this.props.value || '' }; - _this.canvas = + this.canvas = /*#__PURE__*/ react__WEBPACK_IMPORTED_MODULE_0___default().createRef(); - return _this; } - _createClass(TextureWidget, [ - { - key: 'componentDidMount', - value: function componentDidMount() { - this.setValue(this.props.value || ''); - } - }, - { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var component = - this.props.entity.components[this.props.componentname]; - if (!component) { - return; - } - // component.attrValue may be undefined if component is from a mixin - var newValue = - component.attrValue && component.attrValue[this.props.name]; - - // This will be triggered typically when the element is changed directly with element.setAttribute - if (newValue && newValue !== this.state.value) { - this.setValue(newValue); + componentDidMount() { + this.setValue(this.props.value || ''); + } + componentDidUpdate(prevProps) { + // This will be triggered typically when the element is changed directly with + // element.setAttribute. + if (!Object.is(this.props.value, prevProps.value)) { + this.setValue(this.props.value); + } + } + setValue(value) { + var canvas = this.canvas.current; + var context = canvas.getContext('2d'); + function paintPreviewWithImage(image) { + var filename = image.src.replace(/^.*[\\/]/, ''); + if (image !== undefined && image.width > 0) { + canvas.title = filename; + var scale = canvas.width / image.width; + context.drawImage( + image, + 0, + 0, + image.width * scale, + image.height * scale + ); + // self.setState({dataURL: canvas.toDataURL()}); + } else { + context.clearRect(0, 0, canvas.width, canvas.height); + } + } + function paintPreview(texture) { + var image = texture.image; + paintPreviewWithImage(image); + } + function getTextureFromSrc(src) { + for (var hash in AFRAME.INSPECTOR.sceneEl.systems.material + .textureCache) { + // The key in textureCache is not always a json. + // For example gives a "video" key in textureCache. + // So we check for '{' before using JSON.parse here. + if (hash[0] === '{' && JSON.parse(hash).src === src) { + return AFRAME.INSPECTOR.sceneEl.systems.material.textureCache[ + hash + ]; } } - }, - { - key: 'setValue', - value: function setValue(value) { - var canvas = this.canvas.current; - var context = canvas.getContext('2d'); - function paintPreviewWithImage(image) { - var filename = image.src.replace(/^.*[\\/]/, ''); - if (image !== undefined && image.width > 0) { - canvas.title = filename; - var scale = canvas.width / image.width; - context.drawImage( - image, - 0, - 0, - image.width * scale, - image.height * scale - ); - // self.setState({dataURL: canvas.toDataURL()}); - } else { - context.clearRect(0, 0, canvas.width, canvas.height); - } - } - function paintPreview(texture) { - var image = texture.image; + return null; + } + var url; + var isAssetHash = value[0] === '#'; + var isAssetImg = value instanceof HTMLImageElement; + var isAssetVideo = value instanceof HTMLVideoElement; + var isAssetImgOrVideo = isAssetImg || isAssetVideo; + if (isAssetImgOrVideo) { + url = value.src; + } else if (isAssetHash) { + url = getUrlFromId(value); + } else { + url = AFRAME.utils.srcLoader.parseUrl(value); + } + var texture = getTextureFromSrc(value); + var valueType = null; + valueType = isAssetImgOrVideo || isAssetHash ? 'asset' : 'url'; + if (!isAssetVideo && texture) { + texture.then(paintPreview); + } else if (!isAssetVideo && url) { + // The image still didn't load + var image = new Image(); + image.addEventListener( + 'load', + () => { paintPreviewWithImage(image); + }, + false + ); + image.src = url; + } else { + context.clearRect(0, 0, canvas.width, canvas.height); + } + this.setState({ + value: isAssetImgOrVideo ? '#' + value.id : value, + valueType: valueType, + url: url + }); + } + notifyChanged = (value) => { + if (this.props.onChange) { + this.props.onChange(this.props.name, value); + } + this.setState({ + value: value + }); + }; + onChange = (e) => { + var value = e.target.value; + this.setState({ + value: value + }); + this.notifyChanged(value); + }; + removeMap = () => { + this.setValue(''); + this.notifyChanged(''); + }; + openDialog = () => { + _lib_Events__WEBPACK_IMPORTED_MODULE_1__['default'].emit( + 'opentexturesmodal', + this.state.value, + (image) => { + if (!image) { + return; } - function getTextureFromSrc(src) { - for (var hash in AFRAME.INSPECTOR.sceneEl.systems.material - .textureCache) { - // The key in textureCache is not always a json. - // For example gives a "video" key in textureCache. - // So we check for '{' before using JSON.parse here. - if (hash[0] === '{' && JSON.parse(hash).src === src) { - return AFRAME.INSPECTOR.sceneEl.systems.material - .textureCache[hash]; - } - } - return null; + var value = image.value; + if (image.type !== 'asset') { + var assetId = insertOrGetImageAsset(image.src); + value = '#' + assetId; } - var url; - var isAssetHash = value[0] === '#'; - var isAssetImg = value instanceof HTMLImageElement; - var isAssetVideo = value instanceof HTMLVideoElement; - var isAssetImgOrVideo = isAssetImg || isAssetVideo; - if (isAssetImgOrVideo) { - url = value.src; - } else if (isAssetHash) { - url = getUrlFromId(value); - } else { - url = AFRAME.utils.srcLoader.parseUrl(value); - } - var texture = getTextureFromSrc(value); - var valueType = null; - valueType = isAssetImgOrVideo || isAssetHash ? 'asset' : 'url'; - if (!isAssetVideo && texture) { - texture.then(paintPreview); - } else if (!isAssetVideo && url) { - // The image still didn't load - var image = new Image(); - image.addEventListener( - 'load', - function () { - paintPreviewWithImage(image); - }, - false - ); - image.src = url; - } else { - context.clearRect(0, 0, canvas.width, canvas.height); + if (this.props.onChange) { + this.props.onChange(this.props.name, value); } - this.setState({ - value: isAssetImgOrVideo ? '#' + value.id : value, - valueType: valueType, - url: url - }); + this.setValue(value); } - }, - { - key: 'render', - value: function render() { - var hint = ''; - if (this.state.value) { - if (this.state.valueType === 'asset') { - hint = - 'Asset ID: ' + - this.state.value + - '\nURL: ' + - this.state.url; - } else { - hint = 'URL: ' + this.state.value; - } - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { - className: 'texture', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'input', - { - className: 'map_value string', - type: 'text', - title: hint, - value: this.state.value, - onChange: this.onChange - } - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)( - 'canvas', - { - ref: this.canvas, - width: '32', - height: '16', - title: hint, - onClick: this.openDialog - } - ) - ] - }); + ); + }; + render() { + let hint = ''; + if (this.state.value) { + if (this.state.valueType === 'asset') { + hint = + 'Asset ID: ' + this.state.value + '\nURL: ' + this.state.url; + } else { + hint = 'URL: ' + this.state.value; } } - ]); - return TextureWidget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(TextureWidget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_3___default().object, - mapName: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string, - name: prop_types__WEBPACK_IMPORTED_MODULE_3___default().string - .isRequired, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_3___default().func, - value: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([ - prop_types__WEBPACK_IMPORTED_MODULE_3___default().object, - prop_types__WEBPACK_IMPORTED_MODULE_3___default().string - ]) - }); - _defineProperty(TextureWidget, 'defaultProps', { - value: '', - mapName: 'nomap', - dataURL: '' - }); + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { + className: 'texture', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('input', { + className: 'map_value string', + type: 'text', + title: hint, + value: this.state.value, + onChange: this.onChange + }), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('canvas', { + ref: this.canvas, + width: '32', + height: '16', + title: hint, + onClick: this.openDialog + }) + ] + }); + } + } /***/ }, @@ -13042,292 +8759,84 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); + + class Vec2Widget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, + value: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().object + .isRequired }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); + constructor(props) { + super(props); + this.state = { + x: props.value.x, + y: props.value.y + }; } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) + onChange = (name, value) => { + this.setState( + { + [name]: parseFloat(value.toFixed(5)) + }, + () => { + if (this.props.onChange) { + this.props.onChange(name, this.state); + } + } ); - return true; - } catch (e) { - return false; + }; + componentDidUpdate() { + const props = this.props; + if ( + !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( + props.value, + this.state + ) + ) { + this.setState({ + x: props.value.x, + y: props.value.y + }); + } } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true + render() { + const widgetProps = { + componentname: this.props.componentname, + entity: this.props.entity, + onChange: this.onChange + }; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { + className: 'vec2', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'x', + value: this.state.x, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'y', + value: this.state.y, + ...widgetProps + } + ) + ] }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); } - var Vec2Widget = /*#__PURE__*/ (function (_React$Component) { - _inherits(Vec2Widget, _React$Component); - var _super = _createSuper(Vec2Widget); - function Vec2Widget(props) { - var _this; - _classCallCheck(this, Vec2Widget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (name, value) { - _this.setState( - _defineProperty({}, name, parseFloat(value.toFixed(5))), - function () { - if (_this.props.onChange) { - _this.props.onChange(name, _this.state); - } - } - ); - } - ); - _this.state = { - x: props.value.x, - y: props.value.y - }; - return _this; - } - _createClass(Vec2Widget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var props = this.props; - if ( - !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( - props.value, - this.state - ) - ) { - this.setState({ - x: props.value.x, - y: props.value.y - }); - } - } - }, - { - key: 'render', - value: function render() { - var widgetProps = { - componentname: this.props.componentname, - entity: this.props.entity, - onChange: this.onChange - }; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { - className: 'vec2', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'x', - value: this.state.x - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'y', - value: this.state.y - }, - widgetProps - ) - ) - ] - }); - } - } - ]); - return Vec2Widget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Vec2Widget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, - value: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().object.isRequired - }); - /***/ }, @@ -13370,304 +8879,94 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - var Vec3Widget = /*#__PURE__*/ (function (_React$Component) { - _inherits(Vec3Widget, _React$Component); - var _super = _createSuper(Vec3Widget); - function Vec3Widget(props) { - var _this; - _classCallCheck(this, Vec3Widget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (name, value) { - _this.setState( - _defineProperty({}, name, parseFloat(value.toFixed(5))), - function () { - if (_this.props.onChange) { - _this.props.onChange(name, _this.state); - } - } - ); - } - ); - _this.state = { + class Vec3Widget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, + value: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().object + .isRequired + }; + constructor(props) { + super(props); + this.state = { x: props.value.x, y: props.value.y, z: props.value.z }; - return _this; } - _createClass(Vec3Widget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var props = this.props; - if ( - !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( - props.value, - this.state - ) - ) { - this.setState({ - x: props.value.x, - y: props.value.y, - z: props.value.z - }); + onChange = (name, value) => { + this.setState( + { + [name]: parseFloat(value.toFixed(5)) + }, + () => { + if (this.props.onChange) { + this.props.onChange(name, this.state); } } - }, - { - key: 'render', - value: function render() { - var widgetProps = { - componentname: this.props.componentname, - entity: this.props.entity, - onChange: this.onChange - }; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { - className: 'vec3', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'x', - value: this.state.x - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'y', - value: this.state.y - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'z', - value: this.state.z - }, - widgetProps - ) - ) - ] - }); - } + ); + }; + componentDidUpdate() { + const props = this.props; + if ( + !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( + props.value, + this.state + ) + ) { + this.setState({ + x: props.value.x, + y: props.value.y, + z: props.value.z + }); } - ]); - return Vec3Widget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Vec3Widget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, - value: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().object.isRequired - }); + } + render() { + const widgetProps = { + componentname: this.props.componentname, + entity: this.props.entity, + onChange: this.onChange + }; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { + className: 'vec3', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'x', + value: this.state.x, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'y', + value: this.state.y, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'z', + value: this.state.z, + ...widgetProps + } + ) + ] + }); + } + } /***/ }, @@ -13711,317 +9010,105 @@ styleSheet.flush() __webpack_require__( /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' ); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && - (symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), - keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 - ? ownKeys(Object(source), !0).forEach(function (key) { - _defineProperty(target, key, source[key]); - }) - : Object.getOwnPropertyDescriptors - ? Object.defineProperties( - target, - Object.getOwnPropertyDescriptors(source) - ) - : ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty( - target, - key, - Object.getOwnPropertyDescriptor(source, key) - ); - }); - } - return target; - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - var Vec4Widget = /*#__PURE__*/ (function (_React$Component) { - _inherits(Vec4Widget, _React$Component); - var _super = _createSuper(Vec4Widget); - function Vec4Widget(props) { - var _this; - _classCallCheck(this, Vec4Widget); - _this = _super.call(this, props); - _defineProperty( - _assertThisInitialized(_this), - 'onChange', - function (name, value) { - _this.setState( - _defineProperty({}, name, parseFloat(value.toFixed(5))), - function () { - if (_this.props.onChange) { - _this.props.onChange(name, _this.state); - } - } - ); - } - ); - _this.state = { + class Vec4Widget extends react__WEBPACK_IMPORTED_MODULE_0___default() + .Component { + static propTypes = { + componentname: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, + entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, + onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, + value: + prop_types__WEBPACK_IMPORTED_MODULE_4___default().object + .isRequired + }; + constructor(props) { + super(props); + this.state = { x: props.value.x, y: props.value.y, z: props.value.z, w: props.value.w }; - return _this; } - _createClass(Vec4Widget, [ - { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - var props = this.props; - if ( - !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( - props.value, - this.state - ) - ) { - this.setState({ - x: props.value.x, - y: props.value.y, - z: props.value.z, - w: props.value.w - }); + onChange = (name, value) => { + this.setState( + { + [name]: parseFloat(value.toFixed(5)) + }, + () => { + if (this.props.onChange) { + this.props.onChange(name, this.state); } } - }, - { - key: 'render', - value: function render() { - var widgetProps = { - componentname: this.props.componentname, - entity: this.props.entity, - onChange: this.onChange - }; - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { - className: 'vec4', - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'x', - value: this.state.x - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'y', - value: this.state.y - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'z', - value: this.state.z - }, - widgetProps - ) - ), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( - _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], - _objectSpread( - { - name: 'w', - value: this.state.w - }, - widgetProps - ) - ) - ] - }); - } + ); + }; + componentDidUpdate() { + const props = this.props; + if ( + !(0, _lib_utils__WEBPACK_IMPORTED_MODULE_2__.areVectorsEqual)( + props.value, + this.state + ) + ) { + this.setState({ + x: props.value.x, + y: props.value.y, + z: props.value.z, + w: props.value.w + }); } - ]); - return Vec4Widget; - })(react__WEBPACK_IMPORTED_MODULE_0___default().Component); - _defineProperty(Vec4Widget, 'propTypes', { - componentname: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().string, - entity: prop_types__WEBPACK_IMPORTED_MODULE_4___default().object, - onChange: prop_types__WEBPACK_IMPORTED_MODULE_4___default().func, - value: - prop_types__WEBPACK_IMPORTED_MODULE_4___default().object.isRequired - }); + } + render() { + const widgetProps = { + componentname: this.props.componentname, + entity: this.props.entity, + onChange: this.onChange + }; + return /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)('div', { + className: 'vec4', + children: [ + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'x', + value: this.state.x, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'y', + value: this.state.y, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'z', + value: this.state.z, + ...widgetProps + } + ), + /*#__PURE__*/ (0, + react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)( + _NumberWidget__WEBPACK_IMPORTED_MODULE_1__['default'], + { + name: 'w', + value: this.state.w, + ...widgetProps + } + ) + ] + }); + } + } /***/ }, @@ -14120,65 +9207,7 @@ styleSheet.flush() /*!***********************************!*\ !*** ./src/lib/EditorControls.js ***! \***********************************/ - /***/ ( - __unused_webpack_module, - __webpack_exports__, - __webpack_require__ - ) => { - 'use strict'; - __webpack_require__.r(__webpack_exports__); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = - __webpack_require__( - /*! lodash.debounce */ './node_modules/lodash.debounce/index.js' - ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = - /*#__PURE__*/ __webpack_require__.n( - lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ - ); - - THREE.Box3.prototype.expandByObject = (function () { - // Computes the world-axis-aligned bounding box of an object (including its children), - // accounting for both the object's, and children's, world transforms - - var scope, i, l; - var v1 = new THREE.Vector3(); - function traverse(node) { - var geometry = node.geometry; - if (geometry !== undefined) { - if (geometry.isGeometry) { - var vertices = geometry.vertices; - for (i = 0, l = vertices.length; i < l; i++) { - v1.copy(vertices[i]); - v1.applyMatrix4(node.matrixWorld); - if (isNaN(v1.x) || isNaN(v1.y) || isNaN(v1.z)) { - continue; - } - scope.expandByPoint(v1); - } - } else if (geometry.isBufferGeometry) { - var attribute = geometry.attributes.position; - if (attribute !== undefined) { - for (i = 0, l = attribute.count; i < l; i++) { - v1.fromBufferAttribute(attribute, i).applyMatrix4( - node.matrixWorld - ); - if (isNaN(v1.x) || isNaN(v1.y) || isNaN(v1.z)) { - continue; - } - scope.expandByPoint(v1); - } - } - } - } - } - return function expandByObject(object) { - scope = this; - object.updateMatrixWorld(true); - object.traverse(traverse); - return this; - }; - })(); - + /***/ () => { /** * @author qiao / https://github.com/qiao * @author mrdoob / http://mrdoob.com @@ -14236,11 +9265,10 @@ styleSheet.flush() var changeEvent = { type: 'change' }; - this.dispatchChange = - lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(function () { - scope.dispatchEvent(changeEvent); - }, 100); this.focus = function (target) { + if (this.isOrthographic) { + return; + } var distance; box.setFromObject(target); if (box.isEmpty() === false && !isNaN(box.min.x)) { @@ -14253,9 +9281,13 @@ styleSheet.flush() distance = 0.1; } object.position.copy( - target.localToWorld(new THREE.Vector3(0, 0, distance * 2)) + target.localToWorld( + new THREE.Vector3(0, center.y + distance * 0.5, distance * 2.5) + ) ); - object.lookAt(target.getWorldPosition(new THREE.Vector3())); + const pos = target.getWorldPosition(new THREE.Vector3()); + pos.y = center.y; + object.lookAt(pos); scope.dispatchEvent(changeEvent); }; this.pan = function (delta) { @@ -14269,7 +9301,7 @@ styleSheet.flush() delta.applyMatrix3(normalMatrix.getNormalMatrix(object.matrix)); object.position.add(delta); center.add(delta); - scope.dispatchChange(); + scope.dispatchEvent(changeEvent); }; var ratio = 1; this.setAspectRatio = function (_ratio) { @@ -14282,7 +9314,7 @@ styleSheet.flush() delta.applyMatrix3(normalMatrix.getNormalMatrix(object.matrix)); if (this.isOrthographic) { // Change FOV for ortho. - var factor = 1; + let factor = 1; if (delta.x + delta.y + delta.z < 0) { factor = -1; } @@ -14298,7 +9330,7 @@ styleSheet.flush() } else { object.position.add(delta); } - scope.dispatchChange(); + scope.dispatchEvent(changeEvent); }; this.rotate = function (delta) { if (!this.rotationEnabled) { @@ -14312,7 +9344,7 @@ styleSheet.flush() vector.setFromSpherical(spherical); object.position.copy(center).add(vector); object.lookAt(center); - scope.dispatchChange(); + scope.dispatchEvent(changeEvent); }; // mouse @@ -14520,7 +9552,7 @@ styleSheet.flush() events__WEBPACK_IMPORTED_MODULE_0__ ); - var Events = new (events__WEBPACK_IMPORTED_MODULE_0___default())(); + const Events = new (events__WEBPACK_IMPORTED_MODULE_0___default())(); Events.setMaxListeners(0); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = Events; @@ -14532,171 +9564,6 @@ styleSheet.flush() !*** ./src/lib/TransformControls.js ***! \**************************************/ /***/ () => { - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } - function _get() { - if (typeof Reflect !== 'undefined' && Reflect.get) { - _get = Reflect.get.bind(); - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); - if (desc.get) { - return desc.get.call(arguments.length < 3 ? target : receiver); - } - return desc.value; - }; - } - return _get.apply(this, arguments); - } - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } - return object; - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty( - target, - _toPropertyKey(descriptor.key), - descriptor - ); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, 'prototype', { writable: false }); - return Constructor; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); - } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') return res; - throw new TypeError('@@toPrimitive must return a primitive value.'); - } - return (hint === 'string' ? String : Number)(input); - } - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - Object.defineProperty(subClass, 'prototype', { writable: false }); - if (superClass) _setPrototypeOf(subClass, superClass); - } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf - ? Object.setPrototypeOf.bind() - : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } - function _possibleConstructorReturn(self, call) { - if ( - call && - (_typeof(call) === 'object' || typeof call === 'function') - ) { - return call; - } else if (call !== void 0) { - throw new TypeError( - 'Derived constructors may only return object or undefined' - ); - } - return _assertThisInitialized(self); - } - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Boolean.prototype.valueOf.call( - Reflect.construct(Boolean, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf.bind() - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } /* eslint-disable curly, dot-notation */ /** * @author arodic / https://github.com/arodic @@ -14705,22 +9572,18 @@ styleSheet.flush() (function () { 'use strict'; - var GizmoMaterial = /*#__PURE__*/ (function (_THREE$MeshBasicMater) { - _inherits(GizmoMaterial, _THREE$MeshBasicMater); - var _super = _createSuper(GizmoMaterial); - function GizmoMaterial(parameters) { - var _this; - _classCallCheck(this, GizmoMaterial); - _this = _super.call(this); - _this.depthTest = false; - _this.depthWrite = false; - _this.fog = false; - _this.side = THREE.FrontSide; - _this.transparent = true; - _this.setValues(parameters); - _this.oldColor = _this.color.clone(); - _this.oldOpacity = _this.opacity; - _this.highlight = function (highlighted) { + class GizmoMaterial extends THREE.MeshBasicMaterial { + constructor(parameters) { + super(); + this.depthTest = false; + this.depthWrite = false; + this.fog = false; + this.side = THREE.FrontSide; + this.transparent = true; + this.setValues(parameters); + this.oldColor = this.color.clone(); + this.oldOpacity = this.opacity; + this.highlight = function (highlighted) { if (highlighted) { this.color.setRGB(1, 1, 0); this.opacity = 1; @@ -14729,28 +9592,20 @@ styleSheet.flush() this.opacity = this.oldOpacity; } }; - return _this; } - return _createClass(GizmoMaterial); - })(THREE.MeshBasicMaterial); - var GizmoLineMaterial = /*#__PURE__*/ (function ( - _THREE$LineBasicMater - ) { - _inherits(GizmoLineMaterial, _THREE$LineBasicMater); - var _super2 = _createSuper(GizmoLineMaterial); - function GizmoLineMaterial(parameters) { - var _this2; - _classCallCheck(this, GizmoLineMaterial); - _this2 = _super2.call(this); - _this2.depthTest = false; - _this2.depthWrite = false; - _this2.fog = false; - _this2.transparent = true; - _this2.linewidth = 1; - _this2.setValues(parameters); - _this2.oldColor = _this2.color.clone(); - _this2.oldOpacity = _this2.opacity; - _this2.highlight = function (highlighted) { + } + class GizmoLineMaterial extends THREE.LineBasicMaterial { + constructor(parameters) { + super(); + this.depthTest = false; + this.depthWrite = false; + this.fog = false; + this.transparent = true; + this.linewidth = 1; + this.setValues(parameters); + this.oldColor = this.color.clone(); + this.oldOpacity = this.opacity; + this.highlight = function (highlighted) { if (highlighted) { this.color.setRGB(1, 1, 0); this.opacity = 1; @@ -14759,146 +9614,122 @@ styleSheet.flush() this.opacity = this.oldOpacity; } }; - return _this2; } - return _createClass(GizmoLineMaterial); - })(THREE.LineBasicMaterial); + } var pickerMaterial = new GizmoMaterial({ visible: false, transparent: false }); - THREE.TransformGizmo = /*#__PURE__*/ (function (_THREE$Object3D) { - _inherits(TransformGizmo, _THREE$Object3D); - var _super3 = _createSuper(TransformGizmo); - function TransformGizmo() { - _classCallCheck(this, TransformGizmo); - return _super3.apply(this, arguments); - } - _createClass(TransformGizmo, [ - { - key: 'init', - value: function init() { - this.handles = new THREE.Object3D(); - this.pickers = new THREE.Object3D(); - this.planes = new THREE.Object3D(); - this.add(this.handles); - this.add(this.pickers); - this.add(this.planes); - - // PLANES - - var planeGeometry = new THREE.PlaneGeometry(50, 50, 2, 2); - var planeMaterial = new THREE.MeshBasicMaterial({ - visible: false, - side: THREE.DoubleSide - }); - var planes = { - XY: new THREE.Mesh(planeGeometry, planeMaterial), - YZ: new THREE.Mesh(planeGeometry, planeMaterial), - XZ: new THREE.Mesh(planeGeometry, planeMaterial), - XYZE: new THREE.Mesh(planeGeometry, planeMaterial) - }; - this.activePlane = planes['XYZE']; - planes['YZ'].rotation.set(0, Math.PI / 2, 0); - planes['XZ'].rotation.set(-Math.PI / 2, 0, 0); - for (var i in planes) { - planes[i].name = i; - this.planes.add(planes[i]); - this.planes[i] = planes[i]; - } - - // HANDLES AND PICKERS - - var setupGizmos = function setupGizmos(gizmoMap, parent) { - for (var name in gizmoMap) { - for (i = gizmoMap[name].length; i--; ) { - var object = gizmoMap[name][i][0]; - var position = gizmoMap[name][i][1]; - var rotation = gizmoMap[name][i][2]; - object.name = name; - object.renderOrder = Infinity; // avoid being hidden by other transparent objects - - if (position) - object.position.set( - position[0], - position[1], - position[2] - ); - if (rotation) - object.rotation.set( - rotation[0], - rotation[1], - rotation[2] - ); - parent.add(object); - } - } - }; - setupGizmos(this.handleGizmos, this.handles); - setupGizmos(this.pickerGizmos, this.pickers); - - // reset Transformations - - this.traverse(function (child) { - if (child instanceof THREE.Mesh) { - child.updateMatrix(); - var tempGeometry = child.geometry.clone(); - tempGeometry.applyMatrix4(child.matrix); - child.geometry = tempGeometry; - child.position.set(0, 0, 0); - child.rotation.set(0, 0, 0); - child.scale.set(1, 1, 1); - } - }); + THREE.TransformGizmo = class TransformGizmo extends THREE.Object3D { + init() { + this.handles = new THREE.Object3D(); + this.pickers = new THREE.Object3D(); + this.planes = new THREE.Object3D(); + this.add(this.handles); + this.add(this.pickers); + this.add(this.planes); + + // PLANES + + var planeGeometry = new THREE.PlaneGeometry(50, 50, 2, 2); + var planeMaterial = new THREE.MeshBasicMaterial({ + visible: false, + side: THREE.DoubleSide + }); + var planes = { + XY: new THREE.Mesh(planeGeometry, planeMaterial), + YZ: new THREE.Mesh(planeGeometry, planeMaterial), + XZ: new THREE.Mesh(planeGeometry, planeMaterial), + XYZE: new THREE.Mesh(planeGeometry, planeMaterial) + }; + this.activePlane = planes['XYZE']; + planes['YZ'].rotation.set(0, Math.PI / 2, 0); + planes['XZ'].rotation.set(-Math.PI / 2, 0, 0); + for (var i in planes) { + planes[i].name = i; + this.planes.add(planes[i]); + this.planes[i] = planes[i]; + } + + // HANDLES AND PICKERS + + var setupGizmos = function (gizmoMap, parent) { + for (var name in gizmoMap) { + for (i = gizmoMap[name].length; i--; ) { + var object = gizmoMap[name][i][0]; + var position = gizmoMap[name][i][1]; + var rotation = gizmoMap[name][i][2]; + object.name = name; + object.renderOrder = Infinity; // avoid being hidden by other transparent objects + + if (position) + object.position.set( + position[0], + position[1], + position[2] + ); + if (rotation) + object.rotation.set( + rotation[0], + rotation[1], + rotation[2] + ); + parent.add(object); + } } - }, - { - key: 'highlight', - value: function highlight(axis) { - this.traverse(function (child) { - if (child.material && child.material.highlight) { - if (child.name === axis) { - child.material.highlight(true); - } else { - child.material.highlight(false); - } - } - }); + }; + setupGizmos(this.handleGizmos, this.handles); + setupGizmos(this.pickerGizmos, this.pickers); + + // reset Transformations + + this.traverse(function (child) { + if (child instanceof THREE.Mesh) { + child.updateMatrix(); + var tempGeometry = child.geometry.clone(); + tempGeometry.applyMatrix4(child.matrix); + child.geometry = tempGeometry; + child.position.set(0, 0, 0); + child.rotation.set(0, 0, 0); + child.scale.set(1, 1, 1); } - }, - { - key: 'update', - value: function update(rotation, eye) { - var vec1 = new THREE.Vector3(0, 0, 0); - var vec2 = new THREE.Vector3(0, 1, 0); - var lookAtMatrix = new THREE.Matrix4(); - this.traverse(function (child) { - if (child.name.search('E') !== -1) { - child.quaternion.setFromRotationMatrix( - lookAtMatrix.lookAt(eye, vec1, vec2) - ); - } else if ( - child.name.search('X') !== -1 || - child.name.search('Y') !== -1 || - child.name.search('Z') !== -1 - ) { - child.quaternion.setFromEuler(rotation); - } - }); + }); + } + highlight(axis) { + this.traverse(function (child) { + if (child.material && child.material.highlight) { + if (child.name === axis) { + child.material.highlight(true); + } else { + child.material.highlight(false); + } } - } - ]); - return TransformGizmo; - })(THREE.Object3D); - THREE.TransformGizmoTranslate = /*#__PURE__*/ (function ( - _THREE$TransformGizmo + }); + } + update(rotation, eye) { + var vec1 = new THREE.Vector3(0, 0, 0); + var vec2 = new THREE.Vector3(0, 1, 0); + var lookAtMatrix = new THREE.Matrix4(); + this.traverse(function (child) { + if (child.name.search('E') !== -1) { + child.quaternion.setFromRotationMatrix( + lookAtMatrix.lookAt(eye, vec1, vec2) + ); + } else if ( + child.name.search('X') !== -1 || + child.name.search('Y') !== -1 || + child.name.search('Z') !== -1 + ) { + child.quaternion.setFromEuler(rotation); + } + }); + } + }; + THREE.TransformGizmoTranslate = class TransformGizmoTranslate extends ( + THREE.TransformGizmo ) { - _inherits(TransformGizmoTranslate, _THREE$TransformGizmo); - var _super4 = _createSuper(TransformGizmoTranslate); - function TransformGizmoTranslate() { - var _this3; - _classCallCheck(this, TransformGizmoTranslate); - _this3 = _super4.call(this); + constructor() { + super(); var arrowGeometry = new THREE.ConeGeometry( 0.05, 0.2, @@ -14922,7 +9753,7 @@ styleSheet.flush() 'position', new THREE.Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3) ); - _this3.handleGizmos = { + this.handleGizmos = { X: [ [ new THREE.Mesh( @@ -15034,7 +9865,7 @@ styleSheet.flush() ] ] }; - _this3.pickerGizmos = { + this.pickerGizmos = { X: [ [ new THREE.Mesh( @@ -15102,61 +9933,44 @@ styleSheet.flush() ] ] }; - _this3.init(); - return _this3; + this.init(); } - _createClass(TransformGizmoTranslate, [ - { - key: 'setActivePlane', - value: function setActivePlane(axis, eye) { - var tempMatrix = new THREE.Matrix4(); - eye.applyMatrix4( - tempMatrix - .copy( - tempMatrix.extractRotation( - this.planes['XY'].matrixWorld - ) - ) - .invert() - ); - if (axis === 'X') { - this.activePlane = this.planes['XY']; - if (Math.abs(eye.y) > Math.abs(eye.z)) - this.activePlane = this.planes['XZ']; - } - if (axis === 'Y') { - this.activePlane = this.planes['XY']; - if (Math.abs(eye.x) > Math.abs(eye.z)) - this.activePlane = this.planes['YZ']; - } - if (axis === 'Z') { - this.activePlane = this.planes['XZ']; - if (Math.abs(eye.x) > Math.abs(eye.y)) - this.activePlane = this.planes['YZ']; - } - if (axis === 'XYZ') this.activePlane = this.planes['XYZE']; - if (axis === 'XY') this.activePlane = this.planes['XY']; - if (axis === 'YZ') this.activePlane = this.planes['YZ']; - if (axis === 'XZ') this.activePlane = this.planes['XZ']; - } - } - ]); - return TransformGizmoTranslate; - })(THREE.TransformGizmo); - THREE.TransformGizmoRotate = /*#__PURE__*/ (function ( - _THREE$TransformGizmo2 + setActivePlane(axis, eye) { + var tempMatrix = new THREE.Matrix4(); + eye.applyMatrix4( + tempMatrix + .copy( + tempMatrix.extractRotation(this.planes['XY'].matrixWorld) + ) + .invert() + ); + if (axis === 'X') { + this.activePlane = this.planes['XY']; + if (Math.abs(eye.y) > Math.abs(eye.z)) + this.activePlane = this.planes['XZ']; + } + if (axis === 'Y') { + this.activePlane = this.planes['XY']; + if (Math.abs(eye.x) > Math.abs(eye.z)) + this.activePlane = this.planes['YZ']; + } + if (axis === 'Z') { + this.activePlane = this.planes['XZ']; + if (Math.abs(eye.x) > Math.abs(eye.y)) + this.activePlane = this.planes['YZ']; + } + if (axis === 'XYZ') this.activePlane = this.planes['XYZE']; + if (axis === 'XY') this.activePlane = this.planes['XY']; + if (axis === 'YZ') this.activePlane = this.planes['YZ']; + if (axis === 'XZ') this.activePlane = this.planes['XZ']; + } + }; + THREE.TransformGizmoRotate = class TransformGizmoRotate extends ( + THREE.TransformGizmo ) { - _inherits(TransformGizmoRotate, _THREE$TransformGizmo2); - var _super5 = _createSuper(TransformGizmoRotate); - function TransformGizmoRotate() { - var _this4; - _classCallCheck(this, TransformGizmoRotate); - _this4 = _super5.call(this); - var CircleGeometry = function CircleGeometry( - radius, - facing, - arc - ) { + constructor() { + super(); + var CircleGeometry = function (radius, facing, arc) { var geometry = new THREE.BufferGeometry(); var vertices = []; arc = arc || 1; @@ -15186,7 +10000,7 @@ styleSheet.flush() ); return geometry; }; - _this4.handleGizmos = { + this.handleGizmos = { X: [ [ new THREE.Line( @@ -15238,7 +10052,7 @@ styleSheet.flush() ] ] }; - _this4.pickerGizmos = { + this.pickerGizmos = { X: [ [ new THREE.Mesh( @@ -15286,96 +10100,72 @@ styleSheet.flush() ] ] }; - _this4.pickerGizmos.XYZE[0][0].visible = false; // disable XYZE picker gizmo + this.pickerGizmos.XYZE[0][0].visible = false; // disable XYZE picker gizmo - _this4.init(); - return _this4; + this.init(); } - _createClass(TransformGizmoRotate, [ - { - key: 'setActivePlane', - value: function setActivePlane(axis) { - if (axis === 'E') this.activePlane = this.planes['XYZE']; - if (axis === 'X') this.activePlane = this.planes['YZ']; - if (axis === 'Y') this.activePlane = this.planes['XZ']; - if (axis === 'Z') this.activePlane = this.planes['XY']; - } - }, - { - key: 'update', - value: function update(rotation, eye2) { - _get( - _getPrototypeOf(TransformGizmoRotate.prototype), - 'update', - this - ).call(this, rotation, eye2); - var tempMatrix = new THREE.Matrix4(); - var worldRotation = new THREE.Euler(0, 0, 1); - var tempQuaternion = new THREE.Quaternion(); - var unitX = new THREE.Vector3(1, 0, 0); - var unitY = new THREE.Vector3(0, 1, 0); - var unitZ = new THREE.Vector3(0, 0, 1); - var quaternionX = new THREE.Quaternion(); - var quaternionY = new THREE.Quaternion(); - var quaternionZ = new THREE.Quaternion(); - var eye = eye2.clone(); - worldRotation.copy(this.planes['XY'].rotation); - tempQuaternion.setFromEuler(worldRotation); - tempMatrix - .makeRotationFromQuaternion(tempQuaternion) - .copy(tempMatrix) - .invert(); - eye.applyMatrix4(tempMatrix); - this.traverse(function (child) { - tempQuaternion.setFromEuler(worldRotation); - if (child.name === 'X') { - quaternionX.setFromAxisAngle( - unitX, - Math.atan2(-eye.y, eye.z) - ); - tempQuaternion.multiplyQuaternions( - tempQuaternion, - quaternionX - ); - child.quaternion.copy(tempQuaternion); - } - if (child.name === 'Y') { - quaternionY.setFromAxisAngle( - unitY, - Math.atan2(eye.x, eye.z) - ); - tempQuaternion.multiplyQuaternions( - tempQuaternion, - quaternionY - ); - child.quaternion.copy(tempQuaternion); - } - if (child.name === 'Z') { - quaternionZ.setFromAxisAngle( - unitZ, - Math.atan2(eye.y, eye.x) - ); - tempQuaternion.multiplyQuaternions( - tempQuaternion, - quaternionZ - ); - child.quaternion.copy(tempQuaternion); - } - }); + setActivePlane(axis) { + if (axis === 'E') this.activePlane = this.planes['XYZE']; + if (axis === 'X') this.activePlane = this.planes['YZ']; + if (axis === 'Y') this.activePlane = this.planes['XZ']; + if (axis === 'Z') this.activePlane = this.planes['XY']; + } + update(rotation, eye2) { + super.update(rotation, eye2); + var tempMatrix = new THREE.Matrix4(); + var worldRotation = new THREE.Euler(0, 0, 1); + var tempQuaternion = new THREE.Quaternion(); + var unitX = new THREE.Vector3(1, 0, 0); + var unitY = new THREE.Vector3(0, 1, 0); + var unitZ = new THREE.Vector3(0, 0, 1); + var quaternionX = new THREE.Quaternion(); + var quaternionY = new THREE.Quaternion(); + var quaternionZ = new THREE.Quaternion(); + var eye = eye2.clone(); + worldRotation.copy(this.planes['XY'].rotation); + tempQuaternion.setFromEuler(worldRotation); + tempMatrix + .makeRotationFromQuaternion(tempQuaternion) + .copy(tempMatrix) + .invert(); + eye.applyMatrix4(tempMatrix); + this.traverse(function (child) { + tempQuaternion.setFromEuler(worldRotation); + if (child.name === 'X') { + quaternionX.setFromAxisAngle( + unitX, + Math.atan2(-eye.y, eye.z) + ); + tempQuaternion.multiplyQuaternions( + tempQuaternion, + quaternionX + ); + child.quaternion.copy(tempQuaternion); } - } - ]); - return TransformGizmoRotate; - })(THREE.TransformGizmo); - THREE.TransformGizmoScale = /*#__PURE__*/ (function ( - _THREE$TransformGizmo3 + if (child.name === 'Y') { + quaternionY.setFromAxisAngle(unitY, Math.atan2(eye.x, eye.z)); + tempQuaternion.multiplyQuaternions( + tempQuaternion, + quaternionY + ); + child.quaternion.copy(tempQuaternion); + } + if (child.name === 'Z') { + quaternionZ.setFromAxisAngle(unitZ, Math.atan2(eye.y, eye.x)); + tempQuaternion.multiplyQuaternions( + tempQuaternion, + quaternionZ + ); + child.quaternion.copy(tempQuaternion); + } + }); + } + }; + THREE.TransformGizmoScale = class TransformGizmoScale extends ( + THREE.TransformGizmo ) { - _inherits(TransformGizmoScale, _THREE$TransformGizmo3); - var _super6 = _createSuper(TransformGizmoScale); - function TransformGizmoScale() { - var _this5; - _classCallCheck(this, TransformGizmoScale); - _this5 = _super6.call(this); + constructor() { + super(); var arrowGeometry = new THREE.BoxGeometry(0.125, 0.125, 0.125); arrowGeometry.translate(0, 0.5, 0); var lineXGeometry = new THREE.BufferGeometry(); @@ -15393,7 +10183,7 @@ styleSheet.flush() 'position', new THREE.Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3) ); - _this5.handleGizmos = { + this.handleGizmos = { X: [ [ new THREE.Mesh( @@ -15465,7 +10255,7 @@ styleSheet.flush() ] ] }; - _this5.pickerGizmos = { + this.pickerGizmos = { X: [ [ new THREE.Mesh( @@ -15504,64 +10294,53 @@ styleSheet.flush() ] ] }; - _this5.init(); - return _this5; + this.init(); } - _createClass(TransformGizmoScale, [ - { - key: 'setActivePlane', - value: function setActivePlane(axis, eye) { - var tempMatrix = new THREE.Matrix4(); - eye.applyMatrix4( - tempMatrix - .copy( - tempMatrix.extractRotation( - this.planes['XY'].matrixWorld - ) - ) - .invert() - ); - if (axis === 'X') { - this.activePlane = this.planes['XY']; - if (Math.abs(eye.y) > Math.abs(eye.z)) - this.activePlane = this.planes['XZ']; - } - if (axis === 'Y') { - this.activePlane = this.planes['XY']; - if (Math.abs(eye.x) > Math.abs(eye.z)) - this.activePlane = this.planes['YZ']; - } - if (axis === 'Z') { - this.activePlane = this.planes['XZ']; - if (Math.abs(eye.x) > Math.abs(eye.y)) - this.activePlane = this.planes['YZ']; - } - if (axis === 'XYZ') this.activePlane = this.planes['XYZE']; - } - } - ]); - return TransformGizmoScale; - })(THREE.TransformGizmo); - THREE.TransformControls = /*#__PURE__*/ (function (_THREE$Object3D2) { - _inherits(TransformControls, _THREE$Object3D2); - var _super7 = _createSuper(TransformControls); - function TransformControls(_camera, domElement) { - var _this6; - _classCallCheck(this, TransformControls); + setActivePlane(axis, eye) { + var tempMatrix = new THREE.Matrix4(); + eye.applyMatrix4( + tempMatrix + .copy( + tempMatrix.extractRotation(this.planes['XY'].matrixWorld) + ) + .invert() + ); + if (axis === 'X') { + this.activePlane = this.planes['XY']; + if (Math.abs(eye.y) > Math.abs(eye.z)) + this.activePlane = this.planes['XZ']; + } + if (axis === 'Y') { + this.activePlane = this.planes['XY']; + if (Math.abs(eye.x) > Math.abs(eye.z)) + this.activePlane = this.planes['YZ']; + } + if (axis === 'Z') { + this.activePlane = this.planes['XZ']; + if (Math.abs(eye.x) > Math.abs(eye.y)) + this.activePlane = this.planes['YZ']; + } + if (axis === 'XYZ') this.activePlane = this.planes['XYZE']; + } + }; + THREE.TransformControls = class TransformControls extends ( + THREE.Object3D + ) { + constructor(_camera, domElement) { // TODO: Make non-uniform scale and rotate play nice in hierarchies // TODO: ADD RXYZ contol - _this6 = _super7.call(this); + super(); domElement = domElement !== undefined ? domElement : document; - _this6.object = undefined; - _this6.visible = false; - _this6.translationSnap = null; - _this6.rotationSnap = null; - _this6.space = 'world'; - _this6.size = 1; - _this6.axis = null; + this.object = undefined; + this.visible = false; + this.translationSnap = null; + this.rotationSnap = null; + this.space = 'world'; + this.size = 1; + this.axis = null; var camera = _camera; - var scope = _assertThisInitialized(_this6); + var scope = this; var _mode = 'translate'; var _dragging = false; var _gizmo = { @@ -15572,7 +10351,7 @@ styleSheet.flush() for (var type in _gizmo) { var gizmoObj = _gizmo[type]; gizmoObj.visible = type === _mode; - _this6.add(gizmoObj); + this.add(gizmoObj); } var changeEvent = { type: 'change' @@ -15618,10 +10397,10 @@ styleSheet.flush() var worldRotationMatrix = new THREE.Matrix4(); var camPosition = new THREE.Vector3(); var camRotation = new THREE.Euler(); - _this6.setCamera = function (_camera) { + this.setCamera = function (_camera) { camera = _camera; }; - _this6.activate = function () { + this.activate = function () { domElement.addEventListener('mousedown', onPointerDown, false); domElement.addEventListener('touchstart', onPointerDown, false); domElement.addEventListener('mousemove', onPointerHover, false); @@ -15634,8 +10413,8 @@ styleSheet.flush() domElement.addEventListener('touchcancel', onPointerUp, false); domElement.addEventListener('touchleave', onPointerUp, false); }; - _this6.activate(); - _this6.dispose = function () { + this.activate(); + this.dispose = function () { domElement.removeEventListener('mousedown', onPointerDown); domElement.removeEventListener('touchstart', onPointerDown); domElement.removeEventListener('mousemove', onPointerHover); @@ -15648,43 +10427,43 @@ styleSheet.flush() domElement.removeEventListener('touchcancel', onPointerUp); domElement.removeEventListener('touchleave', onPointerUp); }; - _this6.attach = function (object) { + this.attach = function (object) { this.object = object; this.visible = true; this.update(true); }; - _this6.detach = function () { + this.detach = function () { this.object = undefined; this.visible = false; this.axis = null; }; - _this6.getMode = function () { + this.getMode = function () { return _mode; }; - _this6.setMode = function (mode) { + this.setMode = function (mode) { _mode = mode || _mode; if (_mode === 'scale') scope.space = 'local'; for (var type in _gizmo) _gizmo[type].visible = type === _mode; this.update(); scope.dispatchEvent(changeEvent); }; - _this6.setTranslationSnap = function (translationSnap) { + this.setTranslationSnap = function (translationSnap) { scope.translationSnap = translationSnap; }; - _this6.setRotationSnap = function (rotationSnap) { + this.setRotationSnap = function (rotationSnap) { scope.rotationSnap = rotationSnap; }; - _this6.setSize = function (size) { + this.setSize = function (size) { scope.size = size; this.update(true); scope.dispatchEvent(changeEvent); }; - _this6.setSpace = function (space) { + this.setSpace = function (space) { scope.space = space; this.update(); scope.dispatchEvent(changeEvent); }; - _this6.update = function (updateScale) { + this.update = function (updateScale) { if (scope.object === undefined) return; scope.object.updateMatrixWorld(); worldPosition.setFromMatrixPosition(scope.object.matrixWorld); @@ -16143,10 +10922,8 @@ styleSheet.flush() var intersections = ray.intersectObjects(objects, true); return intersections[0] ? intersections[0] : false; } - return _this6; } - return _createClass(TransformControls); - })(THREE.Object3D); + }; })(); /***/ @@ -16170,8 +10947,10 @@ styleSheet.flush() /* harmony import */ var _Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Events */ './src/lib/Events.js'); - var assetsBaseUrl = 'https://aframe.io/sample-assets/'; - var assetsRelativeUrl = { + const assetsBaseUrl = + window.AFRAME_SAMPLE_ASSETS_ROOT || + 'https://aframe.io/sample-assets/'; + const assetsRelativeUrl = { images: 'dist/images.json' }; @@ -16186,17 +10965,16 @@ styleSheet.flush() /** * XHR the assets JSON. */ - load: function load() { - var _this = this; + load: function () { var xhr = new XMLHttpRequest(); var url = assetsBaseUrl + assetsRelativeUrl.images; // @todo Remove the sync call and use a callback xhr.open('GET', url); - xhr.onload = function () { + xhr.onload = () => { var data = JSON.parse(xhr.responseText); - _this.images = data.images; - _this.images.forEach(function (image) { + this.images = data.images; + this.images.forEach((image) => { image.fullPath = assetsBaseUrl + data.basepath.images + image.path; image.fullThumbPath = @@ -16206,10 +10984,10 @@ styleSheet.flush() }); _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( 'assetsimagesload', - _this.images + this.images ); }; - xhr.onerror = function () { + xhr.onerror = () => { console.error('Error loading registry file.'); }; xhr.send(); @@ -16288,8 +11066,8 @@ styleSheet.flush() __webpack_require__(/*! ./Events */ './src/lib/Events.js'); // Save ortho camera FOV / position before switching to restore later. - var currentOrthoDir = ''; - var orthoCameraMemory = { + let currentOrthoDir = ''; + const orthoCameraMemory = { left: { position: new THREE.Vector3(-10, 0, 0), rotation: new THREE.Euler() @@ -16320,8 +11098,9 @@ styleSheet.flush() * Initialize various cameras, store original one. */ function initCameras(inspector) { - var sceneEl = inspector.sceneEl; - var originalCamera = (inspector.currentCameraEl = sceneEl.camera.el); + const sceneEl = inspector.sceneEl; + const originalCamera = (inspector.currentCameraEl = + sceneEl.camera.el); inspector.currentCameraEl.setAttribute( 'data-aframe-inspector-original-camera', '' @@ -16343,7 +11122,7 @@ styleSheet.flush() inspector.currentCameraEl.setAttribute('camera', 'active', false); // Create Inspector camera. - var perspectiveCamera = (inspector.camera = + const perspectiveCamera = (inspector.camera = new THREE.PerspectiveCamera()); perspectiveCamera.far = 10000; perspectiveCamera.near = 0.01; @@ -16352,15 +11131,15 @@ styleSheet.flush() perspectiveCamera.updateMatrixWorld(); sceneEl.object3D.add(perspectiveCamera); sceneEl.camera = perspectiveCamera; - var ratio = sceneEl.canvas.width / sceneEl.canvas.height; - var orthoCamera = new THREE.OrthographicCamera( + const ratio = sceneEl.canvas.width / sceneEl.canvas.height; + const orthoCamera = new THREE.OrthographicCamera( -10 * ratio, 10 * ratio, 10, -10 ); sceneEl.object3D.add(orthoCamera); - var cameras = (inspector.cameras = { + const cameras = (inspector.cameras = { perspective: perspectiveCamera, original: originalCamera, ortho: orthoCamera @@ -16369,7 +11148,7 @@ styleSheet.flush() // Command to switch to perspective. _Events__WEBPACK_IMPORTED_MODULE_0__['default'].on( 'cameraperspectivetoggle', - function () { + () => { saveOrthoCamera(inspector.camera, currentOrthoDir); sceneEl.camera = inspector.camera = cameras.perspective; _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( @@ -16385,7 +11164,7 @@ styleSheet.flush() // Command to switch to ortographic. _Events__WEBPACK_IMPORTED_MODULE_0__['default'].on( 'cameraorthographictoggle', - function (dir) { + (dir) => { saveOrthoCamera(inspector.camera, currentOrthoDir); sceneEl.camera = inspector.camera = cameras.ortho; currentOrthoDir = dir; @@ -16403,7 +11182,7 @@ styleSheet.flush() 'cameratoggle', { camera: inspector.camera, - value: 'ortho'.concat(dir) + value: `ortho${dir}` } ); } @@ -16414,7 +11193,7 @@ styleSheet.flush() if (camera.type !== 'OrthographicCamera') { return; } - var info = orthoCameraMemory[dir]; + const info = orthoCameraMemory[dir]; info.position.copy(camera.position); info.rotation.copy(camera.rotation); info.left = camera.left; @@ -16423,7 +11202,7 @@ styleSheet.flush() info.bottom = camera.bottom; } function setOrthoCamera(camera, dir, ratio) { - var info = orthoCameraMemory[dir]; + const info = orthoCameraMemory[dir]; camera.left = info.left || -10 * ratio; camera.right = info.right || 10 * ratio; camera.top = info.top || 10; @@ -16455,7 +11234,6 @@ styleSheet.flush() /* binding */ getComponentClipboardRepresentation, /* harmony export */ getEntityClipboardRepresentation: () => /* binding */ getEntityClipboardRepresentation, - /* harmony export */ printEntity: () => /* binding */ printEntity, /* harmony export */ removeEntity: () => /* binding */ removeEntity, /* harmony export */ removeSelectedEntity: () => /* binding */ removeSelectedEntity, @@ -16466,49 +11244,38 @@ styleSheet.flush() __webpack_require__(/*! ./Events */ './src/lib/Events.js'); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ './src/lib/utils.js'); - /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = - __webpack_require__( - /*! react/jsx-runtime */ './node_modules/react/jsx-runtime.js' - ); - /* eslint-disable react/no-danger */ /** * Update a component. * * @param {Element} entity - Entity to modify. - * @param {string} component - Name of the component. - * @param {string} property - Property name. - * @param {string|number} value - New value. + * @param {string} component - component name + * @param {string} property - property name, use empty string if component is single property or if value is an object + * @param {string|number|object} value - New value. */ - - function updateEntity(entity, propertyName, value) { - var splitName; - if (propertyName.indexOf('.') !== -1) { - // Multi-prop - splitName = propertyName.split('.'); + function updateEntity(entity, component, property, value) { + if (property) { if (value === null || value === undefined) { // Remove property. - var parameters = entity.getAttribute(splitName[0]); - delete parameters[splitName[1]]; - entity.setAttribute(splitName[0], parameters); + entity.removeAttribute(component, property); } else { // Set property. - entity.setAttribute(splitName[0], splitName[1], value); + entity.setAttribute(component, property, value); } } else { if (value === null || value === undefined) { - // Remove property. - entity.removeAttribute(propertyName); + // Remove component. + entity.removeAttribute(component); } else { - // Set property. - entity.setAttribute(propertyName, value); + // Set component. + entity.setAttribute(component, value); } } _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit('entityupdate', { - component: splitName ? splitName[0] : propertyName, - entity: entity, - property: splitName ? splitName[1] : '', - value: value + entity, + component, + property, + value }); } @@ -16529,7 +11296,6 @@ styleSheet.flush() ) ) { var closest = findClosestEntity(entity); - AFRAME.INSPECTOR.removeObject(entity.object3D); entity.parentNode.removeChild(entity); AFRAME.INSPECTOR.selectEntity(closest); } @@ -16600,11 +11366,20 @@ styleSheet.flush() */ function cloneEntity(entity) { entity.flushToDOM(); - var clone = entity.cloneNode(true); - clone.addEventListener('loaded', function () { - AFRAME.INSPECTOR.selectEntity(clone); - _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit('entityclone'); - }); + const clone = prepareForSerialization(entity); + clone.addEventListener( + 'loaded', + function () { + AFRAME.INSPECTOR.selectEntity(clone); + _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( + 'entityclone', + clone + ); + }, + { + once: true + } + ); // Get a valid unique ID for the entity if (entity.id) { @@ -16638,7 +11413,7 @@ styleSheet.flush() * primitive attributes, mixins and defaults. * * @param {Element} entity Root of the DOM hierarchy. - * @return {Elment} Copy of the DOM hierarchy ready for serialization. + * @return {Element} Copy of the DOM hierarchy ready for serialization. */ function prepareForSerialization(entity) { var clone = entity.cloneNode(false); @@ -16688,6 +11463,17 @@ styleSheet.flush() var value = stringifyComponentValue(schema, optimalUpdate); setAttribute.call(copy, name, value); } + + // Remove special components if they use the default value + if ( + value === '' && + (name === 'visible' || + name === 'position' || + name === 'rotation' || + name === 'scale') + ) { + removeAttribute.call(copy, name); + } }); } @@ -16905,9 +11691,9 @@ styleSheet.flush() */ function getDefaultValue(component, propertyName, source) { if (!propertyName) { - return component.schema['default']; + return component.schema.default; } - return component.schema[propertyName]['default']; + return component.schema[propertyName].default; } /** @@ -16988,7 +11774,7 @@ styleSheet.flush() if (!defaultData[key]) { continue; } - var defaultValue = defaultData[key]['default']; + var defaultValue = defaultData[key].default; var currentValue = data[key]; // Some parameters could be null and '' like mergeTo @@ -17001,106 +11787,47 @@ styleSheet.flush() } return diff; } - var diff = getModifiedProperties(entity, componentName); - var attributes = AFRAME.utils.styleParser.stringify(diff); - return ''.concat(componentName, '="').concat(attributes, '"'); - } - - /** - * Entity representation. - */ - var ICONS = { - camera: 'fa-camera', - mesh: 'fa-cube', - light: 'fa-lightbulb-o', - text: 'fa-font' - }; - function printEntity(entity, onDoubleClick) { - if (!entity) { - return ''; - } - - // Icons. - var icons = ''; - for (var objType in ICONS) { - if (!entity.getObject3D(objType)) { - continue; - } - icons += ' '); - } - - // Name. - var entityName = entity.id; - var type = 'id'; - if (!entity.isScene && !entityName && entity.getAttribute('class')) { - entityName = entity.getAttribute('class').split(' ')[0]; - type = 'class'; - } else if ( - !entity.isScene && - !entityName && - entity.getAttribute('mixin') - ) { - entityName = entity.getAttribute('mixin').split(' ')[0]; - type = 'mixin'; - } - return /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { - className: 'entityPrint', - onDoubleClick: onDoubleClick, - children: [ - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { - className: 'entityTagName', - children: '<' + entity.tagName.toLowerCase() - }), - entityName && - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)('span', { - className: 'entityName', - 'data-entity-name-type': type, - children: ['\xA0', entityName] - }), - !!icons && - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { - className: 'entityIcons', - dangerouslySetInnerHTML: { - __html: icons - } - }), - /*#__PURE__*/ (0, - react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)('span', { - className: 'entityCloseTag', - children: '>' - }) - ] - }); + const diff = getModifiedProperties(entity, componentName); + const attributes = AFRAME.utils.styleParser.stringify(diff); + return `${componentName}="${attributes}"`; } /** * Helper function to add a new entity with a list of components - * @param {object} definition Entity definition to add: - * {element: 'a-entity', components: {geometry: 'primitive:box'}} + * @param {object} definition Entity definition to add, only components is required: + * {element: 'a-entity', id: "hbiuSdYL2", class: "box", components: {geometry: 'primitive:box'}} * @return {Element} Entity created */ function createEntity(definition, cb) { - var entity = document.createElement(definition.element); + const entity = document.createElement( + definition.element || 'a-entity' + ); + if (definition.id) { + entity.id = definition.id; + } + if (definition.class) { + entity.setAttribute('class', definition.class); + } // load default attributes - for (var attr in definition.components) { + for (let attr in definition.components) { entity.setAttribute(attr, definition.components[attr]); } // Ensure the components are loaded before update the UI - entity.addEventListener('loaded', function () { - _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( - 'entitycreated', - entity - ); - cb(entity); - }); + entity.addEventListener( + 'loaded', + () => { + _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( + 'entitycreated', + entity + ); + cb(entity); + }, + { + once: true + } + ); AFRAME.scenes[0].appendChild(entity); return entity; } @@ -17126,7 +11853,7 @@ styleSheet.flush() /* harmony import */ var _Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Events */ './src/lib/Events.js'); - var updates = {}; + const updates = {}; /** * Store change to export. @@ -17135,11 +11862,11 @@ styleSheet.flush() */ _Events__WEBPACK_IMPORTED_MODULE_0__['default'].on( 'entityupdate', - function (payload) { - var value = payload.value; - var entity = payload.entity; + (payload) => { + let value = payload.value; + const entity = payload.entity; updates[entity.id] = updates[entity.id] || {}; - var component = AFRAME.components[payload.component]; + const component = AFRAME.components[payload.component]; if (component) { if (payload.property) { updates[entity.id][payload.component] = @@ -17178,33 +11905,25 @@ styleSheet.flush() }); /* harmony import */ var _Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Events */ './src/lib/Events.js'); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = - __webpack_require__( - /*! lodash.debounce */ './node_modules/lodash.debounce/index.js' - ); - /* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ - ); function initRaycaster(inspector) { // Use cursor="rayOrigin: mouse". - var mouseCursor = document.createElement('a-entity'); + const mouseCursor = document.createElement('a-entity'); mouseCursor.setAttribute('id', 'aframeInspectorMouseCursor'); - mouseCursor.setAttribute('cursor', 'rayOrigin', 'mouse'); - mouseCursor.setAttribute('data-aframe-inspector', 'true'); mouseCursor.setAttribute('raycaster', { interval: 100, objects: 'a-scene :not([data-aframe-inspector])' }); + mouseCursor.setAttribute('cursor', 'rayOrigin', 'mouse'); + mouseCursor.setAttribute('data-aframe-inspector', 'true'); // Only visible objects. - var raycaster = mouseCursor.components.raycaster; - var refreshObjects = raycaster.refreshObjects; - var overrideRefresh = function overrideRefresh() { + const raycaster = mouseCursor.components.raycaster; + const refreshObjects = raycaster.refreshObjects; + const overrideRefresh = () => { refreshObjects.call(raycaster); - var objects = raycaster.objects; - raycaster.objects = objects.filter(function (node) { + const objects = raycaster.objects; + raycaster.objects = objects.filter((node) => { while (node) { if (!node.visible) { return false; @@ -17217,29 +11936,22 @@ styleSheet.flush() raycaster.refreshObjects = overrideRefresh; inspector.sceneEl.appendChild(mouseCursor); inspector.cursor = mouseCursor; - inspector.sceneEl.addEventListener( - 'child-attached', - lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function () { - mouseCursor.components.raycaster.refreshObjects(); - }, 250) - ); mouseCursor.addEventListener('click', handleClick); mouseCursor.addEventListener('mouseenter', onMouseEnter); mouseCursor.addEventListener('mouseleave', onMouseLeave); inspector.container.addEventListener('mousedown', onMouseDown); inspector.container.addEventListener('mouseup', onMouseUp); inspector.container.addEventListener('dblclick', onDoubleClick); - inspector.sceneEl.canvas.addEventListener('mouseleave', function () { - setTimeout(function () { + inspector.sceneEl.canvas.addEventListener('mouseleave', () => { + setTimeout(() => { _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( 'raycastermouseleave', null ); }); }); - var onDownPosition = new THREE.Vector2(); - var onUpPosition = new THREE.Vector2(); - var onDoubleClickPosition = new THREE.Vector2(); + const onDownPosition = new THREE.Vector2(); + const onUpPosition = new THREE.Vector2(); function onMouseEnter() { _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( 'raycastermouseenter', @@ -17254,18 +11966,16 @@ styleSheet.flush() } function handleClick(evt) { // Check to make sure not dragging. - var DRAG_THRESHOLD = 0.03; - if (onDownPosition.distanceTo(onUpPosition) >= DRAG_THRESHOLD) { - return; + if (onDownPosition.distanceTo(onUpPosition) === 0) { + inspector.selectEntity(evt.detail.intersectedEl); } - inspector.selectEntity(evt.detail.intersectedEl); } function onMouseDown(event) { if (event instanceof CustomEvent) { return; } event.preventDefault(); - var array = getMousePosition( + const array = getMousePosition( inspector.container, event.clientX, event.clientY @@ -17277,7 +11987,7 @@ styleSheet.flush() return; } event.preventDefault(); - var array = getMousePosition( + const array = getMousePosition( inspector.container, event.clientX, event.clientY @@ -17289,13 +11999,7 @@ styleSheet.flush() * Focus on double click. */ function onDoubleClick(event) { - var array = getMousePosition( - inspector.container, - event.clientX, - event.clientY - ); - onDoubleClickPosition.fromArray(array); - var intersectedEl = mouseCursor.components.cursor.intersectedEl; + const intersectedEl = mouseCursor.components.cursor.intersectedEl; if (!intersectedEl) { return; } @@ -17306,13 +12010,13 @@ styleSheet.flush() } return { el: mouseCursor, - enable: function enable() { + enable: () => { mouseCursor.setAttribute('raycaster', 'enabled', true); inspector.container.addEventListener('mousedown', onMouseDown); inspector.container.addEventListener('mouseup', onMouseUp); inspector.container.addEventListener('dblclick', onDoubleClick); }, - disable: function disable() { + disable: () => { mouseCursor.setAttribute('raycaster', 'enabled', false); inspector.container.removeEventListener('mousedown', onMouseDown); inspector.container.removeEventListener('mouseup', onMouseUp); @@ -17324,7 +12028,7 @@ styleSheet.flush() }; } function getMousePosition(dom, x, y) { - var rect = dom.getBoundingClientRect(); + const rect = dom.getBoundingClientRect(); return [(x - rect.left) / rect.width, (y - rect.top) / rect.height]; } @@ -17353,24 +12057,21 @@ styleSheet.flush() /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ './src/lib/utils.js'); - var os = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.getOS)(); + const os = (0, _utils__WEBPACK_IMPORTED_MODULE_2__.getOS)(); function shouldCaptureKeyEvent(event) { - if (event.metaKey) { - return false; - } return ( event.target.closest('#cameraToolbar') || (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') ); } - var Shortcuts = { + const Shortcuts = { enabled: false, shortcuts: { default: {}, modules: {} }, - onKeyUp: function onKeyUp(event) { + onKeyUp: function (event) { if (!shouldCaptureKeyEvent(event) || !AFRAME.INSPECTOR.opened) { return; } @@ -17383,7 +12084,7 @@ styleSheet.flush() ); } - // esc: close inspector + // esc: unselect entity if (keyCode === 27) { if (this.inspector.selectedEntity) { this.inspector.selectEntity(null); @@ -17428,13 +12129,6 @@ styleSheet.flush() ); } - // m: motion capture - if (keyCode === 77) { - _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( - 'togglemotioncapture' - ); - } - // n: new entity if (keyCode === 78) { _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( @@ -17446,7 +12140,7 @@ styleSheet.flush() ); } - // backspace & supr: remove selected entity + // backspace & delete: remove selected entity if (keyCode === 8 || keyCode === 46) { (0, _entity__WEBPACK_IMPORTED_MODULE_1__.removeSelectedEntity)(); } @@ -17458,7 +12152,7 @@ styleSheet.flush() // f: Focus on selected entity. if (keyCode === 70) { - var selectedEntity = AFRAME.INSPECTOR.selectedEntity; + const selectedEntity = AFRAME.INSPECTOR.selectedEntity; if (selectedEntity !== undefined && selectedEntity !== null) { _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( 'objectfocus', @@ -17513,28 +12207,18 @@ styleSheet.flush() } } }, - onKeyDown: function onKeyDown(event) { + onKeyDown: function (event) { if (!shouldCaptureKeyEvent(event) || !AFRAME.INSPECTOR.opened) { return; } if ( - (event.ctrlKey && os === 'windows') || + (event.ctrlKey && os !== 'macos') || (event.metaKey && os === 'macos') ) { if ( AFRAME.INSPECTOR.selectedEntity && document.activeElement.tagName !== 'INPUT' ) { - // x: cut selected entity - if (event.keyCode === 88) { - AFRAME.INSPECTOR.entityToCopy = - AFRAME.INSPECTOR.selectedEntity; - (0, - _entity__WEBPACK_IMPORTED_MODULE_1__.removeSelectedEntity)( - true - ); - } - // c: copy selected entity if (event.keyCode === 67) { AFRAME.INSPECTOR.entityToCopy = @@ -17557,7 +12241,7 @@ styleSheet.flush() } } - // º: toggle sidebars visibility + // 0: toggle sidebars visibility if (event.keyCode === 48) { _Events__WEBPACK_IMPORTED_MODULE_0__['default'].emit( 'togglesidebar', @@ -17569,7 +12253,7 @@ styleSheet.flush() event.stopPropagation(); } }, - enable: function enable() { + enable: function () { if (this.enabled) { this.disable(); } @@ -17577,12 +12261,12 @@ styleSheet.flush() window.addEventListener('keyup', this.onKeyUp, false); this.enabled = true; }, - disable: function disable() { + disable: function () { window.removeEventListener('keydown', this.onKeyDown); window.removeEventListener('keyup', this.onKeyUp); this.enabled = false; }, - checkModuleShortcutCollision: function checkModuleShortcutCollision( + checkModuleShortcutCollision: function ( keyCode, moduleName, mustBeActive @@ -17597,7 +12281,7 @@ styleSheet.flush() ); } }, - registerModuleShortcut: function registerModuleShortcut( + registerModuleShortcut: function ( keyCode, callback, moduleName, @@ -17619,11 +12303,11 @@ styleSheet.flush() mustBeActive = true; } this.shortcuts.modules[moduleName][keyCode] = { - callback: callback, - mustBeActive: mustBeActive + callback, + mustBeActive }; }, - init: function init(inspector) { + init: function (inspector) { this.inspector = inspector; this.onKeyDown = this.onKeyDown.bind(this); this.onKeyUp = this.onKeyUp.bind(this); @@ -17658,25 +12342,6 @@ styleSheet.flush() /* harmony export */ saveString: () => /* binding */ saveString /* harmony export */ }); - function _typeof(obj) { - '@babel/helpers - typeof'; - return ( - (_typeof = - 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator - ? function (obj) { - return typeof obj; - } - : function (obj) { - return obj && - 'function' == typeof Symbol && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }), - _typeof(obj) - ); - } function getNumber(value) { return parseFloat(value.toFixed(3)); } @@ -17695,8 +12360,8 @@ styleSheet.flush() function equal(var1, var2) { var keys1; var keys2; - var type1 = _typeof(var1); - var type2 = _typeof(var2); + var type1 = typeof var1; + var type2 = typeof var2; if (type1 !== type2) { return false; } @@ -17769,10 +12434,12 @@ styleSheet.flush() var link = document.createElement('a'); link.style.display = 'none'; document.body.appendChild(link); - link.href = URL.createObjectURL(blob); + const url = URL.createObjectURL(blob); + link.href = url; link.download = filename || 'ascene.html'; link.click(); - // URL.revokeObjectURL(url); breaks Firefox... + URL.revokeObjectURL(url); + link.remove(); } // Compares 2 vector objects up to size 4 @@ -17817,6 +12484,10 @@ styleSheet.flush() __webpack_require__( /*! ./EditorControls.js */ './src/lib/EditorControls.js' ); + /* harmony import */ var _EditorControls_js__WEBPACK_IMPORTED_MODULE_1___default = + /*#__PURE__*/ __webpack_require__.n( + _EditorControls_js__WEBPACK_IMPORTED_MODULE_1__ + ); /* harmony import */ var _raycaster__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./raycaster */ './src/lib/raycaster.js'); /* harmony import */ var _Events__WEBPACK_IMPORTED_MODULE_3__ = @@ -17828,10 +12499,10 @@ styleSheet.flush() */ function Viewport(inspector) { // Initialize raycaster and picking in differentpmodule. - var mouseCursor = (0, + const mouseCursor = (0, _raycaster__WEBPACK_IMPORTED_MODULE_2__.initRaycaster)(inspector); - var sceneEl = inspector.sceneEl; - sceneEl.addEventListener('camera-set-active', function (event) { + const sceneEl = inspector.sceneEl; + sceneEl.addEventListener('camera-set-active', (event) => { // If we're in edit mode, save the newly active camera and activate when exiting. if (inspector.opened) { inspector.cameras.original = event.detail.cameraEl; @@ -17839,17 +12510,17 @@ styleSheet.flush() }); // Helpers. - var sceneHelpers = inspector.sceneHelpers; - var grid = new THREE.GridHelper(30, 60, 0xaaaaaa, 0x262626); + const sceneHelpers = inspector.sceneHelpers; + const grid = new THREE.GridHelper(30, 60, 0xaaaaaa, 0x262626); sceneHelpers.add(grid); - var selectionBox = new THREE.BoxHelper(); + const selectionBox = new THREE.BoxHelper(); selectionBox.material.depthTest = false; selectionBox.material.transparent = true; selectionBox.material.color.set(0x1faaf2); selectionBox.visible = false; sceneHelpers.add(selectionBox); function updateHelpers(object) { - object.traverse(function (node) { + object.traverse((node) => { if ( inspector.helpers[node.uuid] && inspector.helpers[node.uuid].update @@ -17858,46 +12529,33 @@ styleSheet.flush() } }); } - var camera = inspector.camera; - var transformControls = new THREE.TransformControls( + const camera = inspector.camera; + const transformControls = new THREE.TransformControls( camera, inspector.container ); transformControls.size = 0.75; - transformControls.addEventListener('objectChange', function (evt) { - var object = transformControls.object; + transformControls.addEventListener('objectChange', (evt) => { + const object = transformControls.object; if (object === undefined) { return; } selectionBox.setFromObject(object); updateHelpers(object); - _Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( - 'refreshsidebarobject3d', - object - ); // Emit update event for watcher. - var component; - var value; + let component; + let value; if (evt.mode === 'translate') { component = 'position'; - value = '' - .concat(object.position.x, ' ') - .concat(object.position.y, ' ') - .concat(object.position.z); + value = `${object.position.x} ${object.position.y} ${object.position.z}`; } else if (evt.mode === 'rotate') { component = 'rotation'; - var d = THREE.MathUtils.radToDeg; - value = '' - .concat(d(object.rotation.x), ' ') - .concat(d(object.rotation.y), ' ') - .concat(d(object.rotation.z)); + const d = THREE.MathUtils.radToDeg; + value = `${d(object.rotation.x)} ${d(object.rotation.y)} ${d(object.rotation.z)}`; } else if (evt.mode === 'scale') { component = 'scale'; - value = '' - .concat(object.scale.x, ' ') - .concat(object.scale.y, ' ') - .concat(object.scale.z); + value = `${object.scale.x} ${object.scale.y} ${object.scale.z}`; } // We need to call setAttribute for component attrValue to be up to date, @@ -17912,38 +12570,48 @@ styleSheet.flush() value: value } ); - _Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( - 'entitytransformed', - transformControls.object.el - ); }); - transformControls.addEventListener('mouseDown', function () { + transformControls.addEventListener('mouseDown', () => { controls.enabled = false; }); - transformControls.addEventListener('mouseUp', function () { + transformControls.addEventListener('mouseUp', () => { controls.enabled = true; }); sceneHelpers.add(transformControls); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'entityupdate', - function (detail) { - if (inspector.selectedEntity.object3DMap.mesh) { + (detail) => { + const object = detail.entity.object3D; + if ( + inspector.selected === object && + inspector.selectedEntity.object3DMap.mesh + ) { selectionBox.setFromObject(inspector.selected); } } ); // Controls need to be added *after* main logic. - var controls = new THREE.EditorControls(camera, inspector.container); + const controls = new THREE.EditorControls( + camera, + inspector.container + ); controls.center.set(0, 1.6, 0); controls.rotationSpeed = 0.0035; controls.zoomSpeed = 0.05; controls.setAspectRatio(sceneEl.canvas.width / sceneEl.canvas.height); + controls.addEventListener('change', () => { + transformControls.update(true); // true is updateScale + _Events__WEBPACK_IMPORTED_MODULE_3__['default'].emit( + 'camerachanged' + ); + }); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'cameratoggle', - function (data) { + (data) => { controls.setCamera(data.camera); transformControls.setCamera(data.camera); + updateAspectRatio(); } ); function disableControls() { @@ -17959,37 +12627,51 @@ styleSheet.flush() enableControls(); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'inspectorcleared', - function () { + () => { controls.center.set(0, 0, 0); } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'transformmodechange', - function (mode) { + (mode) => { transformControls.setMode(mode); } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( - 'snapchanged', - function (dist) { + 'translationsnapchanged', + (dist) => { transformControls.setTranslationSnap(dist); } ); + _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( + 'rotationsnapchanged', + (dist) => { + transformControls.setRotationSnap(dist); + } + ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'transformspacechanged', - function (space) { + (space) => { transformControls.setSpace(space); } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'objectselect', - function (object) { + (object) => { selectionBox.visible = false; transformControls.detach(); if (object && object.el) { if (object.el.getObject3D('mesh')) { selectionBox.setFromObject(object); selectionBox.visible = true; + } else if (object.el.hasAttribute('gltf-model')) { + const listener = (event) => { + if (event.target !== object.el) return; // we got an event for a child, ignore + selectionBox.setFromObject(object); + selectionBox.visible = true; + object.el.removeEventListener('model-loaded', listener); + }; + object.el.addEventListener('model-loaded', listener); } transformControls.attach(object); } @@ -17997,14 +12679,13 @@ styleSheet.flush() ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'objectfocus', - function (object) { + (object) => { controls.focus(object); - transformControls.update(); } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'geometrychanged', - function (object) { + (object) => { if (object !== null) { selectionBox.setFromObject(object); } @@ -18012,8 +12693,8 @@ styleSheet.flush() ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'entityupdate', - function (detail) { - var object = detail.entity.object3D; + (detail) => { + const object = detail.entity.object3D; if (inspector.selected === object) { // Hack because object3D always has geometry :( if ( @@ -18034,36 +12715,54 @@ styleSheet.flush() updateHelpers(object); } ); - _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( - 'windowresize', - function () { - camera.aspect = - inspector.container.offsetWidth / - inspector.container.offsetHeight; - camera.updateProjectionMatrix(); - } + function updateAspectRatio() { + if (!inspector.opened) return; + // Modifying aspect for perspective camera is done by aframe a-scene.resize function + // when the perspective camera is the active camera, so we actually do it a second time here, + // but we need to modify it ourself when we switch from ortho camera to perspective camera (updateAspectRatio() is called in cameratoggle handler). + const camera = inspector.camera; + const aspect = + inspector.container.offsetWidth / + inspector.container.offsetHeight; + if (camera.isPerspectiveCamera) { + camera.aspect = aspect; + } else if (camera.isOrthographicCamera) { + const frustumSize = camera.top - camera.bottom; + camera.left = (-frustumSize * aspect) / 2; + camera.right = (frustumSize * aspect) / 2; + camera.top = frustumSize / 2; + camera.bottom = -frustumSize / 2; + } + controls.setAspectRatio(aspect); // for zoom in/out to work correctly for orthographic camera + camera.updateProjectionMatrix(); + const cameraHelper = inspector.helpers[camera.uuid]; + if (cameraHelper) cameraHelper.update(); + } + inspector.sceneEl.addEventListener( + 'rendererresize', + updateAspectRatio ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'gridvisibilitychanged', - function (showGrid) { + (showGrid) => { grid.visible = showGrid; } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'togglegrid', - function () { + () => { grid.visible = !grid.visible; } ); _Events__WEBPACK_IMPORTED_MODULE_3__['default'].on( 'inspectortoggle', - function (active) { + (active) => { if (active) { enableControls(); AFRAME.scenes[0].camera = inspector.camera; Array.prototype.slice .call(document.querySelectorAll('.a-enter-vr,.rs-base')) - .forEach(function (element) { + .forEach((element) => { element.style.display = 'none'; }); } else { @@ -18077,13 +12776,10 @@ styleSheet.flush() inspector.cameras.original.getObject3D('camera'); Array.prototype.slice .call(document.querySelectorAll('.a-enter-vr,.rs-base')) - .forEach(function (element) { + .forEach((element) => { element.style.display = 'block'; }); } - if (typeof ga !== 'undefined') { - ga('send', 'event', 'Viewport', 'toggleEditor', active); - } } ); } @@ -18091,10657 +12787,10695 @@ styleSheet.flush() /***/ }, - /***/ './vendor/ga.js': - /*!**********************!*\ - !*** ./vendor/ga.js ***! - \**********************/ - /***/ () => { - (function (i, s, o, g, r, a, m) { - i['GoogleAnalyticsObject'] = r; - (i[r] = - i[r] || - function () { - (i[r].q = i[r].q || []).push(arguments); - }), - (i[r].l = 1 * new Date()); - (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); - a.async = 1; - a.src = g; - a.setAttribute('data-aframe-inspector', ''); - m.parentNode.insertBefore(a, m); - })( - window, - document, - 'script', - 'https://www.google-analytics.com/analytics.js', - 'ga' - ); - ga('create', 'UA-80530812-1', 'auto'); - ga('send', 'pageview'); + /***/ './node_modules/clipboard-copy/index.js': + /*!**********************************************!*\ + !*** ./node_modules/clipboard-copy/index.js ***! + \**********************************************/ + /***/ (module) => { + /*! clipboard-copy. MIT License. Feross Aboukhadijeh */ + /* global DOMException */ + + module.exports = clipboardCopy; + + function makeError() { + return new DOMException( + 'The request is not allowed', + 'NotAllowedError' + ); + } + + async function copyClipboardApi(text) { + // Use the Async Clipboard API when available. Requires a secure browsing + // context (i.e. HTTPS) + if (!navigator.clipboard) { + throw makeError(); + } + return navigator.clipboard.writeText(text); + } + + async function copyExecCommand(text) { + // Put the text to copy into a + const span = document.createElement('span'); + span.textContent = text; + + // Preserve consecutive spaces and newlines + span.style.whiteSpace = 'pre'; + span.style.webkitUserSelect = 'auto'; + span.style.userSelect = 'all'; + + // Add the to the page + document.body.appendChild(span); + + // Make a selection object representing the range of text selected by the user + const selection = window.getSelection(); + const range = window.document.createRange(); + selection.removeAllRanges(); + range.selectNode(span); + selection.addRange(range); + + // Copy text to the clipboard + let success = false; + try { + success = window.document.execCommand('copy'); + } finally { + // Cleanup + selection.removeAllRanges(); + window.document.body.removeChild(span); + } + + if (!success) throw makeError(); + } + + async function clipboardCopy(text) { + try { + await copyClipboardApi(text); + } catch (err) { + // ...Otherwise, use document.execCommand() fallback + try { + await copyExecCommand(text); + } catch (err2) { + throw err2 || err || makeError(); + } + } + } /***/ }, - /***/ './node_modules/classnames/index.js': - /*!******************************************!*\ - !*** ./node_modules/classnames/index.js ***! - \******************************************/ - /***/ (module, exports) => { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ - /* global define */ + /***/ './node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/stylus-loader/dist/cjs.js!./src/style/index.styl': + /*!***************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/stylus-loader/dist/cjs.js!./src/style/index.styl ***! + \***************************************************************************************************************************************************************************************************************/ + /***/ (module, __webpack_exports__, __webpack_require__) => { + 'use strict'; + __webpack_require__.r(__webpack_exports__); + /* harmony export */ __webpack_require__.d(__webpack_exports__, { + /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__ + /* harmony export */ + }); + /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = + __webpack_require__( + /*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ './node_modules/css-loader/dist/runtime/sourceMaps.js' + ); + /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = + /*#__PURE__*/ __webpack_require__.n( + _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ + ); + /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = + __webpack_require__( + /*! ../../node_modules/css-loader/dist/runtime/api.js */ './node_modules/css-loader/dist/runtime/api.js' + ); + /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = + /*#__PURE__*/ __webpack_require__.n( + _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ + ); + // Imports - (function () { - 'use strict'; + var ___CSS_LOADER_EXPORT___ = + _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()( + _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default() + ); + // Module + ___CSS_LOADER_EXPORT___.push([ + module.id, + `svg:not(:root).svg-inline--fa, +svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +.svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +body.aframe-inspector-opened, +.toggle-edit { + font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; +} +.wf-roboto-n4-active body.aframe-inspector-opened, +.wf-roboto-n4-active .toggle-edit { + font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; +} +body.aframe-inspector-opened { + background: #1d1d1d; + color: #fff; + font-size: 12px; + margin: 0; + overflow: hidden; +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector #toolbar { + background-color: #242424; +} +#aframeInspector #toolbar .toolbarActions { + padding: 0 0 5px; + display: flex; + align-items: baseline; +} +#aframeInspector #toolbar .toolbarActions a.disabled { + color: #666; + cursor: default; +} +#aframeInspector #toolbar .toolbarActions .helpButtonContainer { + flex-grow: 1; + padding-right: 10px; + text-align: right; +} +#aframeInspector #scenegraph { + background: #242424; + border-top: 1px solid #111; + display: flex; + flex-direction: column; + overflow: auto; + padding-top: 32px; + width: 230px; +} +#aframeInspector #scenegraph .entity { + background: #242424; + cursor: pointer; + display: flex; + justify-content: space-between; + padding: 3px; + width: 100%; + white-space: nowrap; +} +#aframeInspector #scenegraph .entity:hover { + background: #1d2f39; +} +#aframeInspector #scenegraph .entity.active { + background-color: #155373; + color: #fff; +} +#aframeInspector #scenegraph .entity.active .component:hover { + color: #1888c1; +} +#aframeInspector #scenegraph .entity.active .entityActions { + display: inline; +} +#aframeInspector #scenegraph .entity.novisible.active span, +#aframeInspector #scenegraph .entity.novisible.active svg, +#aframeInspector #scenegraph .entity.novisible.active .collapsespace, +#aframeInspector #scenegraph .entity.novisible.active .id { + color: #999; +} +#aframeInspector #scenegraph .entity.novisible:not(.active) span, +#aframeInspector #scenegraph .entity.novisible:not(.active) svg, +#aframeInspector #scenegraph .entity.novisible:not(.active) .collapsespace, +#aframeInspector #scenegraph .entity.novisible:not(.active) .id { + color: #626262; +} +#aframeInspector #scenegraph .component:hover { + color: #1faaf2; +} +#aframeInspector #scenegraph .entityIcons { + margin-left: 2px; +} +#aframeInspector #scenegraph .entityActions { + display: none; + margin: 0 14px; +} +#aframeInspector #scenegraph .entityActions .button { + color: #fff; + font-size: 12px; + margin-left: 6px; +} +#aframeInspector #scenegraph svg { + color: #ccc; +} +#aframeInspector #scenegraph .toolbarActions svg:hover, +#aframeInspector #scenegraph .entityActions svg:hover { + color: #1faaf2; +} +#aframeInspector #scenegraph .active svg { + color: #fafafa; +} +#aframeInspector #scenegraph .id { + color: #ccc; +} +#aframeInspector #scenegraph .option.active .id { + color: #fff; +} +#aframeInspector #scenegraph .collapsespace { + color: #eee; + display: inline-block; + text-align: center; + width: 14px; +} +#aframeInspector #scenegraph .fa-eye { + color: #bbb; +} +#aframeInspector #scenegraph .icons a.button { + color: #fff; +} +#aframeInspector #scenegraph .search { + padding: 5px; + font-size: 16px; + position: relative; +} +#aframeInspector #scenegraph .search input { + color: #c3c3c3; + background: #1d1d1d; + border-radius: 5px; + height: 22px; + text-indent: 10px; + width: 216px; +} +#aframeInspector #scenegraph .search >svg, +#aframeInspector #scenegraph .search a.button { + position: absolute; + right: 14px; + top: 10px; +} +#aframeInspector #scenegraph .outliner { + background: #242424; + color: #c3c3c3; + cursor: default; + flex: 1 1 auto; + font-size: 13px; + height: calc(100% - 98px); + line-height: normal; + outline: none; + overflow-y: auto; + padding: 0; + width: 230px; +} +#aframeInspector .scenegraph-bottom { + background-color: #323232; + border-top: 1px solid #111; + bottom: 10; + height: 40px; + left: 0; + z-index: 100; +} +#aframeInspector .scenegraph-bottom a { + float: right; + margin: 10px; +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector .components { + background-color: #242424; + color: #c3c3c3; + height: 100%; + overflow: auto; + position: fixed; + width: 331px; +} +#aframeInspector div.vec2, +#aframeInspector div.vec3, +#aframeInspector div.vec4 { + display: inline; +} +#aframeInspector .vec2 input.number, +#aframeInspector .vec3 input.number { + width: 40px; +} +#aframeInspector .vec4 input.number { + width: 34px; +} +#aframeInspector .collapsible-header { + align-items: center; + display: flex; + justify-content: space-between; +} +#aframeInspector .collapsible-header .entityPrint { + color: #fff; +} +#aframeInspector .collapsible-content { + padding: 5px 0; +} +#aframeInspector .componentTitle span { + max-width: 200px; + overflow: hidden; + text-overflow: ellipsis; + text-transform: uppercase; + white-space: nowrap; + color: #fff; + font-weight: 600; + vertical-align: bottom !important; +} +#aframeInspector .collapsible .static { + background: #333; + border-bottom: 2px solid #242424; + box-sizing: content-box; + cursor: pointer; + height: 16px; + padding: 8px 10px 12px 10px; + vertical-align: bottom; + font-size: 13px; +} +#aframeInspector .collapsible .static:hover { + background: #393939; +} +#aframeInspector .collapsible .menu { + text-align: right; +} +#aframeInspector .collapsible .menuafter { + color: #bbb; + content: '\\2807'; + font-size: 12px; + padding: 5px; + text-align: right; +} +#aframeInspector .collapsible .static { + margin: 0; +} +#aframeInspector .collapsible .static .collapse-button { + border: 6px solid transparent; + float: left; + height: 0; + margin-right: 10px; + margin-left: 2px; + width: 0; +} +#aframeInspector .collapsible.collapsed .static .collapse-button { + border-left-color: #c3c3c3; + margin-top: 4px; +} +#aframeInspector .collapsible:not(.collapsed) .static .collapse-button { + border-top-color: #c3c3c3; + margin-top: 7px; +} +#aframeInspector .propertyRow { + align-items: center; + display: flex; + font-size: 13px; + min-height: 30px; + padding: 2px 15px; +} +#aframeInspector .propertyRow .text { + cursor: default; + display: inline-block; + overflow: hidden; + padding-right: 10px; + text-overflow: ellipsis; + vertical-align: middle; + width: 118px; +} +#aframeInspector .propertyRow .map_value { + margin: 0 0 0 5px; + width: 68px; +} +#aframeInspector .propertyRow .Select-control { + font-size: 11px; + height: 24px; +} +#aframeInspector .propertyRow .Select-placeholder, +#aframeInspector .propertyRow .Select--single > .Select-control .Select-value { + line-height: 19px; +} +#aframeInspector .propertyRow .Select-input { + height: 22px; +} +#aframeInspector .propertyRow input[type=text], +#aframeInspector .propertyRow input[type=number], +#aframeInspector .propertyRow input.string, +#aframeInspector .propertyRow input.number { + background: #1d1d1d; + color: #1faaf2; + min-height: 26px; + padding-bottom: 1px; + padding-left: 5px; + padding-right: 5px; + padding-top: 1px; +} +#aframeInspector .propertyRow input[type=text]:last-child, +#aframeInspector .propertyRow input[type=number]:last-child, +#aframeInspector .propertyRow input.string:last-child, +#aframeInspector .propertyRow input.number:last-child { + padding-right: 0; +} +#aframeInspector .propertyRow input.string { + padding-left: 8px; + box-sizing: border-box; + width: 165px; +} +#aframeInspector .propertyRow input[type=text]:focus, +#aframeInspector .propertyRow input.string:focus { + box-shadow: none; +} +#aframeInspector .propertyRow .color_value { + margin: 0 0 0 5px; + width: 68px; + letter-spacing: 1px; +} +#aframeInspector .propertyRowDefined .text { + color: #fafafa; + font-weight: 500; +} +#aframeInspector .components * { + vertical-align: middle; +} +#aframeInspector span.subcomponent { + color: #999; + float: none !important; + margin-left: 10px; + vertical-align: top !important; +} +#aframeInspector a.help-link { + opacity: 0.4; +} +#aframeInspector a.help-linkhover { + opacity: 1; +} +#aframeInspector #addComponentContainer { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + padding: 20px 10px; + background: #1d1d1d; +} +#aframeInspector #addComponentContainer #addComponent { + text-align: left; + width: 200px; +} +#aframeInspector #addComponentContainer #addComponent .select__control { + background: #161616; + height: 35px; + color: #1faaf2; +} +#aframeInspector #addComponentContainer #addComponent .option { + display: flex; + justify-content: space-between; +} +#aframeInspector #addComponentContainer #addComponent .option span { + color: #1faaf2; +} +#aframeInspector #addComponentContainer #addComponentHeader { + font-size: 15px; + margin: 5px 0 10px 0; +} +#aframeInspector #addComponentContainer input[type=text]:focus { + box-shadow: none; +} +#aframeInspector .Select-menu-outer .is-focused span { + color: #fff; +} +#aframeInspector .component-title { + align-items: center; + display: flex; +} +#aframeInspector #componentEntityHeader .collapsible-header { + bottom: 4px; + position: relative; +} +#aframeInspector #componentEntityHeader .collapse-button { + display: none; +} +#aframeInspector #componentEntityHeader .static { + height: 13px; +} +#aframeInspector #componentEntityHeader .entityPrint { + font-size: 15px; + padding-left: 5px; +} +#aframeInspector #componentEntityHeader .entityName { + max-width: 160px; + top: 0; +} +#aframeInspector #componentEntityHeader .entityIcons { + color: #fafafa; +} +#aframeInspector #mixinSelect { + width: 160px; +} +#aframeInspector .propertyRow .texture { + display: flex; +} +#aframeInspector .propertyRow .texture input { + margin-left: 0; + width: 120px; +} +#aframeInspector #componentEntityHeader .gltfIcon img { + top: 0; +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector .entityPrint { + font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; + line-height: 1.15em; +} +#aframeInspector .entityName { + display: inline-block; + overflow: hidden; + position: relative; + text-overflow: ellipsis; + top: 3px; + white-space: nowrap; +} +#aframeInspector [data-entity-name-type="id"] { + color: #92374d; +} +#aframeInspector [data-entity-name-type="class"] { + color: #514b23; +} +#aframeInspector [data-entity-name-type="mixin"] { + color: #d66853; +} +#aframeInspector .help-lists { + display: flex; + justify-content: space-around; +} +#aframeInspector .help-list { + list-style: none; + margin: 0; + padding: 0 0 10px; + width: 350px; +} +#aframeInspector .help-list li { + margin-right: 40px; +} +#aframeInspector .help-key-unit { + line-height: 1.8; + margin-right: 2em; + padding: 5px 0; +} +#aframeInspector .help-key { + bottom: 2px; + margin-right: 4px; + min-width: 60px; + position: relative; +} +#aframeInspector .help-key span { + background-color: #2e2e2e; + background-repeat: repeat-x; + border: 1px solid #666; + border-radius: 3px; + box-shadow: 0 0 5px #000; + color: #999; + display: inline-block; + font-size: 12px; + padding: 0 8px; + text-align: center; +} +#aframeInspector .help-key-def { + color: #bbb; + display: inline-block; + margin-left: 1em; +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector .select__control { + border: 0; + border-radius: 0; + cursor: pointer; + min-height: 26px; + font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; + font-size: 13px; +} +#aframeInspector .select__indicator { + height: 26px; +} +#aframeInspector .select__indicator-separator { + display: none; +} +#aframeInspector .select__input { + min-height: auto !important; +} +#aframeInspector .select__control, +#aframeInspector .select__menu { + background: #1d1d1d; +} +#aframeInspector .select__option { + padding: 5px 10px; +} +#aframeInspector .select__placeholder, +#aframeInspector .select__menu { + color: #c3c3c3; +} +#aframeInspector .select__single-value { + color: #1faaf2; +} +#aframeInspector .select__control--is-focused { + box-shadow: none !important; +} +#aframeInspector .select__option { + cursor: pointer; +} +#aframeInspector .select__clear-indicator { + display: none; +} +#aframeInspector .select__label { + font-size: 11px; +} +#aframeInspector .select__option--is-focused { + background: #155373; +} +#aframeInspector .select__value-container { + height: 26px; + position: static; +} +#aframeInspector .select__value-container.select__value-container--is-multi { + height: auto; + padding: 6px; +} +#aframeInspector .select__dropdown-indicator { + padding: 3px 8px; +} +#aframeInspector .select__multi-value { + background: #242424; + color: #1faaf2; +} +#aframeInspector .select__multi-value__label { + color: #1faaf2; +} +#aframeInspector .select__value-container--is-multi > :last-child { + display: none; +} +#aframeInspector .select__multi-value__remove:hover { + color: #fff; + background: #242424; +} +#aframeInspector .modal { + animation: animateopacity 0.2s ease-out; + background-color: #000; + background-color: rgba(0,0,0,0.6); + display: flex; + height: 100%; + left: 0; + overflow: auto; + position: fixed; + top: 0; + width: 100%; + z-index: 9999999999; +} +#aframeInspector .modal h3 { + font-size: 18px; + font-weight: 100; + margin: 0.6em 0; +} +#aframeInspector #textureModal .modal-content { + height: calc(100% - 50px); + width: calc(100% - 50px); +} +#aframeInspector .modal-content { + animation: animatetop 0.2s ease-out; + animation-duration: 0.2s; + animation-name: animatetop; + background-color: #232323; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.5), 0 6px 20px 0 rgba(0,0,0,0.5); + margin: auto; + overflow: hidden; + padding: 0; +} +#aframeInspector .close { + color: #fff; + float: right; + font-size: 28px; + font-weight: bold; +} +#aframeInspector .close:hover, +#aframeInspector .close:focus { + color: #08f; + cursor: pointer; + text-decoration: none; +} +#aframeInspector .modal-header { + color: #fff; + padding: 2px 16px; +} +#aframeInspector .modal-body { + overflow: auto; + padding: 16px; +} +#aframeInspector .modal-footer { + color: #fff; + padding: 2px 16px; +} +#aframeInspector .gallery { + background: #232323; + display: flex; + flex-wrap: wrap; + margin: 15px auto 0; + overflow: auto; + padding: 15px 3px 3px; +} +#aframeInspector .newimage .gallery { + padding: 16px; +} +#aframeInspector .gallery li { + border-radius: 2px; + box-shadow: 0 0 6px rgba(0,0,0,0.6); + cursor: pointer; + margin: 8px; + overflow: hidden; + width: 155px; +} +#aframeInspector .gallery li.selected, +#aframeInspector .gallery li:hover { + box-shadow: 0 0 0 2px #1eaaf1; +} +#aframeInspector .gallery li .detail { + background-color: #323232; + margin: 0; + min-height: 60px; + padding: 3px 10px; +} +#aframeInspector .preview { + padding: 10px; + width: 150px; +} +#aframeInspector .preview input { + display: block; + margin: 8px 0; + width: 144px; +} +#aframeInspector .preview button { + width: 155px; +} +#aframeInspector .preview .detail .title { + color: #fff; + display: inline-block; + max-width: 155px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +#aframeInspector .gallery li.selected .detail, +#aframeInspector .gallery li:hover .detail { + background-color: #444; +} +#aframeInspector .gallery li .detail span { + color: #777; + display: block; + margin-top: 4px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 140px; +} +#aframeInspector .gallery li.selected .detail span, +#aframeInspector .gallery li:hover .detail span { + color: #888; +} +#aframeInspector .gallery li .detail span.title { + color: #fff !important; +} +#aframeInspector .modal button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 0; + box-shadow: none; + cursor: pointer; + display: inline-block; + font-size: 12px; + line-height: 1.8; + margin: 0 10px 0 0; + padding: 5px 10px; +} +#aframeInspector .modal button:focus { + outline: none; +} +#aframeInspector .modal button { + background-color: #1eaaf1; + border: none; + color: #fff; +} +#aframeInspector .modal button:hover, +#aframeInspector .modal button.hover { + background-color: #346392; + text-shadow: -1px 1px #27496d; +} +#aframeInspector .modal button:active, +#aframeInspector .modal button.active { + background-color: #27496d; + text-shadow: -1px 1px #193047; +} +#aframeInspector .modal button:disabled { + background-color: #888; + cursor: none; +} +#aframeInspector .newimage { + background-color: #323232; + color: #bcbcbc; + display: flex; + font-size: 13px; + justify-content: space-between; + margin-top: 10px; + overflow: auto; + padding: 10px; +} +#aframeInspector .newimage input { + color: #1eaaf1; + padding: 3px 5px; +} +#aframeInspector .texture canvas + input { + margin-left: 5px; +} +#aframeInspector .texture svg { + padding-right: 5px; +} +#aframeInspector .uploader-normal-button .hidden { + display: none; +} +#aframeInspector .assets.search { + position: relative; + margin-top: 10px; + width: 200px; +} +#aframeInspector .assets.search svg { + position: absolute; + right: 0px; + top: 5px; +} +#aframeInspector .new_asset_options { + margin: 10px; +} +#aframeInspector .new_asset_options > ul { + margin-left: 10px; + padding: 5px; +} +#aframeInspector .new_asset_options > ul > li { + padding: 10px 0; +} +#aframeInspector .new_asset_options .imageUrl { + margin-left: 5px; + width: 350px; +} +#aframeInspector .texture canvas { + border: 1px solid #333; + cursor: pointer; +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector #viewportBar { + align-items: center; + background-color: #242424; + color: #c3c3c3; + display: flex; + flex-grow: 2; + height: 32px; + font-size: 15px; + justify-content: space-between; + left: 0; + margin: 0 auto; + right: 0; + top: 0; +} +#aframeInspector .toolbarButtons { + display: flex; + align-items: center; + gap: 6px; +} +#aframeInspector .toolbarButtons * { + margin-left: 0 !important; + vertical-align: middle; +} +#aframeInspector .toolbarButtons a.button svg { + padding: 8px; +} +#aframeInspector .toolbarButtons a.button:not(.active) svg:hover { + background-color: #444; +} +#aframeInspector .toolbarButtons .active svg { + background-color: #1faaf2; + color: #fff; +} +#aframeInspector .toolbarButtons .active:hover svg { + color: #fff !important; +} +#aframeInspector .local-transform { + padding-left: 10px; + padding-right: 20px; +} +#aframeInspector .local-transform label { + color: #aaa; + padding-left: 5px; +} +#aframeInspector .local-transform a.button { + padding-top: 0; +} +#aframeInspector #cameraSelect { + cursor: pointer; + width: 110px; +} +#aframeInspector #cameraSelect .select__dropdown-indicator { + padding-left: 3px; + padding-right: 3px; +} +#aframeInspector #cameraToolbar { + margin-left: 5px; + align-items: center; + display: flex; +} +#aframeInspector #cameraToolbar a { + margin-right: 10px; +} +#aframeInspector #cameraToolbar .select__control { + background: none; +} +#aframeInspector #cameraToolbar .select__single-value { + color: #c3c3c3; +} +#aframeInspector #cameraToolbar .select__single-value:hover { + color: #1faaf2; +} +#aframeInspector #viewportHud { + display: none; +} +@media (min-width: 1024px) { + #aframeInspector #viewportHud { + display: block; + } +} +#aframeInspector svg:not(:root).svg-inline--fa, +#aframeInspector svg:not(:host).svg-inline--fa { + overflow: visible; + box-sizing: content-box; +} +#aframeInspector .svg-inline--fa { + display: inline-block; + height: 1em; + overflow: visible; + vertical-align: -0.125em; +} +#aframeInspector .Select-control { + background-color: #222 !important; + border: none; + border-radius: 0; + color: #1faaf2; + font-family: \$monosapce; +} +#aframeInspector .Select-menu-outer { + border: none; +} +#aframeInspector .Select-menu-outer .is-focused { + background-color: #1faaf2 !important; + color: #c3c3c3; +} +#aframeInspector .Select-option { + background-color: #222 !important; +} +#aframeInspector .select-widget { + display: inline-block; + width: 157px; +} +#aframeInspector .Select-placeholder, +#aframeInspector .Select--single > .Select-control .Select-value { + color: #1faaf2 !important; +} +#aframeInspector .Select-value-label { + color: #1faaf2 !important; +} +#aframeInspector .dropbtn { + border: none; + color: #c3c3c3; + cursor: pointer; +} +#aframeInspector .dropdown { + display: inline-block; + position: relative; +} +#aframeInspector .dropdown-content { + background-color: #f9f9f9; + box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); + display: none; + left: 8px; + min-width: 38px; + position: absolute; + z-index: 999; +} +#aframeInspector .dropdown-content a { + background-color: #232323; + color: #7d7d7d; + display: block; + padding: 10px 14px; + text-decoration: none; +} +#aframeInspector .dropdown-content a:hover { + background-color: #4ecbff; + color: #c3c3c3; +} +#aframeInspector .dropdownhover .dropdown-content { + display: block; +} +#aframeInspector .dropdownhover .dropbtn { + color: #1faaf2; +} +#aframeInspector .Select, +#aframeInspector code, +#aframeInspector pre, +#aframeInspector input, +#aframeInspector textarea, +#aframeInspector select { + font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; + font-size: 13px; +} +#aframeInspector .wf-robotomono-n4-active .Select, +#aframeInspector .wf-robotomono-n4-active code, +#aframeInspector .wf-robotomono-n4-active pre, +#aframeInspector .wf-robotomono-n4-active input, +#aframeInspector .wf-robotomono-n4-active textarea, +#aframeInspector .wf-robotomono-n4-active select { + font-family: Roboto Mono, Consolas, Andale Mono, Monaco, Courier New, monospace; +} +#aframeInspector hr { + border: 0; + border-top: 1px solid #ccc; +} +#aframeInspector a { + cursor: pointer; +} +#aframeInspector button { + position: relative; +} +#aframeInspector code { + font-family: Consolas, Andale Mono, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; +} +#aframeInspector textarea { + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + white-space: pre; + word-wrap: normal; +} +#aframeInspector textarea.success { + border-color: #8b8 !important; +} +#aframeInspector textarea.fail { + background-color: rgba(255,0,0,0.05); + border-color: #f00 !important; +} +#aframeInspector textarea, +#aframeInspector input { + outline: none /* osx */; +} +#aframeInspector .gltfIcon img { + box-sizing: content-box; + display: inline; + height: 20px; + left: 5px; + padding: 0 5px; + position: relative; + top: 4px; + vertical-align: baseline; + width: 20px; +} +#aframeInspector #scenegraph, +#aframeInspector #rightPanel { + z-index: 9998; +} +#aframeInspector #sidebar, +#aframeInspector #scenegraph, +#aframeInspector .panel { + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} +#aframeInspector .toggle-edit { + background-color: #92374d; + box-sizing: content-box; + color: #fafafa; + font-size: 13px; + left: 3px; + line-height: normal; + margin: 0; + padding: 6px 10px; + position: fixed; + text-align: center; + text-decoration: none; + top: 3px; + width: 204px; + z-index: 999999999; +} +#aframeInspector .toggle-edithover { + background-color: #e42b5a; +} +#aframeInspector input { + background-color: transparent; + border: 1px solid #555; + color: #fff; +} +#aframeInspector input, +#aframeInspector .texture canvas { + transition: 0.1s background-color ease-in-out, 0.1s border-color ease-in-out, 0.1s color ease-in-out; +} +#aframeInspector input[type=text], +#aframeInspector input[type=number], +#aframeInspector input.string, +#aframeInspector input.number { + min-height: 14px; + outline: none; +} +#aframeInspector input[type="checkbox"] { + -webkit-appearance: auto; + -moz-appearance: auto; + appearance: auto; + cursor: pointer; + margin: 0; + height: 18px; + width: 18px; +} +#aframeInspector input[type="checkbox"]:focus { + box-shadow: none; +} +#aframeInspector input.number { + background-color: transparent !important; + border: 0; + color: #2cb7ff !important; + cursor: col-resize; + font-size: 13px; + padding: 2px; +} +#aframeInspector input.stringfocus, +#aframeInspector input.numberfocus { + border: 1px solid #20b1fb; + color: #fff; + cursor: auto; +} +#aframeInspector input.error { + border: 1px solid #a00; +} +#aframeInspector #sidebar { + background: #242424; + width: 331px; +} +#aframeInspector #sidebar * { + vertical-align: middle; +} +#aframeInspector input, +#aframeInspector textarea, +#aframeInspector select { + background: #222; + border: 1px solid transparent; + color: #888; +} +#aframeInspector select { + background: #393939; +} +#aframeInspector input[type=color] { + background-color: #333; + border: 1px solid #111; + height: 28px; + cursor: pointer; +} +#aframeInspector input[type=color] { + cursor: pointer; + height: 25px; + padding: 0; + width: 50px; +} +#aframeInspector input[type=color]-webkit-color-swatch { + border: 0 /* To remove the gray border. */; +} +#aframeInspector input[type=color]-webkit-color-swatch-wrapper { + padding: 0 /* To remove the inner padding. */; +} +#aframeInspector input[type=color]-moz-color-swatch { + border: 0; +} +#aframeInspector input[type=color]-moz-focus-inner { + border: 0 /* To remove the inner border (specific to Firefox). */; + padding: 0; +} +#aframeInspector .hidden { + visibility: hidden; +} +#aframeInspector a.button { + color: #bcbcbc; + font-size: 16px; + margin-left: 10px; + text-decoration: none; +} +#aframeInspector a.button:hover { + color: #1faaf2; +} +#aframeInspector .hide { + display: none; +} +#aframeInspector .a-canvas.state-dragging { + cursor: grabbing; +} +#aframeInspector #rightPanel { + align-items: stretch; + display: flex; + justify-content: flex-end; +} +#aframeInspector #inspectorContainer { + display: flex; + justify-content: space-between; + left: 0; + height: 100%; + pointer-events: none; + position: fixed; + top: 0; + width: 100%; + z-index: 999999; +} +#aframeInspector #scenegraph, +#aframeInspector #viewportBar, +#aframeInspector #rightPanel { + pointer-events: all; +} +#aframeInspector .aframe-inspector-opened a-scene .a-canvas { + background-color: #191919; + z-index: 9998; +} +#aframeInspector .toggle-sidebar { + align-items: center; + display: flex; + height: 100%; + position: absolute; + z-index: 9998; +} +#aframeInspector .toggle-sidebar a { + background-color: #262626; + color: #bcbcbc; + padding: 5px; + z-index: 9998; +} +#aframeInspector .toggle-sidebar a.hover { + background-color: #1faaf2; + color: #fff; +} +#aframeInspector .toggle-sidebar.left { + top: 0; + left: 0; +} +#aframeInspector .toggle-sidebar.right { + top: 0; + right: 0; +} +@keyframes animateopacity { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +`, + '', + { + version: 3, + sources: [ + 'webpack://./src/style/lib.styl', + 'webpack://./src/style/index.styl', + 'webpack://./src/style/scenegraph.styl', + 'webpack://./src/style/components.styl', + 'webpack://./src/style/entity.styl', + 'webpack://./src/style/help.styl', + 'webpack://./src/style/select.styl', + 'webpack://./src/style/textureModal.styl', + 'webpack://./src/style/viewport.styl', + 'webpack://./src/style/widgets.styl' + ], + names: [], + mappings: + 'AA8BA;;EACE,iBAAU;EACV,uBAAY;AC5Bd;AD+BA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;AC7BlB;AARA;;EAEE,wFAA8B;AAUhC;AARA;;EAEE,wFAA8B;AAUhC;AARA;EACE,mBAAW;EACX,WAAM;EACN,eAAU;EACV,SAAO;EACP,gBAAS;AAUX;ADKA;;EACE,iBAAU;EACV,uBAAY;ACFd;ADKA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;ACHlB;AClCA;EACE,yBAAiB;ADoCnB;AClCE;EACE,gBAAQ;EACR,aAAQ;EACR,qBAAY;ADoChB;AClCI;EACE,WAAM;EACN,eAAO;ADoCb;AClCI;EACE,YAAU;EACV,mBAAc;EACd,iBAAW;ADoCjB;AClCA;EACE,mBAAW;EACX,0BAAW;EACX,aAAQ;EACR,sBAAe;EACf,cAAS;EACT,iBAAY;EACZ,YAAM;ADoCR;AClCE;EACE,mBAAW;EACX,eAAO;EACP,aAAQ;EACR,8BAAgB;EAChB,YAAQ;EACR,WAAM;EACN,mBAAY;ADoChB;AClCI;EACE,mBAAW;ADoCjB;AClCI;EACE,yBAAiB;EACjB,WAAM;ADoCZ;ACnCM;EACE,cAAM;ADqCd;ACpCM;EACE,eAAQ;ADsChB;AClCQ;;;;EAIE,WAAM;ADoChB;ACjCQ;;;;EAIE,cAAM;ADmChB;ACjCE;EACE,cAAM;ADmCV;ACjCE;EACE,gBAAY;ADmChB;ACjCE;EACE,aAAQ;EACR,cAAO;ADmCX;ACjCI;EACE,WAAM;EACN,eAAU;EACV,gBAAY;ADmClB;ACjCE;EACE,WAAM;ADmCV;ACjCE;;EAEE,cAAM;ADmCV;ACjCE;EACE,cAAM;ADmCV;ACjCE;EACE,WAAM;ADmCV;ACjCE;EACE,WAAM;ADmCV;ACjCE;EACE,WAAM;EACN,qBAAQ;EACR,kBAAW;EACX,WAAM;ADmCV;ACjCE;EACE,WAAM;ADmCV;ACjCE;EACE,WAAM;ADmCV;ACjCE;EACE,YAAQ;EACR,eAAU;EACV,kBAAS;ADmCb;ACjCI;EACE,cAAM;EACN,mBAAW;EACX,kBAAc;EACd,YAAO;EACP,iBAAY;EACZ,YAAM;ADmCZ;ACjCI;;EACE,kBAAS;EACT,WAAM;EACN,SAAI;ADoCV;AClCE;EACE,mBAAW;EACX,cAAM;EACN,eAAO;EACP,cAAK;EACL,eAAU;EACV,yBAAO;EACP,mBAAY;EACZ,aAAQ;EACR,gBAAW;EACX,UAAQ;EACR,YAAM;ADoCV;AClCA;EACE,yBAAiB;EACjB,0BAAW;EACX,UAAO;EACP,YAAO;EACP,OAAK;EACL,YAAQ;ADoCV;AClCE;EACE,YAAM;EACN,YAAO;ADoCX;ADzJA;;EACE,iBAAU;EACV,uBAAY;AC4Jd;ADzJA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;AC2JlB;AE1LA;EACE,yBAAiB;EACjB,cAAM;EACN,YAAO;EACP,cAAS;EACT,eAAS;EACT,YAAM;AF4LR;AE1LA;;;EAGE,eAAQ;AF4LV;AE1LA;;EAEE,WAAM;AF4LR;AE1LA;EACE,WAAM;AF4LR;AE1LA;EACE,mBAAY;EACZ,aAAQ;EACR,8BAAgB;AF4LlB;AE3LE;EACE,WAAM;AF6LV;AE3LA;EACE,cAAQ;AF6LV;AE3LA;EACE,gBAAU;EACV,gBAAS;EACT,uBAAc;EACd,yBAAe;EACf,mBAAY;EACZ,WAAM;EACN,gBAAY;EACZ,iCAAe;AF6LjB;AE3LA;EACE,gBAAW;EACX,gCAAc;EACd,uBAAW;EACX,eAAO;EACP,YAAO;EACP,2BAAQ;EACR,sBAAe;EACf,eAAU;AF6LZ;AE5LE;EACE,mBAAW;AF8Lf;AEnLA;EACE,iBAAW;AFqLb;AEnLA;EACE,WAAM;EACN,gBAAQ;EACR,eAAU;EACV,YAAQ;EACR,iBAAW;AFqLb;AEnLA;EACE,SAAO;AFqLT;AEnLA;EACE,6BAAO;EACP,WAAM;EACN,SAAO;EACP,kBAAa;EACb,gBAAY;EACZ,QAAM;AFqLR;AEnLA;EACE,0BAAkB;EAClB,eAAW;AFqLb;AEnLA;EACE,yBAAiB;EACjB,eAAW;AFqLb;AEnLA;EACE,mBAAY;EACZ,aAAQ;EACR,eAAU;EACV,gBAAW;EACX,iBAAQ;AFqLV;AEnLE;EACE,eAAO;EACP,qBAAQ;EACR,gBAAS;EACT,mBAAc;EACd,uBAAc;EACd,sBAAe;EACf,YAAM;AFqLV;AEnLE;EACE,iBAAO;EACP,WAAM;AFqLV;AEnLE;EACE,eAAU;EACV,YAAO;AFqLX;AEnLE;;EAEE,iBAAY;AFqLhB;AEnLE;EACE,YAAO;AFqLX;AEnLE;;;;EAIE,mBAAW;EACX,cAAM;EACN,gBAAW;EACX,mBAAe;EACf,iBAAa;EACb,kBAAc;EACd,gBAAY;AFqLhB;AEpLI;;;;EACE,gBAAc;AFyLpB;AEvLE;EACE,iBAAa;EACb,sBAAW;EACX,YAAM;AFyLV;AEvLE;;EAEE,gBAAW;AFyLf;AEvLE;EACE,iBAAO;EACP,WAAM;EACN,mBAAe;AFyLnB;AEvLA;EACE,cAAM;EACN,gBAAY;AFyLd;AEvLA;EACE,sBAAe;AFyLjB;AEvLA;EACE,WAAM;EACN,sBAAM;EACN,iBAAY;EACZ,8BAAe;AFyLjB;AEvLA;EACE,YAAQ;AFyLV;AEvLA;EACE,UAAQ;AFyLV;AEvLA;EACE,mBAAY;EACZ,aAAQ;EACR,sBAAe;EACf,uBAAgB;EAChB,kBAAQ;EACR,mBAAW;AFyLb;AEvLE;EACE,gBAAW;EACX,YAAM;AFyLV;AExLI;EACE,mBAAW;EACX,YAAO;EACP,cAAM;AF0LZ;AEzLI;EACE,aAAQ;EACR,8BAAgB;AF2LtB;AE1LM;EACE,cAAM;AF4Ld;AE1LE;EACE,eAAU;EACV,oBAAO;AF4LX;AE1LE;EACE,gBAAW;AF4Lf;AE1LA;EACE,WAAM;AF4LR;AE1LA;EACE,mBAAY;EACZ,aAAQ;AF4LV;AEzLE;EACE,WAAO;EACP,kBAAS;AF2Lb;AE1LE;EACE,aAAQ;AF4LZ;AE3LE;EACE,YAAO;AF6LX;AE5LE;EACE,eAAU;EACV,iBAAa;AF8LjB;AE7LE;EACE,gBAAU;EACV,MAAI;AF+LR;AE9LE;EACE,cAAM;AFgMV;AE9LA;EACE,YAAM;AFgMR;AE9LA;EACE,aAAQ;AFgMV;AE/LE;EACE,cAAY;EACZ,YAAM;AFiMV;AE/LA;EACE,MAAI;AFiMN;ADjZA;;EACE,iBAAU;EACV,uBAAY;ACoZd;ADjZA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;ACmZlB;AGxbA;EACE,mGAAY;EACZ,mBAAY;AH0bd;AGxbA;EACE,qBAAQ;EACR,gBAAS;EACT,kBAAS;EACT,uBAAc;EACd,QAAI;EACJ,mBAAY;AH0bd;AGxbA;EACE,cAAM;AH0bR;AGxbA;EACE,cAAM;AH0bR;AGxbA;EACE,cAAM;AH0bR;AI/cA;EACE,aAAQ;EACR,6BAAgB;AJidlB;AI/cA;EACE,gBAAW;EACX,SAAO;EACP,iBAAQ;EACR,YAAM;AJidR;AI/cA;EACE,kBAAa;AJidf;AI/cA;EACE,gBAAY;EACZ,iBAAa;EACb,cAAQ;AJidV;AI/cA;EACE,WAAO;EACP,iBAAa;EACb,eAAU;EACV,kBAAS;AJidX;AI/cA;EACE,yBAAiB;EACjB,2BAAkB;EAClB,sBAAO;EACP,kBAAc;EACd,wBAAW;EACX,WAAM;EACN,qBAAQ;EACR,eAAU;EACV,cAAQ;EACR,kBAAW;AJidb;AI/cA;EACE,WAAM;EACN,qBAAQ;EACR,gBAAY;AJidd;AD1dA;;EACE,iBAAU;EACV,uBAAY;AC6dd;AD1dA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;AC4dlB;AKjgBA;EACE,SAAO;EACP,gBAAc;EACd,eAAO;EACP,gBAAW;EACX,mGAAY;EACZ,eAAU;ALmgBZ;AKjgBA;EACE,YAAO;ALmgBT;AKjgBA;EACE,aAAQ;ALmgBV;AKjgBA;EACE,2BAAW;ALmgBb;AKjgBA;;EAEE,mBAAW;ALmgBb;AKjgBA;EACE,iBAAQ;ALmgBV;AKjgBA;;EAEE,cAAM;ALmgBR;AKjgBA;EACE,cAAM;ALmgBR;AKjgBA;EACE,2BAAW;ALmgBb;AKjgBA;EACE,eAAO;ALmgBT;AKjgBA;EACE,aAAQ;ALmgBV;AKjgBA;EACE,eAAU;ALmgBZ;AKjgBA;EACE,mBAAW;ALmgBb;AKjgBA;EACE,YAAO;EACP,gBAAS;ALmgBX;AKlgBE;EACE,YAAO;EACP,YAAQ;ALogBZ;AKlgBA;EACE,gBAAQ;ALogBV;AKlgBA;EACE,mBAAW;EACX,cAAM;ALogBR;AKlgBA;EACE,cAAM;ALogBR;AKlgBA;EACE,aAAQ;ALogBV;AKlgBA;EACE,WAAM;EACN,mBAAW;ALogBb;AM1kBA;EACE,uCAAU;EACV,sBAAiB;EACjB,iCAAiB;EACjB,aAAQ;EACR,YAAO;EACP,OAAK;EACL,cAAS;EACT,eAAS;EACT,MAAI;EACJ,WAAM;EACN,mBAAQ;AN4kBV;AM1kBA;EACE,eAAU;EACV,gBAAY;EACZ,eAAO;AN4kBT;AM1kBA;EACE,yBAAO;EACP,wBAAM;AN4kBR;AM1kBA;EACE,mCAAU;EACV,wBAAmB;EACnB,0BAAe;EACf,yBAAiB;EACjB,qEAAyC;EACzC,YAAO;EACP,gBAAS;EACT,UAAQ;AN4kBV;AM1kBA;EACE,WAAM;EACN,YAAM;EACN,eAAU;EACV,iBAAY;AN4kBd;AM1kBA;;EAEE,WAAM;EACN,eAAO;EACP,qBAAgB;AN4kBlB;AM1kBA;EACE,WAAM;EACN,iBAAQ;AN4kBV;AM1kBA;EACE,cAAS;EACT,aAAQ;AN4kBV;AM1kBA;EACE,WAAM;EACN,iBAAQ;AN4kBV;AMzkBA;EACE,mBAAW;EACX,aAAQ;EACR,eAAU;EACV,mBAAO;EACP,cAAS;EACT,qBAAQ;AN2kBV;AMzkBA;EACE,aAAQ;AN2kBV;AMzkBA;EACE,kBAAc;EACd,mCAAW;EACX,eAAO;EACP,WAAO;EACP,gBAAS;EACT,YAAM;AN2kBR;AMzkBA;;EAEE,6BAAW;AN2kBb;AMzkBA;EACE,yBAAiB;EACjB,SAAO;EACP,gBAAW;EACX,iBAAQ;AN2kBV;AMzkBA;EACE,aAAQ;EACR,YAAM;AN2kBR;AMzkBA;EACE,cAAQ;EACR,aAAO;EACP,YAAM;AN2kBR;AMzkBA;EACE,YAAM;AN2kBR;AMzkBA;EACE,WAAM;EACN,qBAAQ;EACR,gBAAU;EACV,gBAAS;EACT,uBAAc;EACd,mBAAY;AN2kBd;AMzkBA;;EAEE,sBAAiB;AN2kBnB;AMzkBA;EACE,WAAM;EACN,cAAQ;EACR,eAAW;EACX,gBAAS;EACT,uBAAc;EACd,mBAAY;EACZ,YAAM;AN2kBR;AMzkBA;;EAEE,WAAM;AN2kBR;AMzkBA;EACE,sBAAM;AN2kBR;AMzkBA;EACE,wBAAW;KAAX,qBAAW;UAAX,gBAAW;EACX,gBAAc;EACd,gBAAW;EACX,eAAO;EACP,qBAAQ;EACR,eAAU;EACV,gBAAY;EACZ,kBAAO;EACP,iBAAQ;AN2kBV;AMzkBA;EACE,aAAQ;AN2kBV;AMzkBA;EACE,yBAAiB;EACjB,YAAO;EACP,WAAM;AN2kBR;AMzkBA;;EAEE,yBAAiB;EACjB,6BAAY;AN2kBd;AMzkBA;;EAEE,yBAAiB;EACjB,6BAAY;AN2kBd;AMzkBA;EACE,sBAAiB;EACjB,YAAO;AN2kBT;AMzkBA;EACE,yBAAiB;EACjB,cAAM;EACN,aAAQ;EACR,eAAU;EACV,8BAAgB;EAChB,gBAAW;EACX,cAAS;EACT,aAAQ;AN2kBV;AMzkBA;EACE,cAAM;EACN,gBAAQ;AN2kBV;AMzkBA;EACE,gBAAY;AN2kBd;AMzkBA;EACE,kBAAc;AN2kBhB;AMzkBA;EACE,aAAQ;AN2kBV;AMzkBA;EACE,kBAAS;EACT,gBAAW;EACX,YAAM;AN2kBR;AMzkBA;EACE,kBAAS;EACT,UAAM;EACN,QAAI;AN2kBN;AMzkBA;EACE,YAAO;AN2kBT;AMzkBA;EACE,iBAAY;EACZ,YAAQ;AN2kBV;AMzkBA;EACE,eAAQ;AN2kBV;AMzkBA;EACE,gBAAY;EACZ,YAAM;AN2kBR;AMzkBA;EACE,sBAAO;EACP,eAAO;AN2kBT;AD7vBA;;EACE,iBAAU;EACV,uBAAY;ACgwBd;AD7vBA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;AC+vBlB;AOpyBA;EACE,mBAAY;EACZ,yBAAiB;EACjB,cAAM;EACN,aAAQ;EACR,YAAU;EACV,YAAO;EACP,eAAU;EACV,8BAAgB;EAChB,OAAK;EACL,cAAO;EACP,QAAM;EACN,MAAI;APsyBN;AOpyBA;EACE,aAAQ;EACR,mBAAY;EACZ,QAAI;APsyBN;AOpyBE;EACE,yBAAY;EACZ,sBAAe;APsyBnB;AOnyBI;EACE,YAAQ;APqyBd;AOnyBI;EACE,sBAAiB;APqyBvB;AOnyBE;EACE,yBAAiB;EACjB,WAAM;APqyBV;AOnyBE;EACE,sBAAM;APqyBV;AOnyBA;EACE,kBAAa;EACb,mBAAc;APqyBhB;AOnyBA;EACE,WAAM;EACN,iBAAa;APqyBf;AOnyBA;EACE,cAAY;APqyBd;AOnyBA;EACE,eAAO;EACP,YAAM;APqyBR;AOpyBE;EACE,iBAAa;EACb,kBAAc;APsyBlB;AOpyBA;EACE,gBAAY;EACZ,mBAAY;EACZ,aAAQ;APsyBV;AOryBE;EACE,kBAAa;APuyBjB;AOtyBE;EACE,gBAAW;APwyBf;AOvyBE;EACE,cAAM;APyyBV;AOxyBI;EACE,cAAM;AP0yBZ;AOxyBA;EACE,aAAQ;AP0yBV;ADz1B2B;EAAA;IQiDvB,cAAQ;EP4yBV;AACF;ADx1BA;;EACE,iBAAU;EACV,uBAAY;AC21Bd;ADx1BA;EACE,qBAAS;EACT,WAAQ;EACR,iBAAU;EACV,wBAAgB;AC01BlB;AQ/3BA;EACE,iCAAiB;EACjB,YAAO;EACP,gBAAc;EACd,cAAM;EACN,uBAAY;ARi4Bd;AQ/3BA;EACE,YAAO;ARi4BT;AQ/3BA;EACE,oCAAiB;EACjB,cAAM;ARi4BR;AQ/3BA;EACE,iCAAiB;ARi4BnB;AQ/3BA;EACE,qBAAQ;EACR,YAAM;ARi4BR;AQ/3BA;;EAEE,yBAAM;ARi4BR;AQ/3BA;EACE,yBAAM;ARi4BR;AQ93BA;EACE,YAAO;EACP,cAAM;EACN,eAAO;ARg4BT;AQ93BA;EACE,qBAAQ;EACR,kBAAS;ARg4BX;AQ93BA;EACE,yBAAiB;EACjB,wCAAW;EACX,aAAQ;EACR,SAAK;EACL,eAAU;EACV,kBAAS;EACT,YAAQ;ARg4BV;AQ93BA;EACE,yBAAiB;EACjB,cAAM;EACN,cAAQ;EACR,kBAAQ;EACR,qBAAgB;ARg4BlB;AQ93BA;EACE,yBAAiB;EACjB,cAAM;ARg4BR;AQ93BA;EACE,cAAQ;ARg4BV;AQ93BA;EACE,cAAM;ARg4BR;AAr6BE;;;;;;EAME,mGAAY;EACZ,eAAU;AAu6Bd;AAr6BE;;;;;;EAME,+EAAuB;AAu6B3B;AAr6BE;EACE,SAAO;EACP,0BAAW;AAu6Bf;AAr6BE;EACE,eAAO;AAu6BX;AAr6BE;EACE,kBAAS;AAu6Bb;AAr6BE;EACE,+IAAoB;AAu6BxB;AAr6BE;EACE,gBAAS;IAAT,cAAS;OAAT,WAAS;EACT,gBAAY;EACZ,iBAAU;AAu6Bd;AAr6BE;EACE,6BAAa;AAu6BjB;AAr6BE;EACE,oCAAiB;EACjB,6BAAa;AAu6BjB;AAr6BE;;EAEE,uBAAQ;AAu6BZ;AAr6BE;EACE,uBAAW;EACX,eAAQ;EACR,YAAO;EACP,SAAK;EACL,cAAQ;EACR,kBAAS;EACT,QAAI;EACJ,wBAAe;EACf,WAAM;AAu6BV;AAr6BE;;EAEE,aAAQ;AAu6BZ;AAr6BE;;;EAGI,eAAO;EACP,yBAAY;KAAZ,sBAAY;UAAZ,iBAAY;AAu6BlB;AAr6BE;EACE,yBAAiB;EACjB,uBAAW;EACX,cAAM;EACN,eAAU;EACV,SAAK;EACL,mBAAY;EACZ,SAAO;EACP,iBAAQ;EACR,eAAS;EACT,kBAAW;EACX,qBAAgB;EAChB,QAAI;EACJ,YAAM;EACN,kBAAQ;AAu6BZ;AAr6BE;EACE,yBAAiB;AAu6BrB;AAr6BE;EACE,6BAAiB;EACjB,sBAAO;EACP,WAAM;AAu6BV;AAr6BE;;EAEE,oGAA4C;AAu6BhD;AAr6BE;;;;EAIE,gBAAW;EACX,aAAQ;AAu6BZ;AAr6BE;EACE,wBAAW;KAAX,qBAAW;UAAX,gBAAW;EACX,eAAO;EACP,SAAO;EACP,YAAO;EACP,WAAM;AAu6BV;AAr6BE;EACE,gBAAW;AAu6Bf;AAr6BE;EACE,wCAAiB;EACjB,SAAO;EACP,yBAAM;EACN,kBAAO;EACP,eAAU;EACV,YAAQ;AAu6BZ;AAr6BE;;EAEE,yBAAO;EACP,WAAM;EACN,YAAO;AAu6BX;AAr6BE;EACE,sBAAO;AAu6BX;AAr6BE;EACE,mBAAW;EACX,YAAM;AAu6BV;AAr6BE;EACE,sBAAe;AAu6BnB;AAr6BE;;;EAGE,gBAAW;EACX,6BAAO;EACP,WAAM;AAu6BV;AAr6BE;EACE,mBAAW;AAu6Bf;AAr6BE;EACE,sBAAiB;EACjB,sBAAO;EACP,YAAO;EACP,eAAO;AAu6BX;AAr6BE;EACE,eAAO;EACP,YAAO;EACP,UAAQ;EACR,WAAM;AAu6BV;AAp6BE;EACE,0CAAO;AAs6BX;AAp6BE;EACE,6CAAQ;AAs6BZ;AAp6BE;EACE,SAAO;AAs6BX;AAp6BE;EACE,iEAAO;EACP,UAAQ;AAs6BZ;AAp6BE;EACE,kBAAW;AAs6Bf;AAp6BE;EACE,cAAM;EACN,eAAU;EACV,iBAAY;EACZ,qBAAgB;AAs6BpB;AAp6BI;EACE,cAAM;AAs6BZ;AAh6BE;EACE,aAAQ;AAk6BZ;AAh6BE;EACE,gBAAO;AAk6BX;AAh6BE;EACE,oBAAY;EACZ,aAAQ;EACR,yBAAgB;AAk6BpB;AAh6BE;EACE,aAAQ;EACR,8BAAgB;EAChB,OAAK;EACL,YAAO;EACP,oBAAe;EACf,eAAS;EACT,MAAI;EACJ,WAAM;EACN,eAAQ;AAk6BZ;AAh6BE;;;EAGE,mBAAe;AAk6BnB;AAh6BE;EACE,yBAAiB;EACjB,aAAQ;AAk6BZ;AAh6BE;EACE,mBAAY;EACZ,aAAQ;EACR,YAAO;EACP,kBAAS;EACT,aAAQ;AAk6BZ;AAh6BI;EACE,yBAAiB;EACjB,cAAM;EACN,YAAQ;EACR,aAAQ;AAk6Bd;AAh6BI;EACE,yBAAiB;EACjB,WAAM;AAk6BZ;AAh6BE;EACE,MAAI;EACJ,OAAK;AAk6BT;AAh6BE;EACE,MAAI;EACJ,QAAM;AAk6BV;AA59BE;EACE;IAAO,UAAS;EAu/BlB;EAt/BE;IAAK,UAAS;EAy/BhB;AACF', + sourcesContent: [ + '$primary=#1faaf2\n$primaryhover=lighten(#1faaf2, 35%)\n\n$bg=#242424\n$bgdark=#1d1d1d\n$bglight=#333\n$bglighter=#393939\n\n$red=#92374d\n$green=#514b23\n$orange=#d66853\n\n$black=#222\n$gray=#262626\n$grayalt=#323232\n$grayhover=#444\n\n$lightgray=#AAA\n$white=#c3c3c3\n\n$normalfont=system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif\n$monospace=system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif\n\nmedia--1024() {\n @media (min-width: 1024px) {\n {block}\n }\n}\n\n/* CSS rules from the original FontAwesomeIcon component */\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}', + "@import './lib';\n\nbody.aframe-inspector-opened,\n.toggle-edit\n font-family BlinkMacSystemFont, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif\n\n.wf-roboto-n4-active body.aframe-inspector-opened,\n.wf-roboto-n4-active .toggle-edit\n font-family BlinkMacSystemFont, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif\n\nbody.aframe-inspector-opened\n background $bgdark\n color #fff\n font-size 12px\n margin 0\n overflow hidden\n\n#aframeInspector\n @import './scenegraph';\n @import './components';\n @import './entity';\n @import './help';\n @import './select';\n @import './textureModal';\n @import './viewport';\n @import './widgets';\n\n .Select,\n code,\n pre,\n input,\n textarea,\n select\n font-family $monospace\n font-size 13px\n\n .wf-robotomono-n4-active .Select,\n .wf-robotomono-n4-active code,\n .wf-robotomono-n4-active pre,\n .wf-robotomono-n4-active input,\n .wf-robotomono-n4-active textarea,\n .wf-robotomono-n4-active select\n font-family Roboto Mono, Consolas, Andale Mono, Monaco, Courier New, monospace\n\n hr\n border 0\n border-top 1px solid #ccc\n\n a\n cursor pointer\n\n button\n position relative\n\n code\n font-family Consolas, Andale Mono, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace\n\n textarea\n tab-size 4\n white-space pre\n word-wrap normal\n\n textarea.success\n border-color #8b8 !important\n\n textarea.fail\n background-color rgba(255, 0, 0, 0.05)\n border-color #f00 !important\n\n textarea,\n input\n outline none /* osx */\n\n .gltfIcon img\n box-sizing content-box\n display inline\n height 20px\n left 5px\n padding 0 5px\n position relative\n top 4px\n vertical-align baseline\n width 20px\n\n #scenegraph,\n #rightPanel\n z-index 9998\n\n #sidebar,\n #scenegraph,\n .panel\n cursor default\n user-select none\n\n .toggle-edit\n background-color $red\n box-sizing content-box\n color #FAFAFA\n font-size 13px\n left 3px\n line-height normal\n margin 0\n padding 6px 10px\n position fixed\n text-align center\n text-decoration none\n top 3px\n width 204px\n z-index 999999999\n\n .toggle-edithover\n background-color rgb(228, 43, 90)\n\n input\n background-color transparent\n border 1px solid #555\n color #fff\n\n input,\n .texture canvas\n transition 0.1s background-color ease-in-out, 0.1s border-color ease-in-out, 0.1s color ease-in-out\n\n input[type=text],\n input[type=number],\n input.string,\n input.number\n min-height 14px\n outline none\n\n input[type=\"checkbox\"]\n appearance auto\n cursor pointer\n margin 0\n height 18px\n width 18px\n\n input[type=\"checkbox\"]:focus\n box-shadow none\n\n input.number\n background-color transparent !important\n border 0\n color #2cb7ff !important\n cursor col-resize\n font-size 13px\n padding 2px\n\n input.stringfocus,\n input.numberfocus\n border 1px solid #20b1fb\n color #fff\n cursor auto\n\n input.error\n border 1px solid #a00\n\n #sidebar\n background $bg\n width 331px\n\n #sidebar *\n vertical-align middle\n\n input,\n textarea,\n select\n background $black\n border 1px solid transparent\n color #888\n\n select\n background $bglighter\n\n input[type=color]\n background-color #333\n border 1px solid #111\n height 28px\n cursor pointer\n\n input[type=color]\n cursor pointer\n height 25px\n padding 0\n width 50px\n\n /* Note these vendor-prefixed selectors cannot be grouped! */\n input[type=color]-webkit-color-swatch\n border 0 /* To remove the gray border. */\n\n input[type=color]-webkit-color-swatch-wrapper\n padding 0 /* To remove the inner padding. */\n\n input[type=color]-moz-color-swatch\n border 0\n\n input[type=color]-moz-focus-inner\n border 0 /* To remove the inner border (specific to Firefox). */\n padding 0\n\n .hidden\n visibility hidden\n\n a.button\n color #bcbcbc\n font-size 16px\n margin-left 10px\n text-decoration none\n\n &:hover\n color $primary\n\n @keyframes animateopacity\n from { opacity: 0 }\n to { opacity: 1 }\n\n .hide\n display none\n\n .a-canvas.state-dragging\n cursor grabbing\n\n #rightPanel\n align-items stretch\n display flex\n justify-content flex-end\n\n #inspectorContainer\n display flex\n justify-content space-between\n left 0\n height 100%\n pointer-events none\n position fixed\n top 0\n width 100%\n z-index 999999\n\n #scenegraph,\n #viewportBar,\n #rightPanel\n pointer-events all\n\n .aframe-inspector-opened a-scene .a-canvas\n background-color #191919\n z-index 9998\n\n .toggle-sidebar\n align-items center\n display flex\n height 100%\n position absolute\n z-index 9998\n\n a\n background-color #262626\n color #bcbcbc\n padding 5px\n z-index 9998\n\n a.hover\n background-color #1faaf2\n color #fff\n\n .toggle-sidebar.left\n top 0\n left 0\n\n .toggle-sidebar.right\n top 0\n right 0\n", + "@import './lib';\n\n#toolbar\n background-color $bg\n\n .toolbarActions\n padding 0 0 5px\n display flex\n align-items baseline\n\n a.disabled\n color #666\n cursor default\n\n .helpButtonContainer\n flex-grow 1\n padding-right 10px\n text-align right\n\n#scenegraph\n background $bg\n border-top 1px solid #111\n display flex\n flex-direction column\n overflow auto\n padding-top 32px\n width 230px\n\n .entity\n background $bg\n cursor pointer\n display flex\n justify-content space-between\n padding 3px\n width 100%\n white-space nowrap\n\n &:hover\n background #1d2f39\n\n &.active\n background-color #155373\n color #fff\n .component:hover\n color #1888c1\n .entityActions\n display inline\n\n &.novisible\n &.active\n span,\n svg,\n .collapsespace,\n .id\n color #999\n\n &:not(.active)\n span,\n svg,\n .collapsespace,\n .id\n color #626262\n\n .component:hover\n color #1faaf2\n\n .entityIcons\n margin-left 2px\n\n .entityActions\n display none\n margin 0 14px\n\n .button\n color #fff\n font-size 12px\n margin-left 6px\n\n svg\n color #CCC\n\n .toolbarActions svg:hover,\n .entityActions svg:hover\n color $primary\n\n .active svg\n color #FAFAFA\n\n .id\n color #ccc\n\n .option.active .id\n color #fff\n\n .collapsespace\n color #eee\n display inline-block\n text-align center\n width 14px\n\n .fa-eye\n color #bbb\n\n .icons a.button\n color #fff\n\n .search\n padding 5px\n font-size 16px\n position relative\n\n input\n color $white\n background $bgdark\n border-radius 5px\n height 22px\n text-indent 10px\n width 216px\n\n >svg, a.button\n position absolute\n right 14px\n top 10px\n\n .outliner\n background $bg\n color $white\n cursor default\n flex 1 1 auto\n font-size 13px\n height calc(100% - 98px)\n line-height normal\n outline none\n overflow-y auto\n padding 0\n width 230px\n\n.scenegraph-bottom\n background-color #323232\n border-top 1px solid #111\n bottom 10\n height 40px\n left 0\n z-index 100\n\n a\n float right\n margin 10px\n", + "@import './lib';\n\npropertyRowDefined() {\n .propertyRowDefined {\n {block}\n }\n}\n\n.components\n background-color $bg\n color $white\n height 100%\n overflow auto\n position fixed\n width 331px\n\ndiv.vec2,\ndiv.vec3,\ndiv.vec4\n display inline\n\n.vec2 input.number,\n.vec3 input.number\n width 40px\n\n.vec4 input.number\n width 34px\n\n.collapsible-header\n align-items center\n display flex\n justify-content space-between\n .entityPrint\n color #fff\n\n.collapsible-content\n padding 5px 0\n\n.componentTitle span\n max-width 200px\n overflow hidden\n text-overflow ellipsis\n text-transform uppercase\n white-space nowrap\n color #fff\n font-weight 600\n vertical-align bottom !important\n\n.collapsible .static\n background $bglight\n border-bottom 2px solid $bg\n box-sizing content-box\n cursor pointer\n height 16px\n padding 8px 10px 12px 10px\n vertical-align bottom\n font-size 13px\n &:hover\n background $bglighter\n/*\n.collapsible\n &.collapsed\n background-color $grayalt\n .static,\n .componentHeaderActions\n color #dedede\n &:hover\n background-color $grayhover\n*/\n.collapsible .menu\n text-align right\n\n.collapsible .menuafter\n color #bbb\n content '\\2807'\n font-size 12px\n padding 5px\n text-align right\n\n.collapsible .static\n margin 0\n\n.collapsible .static .collapse-button\n border 6px solid transparent\n float left\n height 0\n margin-right 10px\n margin-left 2px\n width 0\n\n.collapsible.collapsed .static .collapse-button\n border-left-color $white\n margin-top 4px\n\n.collapsible:not(.collapsed) .static .collapse-button\n border-top-color $white\n margin-top 7px\n\n.propertyRow\n align-items center\n display flex\n font-size 13px\n min-height 30px\n padding 2px 15px\n\n .text\n cursor default\n display inline-block\n overflow hidden\n padding-right 10px\n text-overflow ellipsis\n vertical-align middle\n width 118px\n\n .map_value\n margin 0 0 0 5px\n width 68px\n\n .Select-control\n font-size 11px\n height 24px\n\n .Select-placeholder,\n .Select--single > .Select-control .Select-value\n line-height 19px\n\n .Select-input\n height 22px\n\n input[type=text],\n input[type=number],\n input.string,\n input.number\n background $bgdark\n color #1faaf2\n min-height 26px\n padding-bottom 1px\n padding-left 5px\n padding-right 5px\n padding-top 1px\n &:last-child\n padding-right 0\n\n input.string\n padding-left 8px\n box-sizing border-box\n width 165px\n\n input[type=text]:focus,\n input.string:focus\n box-shadow none\n\n .color_value\n margin 0 0 0 5px\n width 68px\n letter-spacing 1px\n\n.propertyRowDefined .text\n color #FAFAFA\n font-weight 500\n\n.components *\n vertical-align middle\n\nspan.subcomponent\n color #999\n float none !important\n margin-left 10px\n vertical-align top !important\n\na.help-link\n opacity 0.4\n\na.help-linkhover\n opacity 1\n\n#addComponentContainer\n align-items center\n display flex\n flex-direction column\n justify-content center\n padding 20px 10px\n background $bgdark\n\n #addComponent\n text-align left\n width 200px\n .select__control\n background #161616\n height 35px\n color $primary\n .option\n display flex\n justify-content space-between\n span\n color $primary\n\n #addComponentHeader\n font-size 15px\n margin 5px 0 10px 0\n\n input[type=text]:focus\n box-shadow none\n\n.Select-menu-outer .is-focused span\n color #fff\n\n.component-title\n align-items center\n display flex\n\n#componentEntityHeader\n .collapsible-header\n bottom 4px\n position relative\n .collapse-button\n display none\n .static\n height 13px\n .entityPrint\n font-size 15px\n padding-left 5px\n .entityName\n max-width 160px\n top 0\n .entityIcons\n color #FAFAFA\n\n#mixinSelect\n width 160px\n\n.propertyRow .texture\n display flex\n input\n margin-left 0\n width 120px\n\n#componentEntityHeader .gltfIcon img\n top 0", + '@import \'./lib\';\n\n.entityPrint\n font-family $normalfont\n line-height 1.15em\n\n.entityName\n display inline-block\n overflow hidden\n position relative\n text-overflow ellipsis\n top 3px\n white-space nowrap\n\n[data-entity-name-type="id"]\n color $red\n\n[data-entity-name-type="class"]\n color $green\n\n[data-entity-name-type="mixin"]\n color $orange\n', + '.help-lists\n display flex\n justify-content space-around\n\n.help-list\n list-style none\n margin 0\n padding 0 0 10px\n width 350px\n\n.help-list li\n margin-right 40px\n\n.help-key-unit\n line-height 1.8\n margin-right 2em\n padding 5px 0\n\n.help-key\n bottom 2px\n margin-right 4px\n min-width 60px\n position relative\n\n.help-key span\n background-color #2e2e2e\n background-repeat repeat-x\n border 1px solid #666\n border-radius 3px\n box-shadow 0 0 5px #000\n color #999\n display inline-block\n font-size 12px\n padding 0 8px\n text-align center\n\n.help-key-def\n color #bbb\n display inline-block\n margin-left 1em\n', + "@import './lib';\n\n.select__control\n border 0\n border-radius 0\n cursor pointer\n min-height 26px\n font-family $monospace\n font-size 13px\n\n.select__indicator\n height 26px\n\n.select__indicator-separator\n display none\n\n.select__input\n min-height auto !important\n\n.select__control,\n.select__menu\n background $bgdark\n\n.select__option\n padding 5px 10px\n\n.select__placeholder,\n.select__menu\n color $white\n\n.select__single-value\n color $primary\n\n.select__control--is-focused\n box-shadow none !important\n\n.select__option\n cursor pointer\n\n.select__clear-indicator\n display none\n\n.select__label\n font-size 11px\n\n.select__option--is-focused\n background #155373\n\n.select__value-container\n height 26px\n position static\n &.select__value-container--is-multi\n height auto\n padding 6px\n\n.select__dropdown-indicator\n padding 3px 8px\n\n.select__multi-value\n background $bg\n color $primary\n\n.select__multi-value__label\n color $primary\n\n.select__value-container--is-multi > :last-child\n display none\n\n.select__multi-value__remove:hover\n color #fff\n background $bg\n", + '.modal\n animation animateopacity 0.2s ease-out\n background-color rgb(0, 0, 0)\n background-color rgba(0, 0, 0, 0.6)\n display flex\n height 100%\n left 0\n overflow auto\n position fixed\n top 0\n width 100%\n z-index 9999999999\n\n.modal h3\n font-size 18px\n font-weight 100\n margin 0.6em 0\n\n#textureModal .modal-content\n height calc(100% - 50px)\n width calc(100% - 50px)\n\n.modal-content\n animation animatetop 0.2s ease-out\n animation-duration 0.2s\n animation-name animatetop\n background-color #232323\n box-shadow 0 4px 8px 0 rgba(0, 0, 0, 0.5), 0 6px 20px 0 rgba(0, 0, 0, 0.5)\n margin auto\n overflow hidden\n padding 0\n\n.close\n color white\n float right\n font-size 28px\n font-weight bold\n\n.close:hover,\n.close:focus\n color #08f\n cursor pointer\n text-decoration none\n\n.modal-header\n color white\n padding 2px 16px\n\n.modal-body\n overflow auto\n padding 16px\n\n.modal-footer\n color white\n padding 2px 16px\n\n/* Gallery */\n.gallery\n background #232323\n display flex\n flex-wrap wrap\n margin 15px auto 0\n overflow auto\n padding 15px 3px 3px\n\n.newimage .gallery\n padding 16px\n\n.gallery li\n border-radius 2px\n box-shadow 0 0 6px rgba(0, 0, 0, 0.6)\n cursor pointer\n margin 8px\n overflow hidden\n width 155px\n\n.gallery li.selected,\n.gallery li:hover\n box-shadow 0 0 0 2px #1eaaf1\n\n.gallery li .detail\n background-color #323232\n margin 0\n min-height 60px\n padding 3px 10px\n\n.preview\n padding 10px\n width 150px\n\n.preview input\n display block\n margin 8px 0\n width 144px\n\n.preview button\n width 155px\n\n.preview .detail .title\n color #fff\n display inline-block\n max-width 155px\n overflow hidden\n text-overflow ellipsis\n white-space nowrap\n\n.gallery li.selected .detail,\n.gallery li:hover .detail\n background-color #444\n\n.gallery li .detail span\n color #777\n display block\n margin-top 4px\n overflow hidden\n text-overflow ellipsis\n white-space nowrap\n width 140px\n\n.gallery li.selected .detail span,\n.gallery li:hover .detail span\n color #888\n\n.gallery li .detail span.title\n color #fff !important\n\n.modal button\n appearance none\n border-radius 0\n box-shadow none\n cursor pointer\n display inline-block\n font-size 12px\n line-height 1.8\n margin 0 10px 0 0\n padding 5px 10px\n\n.modal button:focus\n outline none\n\n.modal button\n background-color #1eaaf1\n border none\n color #fff\n\n.modal button:hover,\n.modal button.hover\n background-color #346392\n text-shadow -1px 1px #27496d\n\n.modal button:active,\n.modal button.active\n background-color #27496d\n text-shadow -1px 1px #193047\n\n.modal button:disabled\n background-color #888\n cursor none\n\n.newimage\n background-color #323232\n color #bcbcbc\n display flex\n font-size 13px\n justify-content space-between\n margin-top 10px\n overflow auto\n padding 10px\n\n.newimage input\n color #1eaaf1\n padding 3px 5px\n\n.texture canvas + input\n margin-left 5px\n\n.texture svg\n padding-right 5px\n\n.uploader-normal-button .hidden\n display none\n\n.assets.search\n position relative\n margin-top 10px\n width 200px\n\n.assets.search svg\n position absolute\n right 0px\n top 5px\n\n.new_asset_options\n margin 10px\n\n.new_asset_options > ul\n margin-left 10px\n padding 5px\n\n.new_asset_options > ul > li\n padding 10px 0\n\n.new_asset_options .imageUrl\n margin-left 5px\n width 350px\n\n.texture canvas\n border 1px solid $bglight\n cursor pointer\n', + "@import './lib';\n\n#viewportBar\n align-items center\n background-color $bg\n color $white\n display flex\n flex-grow 2\n height 32px\n font-size 15px\n justify-content space-between\n left 0\n margin 0 auto\n right 0\n top 0\n\n.toolbarButtons\n display flex\n align-items center\n gap 6px\n\n *\n margin-left 0 !important\n vertical-align middle\n\n a.button\n & svg\n padding 8px\n\n &:not(.active) svg:hover\n background-color $grayhover\n\n .active svg\n background-color $primary\n color #fff\n\n .active:hover svg\n color #fff !important\n\n.local-transform\n padding-left 10px\n padding-right 20px\n\n.local-transform label\n color $lightgray\n padding-left 5px\n\n.local-transform a.button\n padding-top 0\n\n#cameraSelect\n cursor pointer\n width 110px\n .select__dropdown-indicator\n padding-left 3px\n padding-right 3px\n\n#cameraToolbar\n margin-left 5px\n align-items center\n display flex\n a\n margin-right 10px\n .select__control\n background none\n .select__single-value\n color $white\n &:hover\n color $primary\n\n#viewportHud\n display none\n +media--1024()\n display block\n", + "@import './lib';\n\n.Select-control\n background-color #222 !important\n border none\n border-radius 0\n color $primary\n font-family $monosapce\n\n.Select-menu-outer\n border none\n\n.Select-menu-outer .is-focused\n background-color $primary !important\n color $white\n\n.Select-option\n background-color #222 !important\n\n.select-widget\n display inline-block\n width 157px\n\n.Select-placeholder,\n.Select--single > .Select-control .Select-value\n color $primary !important\n\n.Select-value-label\n color $primary !important\n\n/* Dropdown menu */\n.dropbtn\n border none\n color $white\n cursor pointer\n\n.dropdown\n display inline-block\n position relative\n\n.dropdown-content\n background-color #f9f9f9\n box-shadow 0 8px 16px 0 rgba(0, 0, 0, 0.2)\n display none\n left 8px\n min-width 38px\n position absolute\n z-index 999\n\n.dropdown-content a\n background-color #232323\n color #7d7d7d\n display block\n padding 10px 14px\n text-decoration none\n\n.dropdown-content a:hover\n background-color #4ecbff\n color $white\n\n.dropdownhover .dropdown-content\n display block\n\n.dropdownhover .dropbtn\n color $primary\n" + ], + sourceRoot: '' + } + ]); + // Exports + /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = + ___CSS_LOADER_EXPORT___; - var hasOwn = {}.hasOwnProperty; - var nativeCodeString = '[native code]'; + /***/ + }, - function classNames() { - var classes = []; + /***/ './node_modules/css-loader/dist/runtime/api.js': + /*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ + /***/ (module) => { + 'use strict'; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; + /* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ + module.exports = function (cssWithMappingToString) { + var list = []; - var argType = typeof arg; + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = ''; + var needLayer = typeof item[5] !== 'undefined'; + if (item[4]) { + content += '@supports ('.concat(item[4], ') {'); + } + if (item[2]) { + content += '@media '.concat(item[2], ' {'); + } + if (needLayer) { + content += '@layer'.concat( + item[5].length > 0 ? ' '.concat(item[5]) : '', + ' {' + ); + } + content += cssWithMappingToString(item); + if (needLayer) { + content += '}'; + } + if (item[2]) { + content += '}'; + } + if (item[4]) { + content += '}'; + } + return content; + }).join(''); + }; - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - if (arg.length) { - var inner = classNames.apply(null, arg); - if (inner) { - classes.push(inner); - } + // import a list of modules into the list + list.i = function i(modules, media, dedupe, supports, layer) { + if (typeof modules === 'string') { + modules = [[null, modules, undefined]]; + } + var alreadyImportedModules = {}; + if (dedupe) { + for (var k = 0; k < this.length; k++) { + var id = this[k][0]; + if (id != null) { + alreadyImportedModules[id] = true; } - } else if (argType === 'object') { - if ( - arg.toString !== Object.prototype.toString && - !arg.toString.toString().includes('[native code]') - ) { - classes.push(arg.toString()); - continue; + } + } + for (var _k = 0; _k < modules.length; _k++) { + var item = [].concat(modules[_k]); + if (dedupe && alreadyImportedModules[item[0]]) { + continue; + } + if (typeof layer !== 'undefined') { + if (typeof item[5] === 'undefined') { + item[5] = layer; + } else { + item[1] = '@layer' + .concat(item[5].length > 0 ? ' '.concat(item[5]) : '', ' {') + .concat(item[1], '}'); + item[5] = layer; } - - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } + } + if (media) { + if (!item[2]) { + item[2] = media; + } else { + item[1] = '@media ' + .concat(item[2], ' {') + .concat(item[1], '}'); + item[2] = media; + } + } + if (supports) { + if (!item[4]) { + item[4] = ''.concat(supports); + } else { + item[1] = '@supports (' + .concat(item[4], ') {') + .concat(item[1], '}'); + item[4] = supports; } } + list.push(item); } + }; + return list; + }; - return classes.join(' '); - } + /***/ + }, - if (true && module.exports) { - classNames.default = classNames; - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !((__WEBPACK_AMD_DEFINE_ARRAY__ = []), - (__WEBPACK_AMD_DEFINE_RESULT__ = function () { - return classNames; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && - (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { + /***/ './node_modules/css-loader/dist/runtime/sourceMaps.js': + /*!************************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***! + \************************************************************/ + /***/ (module) => { + 'use strict'; + + module.exports = function (item) { + var content = item[1]; + var cssMapping = item[3]; + if (!cssMapping) { + return content; } - })(); + if (typeof btoa === 'function') { + var base64 = btoa( + unescape(encodeURIComponent(JSON.stringify(cssMapping))) + ); + var data = + 'sourceMappingURL=data:application/json;charset=utf-8;base64,'.concat( + base64 + ); + var sourceMapping = '/*# '.concat(data, ' */'); + return [content].concat([sourceMapping]).join('\n'); + } + return [content].join('\n'); + }; /***/ }, - /***/ './node_modules/clipboard/dist/clipboard.js': - /*!**************************************************!*\ - !*** ./node_modules/clipboard/dist/clipboard.js ***! - \**************************************************/ - /***/ function (module) { - /*! - * clipboard.js v2.0.11 - * https://clipboardjs.com/ - * - * Licensed MIT © Zeno Rocha - */ - (function webpackUniversalModuleDefinition(root, factory) { - if (true) module.exports = factory(); - else { - } - })(this, function () { - return /******/ (function () { - // webpackBootstrap - /******/ var __webpack_modules__ = { - /***/ 686: /***/ function ( - __unused_webpack_module, - __webpack_exports__, - __nested_webpack_require_623__ - ) { - 'use strict'; + /***/ './node_modules/events/events.js': + /*!***************************************!*\ + !*** ./node_modules/events/events.js ***! + \***************************************/ + /***/ (module) => { + 'use strict'; + // Copyright Joyent, Inc. and other Node contributors. + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the + // "Software"), to deal in the Software without restriction, including + // without limitation the rights to use, copy, modify, merge, publish, + // distribute, sublicense, and/or sell copies of the Software, and to permit + // persons to whom the Software is furnished to do so, subject to the + // following conditions: + // + // The above copyright notice and this permission notice shall be included + // in all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. - // EXPORTS - __nested_webpack_require_623__.d(__webpack_exports__, { - default: function () { - return /* binding */ clipboard; - } - }); + var R = typeof Reflect === 'object' ? Reflect : null; + var ReflectApply = + R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; - // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js - var tiny_emitter = __nested_webpack_require_623__(279); - var tiny_emitter_default = - /*#__PURE__*/ __nested_webpack_require_623__.n(tiny_emitter); - // EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js - var listen = __nested_webpack_require_623__(370); - var listen_default = - /*#__PURE__*/ __nested_webpack_require_623__.n(listen); - // EXTERNAL MODULE: ./node_modules/select/src/select.js - var src_select = __nested_webpack_require_623__(817); - var select_default = - /*#__PURE__*/ __nested_webpack_require_623__.n(src_select); // CONCATENATED MODULE: ./src/common/command.js - /** - * Executes a given operation type. - * @param {String} type - * @return {Boolean} - */ - function command(type) { - try { - return document.execCommand(type); - } catch (err) { - return false; - } - } // CONCATENATED MODULE: ./src/actions/cut.js - /** - * Cut action wrapper. - * @param {String|HTMLElement} target - * @return {String} - */ + var ReflectOwnKeys; + if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target).concat( + Object.getOwnPropertySymbols(target) + ); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; + } - var ClipboardActionCut = function ClipboardActionCut(target) { - var selectedText = select_default()(target); - command('cut'); - return selectedText; - }; + function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); + } - /* harmony default export */ var actions_cut = - ClipboardActionCut; // CONCATENATED MODULE: ./src/common/create-fake-element.js - /** - * Creates a fake textarea element with a value. - * @param {String} value - * @return {HTMLElement} - */ - function createFakeElement(value) { - var isRTL = - document.documentElement.getAttribute('dir') === 'rtl'; - var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS - - fakeElement.style.fontSize = '12pt'; // Reset box model - - fakeElement.style.border = '0'; - fakeElement.style.padding = '0'; - fakeElement.style.margin = '0'; // Move element out of screen horizontally - - fakeElement.style.position = 'absolute'; - fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically - - var yPosition = - window.pageYOffset || document.documentElement.scrollTop; - fakeElement.style.top = ''.concat(yPosition, 'px'); - fakeElement.setAttribute('readonly', ''); - fakeElement.value = value; - return fakeElement; - } // CONCATENATED MODULE: ./src/actions/copy.js - /** - * Create fake copy action wrapper using a fake element. - * @param {String} target - * @param {Object} options - * @return {String} - */ + var NumberIsNaN = + Number.isNaN || + function NumberIsNaN(value) { + return value !== value; + }; - var fakeCopyAction = function fakeCopyAction(value, options) { - var fakeElement = createFakeElement(value); - options.container.appendChild(fakeElement); - var selectedText = select_default()(fakeElement); - command('copy'); - fakeElement.remove(); - return selectedText; - }; - /** - * Copy action wrapper. - * @param {String|HTMLElement} target - * @param {Object} options - * @return {String} - */ + function EventEmitter() { + EventEmitter.init.call(this); + } + module.exports = EventEmitter; + module.exports.once = once; - var ClipboardActionCopy = function ClipboardActionCopy(target) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : { - container: document.body - }; - var selectedText = ''; + // Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; - if (typeof target === 'string') { - selectedText = fakeCopyAction(target, options); - } else if ( - target instanceof HTMLInputElement && - !['text', 'search', 'url', 'tel', 'password'].includes( - target === null || target === void 0 - ? void 0 - : target.type - ) - ) { - // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange - selectedText = fakeCopyAction(target.value, options); - } else { - selectedText = select_default()(target); - command('copy'); - } + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._eventsCount = 0; + EventEmitter.prototype._maxListeners = undefined; - return selectedText; - }; + // By default EventEmitters will print a warning if more than 10 listeners are + // added to it. This is a useful default which helps finding memory leaks. + var defaultMaxListeners = 10; - /* harmony default export */ var actions_copy = - ClipboardActionCopy; // CONCATENATED MODULE: ./src/actions/default.js - function _typeof(obj) { - '@babel/helpers - typeof'; - if ( - typeof Symbol === 'function' && - typeof Symbol.iterator === 'symbol' - ) { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === 'function' && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }; - } - return _typeof(obj); - } + function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError( + 'The "listener" argument must be of type Function. Received type ' + + typeof listener + ); + } + } - /** - * Inner function which performs selection from either `text` or `target` - * properties and then executes copy or cut operations. - * @param {Object} options - */ + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function () { + return defaultMaxListeners; + }, + set: function (arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError( + 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + + arg + + '.' + ); + } + defaultMaxListeners = arg; + } + }); - var ClipboardActionDefault = function ClipboardActionDefault() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - // Defines base properties passed from constructor. - var _options$action = options.action, - action = - _options$action === void 0 ? 'copy' : _options$action, - container = options.container, - target = options.target, - text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. - - if (action !== 'copy' && action !== 'cut') { - throw new Error( - 'Invalid "action" value, use either "copy" or "cut"' - ); - } // Sets the `target` property using an element that will be have its content copied. + EventEmitter.init = function () { + if ( + this._events === undefined || + this._events === Object.getPrototypeOf(this)._events + ) { + this._events = Object.create(null); + this._eventsCount = 0; + } - if (target !== undefined) { - if ( - target && - _typeof(target) === 'object' && - target.nodeType === 1 - ) { - if ( - action === 'copy' && - target.hasAttribute('disabled') - ) { - throw new Error( - 'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute' - ); - } + this._maxListeners = this._maxListeners || undefined; + }; - if ( - action === 'cut' && - (target.hasAttribute('readonly') || - target.hasAttribute('disabled')) - ) { - throw new Error( - 'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes' - ); - } - } else { - throw new Error( - 'Invalid "target" value, use a valid Element' - ); - } - } // Define selection strategy based on `text` property. + // Obviously not all Emitters should be limited to 10. This function allows + // that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError( + 'The value of "n" is out of range. It must be a non-negative number. Received ' + + n + + '.' + ); + } + this._maxListeners = n; + return this; + }; - if (text) { - return actions_copy(text, { - container: container - }); - } // Defines which selection strategy based on `target` property. + function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } - if (target) { - return action === 'cut' - ? actions_cut(target) - : actions_copy(target, { - container: container - }); - } - }; + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; - /* harmony default export */ var actions_default = - ClipboardActionDefault; // CONCATENATED MODULE: ./src/clipboard.js - function clipboard_typeof(obj) { - '@babel/helpers - typeof'; - if ( - typeof Symbol === 'function' && - typeof Symbol.iterator === 'symbol' - ) { - clipboard_typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - clipboard_typeof = function _typeof(obj) { - return obj && - typeof Symbol === 'function' && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? 'symbol' - : typeof obj; - }; - } - return clipboard_typeof(obj); - } + EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = type === 'error'; - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } + var events = this._events; + if (events !== undefined) + doError = doError && events.error === undefined; + else if (!doError) return false; - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ('value' in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error( + 'Unhandled error.' + (er ? ' (' + er.message + ')' : '') + ); + err.context = er; + throw err; // Unhandled 'error' event + } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; - } + var handler = events[type]; - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError( - 'Super expression must either be null or a function' - ); - } - subClass.prototype = Object.create( - superClass && superClass.prototype, - { - constructor: { - value: subClass, - writable: true, - configurable: true - } - } - ); - if (superClass) _setPrototypeOf(subClass, superClass); - } + if (handler === undefined) return false; - function _setPrototypeOf(o, p) { - _setPrototypeOf = - Object.setPrototypeOf || - function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); - } + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), - result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; - } + return true; + }; - function _possibleConstructorReturn(self, call) { - if ( - call && - (clipboard_typeof(call) === 'object' || - typeof call === 'function') - ) { - return call; - } - return _assertThisInitialized(self); - } + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError( - "this hasn't been initialised - super() hasn't been called" - ); - } - return self; - } + checkListener(listener); - function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) - return false; - if (Reflect.construct.sham) return false; - if (typeof Proxy === 'function') return true; - try { - Date.prototype.toString.call( - Reflect.construct(Date, [], function () {}) - ); - return true; - } catch (e) { - return false; - } - } + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit( + 'newListener', + type, + listener.listener ? listener.listener : listener + ); - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf - ? Object.getPrototypeOf - : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); - } + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } - /** - * Helper function to retrieve attribute value. - * @param {String} suffix - * @param {Element} element - */ + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = prepend + ? [listener, existing] + : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } - function getAttributeValue(suffix, element) { - var attribute = 'data-clipboard-'.concat(suffix); + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error( + 'Possible EventEmitter memory leak detected. ' + + existing.length + + ' ' + + String(type) + + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit' + ); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } - if (!element.hasAttribute(attribute)) { - return; - } + return target; + } - return element.getAttribute(attribute); - } - /** - * Base class which takes one or more elements, adds event listeners to them, - * and instantiates a new `ClipboardAction` on each click. - */ + EventEmitter.prototype.addListener = function addListener( + type, + listener + ) { + return _addListener(this, type, listener, false); + }; - var Clipboard = /*#__PURE__*/ (function (_Emitter) { - _inherits(Clipboard, _Emitter); + EventEmitter.prototype.on = EventEmitter.prototype.addListener; - var _super = _createSuper(Clipboard); + EventEmitter.prototype.prependListener = function prependListener( + type, + listener + ) { + return _addListener(this, type, listener, true); + }; - /** - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - * @param {Object} options - */ - function Clipboard(trigger, options) { - var _this; + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } - _classCallCheck(this, Clipboard); + function _onceWrap(target, type, listener) { + var state = { + fired: false, + wrapFn: undefined, + target: target, + type: type, + listener: listener + }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } - _this = _super.call(this); + EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; - _this.resolveOptions(options); + EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; - _this.listenClick(trigger); + // Emits a 'removeListener' event if and only if the listener was removed. + EventEmitter.prototype.removeListener = function removeListener( + type, + listener + ) { + var list, events, position, i, originalListener; - return _this; - } - /** - * Defines if attributes would be resolved using internal setter functions - * or custom functions that were passed in the constructor. - * @param {Object} options - */ + checkListener(listener); - _createClass( - Clipboard, - [ - { - key: 'resolveOptions', - value: function resolveOptions() { - var options = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : {}; - this.action = - typeof options.action === 'function' - ? options.action - : this.defaultAction; - this.target = - typeof options.target === 'function' - ? options.target - : this.defaultTarget; - this.text = - typeof options.text === 'function' - ? options.text - : this.defaultText; - this.container = - clipboard_typeof(options.container) === 'object' - ? options.container - : document.body; - } - /** - * Adds a click event listener to the passed trigger. - * @param {String|HTMLElement|HTMLCollection|NodeList} trigger - */ - }, - { - key: 'listenClick', - value: function listenClick(trigger) { - var _this2 = this; - - this.listener = listen_default()( - trigger, - 'click', - function (e) { - return _this2.onClick(e); - } - ); - } - /** - * Defines a new `ClipboardAction` on each click event. - * @param {Event} e - */ - }, - { - key: 'onClick', - value: function onClick(e) { - var trigger = e.delegateTarget || e.currentTarget; - var action = this.action(trigger) || 'copy'; - var text = actions_default({ - action: action, - container: this.container, - target: this.target(trigger), - text: this.text(trigger) - }); // Fires an event based on the copy operation result. - - this.emit(text ? 'success' : 'error', { - action: action, - text: text, - trigger: trigger, - clearSelection: function clearSelection() { - if (trigger) { - trigger.focus(); - } + events = this._events; + if (events === undefined) return this; - window.getSelection().removeAllRanges(); - } - }); - } - /** - * Default `action` lookup function. - * @param {Element} trigger - */ - }, - { - key: 'defaultAction', - value: function defaultAction(trigger) { - return getAttributeValue('action', trigger); - } - /** - * Default `target` lookup function. - * @param {Element} trigger - */ - }, - { - key: 'defaultTarget', - value: function defaultTarget(trigger) { - var selector = getAttributeValue('target', trigger); + list = events[type]; + if (list === undefined) return this; - if (selector) { - return document.querySelector(selector); - } - } - /** - * Allow fire programmatically a copy action - * @param {String|HTMLElement} target - * @param {Object} options - * @returns Text copied. - */ - }, - { - key: 'defaultText', - - /** - * Default `text` lookup function. - * @param {Element} trigger - */ - value: function defaultText(trigger) { - return getAttributeValue('text', trigger); - } - /** - * Destroy lifecycle. - */ - }, - { - key: 'destroy', - value: function destroy() { - this.listener.destroy(); - } - } - ], - [ - { - key: 'copy', - value: function copy(target) { - var options = - arguments.length > 1 && arguments[1] !== undefined - ? arguments[1] - : { - container: document.body - }; - return actions_copy(target, options); - } - /** - * Allow fire programmatically a cut action - * @param {String|HTMLElement} target - * @returns Text cutted. - */ - }, - { - key: 'cut', - value: function cut(target) { - return actions_cut(target); - } - /** - * Returns the support of the given action, or all actions if no action is - * given. - * @param {String} [action] - */ - }, - { - key: 'isSupported', - value: function isSupported() { - var action = - arguments.length > 0 && arguments[0] !== undefined - ? arguments[0] - : ['copy', 'cut']; - var actions = - typeof action === 'string' ? [action] : action; - var support = !!document.queryCommandSupported; - actions.forEach(function (action) { - support = - support && - !!document.queryCommandSupported(action); - }); - return support; - } - } - ] - ); + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; - return Clipboard; - })(tiny_emitter_default()); + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } - /* harmony default export */ var clipboard = Clipboard; + if (position < 0) return this; - /***/ - }, + if (position === 0) list.shift(); + else { + spliceOne(list, position); + } - /***/ 828: /***/ function (module) { - var DOCUMENT_NODE_TYPE = 9; + if (list.length === 1) events[type] = list[0]; - /** - * A polyfill for Element.matches() - */ - if ( - typeof Element !== 'undefined' && - !Element.prototype.matches - ) { - var proto = Element.prototype; + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } - proto.matches = - proto.matchesSelector || - proto.mozMatchesSelector || - proto.msMatchesSelector || - proto.oMatchesSelector || - proto.webkitMatchesSelector; - } + return this; + }; - /** - * Finds the closest parent that matches a selector. - * - * @param {Element} element - * @param {String} selector - * @return {Function} - */ - function closest(element, selector) { - while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { - if ( - typeof element.matches === 'function' && - element.matches(selector) - ) { - return element; - } - element = element.parentNode; - } - } + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - module.exports = closest; + EventEmitter.prototype.removeAllListeners = function removeAllListeners( + type + ) { + var listeners, events, i; - /***/ - }, + events = this._events; + if (events === undefined) return this; - /***/ 438: /***/ function ( - module, - __unused_webpack_exports, - __nested_webpack_require_15749__ - ) { - var closest = __nested_webpack_require_15749__(828); + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) this._events = Object.create(null); + else delete events[type]; + } + return this; + } - /** - * Delegates event to a selector. - * - * @param {Element} element - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @param {Boolean} useCapture - * @return {Object} - */ - function _delegate( - element, - selector, - type, - callback, - useCapture - ) { - var listenerFn = listener.apply(this, arguments); + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } - element.addEventListener(type, listenerFn, useCapture); + listeners = events[type]; - return { - destroy: function () { - element.removeEventListener(type, listenerFn, useCapture); - } - }; - } + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } - /** - * Delegates event to a selector. - * - * @param {Element|String|Array} [elements] - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @param {Boolean} useCapture - * @return {Object} - */ - function delegate( - elements, - selector, - type, - callback, - useCapture - ) { - // Handle the regular Element usage - if (typeof elements.addEventListener === 'function') { - return _delegate.apply(null, arguments); - } + return this; + }; - // Handle Element-less usage, it defaults to global delegation - if (typeof type === 'function') { - // Use `document` as the first parameter, then apply arguments - // This is a short way to .unshift `arguments` without running into deoptimizations - return _delegate - .bind(null, document) - .apply(null, arguments); - } + function _listeners(target, type, unwrap) { + var events = target._events; - // Handle Selector-based usage - if (typeof elements === 'string') { - elements = document.querySelectorAll(elements); - } + if (events === undefined) return []; - // Handle Array-like based usage - return Array.prototype.map.call(elements, function (element) { - return _delegate( - element, - selector, - type, - callback, - useCapture - ); - }); - } + var evlistener = events[type]; + if (evlistener === undefined) return []; - /** - * Finds closest match and invokes callback. - * - * @param {Element} element - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @return {Function} - */ - function listener(element, selector, type, callback) { - return function (e) { - e.delegateTarget = closest(e.target, selector); + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - if (e.delegateTarget) { - callback.call(element, e); - } - }; - } + return unwrap + ? unwrapListeners(evlistener) + : arrayClone(evlistener, evlistener.length); + } - module.exports = delegate; + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; - /***/ - }, + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; - /***/ 879: /***/ function (__unused_webpack_module, exports) { - /** - * Check if argument is a HTML element. - * - * @param {Object} value - * @return {Boolean} - */ - exports.node = function (value) { - return ( - value !== undefined && - value instanceof HTMLElement && - value.nodeType === 1 - ); - }; + EventEmitter.listenerCount = function (emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; - /** - * Check if argument is a list of HTML elements. - * - * @param {Object} value - * @return {Boolean} - */ - exports.nodeList = function (value) { - var type = Object.prototype.toString.call(value); + EventEmitter.prototype.listenerCount = listenerCount; + function listenerCount(type) { + var events = this._events; - return ( - value !== undefined && - (type === '[object NodeList]' || - type === '[object HTMLCollection]') && - 'length' in value && - (value.length === 0 || exports.node(value[0])) - ); - }; + if (events !== undefined) { + var evlistener = events[type]; - /** - * Check if argument is a string. - * - * @param {Object} value - * @return {Boolean} - */ - exports.string = function (value) { - return typeof value === 'string' || value instanceof String; - }; - - /** - * Check if argument is a function. - * - * @param {Object} value - * @return {Boolean} - */ - exports.fn = function (value) { - var type = Object.prototype.toString.call(value); + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } - return type === '[object Function]'; - }; + return 0; + } - /***/ - }, + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; - /***/ 370: /***/ function ( - module, - __unused_webpack_exports, - __nested_webpack_require_19113__ - ) { - var is = __nested_webpack_require_19113__(879); - var delegate = __nested_webpack_require_19113__(438); + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) copy[i] = arr[i]; + return copy; + } - /** - * Validates all params and calls the right - * listener function based on its target type. - * - * @param {String|HTMLElement|HTMLCollection|NodeList} target - * @param {String} type - * @param {Function} callback - * @return {Object} - */ - function listen(target, type, callback) { - if (!target && !type && !callback) { - throw new Error('Missing required arguments'); - } + function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); + } - if (!is.string(type)) { - throw new TypeError('Second argument must be a String'); - } + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } - if (!is.fn(callback)) { - throw new TypeError('Third argument must be a Function'); - } + function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } - if (is.node(target)) { - return listenNode(target, type, callback); - } else if (is.nodeList(target)) { - return listenNodeList(target, type, callback); - } else if (is.string(target)) { - return listenSelector(target, type, callback); - } else { - throw new TypeError( - 'First argument must be a String, HTMLElement, HTMLCollection, or NodeList' - ); - } - } + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + } - /** - * Adds an event listener to a HTML element - * and returns a remove listener function. - * - * @param {HTMLElement} node - * @param {String} type - * @param {Function} callback - * @return {Object} - */ - function listenNode(node, type, callback) { - node.addEventListener(type, callback); + eventTargetAgnosticAddListener(emitter, name, resolver, { + once: true + }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { + once: true + }); + } + }); + } - return { - destroy: function () { - node.removeEventListener(type, callback); - } - }; - } + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } + } - /** - * Add an event listener to a list of HTML elements - * and returns a remove listener function. - * - * @param {NodeList|HTMLCollection} nodeList - * @param {String} type - * @param {Function} callback - * @return {Object} - */ - function listenNodeList(nodeList, type, callback) { - Array.prototype.forEach.call(nodeList, function (node) { - node.addEventListener(type, callback); - }); + function eventTargetAgnosticAddListener( + emitter, + name, + listener, + flags + ) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError( + 'The "emitter" argument must be of type EventEmitter. Received type ' + + typeof emitter + ); + } + } - return { - destroy: function () { - Array.prototype.forEach.call(nodeList, function (node) { - node.removeEventListener(type, callback); - }); - } - }; - } + /***/ + }, - /** - * Add an event listener to a selector - * and returns a remove listener function. - * - * @param {String} selector - * @param {String} type - * @param {Function} callback - * @return {Object} - */ - function listenSelector(selector, type, callback) { - return delegate(document.body, selector, type, callback); - } + /***/ './node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js': + /*!**********************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js ***! + \**********************************************************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { + 'use strict'; - module.exports = listen; + var reactIs = __webpack_require__( + /*! react-is */ './node_modules/hoist-non-react-statics/node_modules/react-is/index.js' + ); - /***/ - }, + /** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true + }; + var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true + }; + var FORWARD_REF_STATICS = { + $$typeof: true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true + }; + var MEMO_STATICS = { + $$typeof: true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true + }; + var TYPE_STATICS = {}; + TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; + TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; - /***/ 817: /***/ function (module) { - function select(element) { - var selectedText; + function getStatics(component) { + // React v16.11 and below + if (reactIs.isMemo(component)) { + return MEMO_STATICS; + } // React v16.12 and above - if (element.nodeName === 'SELECT') { - element.focus(); + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; + } - selectedText = element.value; - } else if ( - element.nodeName === 'INPUT' || - element.nodeName === 'TEXTAREA' - ) { - var isReadOnly = element.hasAttribute('readonly'); + var defineProperty = Object.defineProperty; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var getPrototypeOf = Object.getPrototypeOf; + var objectPrototype = Object.prototype; + function hoistNonReactStatics( + targetComponent, + sourceComponent, + blacklist + ) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); - if (!isReadOnly) { - element.setAttribute('readonly', ''); - } + if ( + inheritedComponent && + inheritedComponent !== objectPrototype + ) { + hoistNonReactStatics( + targetComponent, + inheritedComponent, + blacklist + ); + } + } - element.select(); - element.setSelectionRange(0, element.value.length); + var keys = getOwnPropertyNames(sourceComponent); - if (!isReadOnly) { - element.removeAttribute('readonly'); - } + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } - selectedText = element.value; - } else { - if (element.hasAttribute('contenteditable')) { - element.focus(); - } + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); - var selection = window.getSelection(); - var range = document.createRange(); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; - range.selectNodeContents(element); - selection.removeAllRanges(); - selection.addRange(range); + if ( + !KNOWN_STATICS[key] && + !(blacklist && blacklist[key]) && + !(sourceStatics && sourceStatics[key]) && + !(targetStatics && targetStatics[key]) + ) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); - selectedText = selection.toString(); - } + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + } - return selectedText; - } + return targetComponent; + } - module.exports = select; + module.exports = hoistNonReactStatics; - /***/ - }, + /***/ + }, - /***/ 279: /***/ function (module) { - function E() { - // Keep this empty so it's easier to inherit from - // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) - } + /***/ './node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js': + /*!************************************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js ***! + \************************************************************************************************/ + /***/ (__unused_webpack_module, exports) => { + 'use strict'; + /** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - E.prototype = { - on: function (name, callback, ctx) { - var e = this.e || (this.e = {}); + if (true) { + (function () { + 'use strict'; - (e[name] || (e[name] = [])).push({ - fn: callback, - ctx: ctx - }); + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol + ? Symbol.for('react.element') + : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol + ? Symbol.for('react.portal') + : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol + ? Symbol.for('react.fragment') + : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol + ? Symbol.for('react.strict_mode') + : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol + ? Symbol.for('react.profiler') + : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol + ? Symbol.for('react.provider') + : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol + ? Symbol.for('react.context') + : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + // (unstable) APIs that have been removed. Can we remove the symbols? - return this; - }, + var REACT_ASYNC_MODE_TYPE = hasSymbol + ? Symbol.for('react.async_mode') + : 0xeacf; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol + ? Symbol.for('react.concurrent_mode') + : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol + ? Symbol.for('react.forward_ref') + : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol + ? Symbol.for('react.suspense') + : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol + ? Symbol.for('react.suspense_list') + : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol + ? Symbol.for('react.block') + : 0xead9; + var REACT_FUNDAMENTAL_TYPE = hasSymbol + ? Symbol.for('react.fundamental') + : 0xead5; + var REACT_RESPONDER_TYPE = hasSymbol + ? Symbol.for('react.responder') + : 0xead6; + var REACT_SCOPE_TYPE = hasSymbol + ? Symbol.for('react.scope') + : 0xead7; - once: function (name, callback, ctx) { - var self = this; - function listener() { - self.off(name, listener); - callback.apply(ctx, arguments); - } + function isValidElementType(type) { + return ( + typeof type === 'string' || + typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || + type === REACT_CONCURRENT_MODE_TYPE || + type === REACT_PROFILER_TYPE || + type === REACT_STRICT_MODE_TYPE || + type === REACT_SUSPENSE_TYPE || + type === REACT_SUSPENSE_LIST_TYPE || + (typeof type === 'object' && + type !== null && + (type.$$typeof === REACT_LAZY_TYPE || + type.$$typeof === REACT_MEMO_TYPE || + type.$$typeof === REACT_PROVIDER_TYPE || + type.$$typeof === REACT_CONTEXT_TYPE || + type.$$typeof === REACT_FORWARD_REF_TYPE || + type.$$typeof === REACT_FUNDAMENTAL_TYPE || + type.$$typeof === REACT_RESPONDER_TYPE || + type.$$typeof === REACT_SCOPE_TYPE || + type.$$typeof === REACT_BLOCK_TYPE)) + ); + } - listener._ = callback; - return this.on(name, listener, ctx); - }, + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; - emit: function (name) { - var data = [].slice.call(arguments, 1); - var evtArr = ( - (this.e || (this.e = {}))[name] || [] - ).slice(); - var i = 0; - var len = evtArr.length; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; - return this; - }, + default: + var $$typeofType = type && type.$$typeof; - off: function (name, callback) { - var e = this.e || (this.e = {}); - var evts = e[name]; - var liveEvents = []; + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if ( - evts[i].fn !== callback && - evts[i].fn._ !== callback - ) - liveEvents.push(evts[i]); - } + default: + return $$typeof; + } } - // Remove event from queue to prevent memory leak - // Suggested by https://github.com/lazd - // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 + case REACT_PORTAL_TYPE: + return $$typeof; + } + } - liveEvents.length ? (e[name] = liveEvents) : delete e[name]; + return undefined; + } // AsyncMode is deprecated along with isAsyncMode - return this; - } - }; + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated - module.exports = E; - module.exports.TinyEmitter = E; + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint - /***/ + console['warn']( + 'The ReactIs.isAsyncMode() alias has been deprecated, ' + + 'and will be removed in React 17+. Update your code to use ' + + 'ReactIs.isConcurrentMode() instead. It has the exact same API.' + ); + } } - /******/ - }; - /************************************************************************/ - /******/ // The module cache - /******/ var __webpack_module_cache__ = {}; - /******/ - /******/ // The require function - /******/ function __nested_webpack_require_24495__(moduleId) { - /******/ // Check if module is in cache - /******/ if (__webpack_module_cache__[moduleId]) { - /******/ return __webpack_module_cache__[moduleId].exports; - /******/ - } - /******/ // Create a new module (and put it into the cache) - /******/ var module = (__webpack_module_cache__[moduleId] = { - /******/ // no module.id needed - /******/ // no module.loaded needed - /******/ exports: {} - /******/ - }); - /******/ - /******/ // Execute the module function - /******/ __webpack_modules__[moduleId]( - module, - module.exports, - __nested_webpack_require_24495__ + return ( + isConcurrentMode(object) || + typeOf(object) === REACT_ASYNC_MODE_TYPE ); - /******/ - /******/ // Return the exports of the module - /******/ return module.exports; - /******/ - } - /******/ - /************************************************************************/ - /******/ /* webpack/runtime/compat get default export */ /******/ !(function () { - /******/ // getDefaultExport function for compatibility with non-harmony modules - /******/ __nested_webpack_require_24495__.n = function (module) { - /******/ var getter = - module && module.__esModule - ? /******/ function () { - return module['default']; - } - : /******/ function () { - return module; - }; - /******/ __nested_webpack_require_24495__.d(getter, { - a: getter - }); - /******/ return getter; - /******/ - }; - /******/ - })(); - /******/ - /******/ /* webpack/runtime/define property getters */ /******/ !(function () { - /******/ // define getter functions for harmony exports - /******/ __nested_webpack_require_24495__.d = function ( - exports, - definition - ) { - /******/ for (var key in definition) { - /******/ if ( - __nested_webpack_require_24495__.o(definition, key) && - !__nested_webpack_require_24495__.o(exports, key) - ) { - /******/ Object.defineProperty(exports, key, { - enumerable: true, - get: definition[key] - }); - /******/ - } - /******/ - } - /******/ - }; - /******/ - })(); - /******/ - /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ !(function () { - /******/ __nested_webpack_require_24495__.o = function ( - obj, - prop - ) { - return Object.prototype.hasOwnProperty.call(obj, prop); - }; - /******/ - })(); - /******/ - /************************************************************************/ - /******/ // module exports must be returned from runtime so entry inlining is disabled - /******/ // startup - /******/ // Load entry module and return exports - /******/ return __nested_webpack_require_24495__(686); - /******/ - })().default; - }); + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return ( + typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } /***/ }, - /***/ './node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/stylus-loader/dist/cjs.js!./src/style/index.styl': - /*!***************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[3].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[3].use[2]!./node_modules/stylus-loader/dist/cjs.js!./src/style/index.styl ***! - \***************************************************************************************************************************************************************************************************************/ - /***/ (module, __webpack_exports__, __webpack_require__) => { - 'use strict'; - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ default: () => __WEBPACK_DEFAULT_EXPORT__ - /* harmony export */ - }); - /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = - __webpack_require__( - /*! ../../node_modules/css-loader/dist/runtime/sourceMaps.js */ './node_modules/css-loader/dist/runtime/sourceMaps.js' - ); - /* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = - /*#__PURE__*/ __webpack_require__.n( - _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ - ); - /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = - __webpack_require__( - /*! ../../node_modules/css-loader/dist/runtime/api.js */ './node_modules/css-loader/dist/runtime/api.js' - ); - /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = - /*#__PURE__*/ __webpack_require__.n( - _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ - ); - // Imports + /***/ './node_modules/hoist-non-react-statics/node_modules/react-is/index.js': + /*!*****************************************************************************!*\ + !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/index.js ***! + \*****************************************************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { + 'use strict'; - var ___CSS_LOADER_EXPORT___ = - _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()( - _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default() + if (false) { + } else { + module.exports = __webpack_require__( + /*! ./cjs/react-is.development.js */ './node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js' ); - // Module - ___CSS_LOADER_EXPORT___.push([ - module.id, - 'body.aframe-inspector-opened,\n.toggle-edit {\n font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;\n}\n.wf-roboto-n4-active body.aframe-inspector-opened,\n.wf-roboto-n4-active .toggle-edit {\n font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;\n}\nbody.aframe-inspector-opened {\n background: #1d1d1d;\n color: #fff;\n font-size: 12px;\n margin: 0;\n overflow: hidden;\n}\n#aframeInspector #toolbar {\n background-color: #242424;\n}\n#aframeInspector #toolbar .toolbarActions {\n padding: 0 0 5px;\n}\n#aframeInspector #toolbar .toolbarActions a.disabled {\n color: #666;\n cursor: default;\n}\n#aframeInspector #scenegraph {\n background: #242424;\n border-top: 1px solid #111;\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding-top: 32px;\n width: 230px;\n}\n#aframeInspector #scenegraph .entity {\n background: #242424;\n cursor: pointer;\n display: flex;\n justify-content: space-between;\n padding: 3px;\n width: 100%;\n white-space: nowrap;\n}\n#aframeInspector #scenegraph .entity:hover {\n background: #1d2f39;\n}\n#aframeInspector #scenegraph .entity.active {\n background-color: #155373;\n color: #fff;\n}\n#aframeInspector #scenegraph .entity.active .component:hover {\n color: #1888c1;\n}\n#aframeInspector #scenegraph .entity.active .entityActions {\n display: inline;\n}\n#aframeInspector #scenegraph .entity.novisible.active span,\n#aframeInspector #scenegraph .entity.novisible.active .fa,\n#aframeInspector #scenegraph .entity.novisible.active .collapsespace,\n#aframeInspector #scenegraph .entity.novisible.active .id {\n color: #999;\n}\n#aframeInspector #scenegraph .entity.novisible:not(.active) span,\n#aframeInspector #scenegraph .entity.novisible:not(.active) .fa,\n#aframeInspector #scenegraph .entity.novisible:not(.active) .collapsespace,\n#aframeInspector #scenegraph .entity.novisible:not(.active) .id {\n color: #626262;\n}\n#aframeInspector #scenegraph .component:hover {\n color: #1faaf2;\n}\n#aframeInspector #scenegraph .entityIcons {\n margin-left: 2px;\n}\n#aframeInspector #scenegraph .entityActions {\n display: none;\n margin: 0 14px;\n}\n#aframeInspector #scenegraph .entityActions .button {\n color: #fff;\n font-size: 12px;\n margin-left: 6px;\n}\n#aframeInspector #scenegraph .fa {\n color: #ccc;\n}\n#aframeInspector #scenegraph .entityActions .fa:hover {\n color: #1faaf2;\n}\n#aframeInspector #scenegraph .active .fa {\n color: #fafafa;\n}\n#aframeInspector #scenegraph .id {\n color: #ccc;\n}\n#aframeInspector #scenegraph .option.active .id {\n color: #fff;\n}\n#aframeInspector #scenegraph .collapsespace {\n color: #eee;\n display: inline-block;\n text-align: center;\n width: 14px;\n}\n#aframeInspector #scenegraph .fa-eye {\n color: #bbb;\n}\n#aframeInspector #scenegraph .icons a.button {\n color: #fff;\n}\n#aframeInspector #scenegraph .search {\n padding: 5px;\n font-size: 16px;\n position: relative;\n}\n#aframeInspector #scenegraph .search input {\n color: #c3c3c3;\n background: #1d1d1d;\n border-radius: 5px;\n height: 22px;\n text-indent: 10px;\n width: 216px;\n}\n#aframeInspector #scenegraph .search .fa-search {\n position: absolute;\n right: 14px;\n top: 8px;\n}\n#aframeInspector #scenegraph .search .fa-times {\n position: absolute;\n right: 15px;\n top: 9px;\n}\n#aframeInspector #scenegraph .outliner {\n background: #242424;\n color: #c3c3c3;\n cursor: default;\n flex: 1 1 auto;\n font-size: 13px;\n height: calc(100% - 98px);\n line-height: normal;\n outline: none;\n overflow-y: auto;\n padding: 0;\n width: 230px;\n}\n#aframeInspector .scenegraph-bottom {\n background-color: #323232;\n border-top: 1px solid #111;\n bottom: 10;\n height: 40px;\n left: 0;\n z-index: 100;\n}\n#aframeInspector .scenegraph-bottom a {\n float: right;\n margin: 10px;\n}\n#aframeInspector .components {\n background-color: #242424;\n color: #c3c3c3;\n height: 100%;\n overflow: auto;\n position: fixed;\n width: 331px;\n}\n#aframeInspector div.vec2,\n#aframeInspector div.vec3,\n#aframeInspector div.vec4 {\n display: inline;\n}\n#aframeInspector .vec2 input.number,\n#aframeInspector .vec3 input.number {\n width: 40px;\n}\n#aframeInspector .vec4 input.number {\n width: 34px;\n}\n#aframeInspector .collapsible-header {\n align-items: center;\n display: flex;\n justify-content: space-between;\n}\n#aframeInspector .collapsible-header .entityPrint {\n color: #fff;\n}\n#aframeInspector .collapsible-content {\n padding: 5px 0;\n}\n#aframeInspector .componentTitle span {\n max-width: 200px;\n overflow: hidden;\n text-overflow: ellipsis;\n text-transform: uppercase;\n white-space: nowrap;\n color: #fff;\n font-weight: 600;\n vertical-align: bottom !important;\n}\n#aframeInspector .collapsible .static {\n background: #333;\n border-bottom: 2px solid #242424;\n box-sizing: content-box;\n cursor: pointer;\n height: 16px;\n padding: 8px 10px 12px 10px;\n vertical-align: bottom;\n font-size: 13px;\n}\n#aframeInspector .collapsible .static:hover {\n background: #393939;\n}\n#aframeInspector .collapsible .menu {\n text-align: right;\n}\n#aframeInspector .collapsible .menuafter {\n color: #bbb;\n content: \'\\2807\';\n font-size: 12px;\n padding: 5px;\n text-align: right;\n}\n#aframeInspector .collapsible .static {\n margin: 0;\n}\n#aframeInspector .collapsible .static .collapse-button {\n border: 6px solid transparent;\n float: left;\n height: 0;\n margin-right: 10px;\n margin-left: 2px;\n width: 0;\n}\n#aframeInspector .collapsible.collapsed .static .collapse-button {\n border-left-color: #c3c3c3;\n margin-top: 4px;\n}\n#aframeInspector .collapsible:not(.collapsed) .static .collapse-button {\n border-top-color: #c3c3c3;\n margin-top: 7px;\n}\n#aframeInspector .propertyRow {\n align-items: center;\n display: flex;\n font-size: 13px;\n min-height: 30px;\n padding: 2px 15px;\n}\n#aframeInspector .propertyRow .text {\n cursor: default;\n display: inline-block;\n overflow: hidden;\n padding-right: 10px;\n text-overflow: ellipsis;\n vertical-align: middle;\n width: 118px;\n}\n#aframeInspector .propertyRow .map_value {\n margin: 0 0 0 5px;\n width: 68px;\n}\n#aframeInspector .propertyRow .Select-control {\n font-size: 11px;\n height: 24px;\n}\n#aframeInspector .propertyRow .Select-placeholder,\n#aframeInspector .propertyRow .Select--single > .Select-control .Select-value {\n line-height: 19px;\n}\n#aframeInspector .propertyRow .Select-input {\n height: 22px;\n}\n#aframeInspector .propertyRow input[type=text],\n#aframeInspector .propertyRow input[type=number],\n#aframeInspector .propertyRow input.string,\n#aframeInspector .propertyRow input.number {\n background: #1d1d1d;\n color: #1faaf2;\n min-height: 26px;\n padding-bottom: 1px;\n padding-left: 5px;\n padding-right: 5px;\n padding-top: 1px;\n}\n#aframeInspector .propertyRow input[type=text]:last-child,\n#aframeInspector .propertyRow input[type=number]:last-child,\n#aframeInspector .propertyRow input.string:last-child,\n#aframeInspector .propertyRow input.number:last-child {\n padding-right: 0;\n}\n#aframeInspector .propertyRow input.string {\n padding-left: 8px;\n box-sizing: border-box;\n width: 165px;\n}\n#aframeInspector .propertyRow input[type=text]:focus,\n#aframeInspector .propertyRow input.string:focus {\n box-shadow: none;\n}\n#aframeInspector .propertyRow .color_value {\n margin: 0 0 0 5px;\n width: 68px;\n letter-spacing: 1px;\n}\n#aframeInspector .propertyRowDefined .text {\n color: #fafafa;\n font-weight: 500;\n}\n#aframeInspector .components * {\n vertical-align: middle;\n}\n#aframeInspector span.subcomponent {\n color: #999;\n float: none !important;\n margin-left: 10px;\n vertical-align: top !important;\n}\n#aframeInspector a.help-link {\n opacity: 0.4;\n}\n#aframeInspector a.help-linkhover {\n opacity: 1;\n}\n#aframeInspector #addComponentContainer {\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 20px 10px;\n background: #1d1d1d;\n}\n#aframeInspector #addComponentContainer #addComponent {\n text-align: left;\n width: 200px;\n}\n#aframeInspector #addComponentContainer #addComponent .select__control {\n background: #161616;\n height: 35px;\n color: #1faaf2;\n}\n#aframeInspector #addComponentContainer #addComponent .option {\n display: flex;\n justify-content: space-between;\n}\n#aframeInspector #addComponentContainer #addComponent .option span {\n color: #1faaf2;\n}\n#aframeInspector #addComponentContainer #addComponentHeader {\n font-size: 15px;\n margin: 5px 0 10px 0;\n}\n#aframeInspector #addComponentContainer input[type=text]:focus {\n box-shadow: none;\n}\n#aframeInspector .Select-menu-outer .is-focused span {\n color: #fff;\n}\n#aframeInspector .component-title {\n align-items: center;\n display: flex;\n}\n#aframeInspector #componentEntityHeader .collapsible-header {\n bottom: 4px;\n position: relative;\n}\n#aframeInspector #componentEntityHeader .collapse-button {\n display: none;\n}\n#aframeInspector #componentEntityHeader .static {\n height: 13px;\n}\n#aframeInspector #componentEntityHeader .entityPrint {\n font-size: 15px;\n padding-left: 5px;\n}\n#aframeInspector #componentEntityHeader .entityName {\n max-width: 160px;\n top: 0;\n}\n#aframeInspector #componentEntityHeader .entityIcons {\n color: #fafafa;\n}\n#aframeInspector #mixinSelect {\n width: 160px;\n}\n#aframeInspector .propertyRow .texture {\n display: flex;\n}\n#aframeInspector .propertyRow .texture input {\n margin-left: 0;\n width: 120px;\n}\n#aframeInspector #componentEntityHeader .gltfIcon img {\n top: 0;\n}\n#aframeInspector .fa {\n color: #c3c3c3;\n}\n#aframeInspector .fa:hover {\n color: #1faaf2;\n}\n#aframeInspector .entityPrint {\n font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;\n line-height: 1.15em;\n}\n#aframeInspector .entityName {\n display: inline-block;\n overflow: hidden;\n position: relative;\n text-overflow: ellipsis;\n top: 3px;\n white-space: nowrap;\n}\n#aframeInspector [data-entity-name-type="id"] {\n color: #92374d;\n}\n#aframeInspector [data-entity-name-type="class"] {\n color: #514b23;\n}\n#aframeInspector [data-entity-name-type="mixin"] {\n color: #d66853;\n}\n#aframeInspector .help-lists {\n display: flex;\n justify-content: space-around;\n}\n#aframeInspector .help-list {\n list-style: none;\n margin: 0;\n padding: 0 0 10px;\n width: 350px;\n}\n#aframeInspector .help-list li {\n margin-right: 40px;\n}\n#aframeInspector .help-key-unit {\n line-height: 1.8;\n margin-right: 2em;\n padding: 5px 0;\n}\n#aframeInspector .help-key {\n bottom: 2px;\n margin-right: 4px;\n min-width: 60px;\n position: relative;\n}\n#aframeInspector .help-key span {\n background-color: #2e2e2e;\n background-repeat: repeat-x;\n border: 1px solid #666;\n border-radius: 3px;\n box-shadow: 0 0 5px #000;\n color: #999;\n display: inline-block;\n font-size: 12px;\n padding: 0 8px;\n text-align: center;\n}\n#aframeInspector .help-key-def {\n color: #bbb;\n display: inline-block;\n margin-left: 1em;\n}\n#aframeInspector .select__control {\n border: 0;\n border-radius: 0;\n cursor: pointer;\n min-height: 26px;\n font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;\n font-size: 13px;\n}\n#aframeInspector .select__indicator {\n height: 26px;\n}\n#aframeInspector .select__indicator-separator {\n display: none;\n}\n#aframeInspector .select__input {\n min-height: auto !important;\n}\n#aframeInspector .select__control,\n#aframeInspector .select__menu {\n background: #1d1d1d;\n}\n#aframeInspector .select__option {\n padding: 5px 10px;\n}\n#aframeInspector .select__placeholder,\n#aframeInspector .select__menu {\n color: #c3c3c3;\n}\n#aframeInspector .select__single-value {\n color: #1faaf2;\n}\n#aframeInspector .select__control--is-focused {\n box-shadow: none !important;\n}\n#aframeInspector .select__option {\n cursor: pointer;\n}\n#aframeInspector .select__clear-indicator {\n display: none;\n}\n#aframeInspector .select__label {\n font-size: 11px;\n}\n#aframeInspector .select__option--is-focused {\n background: #155373;\n}\n#aframeInspector .select__value-container {\n height: 26px;\n position: static;\n}\n#aframeInspector .select__value-container.select__value-container--is-multi {\n height: auto;\n padding: 6px;\n}\n#aframeInspector .select__dropdown-indicator {\n padding: 3px 8px;\n}\n#aframeInspector .select__multi-value {\n background: #242424;\n color: #1faaf2;\n}\n#aframeInspector .select__multi-value__label {\n color: #1faaf2;\n}\n#aframeInspector .select__value-container--is-multi > :last-child {\n display: none;\n}\n#aframeInspector .select__multi-value__remove:hover {\n color: #fff;\n background: #242424;\n}\n#aframeInspector .modal {\n animation: animateopacity 0.2s ease-out;\n background-color: #000;\n background-color: rgba(0,0,0,0.6);\n display: flex;\n height: 100%;\n left: 0;\n overflow: auto;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 9999999999;\n}\n#aframeInspector .modal h3 {\n font-size: 18px;\n font-weight: 100;\n margin: 0.6em 0;\n}\n#aframeInspector #textureModal .modal-content {\n height: calc(100% - 50px);\n width: calc(100% - 50px);\n}\n#aframeInspector .modal-content {\n animation: animatetop 0.2s ease-out;\n animation-duration: 0.2s;\n animation-name: animatetop;\n background-color: #232323;\n box-shadow: 0 4px 8px 0 rgba(0,0,0,0.5), 0 6px 20px 0 rgba(0,0,0,0.5);\n margin: auto;\n overflow: hidden;\n padding: 0;\n}\n#aframeInspector .close {\n color: #fff;\n float: right;\n font-size: 28px;\n font-weight: bold;\n}\n#aframeInspector .closehover,\n#aframeInspector .closefocus {\n color: #08f;\n cursor: pointer;\n text-decoration: none;\n}\n#aframeInspector .modal-header {\n color: #fff;\n padding: 2px 16px;\n}\n#aframeInspector .modal-body {\n overflow: auto;\n padding: 16px;\n}\n#aframeInspector .modal-footer {\n color: #fff;\n padding: 2px 16px;\n}\n#aframeInspector .gallery {\n background: #232323;\n display: flex;\n flex-wrap: wrap;\n margin: 15px auto 0;\n overflow: auto;\n padding: 15px 3px 3px;\n}\n#aframeInspector .newimage .gallery {\n padding: 16px;\n}\n#aframeInspector .gallery li {\n border-radius: 2px;\n box-shadow: 0 0 6px rgba(0,0,0,0.6);\n cursor: pointer;\n margin: 8px;\n overflow: hidden;\n width: 155px;\n}\n#aframeInspector .gallery li.selected,\n#aframeInspector .gallery li:hover {\n box-shadow: 0 0 0 2px #1eaaf1;\n}\n#aframeInspector .gallery li .detail {\n background-color: #323232;\n margin: 0;\n min-height: 60px;\n padding: 3px 10px;\n}\n#aframeInspector .gallery li .button.fa-external-link {\n margin-left: 136px;\n margin-top: 5px;\n position: fixed;\n}\n#aframeInspector .preview {\n padding: 10px;\n width: 150px;\n}\n#aframeInspector .preview input {\n display: block;\n margin: 8px 0;\n width: 144px;\n}\n#aframeInspector .preview button {\n width: 155px;\n}\n#aframeInspector .preview .detail .title {\n color: #fff;\n display: inline-block;\n max-width: 155px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n#aframeInspector .gallery li.selected .detail,\n#aframeInspector .gallery li:hover .detail {\n background-color: #444;\n}\n#aframeInspector .gallery li .detail span {\n color: #777;\n display: block;\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 140px;\n}\n#aframeInspector .gallery li.selected .detail span,\n#aframeInspector .gallery li:hover .detail span {\n color: #888;\n}\n#aframeInspector .gallery li .detail span.title {\n color: #fff !important;\n}\n#aframeInspector .modal button {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n border-radius: 0;\n box-shadow: none;\n cursor: pointer;\n display: inline-block;\n font-size: 12px;\n line-height: 1.8;\n margin: 0 10px 0 0;\n padding: 5px 10px;\n}\n#aframeInspector .modal buttonfocus {\n outline: none;\n}\n#aframeInspector .modal button {\n background-color: #1eaaf1;\n border: none;\n color: #fff;\n}\n#aframeInspector .modal buttonhover,\n#aframeInspector .modal button.hover {\n background-color: #346392;\n text-shadow: -1px 1px #27496d;\n}\n#aframeInspector .modal buttonactive,\n#aframeInspector .modal button.active {\n background-color: #27496d;\n text-shadow: -1px 1px #193047;\n}\n#aframeInspector .modal buttondisabled {\n background-color: #888;\n cursor: none;\n}\n#aframeInspector .newimage {\n background-color: #323232;\n color: #bcbcbc;\n display: flex;\n font-size: 13px;\n justify-content: space-between;\n margin-top: 10px;\n overflow: auto;\n padding: 10px;\n}\n#aframeInspector .newimage input {\n color: #1eaaf1;\n padding: 3px 5px;\n}\n#aframeInspector .texture canvas + input {\n margin-left: 5px;\n}\n#aframeInspector .texture .fa {\n padding-right: 5px;\n}\n#aframeInspector .texture .fa-external-link {\n font-size: 14px;\n padding-top: 2px;\n}\n#aframeInspector .uploader-normal-button .hidden {\n display: none;\n}\n#aframeInspector .gallery a.fa.texture-link {\n box-shadow: 0 0 14px -1px rgba(0,0,0,0.75);\n position: fixed;\n}\n#aframeInspector .assets.search {\n margin-top: 10px;\n width: 200px;\n}\n#aframeInspector .assets.search .fa-search {\n top: 7px;\n}\n#aframeInspector .new_asset_options {\n margin: 10px;\n}\n#aframeInspector .new_asset_options > ul {\n margin-left: 10px;\n padding: 5px;\n}\n#aframeInspector .new_asset_options > ul > li {\n padding: 10px 0;\n}\n#aframeInspector .new_asset_options .imageUrl {\n margin-left: 5px;\n width: 350px;\n}\n#aframeInspector .texture canvas {\n border: 1px solid #333;\n cursor: pointer;\n}\n#aframeInspector #viewportBar {\n align-items: center;\n background-color: #242424;\n color: #c3c3c3;\n display: flex;\n flex-grow: 2;\n height: 32px;\n font-size: 15px;\n justify-content: space-between;\n left: 0;\n margin: 0 auto;\n right: 0;\n top: 0;\n}\n#aframeInspector .toolbarButtons {\n position: relative;\n}\n#aframeInspector .toolbarButtons * {\n margin-left: 0;\n padding: 8px;\n vertical-align: middle;\n}\n#aframeInspector .toolbarButtons a.button {\n margin: 0 6px 0 0;\n}\n#aframeInspector .toolbarButtons a.button:not(.active):hover {\n background-color: #444;\n}\n#aframeInspector .toolbarButtons .active {\n background-color: #1faaf2;\n color: #fff;\n}\n#aframeInspector .toolbarButtons .active:hover {\n color: #fff !important;\n}\n#aframeInspector .local-transform {\n padding-left: 10px;\n}\n#aframeInspector .local-transform label {\n color: #aaa;\n padding-left: 5px;\n}\n#aframeInspector .local-transform a.button {\n padding-top: 0;\n}\n#aframeInspector #cameraSelect {\n cursor: pointer;\n width: 110px;\n}\n#aframeInspector #cameraSelect .select__dropdown-indicator {\n padding-left: 3px;\n padding-right: 3px;\n}\n#aframeInspector #cameraToolbar {\n margin-left: 5px;\n align-items: center;\n display: flex;\n}\n#aframeInspector #cameraToolbar a {\n margin-right: 10px;\n}\n#aframeInspector #cameraToolbar .select__control {\n background: none;\n}\n#aframeInspector #cameraToolbar .select__single-value {\n color: #c3c3c3;\n}\n#aframeInspector #cameraToolbar .select__single-value:hover {\n color: #1faaf2;\n}\n#aframeInspector #viewportHud {\n display: none;\n}\n@media (min-width: 1024px) {\n #aframeInspector #viewportHud {\n display: block;\n }\n}\n#aframeInspector .Select-control {\n background-color: #222 !important;\n border: none;\n border-radius: 0;\n color: #1faaf2;\n font-family: $monosapce;\n}\n#aframeInspector .Select-menu-outer {\n border: none;\n}\n#aframeInspector .Select-menu-outer .is-focused {\n background-color: #1faaf2 !important;\n color: #c3c3c3;\n}\n#aframeInspector .Select-option {\n background-color: #222 !important;\n}\n#aframeInspector .select-widget {\n display: inline-block;\n width: 157px;\n}\n#aframeInspector .Select-placeholder,\n#aframeInspector .Select--single > .Select-control .Select-value {\n color: #1faaf2 !important;\n}\n#aframeInspector .Select-value-label {\n color: #1faaf2 !important;\n}\n#aframeInspector .dropbtn {\n border: none;\n color: #c3c3c3;\n cursor: pointer;\n}\n#aframeInspector .dropdown {\n display: inline-block;\n position: relative;\n}\n#aframeInspector .dropdown-content {\n background-color: #f9f9f9;\n box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);\n display: none;\n left: 8px;\n min-width: 38px;\n position: absolute;\n z-index: 999;\n}\n#aframeInspector .dropdown-content a {\n background-color: #232323;\n color: #7d7d7d;\n display: block;\n padding: 10px 14px;\n text-decoration: none;\n}\n#aframeInspector .dropdown-content a:hover {\n background-color: #4ecbff;\n color: #c3c3c3;\n}\n#aframeInspector .dropdownhover .dropdown-content {\n display: block;\n}\n#aframeInspector .dropdownhover .dropbtn {\n color: #1faaf2;\n}\n#aframeInspector .Select,\n#aframeInspector code,\n#aframeInspector pre,\n#aframeInspector input,\n#aframeInspector textarea,\n#aframeInspector select {\n font-family: system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;\n font-size: 13px;\n}\n#aframeInspector .wf-robotomono-n4-active .Select,\n#aframeInspector .wf-robotomono-n4-active code,\n#aframeInspector .wf-robotomono-n4-active pre,\n#aframeInspector .wf-robotomono-n4-active input,\n#aframeInspector .wf-robotomono-n4-active textarea,\n#aframeInspector .wf-robotomono-n4-active select {\n font-family: Roboto Mono, Consolas, Andale Mono, Monaco, Courier New, monospace;\n}\n#aframeInspector hr {\n border: 0;\n border-top: 1px solid #ccc;\n}\n#aframeInspector a {\n cursor: pointer;\n}\n#aframeInspector button {\n position: relative;\n}\n#aframeInspector code {\n font-family: Consolas, Andale Mono, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;\n}\n#aframeInspector textarea {\n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n white-space: pre;\n word-wrap: normal;\n}\n#aframeInspector textarea.success {\n border-color: #8b8 !important;\n}\n#aframeInspector textarea.fail {\n background-color: rgba(255,0,0,0.05);\n border-color: #f00 !important;\n}\n#aframeInspector textarea,\n#aframeInspector input {\n outline: none /* osx */;\n}\n#aframeInspector .gltfIcon img {\n box-sizing: content-box;\n display: inline;\n height: 20px;\n left: 5px;\n padding: 0 5px;\n position: relative;\n top: 4px;\n vertical-align: baseline;\n width: 20px;\n}\n#aframeInspector #scenegraph,\n#aframeInspector #rightPanel {\n z-index: 9998;\n}\n#aframeInspector #sidebar,\n#aframeInspector #scenegraph,\n#aframeInspector .panel {\n cursor: default;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n#aframeInspector .toggle-edit {\n background-color: #92374d;\n box-sizing: content-box;\n color: #fafafa;\n font-size: 13px;\n left: 3px;\n line-height: normal;\n margin: 0;\n padding: 6px 10px;\n position: fixed;\n text-align: center;\n text-decoration: none;\n top: 3px;\n width: 204px;\n z-index: 999999999;\n}\n#aframeInspector .toggle-edithover {\n background-color: #e42b5a;\n}\n#aframeInspector input {\n background-color: transparent;\n border: 1px solid #555;\n color: #fff;\n}\n#aframeInspector input,\n#aframeInspector .texture canvas {\n transition: 0.1s background-color ease-in-out, 0.1s border-color ease-in-out, 0.1s color ease-in-out;\n}\n#aframeInspector input[type=text],\n#aframeInspector input[type=number],\n#aframeInspector input.string,\n#aframeInspector input.number {\n min-height: 14px;\n outline: none;\n}\n#aframeInspector input[type="checkbox"] {\n -webkit-appearance: auto;\n -moz-appearance: auto;\n appearance: auto;\n cursor: pointer;\n margin: 0;\n height: 18px;\n width: 18px;\n}\n#aframeInspector input[type="checkbox"]:focus {\n box-shadow: none;\n}\n#aframeInspector input.number {\n background-color: transparent !important;\n border: 0;\n color: #2cb7ff !important;\n cursor: col-resize;\n font-size: 13px;\n padding: 2px;\n}\n#aframeInspector input.stringfocus,\n#aframeInspector input.numberfocus {\n border: 1px solid #20b1fb;\n color: #fff;\n cursor: auto;\n}\n#aframeInspector input.error {\n border: 1px solid #a00;\n}\n#aframeInspector #sidebar {\n background: #242424;\n width: 331px;\n}\n#aframeInspector #sidebar * {\n vertical-align: middle;\n}\n#aframeInspector input,\n#aframeInspector textarea,\n#aframeInspector select {\n background: #222;\n border: 1px solid transparent;\n color: #888;\n}\n#aframeInspector select {\n background: #393939;\n}\n#aframeInspector input[type=color] {\n background-color: #333;\n border: 1px solid #111;\n height: 28px;\n cursor: pointer;\n}\n#aframeInspector input[type=color] {\n cursor: pointer;\n height: 25px;\n padding: 0;\n width: 50px;\n}\n#aframeInspector input[type=color]-webkit-color-swatch {\n border: 0 /* To remove the gray border. */;\n}\n#aframeInspector input[type=color]-webkit-color-swatch-wrapper {\n padding: 0 /* To remove the inner padding. */;\n}\n#aframeInspector input[type=color]-moz-color-swatch {\n border: 0;\n}\n#aframeInspector input[type=color]-moz-focus-inner {\n border: 0 /* To remove the inner border (specific to Firefox). */;\n padding: 0;\n}\n#aframeInspector .hidden {\n visibility: hidden;\n}\n#aframeInspector a.button {\n color: #bcbcbc;\n font-size: 16px;\n margin-left: 10px;\n text-decoration: none;\n}\n#aframeInspector a.buttonhover {\n color: #1faaf2;\n}\n#aframeInspector .hide {\n display: none;\n}\n#aframeInspector .a-canvas.state-dragging {\n cursor: grabbing;\n}\n#aframeInspector #rightPanel {\n align-items: stretch;\n display: flex;\n justify-content: flex-end;\n}\n#aframeInspector #inspectorContainer {\n display: flex;\n justify-content: space-between;\n left: 0;\n height: 100%;\n pointer-events: none;\n position: fixed;\n top: 0;\n width: 100%;\n z-index: 999999;\n}\n#aframeInspector #scenegraph,\n#aframeInspector #viewportBar,\n#aframeInspector #rightPanel {\n pointer-events: all;\n}\n#aframeInspector .aframe-inspector-opened a-scene .a-canvas {\n background-color: #191919;\n z-index: 9998;\n}\n#aframeInspector .toggle-sidebar {\n align-items: center;\n display: flex;\n height: 100%;\n position: absolute;\n z-index: 9998;\n}\n#aframeInspector .toggle-sidebar a {\n background-color: #262626;\n color: #bcbcbc;\n padding: 5px;\n z-index: 9998;\n}\n#aframeInspector .toggle-sidebar a.hover {\n background-color: #1faaf2;\n color: #fff;\n}\n#aframeInspector .toggle-sidebar.left {\n top: 0;\n left: 0;\n}\n#aframeInspector .toggle-sidebar.right {\n top: 0;\n right: 0;\n}\n@keyframes animateopacity {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n', - '', - { - version: 3, - sources: [ - 'webpack://./src/style/index.styl', - 'webpack://./src/style/scenegraph.styl', - 'webpack://./src/style/components.styl', - 'webpack://./src/style/entity.styl', - 'webpack://./src/style/help.styl', - 'webpack://./src/style/select.styl', - 'webpack://./src/style/textureModal.styl', - 'webpack://./src/style/viewport.styl', - 'webpack://./src/style/lib.styl', - 'webpack://./src/style/widgets.styl' - ], - names: [], - mappings: - 'AAEA;;EAEE,wFAA8B;AADhC;AAGA;;EAEE,wFAA8B;AADhC;AAGA;EACE,mBAAW;EACX,WAAM;EACN,eAAU;EACV,SAAO;EACP,gBAAS;AADX;ACZA;EACE,yBAAiB;ADcnB;ACZE;EACE,gBAAQ;ADcZ;ACZI;EACE,WAAM;EACN,eAAO;ADcb;ACZA;EACE,mBAAW;EACX,0BAAW;EACX,aAAQ;EACR,sBAAe;EACf,cAAS;EACT,iBAAY;EACZ,YAAM;ADcR;ACZE;EACE,mBAAW;EACX,eAAO;EACP,aAAQ;EACR,8BAAgB;EAChB,YAAQ;EACR,WAAM;EACN,mBAAY;ADchB;ACZI;EACE,mBAAW;ADcjB;ACZI;EACE,yBAAiB;EACjB,WAAM;ADcZ;ACbM;EACE,cAAM;ADed;ACdM;EACE,eAAQ;ADgBhB;ACZQ;;;;EAIE,WAAM;ADchB;ACXQ;;;;EAIE,cAAM;ADahB;ACXE;EACE,cAAM;ADaV;ACXE;EACE,gBAAY;ADahB;ACXE;EACE,aAAQ;EACR,cAAO;ADaX;ACXI;EACE,WAAM;EACN,eAAU;EACV,gBAAY;ADalB;ACXE;EACE,WAAM;ADaV;ACXE;EACE,cAAM;ADaV;ACXE;EACE,cAAM;ADaV;ACXE;EACE,WAAM;ADaV;ACXE;EACE,WAAM;ADaV;ACXE;EACE,WAAM;EACN,qBAAQ;EACR,kBAAW;EACX,WAAM;ADaV;ACXE;EACE,WAAM;ADaV;ACXE;EACE,WAAM;ADaV;ACXE;EACE,YAAQ;EACR,eAAU;EACV,kBAAS;ADab;ACXI;EACE,cAAM;EACN,mBAAW;EACX,kBAAc;EACd,YAAO;EACP,iBAAY;EACZ,YAAM;ADaZ;ACXI;EACE,kBAAS;EACT,WAAM;EACN,QAAI;ADaV;ACXI;EACE,kBAAS;EACT,WAAM;EACN,QAAI;ADaV;ACXE;EACE,mBAAW;EACX,cAAM;EACN,eAAO;EACP,cAAK;EACL,eAAU;EACV,yBAAO;EACP,mBAAY;EACZ,aAAQ;EACR,gBAAW;EACX,UAAQ;EACR,YAAM;ADaV;ACXA;EACE,yBAAiB;EACjB,0BAAW;EACX,UAAO;EACP,YAAO;EACP,OAAK;EACL,YAAQ;ADaV;ACXE;EACE,YAAM;EACN,YAAO;ADaX;AErJA;EACE,yBAAiB;EACjB,cAAM;EACN,YAAO;EACP,cAAS;EACT,eAAS;EACT,YAAM;AFuJR;AErJA;;;EAGE,eAAQ;AFuJV;AErJA;;EAEE,WAAM;AFuJR;AErJA;EACE,WAAM;AFuJR;AErJA;EACE,mBAAY;EACZ,aAAQ;EACR,8BAAgB;AFuJlB;AEtJE;EACE,WAAM;AFwJV;AEtJA;EACE,cAAQ;AFwJV;AEtJA;EACE,gBAAU;EACV,gBAAS;EACT,uBAAc;EACd,yBAAe;EACf,mBAAY;EACZ,WAAM;EACN,gBAAY;EACZ,iCAAe;AFwJjB;AEtJA;EACE,gBAAW;EACX,gCAAc;EACd,uBAAW;EACX,eAAO;EACP,YAAO;EACP,2BAAQ;EACR,sBAAe;EACf,eAAU;AFwJZ;AEvJE;EACE,mBAAW;AFyJf;AE9IA;EACE,iBAAW;AFgJb;AE9IA;EACE,WAAM;EACN,gBAAQ;EACR,eAAU;EACV,YAAQ;EACR,iBAAW;AFgJb;AE9IA;EACE,SAAO;AFgJT;AE9IA;EACE,6BAAO;EACP,WAAM;EACN,SAAO;EACP,kBAAa;EACb,gBAAY;EACZ,QAAM;AFgJR;AE9IA;EACE,0BAAkB;EAClB,eAAW;AFgJb;AE9IA;EACE,yBAAiB;EACjB,eAAW;AFgJb;AE9IA;EACE,mBAAY;EACZ,aAAQ;EACR,eAAU;EACV,gBAAW;EACX,iBAAQ;AFgJV;AE9IE;EACE,eAAO;EACP,qBAAQ;EACR,gBAAS;EACT,mBAAc;EACd,uBAAc;EACd,sBAAe;EACf,YAAM;AFgJV;AE9IE;EACE,iBAAO;EACP,WAAM;AFgJV;AE9IE;EACE,eAAU;EACV,YAAO;AFgJX;AE9IE;;EAEE,iBAAY;AFgJhB;AE9IE;EACE,YAAO;AFgJX;AE9IE;;;;EAIE,mBAAW;EACX,cAAM;EACN,gBAAW;EACX,mBAAe;EACf,iBAAa;EACb,kBAAc;EACd,gBAAY;AFgJhB;AE/II;;;;EACE,gBAAc;AFoJpB;AElJE;EACE,iBAAa;EACb,sBAAW;EACX,YAAM;AFoJV;AElJE;;EAEE,gBAAW;AFoJf;AElJE;EACE,iBAAO;EACP,WAAM;EACN,mBAAe;AFoJnB;AElJA;EACE,cAAM;EACN,gBAAY;AFoJd;AElJA;EACE,sBAAe;AFoJjB;AElJA;EACE,WAAM;EACN,sBAAM;EACN,iBAAY;EACZ,8BAAe;AFoJjB;AElJA;EACE,YAAQ;AFoJV;AElJA;EACE,UAAQ;AFoJV;AElJA;EACE,mBAAY;EACZ,aAAQ;EACR,sBAAe;EACf,uBAAgB;EAChB,kBAAQ;EACR,mBAAW;AFoJb;AElJE;EACE,gBAAW;EACX,YAAM;AFoJV;AEnJI;EACE,mBAAW;EACX,YAAO;EACP,cAAM;AFqJZ;AEpJI;EACE,aAAQ;EACR,8BAAgB;AFsJtB;AErJM;EACE,cAAM;AFuJd;AErJE;EACE,eAAU;EACV,oBAAO;AFuJX;AErJE;EACE,gBAAW;AFuJf;AErJA;EACE,WAAM;AFuJR;AErJA;EACE,mBAAY;EACZ,aAAQ;AFuJV;AEpJE;EACE,WAAO;EACP,kBAAS;AFsJb;AErJE;EACE,aAAQ;AFuJZ;AEtJE;EACE,YAAO;AFwJX;AEvJE;EACE,eAAU;EACV,iBAAa;AFyJjB;AExJE;EACE,gBAAU;EACV,MAAI;AF0JR;AEzJE;EACE,cAAM;AF2JV;AEzJA;EACE,YAAM;AF2JR;AEzJA;EACE,aAAQ;AF2JV;AE1JE;EACE,cAAY;EACZ,YAAM;AF4JV;AE1JA;EACE,MAAI;AF4JN;AE1JA;EACE,cAAM;AF4JR;AE3JE;EACE,cAAM;AF6JV;AG9YA;EACE,mGAAY;EACZ,mBAAY;AHgZd;AG9YA;EACE,qBAAQ;EACR,gBAAS;EACT,kBAAS;EACT,uBAAc;EACd,QAAI;EACJ,mBAAY;AHgZd;AG9YA;EACE,cAAM;AHgZR;AG9YA;EACE,cAAM;AHgZR;AG9YA;EACE,cAAM;AHgZR;AIraA;EACE,aAAQ;EACR,6BAAgB;AJualB;AIraA;EACE,gBAAW;EACX,SAAO;EACP,iBAAQ;EACR,YAAM;AJuaR;AIraA;EACE,kBAAa;AJuaf;AIraA;EACE,gBAAY;EACZ,iBAAa;EACb,cAAQ;AJuaV;AIraA;EACE,WAAO;EACP,iBAAa;EACb,eAAU;EACV,kBAAS;AJuaX;AIraA;EACE,yBAAiB;EACjB,2BAAkB;EAClB,sBAAO;EACP,kBAAc;EACd,wBAAW;EACX,WAAM;EACN,qBAAQ;EACR,eAAU;EACV,cAAQ;EACR,kBAAW;AJuab;AIraA;EACE,WAAM;EACN,qBAAQ;EACR,gBAAY;AJuad;AK5cA;EACE,SAAO;EACP,gBAAc;EACd,eAAO;EACP,gBAAW;EACX,mGAAY;EACZ,eAAU;AL8cZ;AK5cA;EACE,YAAO;AL8cT;AK5cA;EACE,aAAQ;AL8cV;AK5cA;EACE,2BAAW;AL8cb;AK5cA;;EAEE,mBAAW;AL8cb;AK5cA;EACE,iBAAQ;AL8cV;AK5cA;;EAEE,cAAM;AL8cR;AK5cA;EACE,cAAM;AL8cR;AK5cA;EACE,2BAAW;AL8cb;AK5cA;EACE,eAAO;AL8cT;AK5cA;EACE,aAAQ;AL8cV;AK5cA;EACE,eAAU;AL8cZ;AK5cA;EACE,mBAAW;AL8cb;AK5cA;EACE,YAAO;EACP,gBAAS;AL8cX;AK7cE;EACE,YAAO;EACP,YAAQ;AL+cZ;AK7cA;EACE,gBAAQ;AL+cV;AK7cA;EACE,mBAAW;EACX,cAAM;AL+cR;AK7cA;EACE,cAAM;AL+cR;AK7cA;EACE,aAAQ;AL+cV;AK7cA;EACE,WAAM;EACN,mBAAW;AL+cb;AMrhBA;EACE,uCAAU;EACV,sBAAiB;EACjB,iCAAiB;EACjB,aAAQ;EACR,YAAO;EACP,OAAK;EACL,cAAS;EACT,eAAS;EACT,MAAI;EACJ,WAAM;EACN,mBAAQ;ANuhBV;AMrhBA;EACE,eAAU;EACV,gBAAY;EACZ,eAAO;ANuhBT;AMrhBA;EACE,yBAAO;EACP,wBAAM;ANuhBR;AMrhBA;EACE,mCAAU;EACV,wBAAmB;EACnB,0BAAe;EACf,yBAAiB;EACjB,qEAAyC;EACzC,YAAO;EACP,gBAAS;EACT,UAAQ;ANuhBV;AMrhBA;EACE,WAAM;EACN,YAAM;EACN,eAAU;EACV,iBAAY;ANuhBd;AMrhBA;;EAEE,WAAM;EACN,eAAO;EACP,qBAAgB;ANuhBlB;AMrhBA;EACE,WAAM;EACN,iBAAQ;ANuhBV;AMrhBA;EACE,cAAS;EACT,aAAQ;ANuhBV;AMrhBA;EACE,WAAM;EACN,iBAAQ;ANuhBV;AMphBA;EACE,mBAAW;EACX,aAAQ;EACR,eAAU;EACV,mBAAO;EACP,cAAS;EACT,qBAAQ;ANshBV;AMphBA;EACE,aAAQ;ANshBV;AMphBA;EACE,kBAAc;EACd,mCAAW;EACX,eAAO;EACP,WAAO;EACP,gBAAS;EACT,YAAM;ANshBR;AMphBA;;EAEE,6BAAW;ANshBb;AMphBA;EACE,yBAAiB;EACjB,SAAO;EACP,gBAAW;EACX,iBAAQ;ANshBV;AMphBA;EACE,kBAAY;EACZ,eAAW;EACX,eAAS;ANshBX;AMphBA;EACE,aAAQ;EACR,YAAM;ANshBR;AMphBA;EACE,cAAQ;EACR,aAAO;EACP,YAAM;ANshBR;AMphBA;EACE,YAAM;ANshBR;AMphBA;EACE,WAAM;EACN,qBAAQ;EACR,gBAAU;EACV,gBAAS;EACT,uBAAc;EACd,mBAAY;ANshBd;AMphBA;;EAEE,sBAAiB;ANshBnB;AMphBA;EACE,WAAM;EACN,cAAQ;EACR,eAAW;EACX,gBAAS;EACT,uBAAc;EACd,mBAAY;EACZ,YAAM;ANshBR;AMphBA;;EAEE,WAAM;ANshBR;AMphBA;EACE,sBAAM;ANshBR;AMphBA;EACE,wBAAW;KAAX,qBAAW;UAAX,gBAAW;EACX,gBAAc;EACd,gBAAW;EACX,eAAO;EACP,qBAAQ;EACR,eAAU;EACV,gBAAY;EACZ,kBAAO;EACP,iBAAQ;ANshBV;AMphBA;EACE,aAAQ;ANshBV;AMphBA;EACE,yBAAiB;EACjB,YAAO;EACP,WAAM;ANshBR;AMphBA;;EAEE,yBAAiB;EACjB,6BAAY;ANshBd;AMphBA;;EAEE,yBAAiB;EACjB,6BAAY;ANshBd;AMphBA;EACE,sBAAiB;EACjB,YAAO;ANshBT;AMphBA;EACE,yBAAiB;EACjB,cAAM;EACN,aAAQ;EACR,eAAU;EACV,8BAAgB;EAChB,gBAAW;EACX,cAAS;EACT,aAAQ;ANshBV;AMphBA;EACE,cAAM;EACN,gBAAQ;ANshBV;AMphBA;EACE,gBAAY;ANshBd;AMphBA;EACE,kBAAc;ANshBhB;AMphBA;EACE,eAAU;EACV,gBAAY;ANshBd;AMphBA;EACE,aAAQ;ANshBV;AMphBA;EACE,0CAAW;EACX,eAAS;ANshBX;AMphBA;EACE,gBAAW;EACX,YAAM;ANshBR;AMphBA;EACE,QAAI;ANshBN;AMphBA;EACE,YAAO;ANshBT;AMphBA;EACE,iBAAY;EACZ,YAAQ;ANshBV;AMphBA;EACE,eAAQ;ANshBV;AMphBA;EACE,gBAAY;EACZ,YAAM;ANshBR;AMphBA;EACE,sBAAO;EACP,eAAO;ANshBT;AO9uBA;EACE,mBAAY;EACZ,yBAAiB;EACjB,cAAM;EACN,aAAQ;EACR,YAAU;EACV,YAAO;EACP,eAAU;EACV,8BAAgB;EAChB,OAAK;EACL,cAAO;EACP,QAAM;EACN,MAAI;APgvBN;AO9uBA;EACE,kBAAS;APgvBX;AO9uBE;EACE,cAAY;EACZ,YAAQ;EACR,sBAAe;APgvBnB;AO9uBE;EACE,iBAAO;APgvBX;AO/uBI;EACE,sBAAiB;APivBvB;AO/uBE;EACE,yBAAiB;EACjB,WAAM;APivBV;AO/uBE;EACE,sBAAM;APivBV;AO/uBA;EACE,kBAAa;APivBf;AO/uBA;EACE,WAAM;EACN,iBAAa;APivBf;AO/uBA;EACE,cAAY;APivBd;AO/uBA;EACE,eAAO;EACP,YAAM;APivBR;AOhvBE;EACE,iBAAa;EACb,kBAAc;APkvBlB;AOhvBA;EACE,gBAAY;EACZ,mBAAY;EACZ,aAAQ;APkvBV;AOjvBE;EACE,kBAAa;APmvBjB;AOlvBE;EACE,gBAAW;APovBf;AOnvBE;EACE,cAAM;APqvBV;AOpvBI;EACE,cAAM;APsvBZ;AOpvBA;EACE,aAAQ;APsvBV;AQjyB2B;EAAA;ID6CvB,cAAQ;EPwvBV;AACF;AS5zBA;EACE,iCAAiB;EACjB,YAAO;EACP,gBAAc;EACd,cAAM;EACN,uBAAY;AT8zBd;AS5zBA;EACE,YAAO;AT8zBT;AS5zBA;EACE,oCAAiB;EACjB,cAAM;AT8zBR;AS5zBA;EACE,iCAAiB;AT8zBnB;AS5zBA;EACE,qBAAQ;EACR,YAAM;AT8zBR;AS5zBA;;EAEE,yBAAM;AT8zBR;AS5zBA;EACE,yBAAM;AT8zBR;AS3zBA;EACE,YAAO;EACP,cAAM;EACN,eAAO;AT6zBT;AS3zBA;EACE,qBAAQ;EACR,kBAAS;AT6zBX;AS3zBA;EACE,yBAAiB;EACjB,wCAAW;EACX,aAAQ;EACR,SAAK;EACL,eAAU;EACV,kBAAS;EACT,YAAQ;AT6zBV;AS3zBA;EACE,yBAAiB;EACjB,cAAM;EACN,cAAQ;EACR,kBAAQ;EACR,qBAAgB;AT6zBlB;AS3zBA;EACE,yBAAiB;EACjB,cAAM;AT6zBR;AS3zBA;EACE,cAAQ;AT6zBV;AS3zBA;EACE,cAAM;AT6zBR;AAl2BE;;;;;;EAME,mGAAY;EACZ,eAAU;AAo2Bd;AAl2BE;;;;;;EAME,+EAAuB;AAo2B3B;AAl2BE;EACE,SAAO;EACP,0BAAW;AAo2Bf;AAl2BE;EACE,eAAO;AAo2BX;AAl2BE;EACE,kBAAS;AAo2Bb;AAl2BE;EACE,+IAAoB;AAo2BxB;AAl2BE;EACE,gBAAS;IAAT,cAAS;OAAT,WAAS;EACT,gBAAY;EACZ,iBAAU;AAo2Bd;AAl2BE;EACE,6BAAa;AAo2BjB;AAl2BE;EACE,oCAAiB;EACjB,6BAAa;AAo2BjB;AAl2BE;;EAEE,uBAAQ;AAo2BZ;AAl2BE;EACE,uBAAW;EACX,eAAQ;EACR,YAAO;EACP,SAAK;EACL,cAAQ;EACR,kBAAS;EACT,QAAI;EACJ,wBAAe;EACf,WAAM;AAo2BV;AAl2BE;;EAEE,aAAQ;AAo2BZ;AAl2BE;;;EAGI,eAAO;EACP,yBAAY;KAAZ,sBAAY;UAAZ,iBAAY;AAo2BlB;AAl2BE;EACE,yBAAiB;EACjB,uBAAW;EACX,cAAM;EACN,eAAU;EACV,SAAK;EACL,mBAAY;EACZ,SAAO;EACP,iBAAQ;EACR,eAAS;EACT,kBAAW;EACX,qBAAgB;EAChB,QAAI;EACJ,YAAM;EACN,kBAAQ;AAo2BZ;AAl2BE;EACE,yBAAiB;AAo2BrB;AAl2BE;EACE,6BAAiB;EACjB,sBAAO;EACP,WAAM;AAo2BV;AAl2BE;;EAEE,oGAA4C;AAo2BhD;AAl2BE;;;;EAIE,gBAAW;EACX,aAAQ;AAo2BZ;AAl2BE;EACE,wBAAW;KAAX,qBAAW;UAAX,gBAAW;EACX,eAAO;EACP,SAAO;EACP,YAAO;EACP,WAAM;AAo2BV;AAl2BE;EACE,gBAAW;AAo2Bf;AAl2BE;EACE,wCAAiB;EACjB,SAAO;EACP,yBAAM;EACN,kBAAO;EACP,eAAU;EACV,YAAQ;AAo2BZ;AAl2BE;;EAEE,yBAAO;EACP,WAAM;EACN,YAAO;AAo2BX;AAl2BE;EACE,sBAAO;AAo2BX;AAl2BE;EACE,mBAAW;EACX,YAAM;AAo2BV;AAl2BE;EACE,sBAAe;AAo2BnB;AAl2BE;;;EAGE,gBAAW;EACX,6BAAO;EACP,WAAM;AAo2BV;AAl2BE;EACE,mBAAW;AAo2Bf;AAl2BE;EACE,sBAAiB;EACjB,sBAAO;EACP,YAAO;EACP,eAAO;AAo2BX;AAl2BE;EACE,eAAO;EACP,YAAO;EACP,UAAQ;EACR,WAAM;AAo2BV;AAj2BE;EACE,0CAAO;AAm2BX;AAj2BE;EACE,6CAAQ;AAm2BZ;AAj2BE;EACE,SAAO;AAm2BX;AAj2BE;EACE,iEAAO;EACP,UAAQ;AAm2BZ;AAj2BE;EACE,kBAAW;AAm2Bf;AAj2BE;EACE,cAAM;EACN,eAAU;EACV,iBAAY;EACZ,qBAAgB;AAm2BpB;AAj2BE;EACE,cAAM;AAm2BV;AA71BE;EACE,aAAQ;AA+1BZ;AA71BE;EACE,gBAAO;AA+1BX;AA71BE;EACE,oBAAY;EACZ,aAAQ;EACR,yBAAgB;AA+1BpB;AA71BE;EACE,aAAQ;EACR,8BAAgB;EAChB,OAAK;EACL,YAAO;EACP,oBAAe;EACf,eAAS;EACT,MAAI;EACJ,WAAM;EACN,eAAQ;AA+1BZ;AA71BE;;;EAGE,mBAAe;AA+1BnB;AA71BE;EACE,yBAAiB;EACjB,aAAQ;AA+1BZ;AA71BE;EACE,mBAAY;EACZ,aAAQ;EACR,YAAO;EACP,kBAAS;EACT,aAAQ;AA+1BZ;AA71BI;EACE,yBAAiB;EACjB,cAAM;EACN,YAAQ;EACR,aAAQ;AA+1Bd;AA71BI;EACE,yBAAiB;EACjB,WAAM;AA+1BZ;AA71BE;EACE,MAAI;EACJ,OAAK;AA+1BT;AA71BE;EACE,MAAI;EACJ,QAAM;AA+1BV;AAz5BE;EACE;IAAO,UAAS;EAo7BlB;EAn7BE;IAAK,UAAS;EAs7BhB;AACF', - sourcesContent: [ - "@import './lib';\n\nbody.aframe-inspector-opened,\n.toggle-edit\n font-family BlinkMacSystemFont, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif\n\n.wf-roboto-n4-active body.aframe-inspector-opened,\n.wf-roboto-n4-active .toggle-edit\n font-family BlinkMacSystemFont, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif\n\nbody.aframe-inspector-opened\n background $bgdark\n color #fff\n font-size 12px\n margin 0\n overflow hidden\n\n#aframeInspector\n @import './scenegraph';\n @import './components';\n @import './entity';\n @import './help';\n @import './select';\n @import './textureModal';\n @import './viewport';\n @import './widgets';\n\n .Select,\n code,\n pre,\n input,\n textarea,\n select\n font-family $monospace\n font-size 13px\n\n .wf-robotomono-n4-active .Select,\n .wf-robotomono-n4-active code,\n .wf-robotomono-n4-active pre,\n .wf-robotomono-n4-active input,\n .wf-robotomono-n4-active textarea,\n .wf-robotomono-n4-active select\n font-family Roboto Mono, Consolas, Andale Mono, Monaco, Courier New, monospace\n\n hr\n border 0\n border-top 1px solid #ccc\n\n a\n cursor pointer\n\n button\n position relative\n\n code\n font-family Consolas, Andale Mono, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace\n\n textarea\n tab-size 4\n white-space pre\n word-wrap normal\n\n textarea.success\n border-color #8b8 !important\n\n textarea.fail\n background-color rgba(255, 0, 0, 0.05)\n border-color #f00 !important\n\n textarea,\n input\n outline none /* osx */\n\n .gltfIcon img\n box-sizing content-box\n display inline\n height 20px\n left 5px\n padding 0 5px\n position relative\n top 4px\n vertical-align baseline\n width 20px\n\n #scenegraph,\n #rightPanel\n z-index 9998\n\n #sidebar,\n #scenegraph,\n .panel\n cursor default\n user-select none\n\n .toggle-edit\n background-color $red\n box-sizing content-box\n color #FAFAFA\n font-size 13px\n left 3px\n line-height normal\n margin 0\n padding 6px 10px\n position fixed\n text-align center\n text-decoration none\n top 3px\n width 204px\n z-index 999999999\n\n .toggle-edithover\n background-color rgb(228, 43, 90)\n\n input\n background-color transparent\n border 1px solid #555\n color #fff\n\n input,\n .texture canvas\n transition 0.1s background-color ease-in-out, 0.1s border-color ease-in-out, 0.1s color ease-in-out\n\n input[type=text],\n input[type=number],\n input.string,\n input.number\n min-height 14px\n outline none\n\n input[type=\"checkbox\"]\n appearance auto\n cursor pointer\n margin 0\n height 18px\n width 18px\n\n input[type=\"checkbox\"]:focus\n box-shadow none\n\n input.number\n background-color transparent !important\n border 0\n color #2cb7ff !important\n cursor col-resize\n font-size 13px\n padding 2px\n\n input.stringfocus,\n input.numberfocus\n border 1px solid #20b1fb\n color #fff\n cursor auto\n\n input.error\n border 1px solid #a00\n\n #sidebar\n background $bg\n width 331px\n\n #sidebar *\n vertical-align middle\n\n input,\n textarea,\n select\n background $black\n border 1px solid transparent\n color #888\n\n select\n background $bglighter\n\n input[type=color]\n background-color #333\n border 1px solid #111\n height 28px\n cursor pointer\n\n input[type=color]\n cursor pointer\n height 25px\n padding 0\n width 50px\n\n /* Note these vendor-prefixed selectors cannot be grouped! */\n input[type=color]-webkit-color-swatch\n border 0 /* To remove the gray border. */\n\n input[type=color]-webkit-color-swatch-wrapper\n padding 0 /* To remove the inner padding. */\n\n input[type=color]-moz-color-swatch\n border 0\n\n input[type=color]-moz-focus-inner\n border 0 /* To remove the inner border (specific to Firefox). */\n padding 0\n\n .hidden\n visibility hidden\n\n a.button\n color #bcbcbc\n font-size 16px\n margin-left 10px\n text-decoration none\n\n a.buttonhover\n color #1faaf2\n\n @keyframes animateopacity\n from { opacity: 0 }\n to { opacity: 1 }\n\n .hide\n display none\n\n .a-canvas.state-dragging\n cursor grabbing\n\n #rightPanel\n align-items stretch\n display flex\n justify-content flex-end\n\n #inspectorContainer\n display flex\n justify-content space-between\n left 0\n height 100%\n pointer-events none\n position fixed\n top 0\n width 100%\n z-index 999999\n\n #scenegraph,\n #viewportBar,\n #rightPanel\n pointer-events all\n\n .aframe-inspector-opened a-scene .a-canvas\n background-color #191919\n z-index 9998\n\n .toggle-sidebar\n align-items center\n display flex\n height 100%\n position absolute\n z-index 9998\n\n a\n background-color #262626\n color #bcbcbc\n padding 5px\n z-index 9998\n\n a.hover\n background-color #1faaf2\n color #fff\n\n .toggle-sidebar.left\n top 0\n left 0\n\n .toggle-sidebar.right\n top 0\n right 0\n", - "@import './lib';\n\n#toolbar\n background-color $bg\n\n .toolbarActions\n padding 0 0 5px\n\n a.disabled\n color #666\n cursor default\n\n#scenegraph\n background $bg\n border-top 1px solid #111\n display flex\n flex-direction column\n overflow auto\n padding-top 32px\n width 230px\n\n .entity\n background $bg\n cursor pointer\n display flex\n justify-content space-between\n padding 3px\n width 100%\n white-space nowrap\n\n &:hover\n background #1d2f39\n\n &.active\n background-color #155373\n color #fff\n .component:hover\n color #1888c1\n .entityActions\n display inline\n\n &.novisible\n &.active\n span,\n .fa,\n .collapsespace,\n .id\n color #999\n\n &:not(.active)\n span,\n .fa,\n .collapsespace,\n .id\n color #626262\n\n .component:hover\n color #1faaf2\n\n .entityIcons\n margin-left 2px\n\n .entityActions\n display none\n margin 0 14px\n\n .button\n color #fff\n font-size 12px\n margin-left 6px\n\n .fa\n color #CCC\n\n .entityActions .fa:hover\n color $primary\n\n .active .fa\n color #FAFAFA\n\n .id\n color #ccc\n\n .option.active .id\n color #fff\n\n .collapsespace\n color #eee\n display inline-block\n text-align center\n width 14px\n\n .fa-eye\n color #bbb\n\n .icons a.button\n color #fff\n\n .search\n padding 5px\n font-size 16px\n position relative\n\n input\n color $white\n background $bgdark\n border-radius 5px\n height 22px\n text-indent 10px\n width 216px\n\n .fa-search\n position absolute\n right 14px\n top 8px\n\n .fa-times\n position absolute\n right 15px\n top 9px\n\n .outliner\n background $bg\n color $white\n cursor default\n flex 1 1 auto\n font-size 13px\n height calc(100% - 98px)\n line-height normal\n outline none\n overflow-y auto\n padding 0\n width 230px\n\n.scenegraph-bottom\n background-color #323232\n border-top 1px solid #111\n bottom 10\n height 40px\n left 0\n z-index 100\n\n a\n float right\n margin 10px\n", - "@import './lib';\n\npropertyRowDefined() {\n .propertyRowDefined {\n {block}\n }\n}\n\n.components\n background-color $bg\n color $white\n height 100%\n overflow auto\n position fixed\n width 331px\n\ndiv.vec2,\ndiv.vec3,\ndiv.vec4\n display inline\n\n.vec2 input.number,\n.vec3 input.number\n width 40px\n\n.vec4 input.number\n width 34px\n\n.collapsible-header\n align-items center\n display flex\n justify-content space-between\n .entityPrint\n color #fff\n\n.collapsible-content\n padding 5px 0\n\n.componentTitle span\n max-width 200px\n overflow hidden\n text-overflow ellipsis\n text-transform uppercase\n white-space nowrap\n color #fff\n font-weight 600\n vertical-align bottom !important\n\n.collapsible .static\n background $bglight\n border-bottom 2px solid $bg\n box-sizing content-box\n cursor pointer\n height 16px\n padding 8px 10px 12px 10px\n vertical-align bottom\n font-size 13px\n &:hover\n background $bglighter\n/*\n.collapsible\n &.collapsed\n background-color $grayalt\n .static,\n .componentHeaderActions\n color #dedede\n &:hover\n background-color $grayhover\n*/\n.collapsible .menu\n text-align right\n\n.collapsible .menuafter\n color #bbb\n content '\\2807'\n font-size 12px\n padding 5px\n text-align right\n\n.collapsible .static\n margin 0\n\n.collapsible .static .collapse-button\n border 6px solid transparent\n float left\n height 0\n margin-right 10px\n margin-left 2px\n width 0\n\n.collapsible.collapsed .static .collapse-button\n border-left-color $white\n margin-top 4px\n\n.collapsible:not(.collapsed) .static .collapse-button\n border-top-color $white\n margin-top 7px\n\n.propertyRow\n align-items center\n display flex\n font-size 13px\n min-height 30px\n padding 2px 15px\n\n .text\n cursor default\n display inline-block\n overflow hidden\n padding-right 10px\n text-overflow ellipsis\n vertical-align middle\n width 118px\n\n .map_value\n margin 0 0 0 5px\n width 68px\n\n .Select-control\n font-size 11px\n height 24px\n\n .Select-placeholder,\n .Select--single > .Select-control .Select-value\n line-height 19px\n\n .Select-input\n height 22px\n\n input[type=text],\n input[type=number],\n input.string,\n input.number\n background $bgdark\n color #1faaf2\n min-height 26px\n padding-bottom 1px\n padding-left 5px\n padding-right 5px\n padding-top 1px\n &:last-child\n padding-right 0\n\n input.string\n padding-left 8px\n box-sizing border-box\n width 165px\n\n input[type=text]:focus,\n input.string:focus\n box-shadow none\n\n .color_value\n margin 0 0 0 5px\n width 68px\n letter-spacing 1px\n\n.propertyRowDefined .text\n color #FAFAFA\n font-weight 500\n\n.components *\n vertical-align middle\n\nspan.subcomponent\n color #999\n float none !important\n margin-left 10px\n vertical-align top !important\n\na.help-link\n opacity 0.4\n\na.help-linkhover\n opacity 1\n\n#addComponentContainer\n align-items center\n display flex\n flex-direction column\n justify-content center\n padding 20px 10px\n background $bgdark\n\n #addComponent\n text-align left\n width 200px\n .select__control\n background #161616\n height 35px\n color $primary\n .option\n display flex\n justify-content space-between\n span\n color $primary\n\n #addComponentHeader\n font-size 15px\n margin 5px 0 10px 0\n\n input[type=text]:focus\n box-shadow none\n\n.Select-menu-outer .is-focused span\n color #fff\n\n.component-title\n align-items center\n display flex\n\n#componentEntityHeader\n .collapsible-header\n bottom 4px\n position relative\n .collapse-button\n display none\n .static\n height 13px\n .entityPrint\n font-size 15px\n padding-left 5px\n .entityName\n max-width 160px\n top 0\n .entityIcons\n color #FAFAFA\n\n#mixinSelect\n width 160px\n\n.propertyRow .texture\n display flex\n input\n margin-left 0\n width 120px\n\n#componentEntityHeader .gltfIcon img\n top 0\n\n.fa\n color $white\n &:hover\n color $primary\n", - '@import \'./lib\';\n\n.entityPrint\n font-family $normalfont\n line-height 1.15em\n\n.entityName\n display inline-block\n overflow hidden\n position relative\n text-overflow ellipsis\n top 3px\n white-space nowrap\n\n[data-entity-name-type="id"]\n color $red\n\n[data-entity-name-type="class"]\n color $green\n\n[data-entity-name-type="mixin"]\n color $orange\n', - '.help-lists\n display flex\n justify-content space-around\n\n.help-list\n list-style none\n margin 0\n padding 0 0 10px\n width 350px\n\n.help-list li\n margin-right 40px\n\n.help-key-unit\n line-height 1.8\n margin-right 2em\n padding 5px 0\n\n.help-key\n bottom 2px\n margin-right 4px\n min-width 60px\n position relative\n\n.help-key span\n background-color #2e2e2e\n background-repeat repeat-x\n border 1px solid #666\n border-radius 3px\n box-shadow 0 0 5px #000\n color #999\n display inline-block\n font-size 12px\n padding 0 8px\n text-align center\n\n.help-key-def\n color #bbb\n display inline-block\n margin-left 1em\n', - "@import './lib';\n\n.select__control\n border 0\n border-radius 0\n cursor pointer\n min-height 26px\n font-family $monospace\n font-size 13px\n\n.select__indicator\n height 26px\n\n.select__indicator-separator\n display none\n\n.select__input\n min-height auto !important\n\n.select__control,\n.select__menu\n background $bgdark\n\n.select__option\n padding 5px 10px\n\n.select__placeholder,\n.select__menu\n color $white\n\n.select__single-value\n color $primary\n\n.select__control--is-focused\n box-shadow none !important\n\n.select__option\n cursor pointer\n\n.select__clear-indicator\n display none\n\n.select__label\n font-size 11px\n\n.select__option--is-focused\n background #155373\n\n.select__value-container\n height 26px\n position static\n &.select__value-container--is-multi\n height auto\n padding 6px\n\n.select__dropdown-indicator\n padding 3px 8px\n\n.select__multi-value\n background $bg\n color $primary\n\n.select__multi-value__label\n color $primary\n\n.select__value-container--is-multi > :last-child\n display none\n\n.select__multi-value__remove:hover\n color #fff\n background $bg\n", - '.modal\n animation animateopacity 0.2s ease-out\n background-color rgb(0, 0, 0)\n background-color rgba(0, 0, 0, 0.6)\n display flex\n height 100%\n left 0\n overflow auto\n position fixed\n top 0\n width 100%\n z-index 9999999999\n\n.modal h3\n font-size 18px\n font-weight 100\n margin 0.6em 0\n\n#textureModal .modal-content\n height calc(100% - 50px)\n width calc(100% - 50px)\n\n.modal-content\n animation animatetop 0.2s ease-out\n animation-duration 0.2s\n animation-name animatetop\n background-color #232323\n box-shadow 0 4px 8px 0 rgba(0, 0, 0, 0.5), 0 6px 20px 0 rgba(0, 0, 0, 0.5)\n margin auto\n overflow hidden\n padding 0\n\n.close\n color white\n float right\n font-size 28px\n font-weight bold\n\n.closehover,\n.closefocus\n color #08f\n cursor pointer\n text-decoration none\n\n.modal-header\n color white\n padding 2px 16px\n\n.modal-body\n overflow auto\n padding 16px\n\n.modal-footer\n color white\n padding 2px 16px\n\n/* Gallery */\n.gallery\n background #232323\n display flex\n flex-wrap wrap\n margin 15px auto 0\n overflow auto\n padding 15px 3px 3px\n\n.newimage .gallery\n padding 16px\n\n.gallery li\n border-radius 2px\n box-shadow 0 0 6px rgba(0, 0, 0, 0.6)\n cursor pointer\n margin 8px\n overflow hidden\n width 155px\n\n.gallery li.selected,\n.gallery li:hover\n box-shadow 0 0 0 2px #1eaaf1\n\n.gallery li .detail\n background-color #323232\n margin 0\n min-height 60px\n padding 3px 10px\n\n.gallery li .button.fa-external-link\n margin-left 136px\n margin-top 5px\n position fixed\n\n.preview\n padding 10px\n width 150px\n\n.preview input\n display block\n margin 8px 0\n width 144px\n\n.preview button\n width 155px\n\n.preview .detail .title\n color #fff\n display inline-block\n max-width 155px\n overflow hidden\n text-overflow ellipsis\n white-space nowrap\n\n.gallery li.selected .detail,\n.gallery li:hover .detail\n background-color #444\n\n.gallery li .detail span\n color #777\n display block\n margin-top 4px\n overflow hidden\n text-overflow ellipsis\n white-space nowrap\n width 140px\n\n.gallery li.selected .detail span,\n.gallery li:hover .detail span\n color #888\n\n.gallery li .detail span.title\n color #fff !important\n\n.modal button\n appearance none\n border-radius 0\n box-shadow none\n cursor pointer\n display inline-block\n font-size 12px\n line-height 1.8\n margin 0 10px 0 0\n padding 5px 10px\n\n.modal buttonfocus\n outline none\n\n.modal button\n background-color #1eaaf1\n border none\n color #fff\n\n.modal buttonhover,\n.modal button.hover\n background-color #346392\n text-shadow -1px 1px #27496d\n\n.modal buttonactive,\n.modal button.active\n background-color #27496d\n text-shadow -1px 1px #193047\n\n.modal buttondisabled\n background-color #888\n cursor none\n\n.newimage\n background-color #323232\n color #bcbcbc\n display flex\n font-size 13px\n justify-content space-between\n margin-top 10px\n overflow auto\n padding 10px\n\n.newimage input\n color #1eaaf1\n padding 3px 5px\n\n.texture canvas + input\n margin-left 5px\n\n.texture .fa\n padding-right 5px\n\n.texture .fa-external-link\n font-size 14px\n padding-top 2px\n\n.uploader-normal-button .hidden\n display none\n\n.gallery a.fa.texture-link\n box-shadow 0 0 14px -1px rgba(0, 0, 0, 0.75)\n position fixed\n\n.assets.search\n margin-top 10px\n width 200px\n\n.assets.search .fa-search\n top 7px\n\n.new_asset_options\n margin 10px\n\n.new_asset_options > ul\n margin-left 10px\n padding 5px\n\n.new_asset_options > ul > li\n padding 10px 0\n\n.new_asset_options .imageUrl\n margin-left 5px\n width 350px\n\n.texture canvas\n border 1px solid $bglight\n cursor pointer\n', - "@import './lib';\n\n#viewportBar\n align-items center\n background-color $bg\n color $white\n display flex\n flex-grow 2\n height 32px\n font-size 15px\n justify-content space-between\n left 0\n margin 0 auto\n right 0\n top 0\n\n.toolbarButtons\n position relative\n\n *\n margin-left 0\n padding 8px\n vertical-align middle\n\n a.button\n margin 0 6px 0 0\n &:not(.active):hover\n background-color $grayhover\n\n .active\n background-color $primary\n color #fff\n\n .active:hover\n color #fff !important\n\n.local-transform\n padding-left 10px\n\n.local-transform label\n color $lightgray\n padding-left 5px\n\n.local-transform a.button\n padding-top 0\n\n#cameraSelect\n cursor pointer\n width 110px\n .select__dropdown-indicator\n padding-left 3px\n padding-right 3px\n\n#cameraToolbar\n margin-left 5px\n align-items center\n display flex\n a\n margin-right 10px\n .select__control\n background none\n .select__single-value\n color $white\n &:hover\n color $primary\n\n#viewportHud\n display none\n +media--1024()\n display block\n", - '$primary=#1faaf2\n$primaryhover=lighten(#1faaf2, 35%)\n\n$bg=#242424\n$bgdark=#1d1d1d\n$bglight=#333\n$bglighter=#393939\n\n$red=#92374d\n$green=#514b23\n$orange=#d66853\n\n$black=#222\n$gray=#262626\n$grayalt=#323232\n$grayhover=#444\n\n$lightgray=#AAA\n$white=#c3c3c3\n\n$normalfont=system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif\n$monospace=system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif\n\nmedia--1024() {\n @media (min-width: 1024px) {\n {block}\n }\n}\n', - "@import './lib';\n\n.Select-control\n background-color #222 !important\n border none\n border-radius 0\n color $primary\n font-family $monosapce\n\n.Select-menu-outer\n border none\n\n.Select-menu-outer .is-focused\n background-color $primary !important\n color $white\n\n.Select-option\n background-color #222 !important\n\n.select-widget\n display inline-block\n width 157px\n\n.Select-placeholder,\n.Select--single > .Select-control .Select-value\n color $primary !important\n\n.Select-value-label\n color $primary !important\n\n/* Dropdown menu */\n.dropbtn\n border none\n color $white\n cursor pointer\n\n.dropdown\n display inline-block\n position relative\n\n.dropdown-content\n background-color #f9f9f9\n box-shadow 0 8px 16px 0 rgba(0, 0, 0, 0.2)\n display none\n left 8px\n min-width 38px\n position absolute\n z-index 999\n\n.dropdown-content a\n background-color #232323\n color #7d7d7d\n display block\n padding 10px 14px\n text-decoration none\n\n.dropdown-content a:hover\n background-color #4ecbff\n color $white\n\n.dropdownhover .dropdown-content\n display block\n\n.dropdownhover .dropbtn\n color $primary\n" - ], - sourceRoot: '' - } - ]); - // Exports - /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = - ___CSS_LOADER_EXPORT___; + } /***/ }, - /***/ './node_modules/css-loader/dist/runtime/api.js': - /*!*****************************************************!*\ - !*** ./node_modules/css-loader/dist/runtime/api.js ***! - \*****************************************************/ - /***/ (module) => { - 'use strict'; + /***/ './node_modules/lodash.debounce/index.js': + /*!***********************************************!*\ + !*** ./node_modules/lodash.debounce/index.js ***! + \***********************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ - /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - module.exports = function (cssWithMappingToString) { - var list = []; + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = ''; - var needLayer = typeof item[5] !== 'undefined'; - if (item[4]) { - content += '@supports ('.concat(item[4], ') {'); - } - if (item[2]) { - content += '@media '.concat(item[2], ' {'); - } - if (needLayer) { - content += '@layer'.concat( - item[5].length > 0 ? ' '.concat(item[5]) : '', - ' {' - ); - } - content += cssWithMappingToString(item); - if (needLayer) { - content += '}'; - } - if (item[2]) { - content += '}'; - } - if (item[4]) { - content += '}'; - } - return content; - }).join(''); - }; + /** Used as references for various `Number` constants. */ + var NAN = 0 / 0; - // import a list of modules into the list - list.i = function i(modules, media, dedupe, supports, layer) { - if (typeof modules === 'string') { - modules = [[null, modules, undefined]]; - } - var alreadyImportedModules = {}; - if (dedupe) { - for (var k = 0; k < this.length; k++) { - var id = this[k][0]; - if (id != null) { - alreadyImportedModules[id] = true; - } - } - } - for (var _k = 0; _k < modules.length; _k++) { - var item = [].concat(modules[_k]); - if (dedupe && alreadyImportedModules[item[0]]) { - continue; - } - if (typeof layer !== 'undefined') { - if (typeof item[5] === 'undefined') { - item[5] = layer; - } else { - item[1] = '@layer' - .concat(item[5].length > 0 ? ' '.concat(item[5]) : '', ' {') - .concat(item[1], '}'); - item[5] = layer; - } - } - if (media) { - if (!item[2]) { - item[2] = media; - } else { - item[1] = '@media ' - .concat(item[2], ' {') - .concat(item[1], '}'); - item[2] = media; - } - } - if (supports) { - if (!item[4]) { - item[4] = ''.concat(supports); - } else { - item[1] = '@supports (' - .concat(item[4], ') {') - .concat(item[1], '}'); - item[4] = supports; - } - } - list.push(item); - } - }; - return list; - }; + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; - /***/ - }, + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g; - /***/ './node_modules/css-loader/dist/runtime/sourceMaps.js': - /*!************************************************************!*\ - !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***! - \************************************************************/ - /***/ (module) => { - 'use strict'; + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - module.exports = function (item) { - var content = item[1]; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - if (typeof btoa === 'function') { - var base64 = btoa( - unescape(encodeURIComponent(JSON.stringify(cssMapping))) - ); - var data = - 'sourceMappingURL=data:application/json;charset=utf-8;base64,'.concat( - base64 - ); - var sourceMapping = '/*# '.concat(data, ' */'); - return [content].concat([sourceMapping]).join('\n'); - } - return [content].join('\n'); - }; + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; - /***/ - }, + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; - /***/ './node_modules/events/events.js': - /*!***************************************!*\ - !*** ./node_modules/events/events.js ***! - \***************************************/ - /***/ (module) => { - 'use strict'; - // Copyright Joyent, Inc. and other Node contributors. - // - // Permission is hereby granted, free of charge, to any person obtaining a - // copy of this software and associated documentation files (the - // "Software"), to deal in the Software without restriction, including - // without limitation the rights to use, copy, modify, merge, publish, - // distribute, sublicense, and/or sell copies of the Software, and to permit - // persons to whom the Software is furnished to do so, subject to the - // following conditions: - // - // The above copyright notice and this permission notice shall be included - // in all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN - // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. + /** Built-in method references without a dependency on `root`. */ + var freeParseInt = parseInt; - var R = typeof Reflect === 'object' ? Reflect : null; - var ReflectApply = - R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - }; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = + typeof __webpack_require__.g == 'object' && + __webpack_require__.g && + __webpack_require__.g.Object === Object && + __webpack_require__.g; - var ReflectOwnKeys; - if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys; - } else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target).concat( - Object.getOwnPropertySymbols(target) - ); - }; - } else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; - } + /** Detect free variable `self`. */ + var freeSelf = + typeof self == 'object' && self && self.Object === Object && self; - function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); - } + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); - var NumberIsNaN = - Number.isNaN || - function NumberIsNaN(value) { - return value !== value; - }; + /** Used for built-in method references. */ + var objectProto = Object.prototype; - function EventEmitter() { - EventEmitter.init.call(this); - } - module.exports = EventEmitter; - module.exports.once = once; + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; - // Backwards-compat with node 0.10.x - EventEmitter.EventEmitter = EventEmitter; + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max, + nativeMin = Math.min; - EventEmitter.prototype._events = undefined; - EventEmitter.prototype._eventsCount = 0; - EventEmitter.prototype._maxListeners = undefined; + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = function () { + return root.Date.now(); + }; - // By default EventEmitters will print a warning if more than 10 listeners are - // added to it. This is a useful default which helps finding memory leaks. - var defaultMaxListeners = 10; + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; - function checkListener(listener) { - if (typeof listener !== 'function') { - throw new TypeError( - 'The "listener" argument must be of type Function. Received type ' + - typeof listener - ); + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing + ? nativeMax(toNumber(options.maxWait) || 0, wait) + : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; } - } - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function () { - return defaultMaxListeners; - }, - set: function (arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError( - 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + - arg + - '.' - ); - } - defaultMaxListeners = arg; + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; } - }); - EventEmitter.init = function () { - if ( - this._events === undefined || - this._events === Object.getPrototypeOf(this)._events - ) { - this._events = Object.create(null); - this._eventsCount = 0; + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; } - this._maxListeners = this._maxListeners || undefined; - }; + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError( - 'The value of "n" is out of range. It must be a non-negative number. Received ' + - n + - '.' - ); + return maxing + ? nativeMin(result, maxWait - timeSinceLastInvoke) + : result; } - this._maxListeners = n; - return this; - }; - function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; - } + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; - EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); - }; + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return ( + lastCallTime === undefined || + timeSinceLastCall >= wait || + timeSinceLastCall < 0 || + (maxing && timeSinceLastInvoke >= maxWait) + ); + } - EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = type === 'error'; + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } - var events = this._events; - if (events !== undefined) - doError = doError && events.error === undefined; - else if (!doError) return false; + function trailingEdge(time) { + timerId = undefined; - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); } - // At least give some kind of context to the user - var err = new Error( - 'Unhandled error.' + (er ? ' (' + er.message + ')' : '') - ); - err.context = er; - throw err; // Unhandled 'error' event + lastArgs = lastThis = undefined; + return result; } - var handler = events[type]; - - if (handler === undefined) return false; - - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; } - return true; - }; - - function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } - checkListener(listener); + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit( - 'newListener', - type, - listener.listener ? listener.listener : listener - ); + lastArgs = arguments; + lastThis = this; + lastCallTime = time; - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } } - existing = events[type]; + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = prepend - ? [listener, existing] - : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error( - 'Possible EventEmitter memory leak detected. ' + - existing.length + - ' ' + - String(type) + - ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit' - ); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } - return target; + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return ( + typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag) + ); } - EventEmitter.prototype.addListener = function addListener( - type, - listener - ) { - return _addListener(this, type, listener, false); - }; + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = + typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? other + '' : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : reIsBadHex.test(value) + ? NAN + : +value; + } - EventEmitter.prototype.on = EventEmitter.prototype.addListener; + module.exports = debounce; - EventEmitter.prototype.prependListener = function prependListener( - type, - listener - ) { - return _addListener(this, type, listener, true); - }; + /***/ + }, - function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); + /***/ './node_modules/memoize-one/dist/memoize-one.esm.js': + /*!**********************************************************!*\ + !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***! + \**********************************************************/ + /***/ ( + __unused_webpack_module, + __webpack_exports__, + __webpack_require__ + ) => { + 'use strict'; + __webpack_require__.r(__webpack_exports__); + /* harmony export */ __webpack_require__.d(__webpack_exports__, { + /* harmony export */ default: () => /* binding */ memoizeOne + /* harmony export */ + }); + var safeIsNaN = + Number.isNaN || + function ponyfill(value) { + return typeof value === 'number' && value !== value; + }; + function isEqual(first, second) { + if (first === second) { + return true; + } + if (safeIsNaN(first) && safeIsNaN(second)) { + return true; + } + return false; + } + function areInputsEqual(newInputs, lastInputs) { + if (newInputs.length !== lastInputs.length) { + return false; + } + for (var i = 0; i < newInputs.length; i++) { + if (!isEqual(newInputs[i], lastInputs[i])) { + return false; + } } + return true; } - function _onceWrap(target, type, listener) { - var state = { - fired: false, - wrapFn: undefined, - target: target, - type: type, - listener: listener + function memoizeOne(resultFn, isEqual) { + if (isEqual === void 0) { + isEqual = areInputsEqual; + } + var cache = null; + function memoized() { + var newArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + newArgs[_i] = arguments[_i]; + } + if ( + cache && + cache.lastThis === this && + isEqual(newArgs, cache.lastArgs) + ) { + return cache.lastResult; + } + var lastResult = resultFn.apply(this, newArgs); + cache = { + lastResult: lastResult, + lastArgs: newArgs, + lastThis: this + }; + return lastResult; + } + memoized.clear = function clear() { + cache = null; }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; + return memoized; } - EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; - }; - - EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; + /***/ + }, - // Emits a 'removeListener' event if and only if the listener was removed. - EventEmitter.prototype.removeListener = function removeListener( - type, - listener - ) { - var list, events, position, i, originalListener; + /***/ './node_modules/object-assign/index.js': + /*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ + /***/ (module) => { + 'use strict'; + /* +object-assign +(c) Sindre Sorhus +@license MIT +*/ - checkListener(listener); + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; - events = this._events; - if (events === undefined) return this; + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError( + 'Object.assign cannot be called with null or undefined' + ); + } - list = events[type]; - if (list === undefined) return this; + return Object(val); + } - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); + function shouldUseNative() { + try { + if (!Object.assign) { + return false; } - } else if (typeof list !== 'function') { - position = -1; - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } + // Detect buggy property enumeration order in older V8 versions. - if (position < 0) return this; + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } - if (position === 0) list.shift(); - else { - spliceOne(list, position); + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; } - if (list.length === 1) events[type] = list[0]; + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if ( + Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst' + ) { + return false; + } - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; } + } - return this; - }; + module.exports = shouldUseNative() + ? Object.assign + : function (target, source) { + var from; + var to = toObject(target); + var symbols; - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); - EventEmitter.prototype.removeAllListeners = function removeAllListeners( - type - ) { - var listeners, events, i; + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } - events = this._events; - if (events === undefined) return this; + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) this._events = Object.create(null); - else delete events[type]; - } - return this; - } + return to; + }; - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } + /***/ + }, - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - - function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) return []; - - var evlistener = events[type]; - if (evlistener === undefined) return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap - ? unwrapListeners(evlistener) - : arrayClone(evlistener, evlistener.length); - } - - EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); - }; - - EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); - }; - - EventEmitter.listenerCount = function (emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } - }; + /***/ './node_modules/prop-types/checkPropTypes.js': + /*!***************************************************!*\ + !*** ./node_modules/prop-types/checkPropTypes.js ***! + \***************************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { + 'use strict'; + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - EventEmitter.prototype.listenerCount = listenerCount; - function listenerCount(type) { - var events = this._events; + var printWarning = function () {}; - if (events !== undefined) { - var evlistener = events[type]; + if (true) { + var ReactPropTypesSecret = __webpack_require__( + /*! ./lib/ReactPropTypesSecret */ './node_modules/prop-types/lib/ReactPropTypesSecret.js' + ); + var loggedTypeFailures = {}; + var has = __webpack_require__( + /*! ./lib/has */ './node_modules/prop-types/lib/has.js' + ); - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; + printWarning = function (text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); } - } - - return 0; - } - - EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; - }; - - function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) copy[i] = arr[i]; - return copy; - } - - function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) { + /**/ + } + }; } - function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; - } + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes( + typeSpecs, + values, + location, + componentName, + getStack + ) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + + ': ' + + location + + ' type `' + + typeSpecName + + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + + typeof typeSpecs[typeSpecName] + + '`.' + + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName]( + values, + typeSpecName, + componentName, + location, + null, + ReactPropTypesSecret + ); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + + ': type specification of ' + + location + + ' `' + + typeSpecName + + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + + typeof error + + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if ( + error instanceof Error && + !(error.message in loggedTypeFailures) + ) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; - function once(emitter, name) { - return new Promise(function (resolve, reject) { - function errorListener(err) { - emitter.removeListener(name, resolver); - reject(err); - } + var stack = getStack ? getStack() : ''; - function resolver() { - if (typeof emitter.removeListener === 'function') { - emitter.removeListener('error', errorListener); + printWarning( + 'Failed ' + + location + + ' type: ' + + error.message + + (stack != null ? stack : '') + ); + } } - resolve([].slice.call(arguments)); - } - - eventTargetAgnosticAddListener(emitter, name, resolver, { - once: true - }); - if (name !== 'error') { - addErrorHandlerIfEventEmitter(emitter, errorListener, { - once: true - }); } - }); - } - - function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === 'function') { - eventTargetAgnosticAddListener(emitter, 'error', handler, flags); } } - function eventTargetAgnosticAddListener( - emitter, - name, - listener, - flags - ) { - if (typeof emitter.on === 'function') { - if (flags.once) { - emitter.once(name, listener); - } else { - emitter.on(name, listener); - } - } else if (typeof emitter.addEventListener === 'function') { - // EventTarget does not have `error` event semantics like Node - // EventEmitters, we do not listen for `error` events here. - emitter.addEventListener(name, function wrapListener(arg) { - // IE does not have builtin `{ once: true }` support so we - // have to do it manually. - if (flags.once) { - emitter.removeEventListener(name, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError( - 'The "emitter" argument must be of type EventEmitter. Received type ' + - typeof emitter - ); + /** + * Resets warning cache when testing. + * + * @private + */ + checkPropTypes.resetWarningCache = function () { + if (true) { + loggedTypeFailures = {}; } - } + }; + + module.exports = checkPropTypes; /***/ }, - /***/ './node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js': - /*!**********************************************************************************!*\ - !*** ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js ***! - \**********************************************************************************/ + /***/ './node_modules/prop-types/factoryWithTypeCheckers.js': + /*!************************************************************!*\ + !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! + \************************************************************/ /***/ (module, __unused_webpack_exports, __webpack_require__) => { 'use strict'; - - var reactIs = __webpack_require__( - /*! react-is */ './node_modules/hoist-non-react-statics/node_modules/react-is/index.js' - ); - /** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ - var REACT_STATICS = { - childContextTypes: true, - contextType: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromError: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true - }; - var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true - }; - var FORWARD_REF_STATICS = { - $$typeof: true, - render: true, - defaultProps: true, - displayName: true, - propTypes: true - }; - var MEMO_STATICS = { - $$typeof: true, - compare: true, - defaultProps: true, - displayName: true, - propTypes: true, - type: true - }; - var TYPE_STATICS = {}; - TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; - TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; - - function getStatics(component) { - // React v16.11 and below - if (reactIs.isMemo(component)) { - return MEMO_STATICS; - } // React v16.12 and above - - return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; - } - var defineProperty = Object.defineProperty; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var getPrototypeOf = Object.getPrototypeOf; - var objectPrototype = Object.prototype; - function hoistNonReactStatics( - targetComponent, - sourceComponent, - blacklist - ) { - if (typeof sourceComponent !== 'string') { - // don't hoist over string (html) components - if (objectPrototype) { - var inheritedComponent = getPrototypeOf(sourceComponent); + var ReactIs = __webpack_require__( + /*! react-is */ './node_modules/prop-types/node_modules/react-is/index.js' + ); + var assign = __webpack_require__( + /*! object-assign */ './node_modules/object-assign/index.js' + ); - if ( - inheritedComponent && - inheritedComponent !== objectPrototype - ) { - hoistNonReactStatics( - targetComponent, - inheritedComponent, - blacklist - ); - } - } + var ReactPropTypesSecret = __webpack_require__( + /*! ./lib/ReactPropTypesSecret */ './node_modules/prop-types/lib/ReactPropTypesSecret.js' + ); + var has = __webpack_require__( + /*! ./lib/has */ './node_modules/prop-types/lib/has.js' + ); + var checkPropTypes = __webpack_require__( + /*! ./checkPropTypes */ './node_modules/prop-types/checkPropTypes.js' + ); - var keys = getOwnPropertyNames(sourceComponent); + var printWarning = function () {}; - if (getOwnPropertySymbols) { - keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + if (true) { + printWarning = function (text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } - var targetStatics = getStatics(targetComponent); - var sourceStatics = getStatics(sourceComponent); - - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; + function emptyFunctionThatReturnsNull() { + return null; + } - if ( - !KNOWN_STATICS[key] && - !(blacklist && blacklist[key]) && - !(sourceStatics && sourceStatics[key]) && - !(targetStatics && targetStatics[key]) - ) { - var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + module.exports = function (isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - try { - // Avoid failures from read-only properties - defineProperty(targetComponent, key, descriptor); - } catch (e) {} - } + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = + maybeIterable && + ((ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL]) || + maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; } } - return targetComponent; - } + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ - module.exports = hoistNonReactStatics; + var ANONYMOUS = '<>'; - /***/ - }, + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bigint: createPrimitiveTypeChecker('bigint'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), - /***/ './node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js': - /*!************************************************************************************************!*\ - !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js ***! - \************************************************************************************************/ - /***/ (__unused_webpack_module, exports) => { - 'use strict'; - /** @license React v16.13.1 - * react-is.development.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - if (true) { - (function () { - 'use strict'; + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker + }; - // The Symbol used to tag the ReactElement-like types. If there is no native Symbol - // nor polyfill, then a plain number is used for performance. - var hasSymbol = typeof Symbol === 'function' && Symbol.for; - var REACT_ELEMENT_TYPE = hasSymbol - ? Symbol.for('react.element') - : 0xeac7; - var REACT_PORTAL_TYPE = hasSymbol - ? Symbol.for('react.portal') - : 0xeaca; - var REACT_FRAGMENT_TYPE = hasSymbol - ? Symbol.for('react.fragment') - : 0xeacb; - var REACT_STRICT_MODE_TYPE = hasSymbol - ? Symbol.for('react.strict_mode') - : 0xeacc; - var REACT_PROFILER_TYPE = hasSymbol - ? Symbol.for('react.profiler') - : 0xead2; - var REACT_PROVIDER_TYPE = hasSymbol - ? Symbol.for('react.provider') - : 0xeacd; - var REACT_CONTEXT_TYPE = hasSymbol - ? Symbol.for('react.context') - : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary - // (unstable) APIs that have been removed. Can we remove the symbols? + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ - var REACT_ASYNC_MODE_TYPE = hasSymbol - ? Symbol.for('react.async_mode') - : 0xeacf; - var REACT_CONCURRENT_MODE_TYPE = hasSymbol - ? Symbol.for('react.concurrent_mode') - : 0xeacf; - var REACT_FORWARD_REF_TYPE = hasSymbol - ? Symbol.for('react.forward_ref') - : 0xead0; - var REACT_SUSPENSE_TYPE = hasSymbol - ? Symbol.for('react.suspense') - : 0xead1; - var REACT_SUSPENSE_LIST_TYPE = hasSymbol - ? Symbol.for('react.suspense_list') - : 0xead8; - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; - var REACT_BLOCK_TYPE = hasSymbol - ? Symbol.for('react.block') - : 0xead9; - var REACT_FUNDAMENTAL_TYPE = hasSymbol - ? Symbol.for('react.fundamental') - : 0xead5; - var REACT_RESPONDER_TYPE = hasSymbol - ? Symbol.for('react.responder') - : 0xead6; - var REACT_SCOPE_TYPE = hasSymbol - ? Symbol.for('react.scope') - : 0xead7; + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message, data) { + this.message = message; + this.data = data && typeof data === 'object' ? data : {}; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; - function isValidElementType(type) { - return ( - typeof type === 'string' || - typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - type === REACT_FRAGMENT_TYPE || - type === REACT_CONCURRENT_MODE_TYPE || - type === REACT_PROFILER_TYPE || - type === REACT_STRICT_MODE_TYPE || - type === REACT_SUSPENSE_TYPE || - type === REACT_SUSPENSE_LIST_TYPE || - (typeof type === 'object' && - type !== null && - (type.$$typeof === REACT_LAZY_TYPE || - type.$$typeof === REACT_MEMO_TYPE || - type.$$typeof === REACT_PROVIDER_TYPE || - type.$$typeof === REACT_CONTEXT_TYPE || - type.$$typeof === REACT_FORWARD_REF_TYPE || - type.$$typeof === REACT_FUNDAMENTAL_TYPE || - type.$$typeof === REACT_RESPONDER_TYPE || - type.$$typeof === REACT_SCOPE_TYPE || - type.$$typeof === REACT_BLOCK_TYPE)) - ); + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; } + function checkType( + isRequired, + props, + propName, + componentName, + location, + propFullName, + secret + ) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; - function typeOf(object) { - if (typeof object === 'object' && object !== null) { - var $$typeof = object.$$typeof; + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (true && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + + propFullName + + '` prop on `' + + componentName + + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError( + 'The ' + + location + + ' `' + + propFullName + + '` is marked as required ' + + ('in `' + componentName + '`, but its value is `null`.') + ); + } + return new PropTypeError( + 'The ' + + location + + ' `' + + propFullName + + '` is marked as required in ' + + ('`' + componentName + '`, but its value is `undefined`.') + ); + } + return null; + } else { + return validate( + props, + propName, + componentName, + location, + propFullName + ); + } + } - switch ($$typeof) { - case REACT_ELEMENT_TYPE: - var type = object.type; + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); - switch (type) { - case REACT_ASYNC_MODE_TYPE: - case REACT_CONCURRENT_MODE_TYPE: - case REACT_FRAGMENT_TYPE: - case REACT_PROFILER_TYPE: - case REACT_STRICT_MODE_TYPE: - case REACT_SUSPENSE_TYPE: - return type; + return chainedCheckType; + } - default: - var $$typeofType = type && type.$$typeof; + function createPrimitiveTypeChecker(expectedType) { + function validate( + props, + propName, + componentName, + location, + propFullName, + secret + ) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); - switch ($$typeofType) { - case REACT_CONTEXT_TYPE: - case REACT_FORWARD_REF_TYPE: - case REACT_LAZY_TYPE: - case REACT_MEMO_TYPE: - case REACT_PROVIDER_TYPE: - return $$typeofType; + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + preciseType + + '` supplied to `' + + componentName + + '`, expected ') + + ('`' + expectedType + '`.'), + { expectedType: expectedType } + ); + } + return null; + } + return createChainableTypeChecker(validate); + } - default: - return $$typeof; - } - } + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } - case REACT_PORTAL_TYPE: - return $$typeof; + function createArrayOfTypeChecker(typeChecker) { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + if (typeof typeChecker !== 'function') { + return new PropTypeError( + 'Property `' + + propFullName + + '` of component `' + + componentName + + '` has invalid PropType notation inside arrayOf.' + ); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + propType + + '` supplied to `' + + componentName + + '`, expected an array.') + ); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker( + propValue, + i, + componentName, + location, + propFullName + '[' + i + ']', + ReactPropTypesSecret + ); + if (error instanceof Error) { + return error; } } + return null; + } + return createChainableTypeChecker(validate); + } - return undefined; - } // AsyncMode is deprecated along with isAsyncMode + function createElementTypeChecker() { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + propType + + '` supplied to `' + + componentName + + '`, expected a single ReactElement.') + ); + } + return null; + } + return createChainableTypeChecker(validate); + } - var AsyncMode = REACT_ASYNC_MODE_TYPE; - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; - var ContextConsumer = REACT_CONTEXT_TYPE; - var ContextProvider = REACT_PROVIDER_TYPE; - var Element = REACT_ELEMENT_TYPE; - var ForwardRef = REACT_FORWARD_REF_TYPE; - var Fragment = REACT_FRAGMENT_TYPE; - var Lazy = REACT_LAZY_TYPE; - var Memo = REACT_MEMO_TYPE; - var Portal = REACT_PORTAL_TYPE; - var Profiler = REACT_PROFILER_TYPE; - var StrictMode = REACT_STRICT_MODE_TYPE; - var Suspense = REACT_SUSPENSE_TYPE; - var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated + function createElementTypeTypeChecker() { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + propType + + '` supplied to `' + + componentName + + '`, expected a single ReactElement type.') + ); + } + return null; + } + return createChainableTypeChecker(validate); + } - function isAsyncMode(object) { - { - if (!hasWarnedAboutDeprecatedIsAsyncMode) { - hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint + function createInstanceTypeChecker(expectedClass) { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + actualClassName + + '` supplied to `' + + componentName + + '`, expected ') + + ('instance of `' + expectedClassName + '`.') + ); + } + return null; + } + return createChainableTypeChecker(validate); + } - console['warn']( - 'The ReactIs.isAsyncMode() alias has been deprecated, ' + - 'and will be removed in React 17+. Update your code to use ' + - 'ReactIs.isConcurrentMode() instead. It has the exact same API.' + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + + arguments.length + + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning( + 'Invalid argument supplied to oneOf, expected an array.' ); } } + return emptyFunctionThatReturnsNull; + } - return ( - isConcurrentMode(object) || - typeOf(object) === REACT_ASYNC_MODE_TYPE + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify( + expectedValues, + function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + } ); - } - function isConcurrentMode(object) { - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; - } - function isContextConsumer(object) { - return typeOf(object) === REACT_CONTEXT_TYPE; - } - function isContextProvider(object) { - return typeOf(object) === REACT_PROVIDER_TYPE; - } - function isElement(object) { - return ( - typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of value `' + + String(propValue) + + '` ' + + ('supplied to `' + + componentName + + '`, expected one of ' + + valuesString + + '.') ); } - function isForwardRef(object) { - return typeOf(object) === REACT_FORWARD_REF_TYPE; - } - function isFragment(object) { - return typeOf(object) === REACT_FRAGMENT_TYPE; - } - function isLazy(object) { - return typeOf(object) === REACT_LAZY_TYPE; - } - function isMemo(object) { - return typeOf(object) === REACT_MEMO_TYPE; + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + if (typeof typeChecker !== 'function') { + return new PropTypeError( + 'Property `' + + propFullName + + '` of component `' + + componentName + + '` has invalid PropType notation inside objectOf.' + ); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type ' + + ('`' + + propType + + '` supplied to `' + + componentName + + '`, expected an object.') + ); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker( + propValue, + key, + componentName, + location, + propFullName + '.' + key, + ReactPropTypesSecret + ); + if (error instanceof Error) { + return error; + } + } + } + return null; } - function isPortal(object) { - return typeOf(object) === REACT_PORTAL_TYPE; + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true + ? printWarning( + 'Invalid argument supplied to oneOfType, expected an instance of array.' + ) + : 0; + return emptyFunctionThatReturnsNull; } - function isProfiler(object) { - return typeOf(object) === REACT_PROFILER_TYPE; + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + + getPostfixForTypeWarning(checker) + + ' at index ' + + i + + '.' + ); + return emptyFunctionThatReturnsNull; + } } - function isStrictMode(object) { - return typeOf(object) === REACT_STRICT_MODE_TYPE; + + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var expectedTypes = []; + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + var checkerResult = checker( + props, + propName, + componentName, + location, + propFullName, + ReactPropTypesSecret + ); + if (checkerResult == null) { + return null; + } + if ( + checkerResult.data && + has(checkerResult.data, 'expectedType') + ) { + expectedTypes.push(checkerResult.data.expectedType); + } + } + var expectedTypesMessage = + expectedTypes.length > 0 + ? ', expected one of type [' + expectedTypes.join(', ') + ']' + : ''; + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` supplied to ' + + ('`' + componentName + '`' + expectedTypesMessage + '.') + ); } - function isSuspense(object) { - return typeOf(object) === REACT_SUSPENSE_TYPE; + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + if (!isNode(props[propName])) { + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` supplied to ' + + ('`' + componentName + '`, expected a ReactNode.') + ); + } + return null; } + return createChainableTypeChecker(validate); + } - exports.AsyncMode = AsyncMode; - exports.ConcurrentMode = ConcurrentMode; - exports.ContextConsumer = ContextConsumer; - exports.ContextProvider = ContextProvider; - exports.Element = Element; - exports.ForwardRef = ForwardRef; - exports.Fragment = Fragment; - exports.Lazy = Lazy; - exports.Memo = Memo; - exports.Portal = Portal; - exports.Profiler = Profiler; - exports.StrictMode = StrictMode; - exports.Suspense = Suspense; - exports.isAsyncMode = isAsyncMode; - exports.isConcurrentMode = isConcurrentMode; - exports.isContextConsumer = isContextConsumer; - exports.isContextProvider = isContextProvider; - exports.isElement = isElement; - exports.isForwardRef = isForwardRef; - exports.isFragment = isFragment; - exports.isLazy = isLazy; - exports.isMemo = isMemo; - exports.isPortal = isPortal; - exports.isProfiler = isProfiler; - exports.isStrictMode = isStrictMode; - exports.isSuspense = isSuspense; - exports.isValidElementType = isValidElementType; - exports.typeOf = typeOf; - })(); - } + function invalidValidatorError( + componentName, + location, + propFullName, + key, + type + ) { + return new PropTypeError( + (componentName || 'React class') + + ': ' + + location + + ' type `' + + propFullName + + '.' + + key + + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + + type + + '`.' + ); + } - /***/ - }, + function createShapeTypeChecker(shapeTypes) { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type `' + + propType + + '` ' + + ('supplied to `' + componentName + '`, expected `object`.') + ); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (typeof checker !== 'function') { + return invalidValidatorError( + componentName, + location, + propFullName, + key, + getPreciseType(checker) + ); + } + var error = checker( + propValue, + key, + componentName, + location, + propFullName + '.' + key, + ReactPropTypesSecret + ); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } - /***/ './node_modules/hoist-non-react-statics/node_modules/react-is/index.js': - /*!*****************************************************************************!*\ - !*** ./node_modules/hoist-non-react-statics/node_modules/react-is/index.js ***! - \*****************************************************************************/ - /***/ (module, __unused_webpack_exports, __webpack_require__) => { - 'use strict'; + function createStrictShapeTypeChecker(shapeTypes) { + function validate( + props, + propName, + componentName, + location, + propFullName + ) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` of type `' + + propType + + '` ' + + ('supplied to `' + componentName + '`, expected `object`.') + ); + } + // We need to check all keys in case some are required but missing from props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (has(shapeTypes, key) && typeof checker !== 'function') { + return invalidValidatorError( + componentName, + location, + propFullName, + key, + getPreciseType(checker) + ); + } + if (!checker) { + return new PropTypeError( + 'Invalid ' + + location + + ' `' + + propFullName + + '` key `' + + key + + '` supplied to `' + + componentName + + '`.' + + '\nBad object: ' + + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker( + propValue, + key, + componentName, + location, + propFullName + '.' + key, + ReactPropTypesSecret + ); + if (error) { + return error; + } + } + return null; + } - if (false) { - } else { - module.exports = __webpack_require__( - /*! ./cjs/react-is.development.js */ './node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js' - ); - } + return createChainableTypeChecker(validate); + } - /***/ - }, + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } - /***/ './node_modules/lodash.debounce/index.js': - /*!***********************************************!*\ - !*** ./node_modules/lodash.debounce/index.js ***! - \***********************************************/ - /***/ (module, __unused_webpack_exports, __webpack_require__) => { - /** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; + return true; + default: + return false; + } + } - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; + // falsy value can't be a Symbol + if (!propValue) { + return false; + } - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; + return false; + } - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } - /** Detect free variable `global` from Node.js. */ - var freeGlobal = - typeof __webpack_require__.g == 'object' && - __webpack_require__.g && - __webpack_require__.g.Object === Object && - __webpack_require__.g; + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } - /** Detect free variable `self`. */ - var freeSelf = - typeof self == 'object' && self && self.Object === Object && self; + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; - /** Used for built-in method references. */ - var objectProto = Object.prototype; + return ReactPropTypes; + }; - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max, - nativeMin = Math.min; + /***/ + }, + /***/ './node_modules/prop-types/index.js': + /*!******************************************!*\ + !*** ./node_modules/prop-types/index.js ***! + \******************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example + * Copyright (c) 2013-present, Facebook, Inc. * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ - var now = function () { - return root.Date.now(); - }; + if (true) { + var ReactIs = __webpack_require__( + /*! react-is */ './node_modules/prop-types/node_modules/react-is/index.js' + ); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__( + /*! ./factoryWithTypeCheckers */ './node_modules/prop-types/factoryWithTypeCheckers.js' + )(ReactIs.isElement, throwOnDirectAccess); + } else { + } + + /***/ + }, + + /***/ './node_modules/prop-types/lib/ReactPropTypesSecret.js': + /*!*************************************************************!*\ + !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*************************************************************/ + /***/ (module) => { + 'use strict'; /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); + * Copyright (c) 2013-present, Facebook, Inc. * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing - ? nativeMax(toNumber(options.maxWait) || 0, wait) - : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } + var ReactPropTypesSecret = + 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; + module.exports = ReactPropTypesSecret; - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } + /***/ + }, - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } + /***/ './node_modules/prop-types/lib/has.js': + /*!********************************************!*\ + !*** ./node_modules/prop-types/lib/has.js ***! + \********************************************/ + /***/ (module) => { + module.exports = Function.call.bind(Object.prototype.hasOwnProperty); - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; + /***/ + }, - return maxing - ? nativeMin(result, maxWait - timeSinceLastInvoke) - : result; - } + /***/ './node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js': + /*!***********************************************************************************!*\ + !*** ./node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! + \***********************************************************************************/ + /***/ (__unused_webpack_module, exports) => { + 'use strict'; + /** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; + if (true) { + (function () { + 'use strict'; - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return ( - lastCallTime === undefined || - timeSinceLastCall >= wait || - timeSinceLastCall < 0 || - (maxing && timeSinceLastInvoke >= maxWait) - ); - } + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + var REACT_ELEMENT_TYPE = hasSymbol + ? Symbol.for('react.element') + : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol + ? Symbol.for('react.portal') + : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol + ? Symbol.for('react.fragment') + : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol + ? Symbol.for('react.strict_mode') + : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol + ? Symbol.for('react.profiler') + : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol + ? Symbol.for('react.provider') + : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol + ? Symbol.for('react.context') + : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary + // (unstable) APIs that have been removed. Can we remove the symbols? - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); + var REACT_ASYNC_MODE_TYPE = hasSymbol + ? Symbol.for('react.async_mode') + : 0xeacf; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol + ? Symbol.for('react.concurrent_mode') + : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol + ? Symbol.for('react.forward_ref') + : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol + ? Symbol.for('react.suspense') + : 0xead1; + var REACT_SUSPENSE_LIST_TYPE = hasSymbol + ? Symbol.for('react.suspense_list') + : 0xead8; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + var REACT_BLOCK_TYPE = hasSymbol + ? Symbol.for('react.block') + : 0xead9; + var REACT_FUNDAMENTAL_TYPE = hasSymbol + ? Symbol.for('react.fundamental') + : 0xead5; + var REACT_RESPONDER_TYPE = hasSymbol + ? Symbol.for('react.responder') + : 0xead6; + var REACT_SCOPE_TYPE = hasSymbol + ? Symbol.for('react.scope') + : 0xead7; + + function isValidElementType(type) { + return ( + typeof type === 'string' || + typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || + type === REACT_CONCURRENT_MODE_TYPE || + type === REACT_PROFILER_TYPE || + type === REACT_STRICT_MODE_TYPE || + type === REACT_SUSPENSE_TYPE || + type === REACT_SUSPENSE_LIST_TYPE || + (typeof type === 'object' && + type !== null && + (type.$$typeof === REACT_LAZY_TYPE || + type.$$typeof === REACT_MEMO_TYPE || + type.$$typeof === REACT_PROVIDER_TYPE || + type.$$typeof === REACT_CONTEXT_TYPE || + type.$$typeof === REACT_FORWARD_REF_TYPE || + type.$$typeof === REACT_FUNDAMENTAL_TYPE || + type.$$typeof === REACT_RESPONDER_TYPE || + type.$$typeof === REACT_SCOPE_TYPE || + type.$$typeof === REACT_BLOCK_TYPE)) + ); } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - function trailingEdge(time) { - timerId = undefined; + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } + default: + var $$typeofType = type && type.$$typeof; - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; - lastArgs = arguments; - lastThis = this; - lastCallTime = time; + default: + return $$typeof; + } + } - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); + case REACT_PORTAL_TYPE: + return $$typeof; + } } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); + + return undefined; + } // AsyncMode is deprecated along with isAsyncMode + + var AsyncMode = REACT_ASYNC_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Lazy = REACT_LAZY_TYPE; + var Memo = REACT_MEMO_TYPE; + var Portal = REACT_PORTAL_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + var Suspense = REACT_SUSPENSE_TYPE; + var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated + + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint + + console['warn']( + 'The ReactIs.isAsyncMode() alias has been deprecated, ' + + 'and will be removed in React 17+. Update your code to use ' + + 'ReactIs.isConcurrentMode() instead. It has the exact same API.' + ); + } } + + return ( + isConcurrentMode(object) || + typeOf(object) === REACT_ASYNC_MODE_TYPE + ); } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return ( + typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE + ); + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; + } + function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; + } + + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Lazy = Lazy; + exports.Memo = Memo; + exports.Portal = Portal; + exports.Profiler = Profiler; + exports.StrictMode = StrictMode; + exports.Suspense = Suspense; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isLazy = isLazy; + exports.isMemo = isMemo; + exports.isPortal = isPortal; + exports.isProfiler = isProfiler; + exports.isStrictMode = isStrictMode; + exports.isSuspense = isSuspense; + exports.isValidElementType = isValidElementType; + exports.typeOf = typeOf; + })(); + } + + /***/ + }, + + /***/ './node_modules/prop-types/node_modules/react-is/index.js': + /*!****************************************************************!*\ + !*** ./node_modules/prop-types/node_modules/react-is/index.js ***! + \****************************************************************/ + /***/ (module, __unused_webpack_exports, __webpack_require__) => { + 'use strict'; + + if (false) { + } else { + module.exports = __webpack_require__( + /*! ./cjs/react-is.development.js */ './node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js' + ); } + /***/ + }, + + /***/ './node_modules/react-dom/cjs/react-dom.development.js': + /*!*************************************************************!*\ + !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! + \*************************************************************/ + /***/ (__unused_webpack_module, exports, __webpack_require__) => { + 'use strict'; /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true + * @license React + * react-dom.development.js * - * _.isObject(_.noop); - * // => true + * Copyright (c) Facebook, Inc. and its affiliates. * - * _.isObject(null); - * // => false + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } + if (true) { + (function () { + 'use strict'; - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return ( - typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag) - ); - } + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if ( + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === + 'function' + ) { + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart( + new Error() + ); + } + var React = __webpack_require__( + /*! react */ './node_modules/react/index.js' + ); + var Scheduler = __webpack_require__( + /*! scheduler */ './node_modules/scheduler/index.js' + ); - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = - typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? other + '' : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : reIsBadHex.test(value) - ? NAN - : +value; - } + var ReactSharedInternals = + React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - module.exports = debounce; + var suppressWarning = false; + function setSuppressWarning(newSuppressWarning) { + { + suppressWarning = newSuppressWarning; + } + } // In DEV, calls to console.warn and console.error get replaced + // by calls to these methods by a Babel plugin. + // + // In PROD (or in packages without access to React internals), + // they are left as they are instead. - /***/ - }, + function warn(format) { + { + if (!suppressWarning) { + for ( + var _len = arguments.length, + args = new Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } - /***/ './node_modules/memoize-one/dist/memoize-one.esm.js': - /*!**********************************************************!*\ - !*** ./node_modules/memoize-one/dist/memoize-one.esm.js ***! - \**********************************************************/ - /***/ ( - __unused_webpack_module, - __webpack_exports__, - __webpack_require__ - ) => { - 'use strict'; - __webpack_require__.r(__webpack_exports__); - /* harmony export */ __webpack_require__.d(__webpack_exports__, { - /* harmony export */ default: () => /* binding */ memoizeOne - /* harmony export */ - }); - var safeIsNaN = - Number.isNaN || - function ponyfill(value) { - return typeof value === 'number' && value !== value; - }; - function isEqual(first, second) { - if (first === second) { - return true; - } - if (safeIsNaN(first) && safeIsNaN(second)) { - return true; - } - return false; - } - function areInputsEqual(newInputs, lastInputs) { - if (newInputs.length !== lastInputs.length) { - return false; - } - for (var i = 0; i < newInputs.length; i++) { - if (!isEqual(newInputs[i], lastInputs[i])) { - return false; + printWarning('warn', format, args); + } + } } - } - return true; - } + function error(format) { + { + if (!suppressWarning) { + for ( + var _len2 = arguments.length, + args = new Array(_len2 > 1 ? _len2 - 1 : 0), + _key2 = 1; + _key2 < _len2; + _key2++ + ) { + args[_key2 - 1] = arguments[_key2]; + } - function memoizeOne(resultFn, isEqual) { - if (isEqual === void 0) { - isEqual = areInputsEqual; - } - var cache = null; - function memoized() { - var newArgs = []; - for (var _i = 0; _i < arguments.length; _i++) { - newArgs[_i] = arguments[_i]; + printWarning('error', format, args); + } + } } - if ( - cache && - cache.lastThis === this && - isEqual(newArgs, cache.lastArgs) - ) { - return cache.lastResult; + + function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var ReactDebugCurrentFrame = + ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } // eslint-disable-next-line react-internal/safe-string-coercion + + var argsWithFormat = args.map(function (item) { + return String(item); + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call( + console[level], + console, + argsWithFormat + ); + } } - var lastResult = resultFn.apply(this, newArgs); - cache = { - lastResult: lastResult, - lastArgs: newArgs, - lastThis: this - }; - return lastResult; - } - memoized.clear = function clear() { - cache = null; - }; - return memoized; - } - /***/ - }, + var FunctionComponent = 0; + var ClassComponent = 1; + var IndeterminateComponent = 2; // Before we know whether it is function or class - /***/ './node_modules/object-assign/index.js': - /*!*********************************************!*\ - !*** ./node_modules/object-assign/index.js ***! - \*********************************************/ - /***/ (module) => { - 'use strict'; - /* -object-assign -(c) Sindre Sorhus -@license MIT -*/ + var HostRoot = 3; // Root of a host tree. Could be nested inside another node. - /* eslint-disable no-unused-vars */ - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var propIsEnumerable = Object.prototype.propertyIsEnumerable; + var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. - function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError( - 'Object.assign cannot be called with null or undefined' - ); - } + var HostComponent = 5; + var HostText = 6; + var Fragment = 7; + var Mode = 8; + var ContextConsumer = 9; + var ContextProvider = 10; + var ForwardRef = 11; + var Profiler = 12; + var SuspenseComponent = 13; + var MemoComponent = 14; + var SimpleMemoComponent = 15; + var LazyComponent = 16; + var IncompleteClassComponent = 17; + var DehydratedFragment = 18; + var SuspenseListComponent = 19; + var ScopeComponent = 21; + var OffscreenComponent = 22; + var LegacyHiddenComponent = 23; + var CacheComponent = 24; + var TracingMarkerComponent = 25; - return Object(val); - } + // ----------------------------------------------------------------------------- - function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } + var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing + // the react-reconciler package. - // Detect buggy property enumeration order in older V8 versions. + var enableNewReconciler = false; // Support legacy Primer support on internal FB www - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } + var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics. - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } + var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if ( - Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst' - ) { - return false; - } + var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz + // React DOM Chopping Block + // + // Similar to main Chopping Block but only flags related to React DOM. These are + // grouped because we will likely batch all of them into a single major release. + // ----------------------------------------------------------------------------- + // Disable support for comment nodes as React DOM containers. Already disabled + // in open source, but www codebase still relies on it. Need to remove. - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } - } + var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection. + // and client rendering, mostly to allow JSX attributes to apply to the custom + // element's object properties instead of only HTML attributes. + // https://github.com/facebook/react/issues/11347 - module.exports = shouldUseNative() - ? Object.assign - : function (target, source) { - var from; - var to = toObject(target); - var symbols; + var enableCustomElementPropertySupport = false; // Disables children for