From b653de1c5ea6db1f1955cea74f3bc0784fce9b98 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Sun, 14 Jun 2020 18:08:38 -0400 Subject: [PATCH 01/37] View detects mobile devices, uses old controls if on mobile. --- package.json | 1 + src/components/structural/View.js | 44 ++++++++++++++++++++++++------- yarn.lock | 29 +++++++++++++++++++- 3 files changed, 64 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 36ee995b..581ea98c 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "react-dom": "^16.2.0", "react-progressive-image": "^0.3.0", "react-redux": "^5.0.7", + "react-responsive": "^8.1.0", "react-router-dom": "^4.2.2", "react-select": "^3.0.4", "reactour": "^1.9.1", diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 25f12542..9cdfd889 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -1,10 +1,13 @@ import React, { Component, Fragment } from "react"; +import { useMediaQuery } from "react-responsive"; import "aframe"; import "aframe-animation-component"; import "three-pathfinding/dist/three-pathfinding"; import "aframe-extras/dist/aframe-extras.min.js"; import "aframe-physics-system"; import "aframe-environment-component"; + + /** * @summary - The View component return the aframe representation of the scene. This * system utilizes the entity component system(ECS) to build objects in the scene from different @@ -142,18 +145,41 @@ class View extends Component { ); } + isMobile = () => { + return useMediaQuery({query: "(max-device-width: 1224px)"}); + } + + basicMoveCam = () => { return ( - - - + { + this.isMobile() ? + + + + + + : + + + + + + } ); } diff --git a/yarn.lock b/yarn.lock index dda1e765..2e5ea464 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3372,6 +3372,11 @@ css-loader@1.0.0: postcss-value-parser "^3.3.0" source-list-map "^2.0.0" +css-mediaquery@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/css-mediaquery/-/css-mediaquery-0.1.2.tgz#6a2c37344928618631c54bd33cedd301da18bea0" + integrity sha1-aiw3NEkoYYYxxUvTPO3TAdoYvqA= + css-parse@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" @@ -5747,7 +5752,7 @@ hyperquest@2.1.3: duplexer2 "~0.0.2" through2 "~0.6.3" -hyphenate-style-name@^1.0.2: +hyphenate-style-name@^1.0.0, hyphenate-style-name@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ== @@ -7462,6 +7467,13 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" +matchmediaquery@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/matchmediaquery/-/matchmediaquery-0.3.1.tgz#8247edc47e499ebb7c58f62a9ff9ccf5b815c6d7" + integrity sha512-Hlk20WQHRIm9EE9luN1kjRjYXAQToHOIAHPJn9buxBwuhfTHoKUcX+lXBbxc85DVQfXYbEQ4HcwQdd128E3qHQ== + dependencies: + css-mediaquery "^0.1.2" + material-colors@^1.2.1: version "1.2.6" resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46" @@ -9827,6 +9839,16 @@ react-redux@^5.0.7: react-is "^16.6.0" react-lifecycles-compat "^3.0.0" +react-responsive@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/react-responsive/-/react-responsive-8.1.0.tgz#afcc2293c46a37b1e7926ff7fef66bcb147e7cba" + integrity sha512-U8Nv2/ZWACIw/fAE9XNPbc2Xo33X5q1bcCASc2SufvJ9ifB+o/rokfogfznSVcvS22hN1rafGi0uZD6GiVFEHw== + dependencies: + hyphenate-style-name "^1.0.0" + matchmediaquery "^0.3.0" + prop-types "^15.6.1" + shallow-equal "^1.1.0" + react-router-dom@^4.2.2: version "4.3.1" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" @@ -10707,6 +10729,11 @@ shallow-clone@^1.0.0: kind-of "^5.0.0" mixin-object "^2.0.1" +shallow-equal@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" + integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" From c37f17fb373e7553695dd84666558cf22a0cdf14 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Sun, 14 Jun 2020 19:15:30 -0400 Subject: [PATCH 02/37] Removed the flying toggle in the settings menu and in Redux, plus all references to it. Reformatted move cam code. --- src/actions/sceneActions.js | 5 -- src/components/structural/View.js | 67 +++++++++---------- src/components/structural/WelcomeScene.js | 49 ++++++++++---- src/components/structural/header/Header.js | 2 +- .../structural/header/SceneConfigMenu.js | 24 ------- src/constants/ActionTypes.js | 1 - src/myr/tour.js | 2 +- src/reducers/scene.js | 9 --- src/tests/App.test.js | 3 - 9 files changed, 70 insertions(+), 92 deletions(-) diff --git a/src/actions/sceneActions.js b/src/actions/sceneActions.js index 5887ef91..183bac5c 100644 --- a/src/actions/sceneActions.js +++ b/src/actions/sceneActions.js @@ -50,10 +50,6 @@ export function changeView() { return { type: types.CHANGE_VIEW }; } -export function toggleFly() { - return { type: types.TOGGLE_FLY }; -} - export function toggleFloor() { return { type: types.TOGGLE_FLOOR }; } @@ -88,7 +84,6 @@ export default { setCamera, changePerspective, changeView, - toggleFly, toggleFloor, loadSettings, changeSetting, diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 9cdfd889..8c8a7493 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -145,43 +145,38 @@ class View extends Component { ); } - isMobile = () => { - return useMediaQuery({query: "(max-device-width: 1224px)"}); - } - - basicMoveCam = () => { - return ( - - { - this.isMobile() ? - - - - - - : - - - - - - } - - ); + if (useMediaQuery({query: "(max-device-width: 1224px)"})) { + return ( + + + + + + ); + } + else { + return ( + + + + + + ); + } } diff --git a/src/components/structural/WelcomeScene.js b/src/components/structural/WelcomeScene.js index 979f604a..4e3ed73b 100644 --- a/src/components/structural/WelcomeScene.js +++ b/src/components/structural/WelcomeScene.js @@ -1,6 +1,42 @@ import React, { Component } from "react"; +import { useMediaQuery } from "react-responsive"; + class WelcomeScene extends Component { + createCam = () => { + if (useMediaQuery({query: "(max-device-width: 1224px)"})) { + return ( + + + + + + ); + } + else { + return ( + + + + + + ); + } + } + render() { return ( @@ -8,18 +44,7 @@ class WelcomeScene extends Component { - - - - - + { const sceneSettings = this.props.scene.settings; - return [sceneSettings.canFly, sceneSettings.floorColor, + return [ sceneSettings.floorColor, sceneSettings.showCoordHelper, sceneSettings.showFloor, sceneSettings.skyColor, sceneSettings.viewOnly]; }; diff --git a/src/components/structural/header/SceneConfigMenu.js b/src/components/structural/header/SceneConfigMenu.js index 68ca9f53..03064f2b 100644 --- a/src/components/structural/header/SceneConfigMenu.js +++ b/src/components/structural/header/SceneConfigMenu.js @@ -248,27 +248,6 @@ class ConfigModal extends Component { ); }; - // Toggles the ability to fly in the scene - flyToggle = () => { - let style = this.props.scene.settings.canFly ? btnStyle.on : btnStyle.off; - style = { ...btnStyle.base, ...style }; - return ( - { - this.props.handleRender(); - this.props.sceneActions.toggleFly(); - }} > - { - this.props.scene.settings.canFly - ? toggle_on - : toggle_off - } - Flying - - ); - }; - // Toggles the grid on and off gridToggle = () => { let style = this.props.scene.settings.showCoordHelper ? btnStyle.on : btnStyle.off; @@ -462,9 +441,6 @@ class ConfigModal extends Component {
Camera Control
-
- -
diff --git a/src/constants/ActionTypes.js b/src/constants/ActionTypes.js index 4f5fe9fa..c5e54e49 100644 --- a/src/constants/ActionTypes.js +++ b/src/constants/ActionTypes.js @@ -32,7 +32,6 @@ export const CHANGE_CAM_MODE = "CHANGE_CAM_MODE"; export const SET_CAMERA = "SET_CAMERA"; export const CHANGE_PERSPECTIVE = "CHANGE_PERSPECTIVE"; export const CHANGE_VIEW = "CHANGE_VIEW"; -export const TOGGLE_FLY = "TOGGLE_FLY"; export const TOGGLE_FLOOR = "TOGGLE_FLOOR"; export const LOAD_SETTINGS = "LOAD_SETTINGS"; export const CHANGE_SETTING = "CHANGE_SETTING"; diff --git a/src/myr/tour.js b/src/myr/tour.js index bad9f9f9..9add7ad4 100644 --- a/src/myr/tour.js +++ b/src/myr/tour.js @@ -44,7 +44,7 @@ export const TourSteps = [ }, { selector: "#configure-scene", - content: "Modify and share your scene including setting the background color, enabling the grid, and enabling flying.", + content: "Modify and share your scene including setting the background color, enabling the grid, and hiding the editor pane.", }, { selector: "#select-course", diff --git a/src/reducers/scene.js b/src/reducers/scene.js index 248af647..9e1df0d7 100644 --- a/src/reducers/scene.js +++ b/src/reducers/scene.js @@ -5,7 +5,6 @@ export const DEF_SETTINGS = { floorColor: "#222", camConfig: 0, showCoordHelper: false, - canFly: false, showFloor: true, cameraPosition: "0 1.6 3", viewOnly: false, @@ -48,14 +47,6 @@ export default function scene(state = initial_state, action) { showCoordHelper: !state.settings.showCoordHelper } }; - case types.TOGGLE_FLY: - return { - ...state, - settings: { - ...state.settings, - canFly: !state.settings.canFly - } - }; case types.SET_CAMERA: let camPos = `${action.x || 0} ${action.y + (Math.random() / 10) || 1.6} ${action.z || 0}`; return { diff --git a/src/tests/App.test.js b/src/tests/App.test.js index fe35ce48..eda1f580 100644 --- a/src/tests/App.test.js +++ b/src/tests/App.test.js @@ -38,7 +38,6 @@ const generateMockProps = () => { setCamera: jest.fn(), changePerspective: jest.fn(), changeView: jest.fn(), - toggleFly: jest.fn(), toggleFloor: jest.fn(), loadSettings: jest.fn(), changeSetting: jest.fn(), @@ -65,7 +64,6 @@ const generateMockProps = () => { floorColor: "#222", camConfig: 0, showCoordHelper: false, - canFly: false, showFloor: true, cameraPosition: "0 1.6 3", viewOnly: false, @@ -315,7 +313,6 @@ describe("Scene Reducer", () => { floorColor: "#222", camConfig: 0, showCoordHelper: false, - canFly: false, showFloor: true, cameraPosition: "0 1.6 3", viewOnly: false, From bd83818e6a3f0c5869f2f09d2c6ca15a46860b8f Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Sun, 19 Jul 2020 18:43:52 -0400 Subject: [PATCH 03/37] setting up for new utils for checking mobile devices --- package.json | 1 - src/utils/mobileCheck.js | 0 yarn.lock | 29 +---------------------------- 3 files changed, 1 insertion(+), 29 deletions(-) create mode 100644 src/utils/mobileCheck.js diff --git a/package.json b/package.json index 581ea98c..36ee995b 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "react-dom": "^16.2.0", "react-progressive-image": "^0.3.0", "react-redux": "^5.0.7", - "react-responsive": "^8.1.0", "react-router-dom": "^4.2.2", "react-select": "^3.0.4", "reactour": "^1.9.1", diff --git a/src/utils/mobileCheck.js b/src/utils/mobileCheck.js new file mode 100644 index 00000000..e69de29b diff --git a/yarn.lock b/yarn.lock index 2e5ea464..dda1e765 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3372,11 +3372,6 @@ css-loader@1.0.0: postcss-value-parser "^3.3.0" source-list-map "^2.0.0" -css-mediaquery@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/css-mediaquery/-/css-mediaquery-0.1.2.tgz#6a2c37344928618631c54bd33cedd301da18bea0" - integrity sha1-aiw3NEkoYYYxxUvTPO3TAdoYvqA= - css-parse@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" @@ -5752,7 +5747,7 @@ hyperquest@2.1.3: duplexer2 "~0.0.2" through2 "~0.6.3" -hyphenate-style-name@^1.0.0, hyphenate-style-name@^1.0.2: +hyphenate-style-name@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48" integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ== @@ -7467,13 +7462,6 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -matchmediaquery@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/matchmediaquery/-/matchmediaquery-0.3.1.tgz#8247edc47e499ebb7c58f62a9ff9ccf5b815c6d7" - integrity sha512-Hlk20WQHRIm9EE9luN1kjRjYXAQToHOIAHPJn9buxBwuhfTHoKUcX+lXBbxc85DVQfXYbEQ4HcwQdd128E3qHQ== - dependencies: - css-mediaquery "^0.1.2" - material-colors@^1.2.1: version "1.2.6" resolved "https://registry.yarnpkg.com/material-colors/-/material-colors-1.2.6.tgz#6d1958871126992ceecc72f4bcc4d8f010865f46" @@ -9839,16 +9827,6 @@ react-redux@^5.0.7: react-is "^16.6.0" react-lifecycles-compat "^3.0.0" -react-responsive@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/react-responsive/-/react-responsive-8.1.0.tgz#afcc2293c46a37b1e7926ff7fef66bcb147e7cba" - integrity sha512-U8Nv2/ZWACIw/fAE9XNPbc2Xo33X5q1bcCASc2SufvJ9ifB+o/rokfogfznSVcvS22hN1rafGi0uZD6GiVFEHw== - dependencies: - hyphenate-style-name "^1.0.0" - matchmediaquery "^0.3.0" - prop-types "^15.6.1" - shallow-equal "^1.1.0" - react-router-dom@^4.2.2: version "4.3.1" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6" @@ -10729,11 +10707,6 @@ shallow-clone@^1.0.0: kind-of "^5.0.0" mixin-object "^2.0.1" -shallow-equal@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" - integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== - shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" From 835373c97563b605c0268800c2ce6a95579fbf5a Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Sun, 19 Jul 2020 20:28:04 -0400 Subject: [PATCH 04/37] Adding new implementation of mobile device checking --- src/components/structural/View.js | 4 +- src/components/structural/WelcomeScene.js | 4 +- src/utils/WASDPlusControls.js | 193 ++++++++++++++++++++++ src/utils/mobileCheck.js | 16 ++ 4 files changed, 213 insertions(+), 4 deletions(-) create mode 100644 src/utils/WASDPlusControls.js diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 381b87f7..5fb42603 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -1,5 +1,5 @@ import React, { Component, Fragment } from "react"; -import { useMediaQuery } from "react-responsive"; +import { isMobile } from "../../utils/mobileCheck"; import "aframe"; import "aframe-animation-component"; import "three-pathfinding/dist/three-pathfinding"; @@ -145,7 +145,7 @@ class View extends Component { } basicMoveCam = () => { - if (useMediaQuery({query: "(max-device-width: 1224px)"})) { + if (isMobile()) { return ( { - if (useMediaQuery({query: "(max-device-width: 1224px)"})) { + if (isMobile()) { return ( { + let key; + for (key in keys) { return false; } + return true; +}; + +AFRAME.registerComponent("wasd-plus-controls", { + schema: { + acceleration: {default : 100}, + enabled : {default : true}, + xInverted : {default : false}, + yInverted : {default : false}, + zInverted : {default : false}, + }, + init: function() { + //tracks the state of keypresses + this.keys = {}; + this.easing = 1.1; + this.velocity = new THREE.Vector3(); + + this.onBlur = bind(this.onBlur, this); + this.onFocus = bind(this.onFocus, this); + this.onKeyDown = bind(this.onKeyDown, this); + this.onKeyUp = bind(this.onKeyUp, this); + this.onVisibilityChange = bind(this.onVisibilityChange, this); + this.attachVisibilityEventListeners(); + }, + + tick: function (time, delta) { + let el = this.el; + let velocity = this.velocity; + + if (!velocity["x"] && !velocity["y"] && !velocity["z"] && isEmptyObject(this.keys)) { return; } + + // Update velocity. + delta = delta / 1000; + this.updateVelocity(delta); + + if (!velocity["x"] && !velocity["y"] && !velocity["z"]) { return; } + + // Get movement vector and translate position. + el.object3D.position.add(this.getMovementVector(delta)); + }, + + remove: function () { + this.removeKeyEventListeners(); + this.removeVisibilityEventListeners(); + }, + + play: function () { + this.attachKeyEventListeners(); + }, + + pause: function () { + this.keys = {}; + this.removeKeyEventListeners(); + }, + + updateVelocity: function (delta) { + let data = this.data; + let keys = this.keys; + let velocity = this.velocity; + let acceleration; + let xSign; + let ySign; + let zSign; + + // If FPS too low, reset velocity. + if (delta > MAX_DELTA) { + velocity["x"] = 0; + velocity["y"] = 0; + velocity["z"] = 0; + return; + } + + // https://gamedev.stackexchange.com/questions/151383/frame-rate-independant-movement-with-acceleration + let scaledEasing = Math.pow(1 / this.easing, delta * 60); + // Velocity Easing based on framerate + if (velocity["x"] !== 0) { + velocity["x"] -= velocity["x"] * scaledEasing; + } + if (velocity["y"] !== 0) { + velocity["y"] -= velocity["y"] * scaledEasing; + } + if (velocity["z"] !== 0) { + velocity["z"] -= velocity["z"] * scaledEasing; + } + + // Clamp velocity easing. + if (Math.abs(velocity["x"]) < CLAMP_VELOCITY) { velocity["x"] = 0; } + if (Math.abs(velocity["y"]) < CLAMP_VELOCITY) { velocity["y"] = 0; } + if (Math.abs(velocity["z"]) < CLAMP_VELOCITY) { velocity["z"] = 0; } + + if (!data.enabled) { return; } + + // Update velocity using keys pressed. + acceleration = data.acceleration; + xSign = data.xInverted ? -1 : 1; + if (keys.KeyA || keys.ArrowLeft) { velocity["x"] -= xSign * acceleration * delta; } + if (keys.KeyD || keys.ArrowRight) { velocity["x"] += xSign * acceleration * delta; } + + ySign = data.yInverted ? -1 : 1; + if (keys.ShiftLeft || keys.ShiftRight) { velocity["y"] -= ySign * acceleration * delta * MOD_Y; } + if (keys.Space) { velocity["y"] += ySign * acceleration * delta * MOD_Y; } + + zSign = data.zInverted ? -1 : 1; + if (keys.KeyW || keys.ArrowUp) { velocity["z"] -= zSign * acceleration * delta; } + if (keys.KeyS || keys.ArrowDown) { velocity["z"] += zSign * acceleration * delta; } + }, + + getMovementVector: function (delta) { + let directionVector = new THREE.Vector3(0, 0, 0); + let rotationEuler = new THREE.Euler(0, 0, 0); + let rotation = this.el.object3D.rotation; + let velocity = this.velocity; + + directionVector.copy(velocity); + directionVector.multiplyScalar(delta); + + // Absolute. + if (!rotation) { return directionVector; } + + // Transform direction relative to heading. + rotationEuler.set(0, rotation.y, 0); + directionVector.applyEuler(rotationEuler); + return directionVector; + }, + + attachVisibilityEventListeners: function () { + window.addEventListener("blur", this.onBlur); + window.addEventListener("focus", this.onFocus); + document.addEventListener("visibilitychange", this.onVisibilityChange); + }, + + removeVisibilityEventListeners: function () { + window.removeEventListener("blur", this.onBlur); + window.removeEventListener("focus", this.onFocus); + document.removeEventListener("visibilitychange", this.onVisibilityChange); + }, + + attachKeyEventListeners: function () { + window.addEventListener("keydown", this.onKeyDown); + window.addEventListener("keyup", this.onKeyUp); + }, + + removeKeyEventListeners: function () { + window.removeEventListener("keydown", this.onKeyDown); + window.removeEventListener("keyup", this.onKeyUp); + }, + + onBlur: function () { + this.pause(); + }, + + onFocus: function () { + this.play(); + }, + + onVisibilityChange: function () { + if (document.hidden) { + this.onBlur(); + } else { + this.onFocus(); + } + }, + + onKeyDown: function (event) { + if (!shouldCaptureKeyEvent(event)) { return; } + let code = event.code; + if (KEYS.includes(code)) { this.keys[code] = true; } + }, + + onKeyUp: function (event) { + if (!shouldCaptureKeyEvent(event)) { return; } + let code = event.code; + delete this.keys[code]; + } +}); diff --git a/src/utils/mobileCheck.js b/src/utils/mobileCheck.js index e69de29b..2503fde6 100644 --- a/src/utils/mobileCheck.js +++ b/src/utils/mobileCheck.js @@ -0,0 +1,16 @@ +import { getDevice } from "ua-parser-js"; + +const MOBILE_TYPES = [ + "mobile", + "tablet", + "wearable" +]; + +const isMobile = () => { + let device = getDevice(); + if(MOBILE_TYPES.find(device) !== undefined) { + return true; + } +}; + +export default isMobile; \ No newline at end of file From 520063ec0e6ceb78c0389e9ff1d890fc4f9fd8b9 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Sun, 19 Jul 2020 23:30:54 -0400 Subject: [PATCH 05/37] update package-lock --- package-lock.json | 59 +++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index edccd874..8d7eaa6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1892,16 +1892,16 @@ "requires": { "@tweenjs/tween.js": "^16.8.0", "browserify-css": "^0.8.2", - "debug": "github:ngokevin/debug#noTimestamp", + "debug": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", "deep-assign": "^2.0.0", - "document-register-element": "github:dmarcos/document-register-element#8ccc532b7", + "document-register-element": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", "envify": "^3.4.1", "load-bmfont": "^1.2.3", "object-assign": "^4.0.1", "present": "0.0.6", "promise-polyfill": "^3.1.0", "style-attr": "^1.0.2", - "three": "github:supermedium/three.js#r90fixMTLLoader", + "three": "github:supermedium/three.js#5ef2887ab3621cae54fa129a500424d6caa25b62", "three-bmfont-text": "^2.1.0", "webvr-polyfill": "^0.10.5" }, @@ -1938,7 +1938,7 @@ "resolved": "https://registry.npmjs.org/aframe-physics-system/-/aframe-physics-system-3.3.0.tgz", "integrity": "sha512-kNZ13/94pNLVMCbKXo8Si8ibcocuhy5UmSji8T+3qgP/MkacFlpdBYVth3IwcZBKzAq7jXRS5RbTs5PrpySmLw==", "requires": { - "cannon": "github:donmccurdy/cannon.js#v0.6.2-dev1", + "cannon": "github:donmccurdy/cannon.js#022e8ba53fa83abf0ad8a0e4fd08623123838a17", "three-to-cannon": "^1.3.0", "webworkify": "^1.4.0" }, @@ -8903,8 +8903,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -8925,14 +8924,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -8947,20 +8944,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -9077,8 +9071,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -9090,7 +9083,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9105,7 +9097,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9113,14 +9104,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -9139,7 +9128,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -9220,8 +9208,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -9233,7 +9220,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -9319,8 +9305,7 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -9356,7 +9341,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9376,7 +9360,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9420,14 +9403,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -15337,8 +15318,7 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "optional": true + "dev": true }, "pify": { "version": "2.3.0", @@ -26515,15 +26495,13 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "optional": true + "dev": true }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, - "optional": true, "requires": { "is-extglob": "^2.1.1" } @@ -26539,8 +26517,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "optional": true + "dev": true }, "readdirp": { "version": "3.4.0", From d8b703580c6b7b189fe3d9b82b581d80cd2e7fe5 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Mon, 20 Jul 2020 17:59:41 -0400 Subject: [PATCH 06/37] Replaced some code lost in the 2.0 upgrade. --- src/components/structural/View.js | 2 +- src/components/structural/header/MyrTour.js | 75 +++++++-------------- src/utils/mobileCheck.js | 11 ++- 3 files changed, 31 insertions(+), 57 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 5fb42603..2e20259b 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -31,7 +31,7 @@ class View extends Component { } window.addEventListener("keydown", function (e) { //KEYS: left and right: 37, 39; up and down: 38, 40; space: 32 - if ([38, 40].indexOf(e.keyCode) > -1) { + if ([38, 40, 32].indexOf(e.keyCode) > -1) { e.preventDefault(); } }, false); diff --git a/src/components/structural/header/MyrTour.js b/src/components/structural/header/MyrTour.js index 6f748816..9d1ec991 100644 --- a/src/components/structural/header/MyrTour.js +++ b/src/components/structural/header/MyrTour.js @@ -2,6 +2,7 @@ import React, { Component } from "react"; import Tour from "reactour"; import { Button } from "@material-ui/core"; import * as layoutTypes from "../../../constants/LayoutTypes"; +import { TourSteps } from "../../../myr/tour"; class MyrTour extends Component { constructor(props) { @@ -25,7 +26,7 @@ class MyrTour extends Component { {!isDisabled ? { this.setState({ viewOnlyOnOpen: this.props.viewOnly }); @@ -54,54 +55,28 @@ class MyrTour extends Component { } } -const steps = [ - { - selector: "#ace-editor", - content: "This is the editor. You can create 3D scenes using JavaScript " + - "and a special set of instructions or functions to MYR.\n The editor can be " + - "toggled on and off by opening the settings menu in the top right and " + - "clicking the \"View Editor\" switch." - }, - { - selector: "#play-btn", - content: "The Play button will render the scene." - }, - { - selector: "#stop-btn", - content: "The Stop button will stop the scene. \n Use this to save battery." - }, - { - selector: "#scene", - content: "The View is where you can see your work. \n Click the goggle to view in VR." - }, - { - selector: "#new-btn", - content: "Create a new scene from scratch. Be sure to save first!", - }, - { - selector: "#save-btn", - content: "Save your work.", - }, - { - selector: "#open-btn", - content: "See previous work and view examples.", - }, - { - selector: "#ref-btn", - content: "Use the Reference to see all MYR has to offer.", - }, - { - selector: "#configure-scene", - content: "Modify and share your scene including setting the background color, enabling the grid, and enabling flying.", - }, - { - selector: "#select-course", - content: "View the list of available courses to get you started on using MYR.", - }, - { - selector: "#user", - content: "You can log in with a Google account in order to save your scenes.", - }, -]; +const formatLineBreaks = (string) => { + if (typeof string !== "string") { + return string; + } + else { + return ( +
+ { + string.split("\n").map( (i, key) => { + return
{i}
; + }) + } +
+ ); + } +}; + +const formatSteps = (steps) => { + return steps.map( (step) => { + step.content = formatLineBreaks(step.content); + return step; + }); +}; export default MyrTour; diff --git a/src/utils/mobileCheck.js b/src/utils/mobileCheck.js index 2503fde6..f5961657 100644 --- a/src/utils/mobileCheck.js +++ b/src/utils/mobileCheck.js @@ -1,4 +1,4 @@ -import { getDevice } from "ua-parser-js"; +import { UAParser } from "ua-parser-js"; const MOBILE_TYPES = [ "mobile", @@ -6,11 +6,10 @@ const MOBILE_TYPES = [ "wearable" ]; -const isMobile = () => { - let device = getDevice(); - if(MOBILE_TYPES.find(device) !== undefined) { +export const isMobile = () => { + let parser = new UAParser(); + const device = parser.getDevice(); + if(MOBILE_TYPES.indexOf(device) !== -1) { return true; } }; - -export default isMobile; \ No newline at end of file From 2461fa1c6ffd987fe1cc13ab554c5b6bbd5c09b3 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Mon, 27 Jul 2020 20:12:55 -0400 Subject: [PATCH 07/37] Mobile control switching works using user-agent string parsing, restructured A-Frame component imports --- src/index.js | 3 ++- src/utils/{AframeReg.js => AFramePhysics.js} | 0 src/utils/WASDPlusControls.js | 2 +- src/utils/mobileCheck.js | 5 ++++- 4 files changed, 7 insertions(+), 3 deletions(-) rename src/utils/{AframeReg.js => AFramePhysics.js} (100%) diff --git a/src/index.js b/src/index.js index 33fb0686..2466c728 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,8 @@ import React from "react"; import ReactDOM from "react-dom"; import { Provider } from "react-redux"; -import "./utils/AframeReg"; +import "./utils/AFramePhysics"; +import "./utils/WASDPlusControls"; import "bootstrap/dist/css/bootstrap.css"; import "./css/App.css"; diff --git a/src/utils/AframeReg.js b/src/utils/AFramePhysics.js similarity index 100% rename from src/utils/AframeReg.js rename to src/utils/AFramePhysics.js diff --git a/src/utils/WASDPlusControls.js b/src/utils/WASDPlusControls.js index 71d85e2b..66aff323 100644 --- a/src/utils/WASDPlusControls.js +++ b/src/utils/WASDPlusControls.js @@ -21,7 +21,7 @@ const isEmptyObject = (keys) => { AFRAME.registerComponent("wasd-plus-controls", { schema: { - acceleration: {default : 100}, + acceleration: {default : 150}, enabled : {default : true}, xInverted : {default : false}, yInverted : {default : false}, diff --git a/src/utils/mobileCheck.js b/src/utils/mobileCheck.js index f5961657..c79459df 100644 --- a/src/utils/mobileCheck.js +++ b/src/utils/mobileCheck.js @@ -9,7 +9,10 @@ const MOBILE_TYPES = [ export const isMobile = () => { let parser = new UAParser(); const device = parser.getDevice(); - if(MOBILE_TYPES.indexOf(device) !== -1) { + if(MOBILE_TYPES.indexOf(device.type) !== -1) { return true; } + else { + return false; + } }; From 2ab06a1ca475b88fa768ffd334620eed3c7f379e Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Tue, 20 Oct 2020 00:29:20 -0400 Subject: [PATCH 08/37] updated a-frame version, improved user-agent checking for webXR and webVR --- package-lock.json | 465 ++++++---------------- package.json | 2 +- src/components/structural/View.js | 20 +- src/components/structural/WelcomeScene.js | 21 +- src/utils/browserType.js | 26 ++ src/utils/mobileCheck.js | 18 - 6 files changed, 173 insertions(+), 379 deletions(-) create mode 100644 src/utils/browserType.js delete mode 100644 src/utils/mobileCheck.js diff --git a/package-lock.json b/package-lock.json index 8d7eaa6d..ff326495 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "myr", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1567,11 +1567,6 @@ "loader-utils": "^1.1.0" } }, - "@tweenjs/tween.js": { - "version": "16.11.0", - "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-16.11.0.tgz", - "integrity": "sha1-bnqKPWx4oFfs1WBQh5MEBtTgWAA=" - }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -1839,7 +1834,8 @@ "acorn": { "version": "5.7.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==" + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true }, "acorn-dynamic-import": { "version": "3.0.0", @@ -1886,30 +1882,22 @@ "dev": true }, "aframe": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/aframe/-/aframe-0.8.2.tgz", - "integrity": "sha512-kp0c3f17moiilChTsD95q+USB7/12LuusGERSmO2X7Cgq6q6evVv9Oe7qRMZ6Baf26gS0T9Z7umc/e1alqcEVA==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/aframe/-/aframe-1.0.4.tgz", + "integrity": "sha512-iG/4VyRt22zUPxDsFjP4SHUXNPGIStM2hHX/iPblht6dtN8m09e7LAaFq4iQdXoT0EkZBWEVmXVBF1J7Tca3QQ==", "requires": { - "@tweenjs/tween.js": "^16.8.0", - "browserify-css": "^0.8.2", + "custom-event-polyfill": "^1.0.6", "debug": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", "deep-assign": "^2.0.0", "document-register-element": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", - "envify": "^3.4.1", "load-bmfont": "^1.2.3", "object-assign": "^4.0.1", "present": "0.0.6", "promise-polyfill": "^3.1.0", - "style-attr": "^1.0.2", - "three": "github:supermedium/three.js#5ef2887ab3621cae54fa129a500424d6caa25b62", - "three-bmfont-text": "^2.1.0", - "webvr-polyfill": "^0.10.5" - }, - "dependencies": { - "three": { - "version": "github:supermedium/three.js#5ef2887ab3621cae54fa129a500424d6caa25b62", - "from": "github:supermedium/three.js#r90fixMTLLoader" - } + "super-animejs": "^3.1.0", + "super-three": "^0.111.6", + "three-bmfont-text": "github:dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e", + "webvr-polyfill": "^0.10.10" } }, "aframe-animation-component": { @@ -2004,11 +1992,6 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "dev": true }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" - }, "an-array": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/an-array/-/an-array-1.0.0.tgz", @@ -2393,6 +2376,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, "requires": { "arr-flatten": "^1.0.1" } @@ -2400,7 +2384,8 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true }, "arr-union": { "version": "3.1.0", @@ -2472,7 +2457,8 @@ "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true }, "array.prototype.find": { "version": "2.1.1", @@ -2593,11 +2579,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "ast-types": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz", - "integrity": "sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=" - }, "ast-types-flow": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", @@ -3648,11 +3629,6 @@ } } }, - "base62": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/base62/-/base62-1.2.8.tgz", - "integrity": "sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA==" - }, "base64-arraybuffer": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", @@ -3834,6 +3810,7 @@ "version": "1.8.5", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, "requires": { "expand-range": "^1.8.1", "preserve": "^0.2.0", @@ -3899,26 +3876,6 @@ "evp_bytestokey": "^1.0.0" } }, - "browserify-css": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/browserify-css/-/browserify-css-0.8.4.tgz", - "integrity": "sha1-Hk4nedy7By0Jvq605vaVAdVE1/M=", - "requires": { - "clean-css": "2.2.x", - "concat-stream": "1.4.x", - "css": "1.6.x", - "find-node-modules": "^1.0.1", - "lodash": "3.6.x", - "through2": "0.6.x" - }, - "dependencies": { - "lodash": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.6.0.tgz", - "integrity": "sha1-Umao9J3Zib5Pn2gbbyoMVShdDZo=" - } - } - }, "browserify-des": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", @@ -4508,14 +4465,6 @@ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" }, - "clean-css": { - "version": "2.2.23", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.2.23.tgz", - "integrity": "sha1-BZC1R4tRbEkD7cLYm9P9vdKGMow=", - "requires": { - "commander": "2.2.x" - } - }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -4724,11 +4673,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.2.0.tgz", - "integrity": "sha1-F1rUuTF/P/YV8gHB5XIk9Vo+kd8=" - }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -4741,37 +4685,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "commoner": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/commoner/-/commoner-0.10.8.tgz", - "integrity": "sha1-NPw2cs0kOT6LtH5wyqApOBH08sU=", - "requires": { - "commander": "^2.5.0", - "detective": "^4.3.1", - "glob": "^5.0.15", - "graceful-fs": "^4.1.2", - "iconv-lite": "^0.4.5", - "mkdirp": "^0.5.0", - "private": "^0.1.6", - "q": "^1.1.2", - "recast": "^0.11.17" - }, - "dependencies": { - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", @@ -4833,16 +4746,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "concat-stream": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.11.tgz", - "integrity": "sha512-X3JMh8+4je3U1cQpG87+f9lXHDrqcb2MVLg9L7o8b1UZ0DzhRrUpdn65ttzu10PpJPPI3MQNkis+oha6TSA9Mw==", - "requires": { - "inherits": "~2.0.1", - "readable-stream": "~1.1.9", - "typedarray": "~0.0.5" - } - }, "confusing-browser-globals": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", @@ -5077,15 +4980,6 @@ "randomfill": "^1.0.3" } }, - "css": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/css/-/css-1.6.0.tgz", - "integrity": "sha1-wG//CvuzE/zlvOBw12UxpsjTAKo=", - "requires": { - "css-parse": "1.7.0", - "css-stringify": "1.4.1" - } - }, "css-color-keywords": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", @@ -5207,11 +5101,6 @@ "source-list-map": "^2.0.0" } }, - "css-parse": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.7.0.tgz", - "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=" - }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -5241,14 +5130,6 @@ "regexpu-core": "^4.6.0" } }, - "css-stringify": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/css-stringify/-/css-stringify-1.4.1.tgz", - "integrity": "sha1-JSzL8D9yOgCb3Ydw/n6ydBca/fo=", - "requires": { - "source-map": "~0.1.31" - } - }, "css-to-react-native": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-2.3.2.tgz", @@ -5728,6 +5609,11 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.11.tgz", "integrity": "sha512-l8YyEC9NBkSm783PFTvh0FmJy7s5pFKrDp49ZL7zBGX3fWkO+N4EEyan1qqp8cwPLDcD0OSdyY6hAMoxp34JFw==" }, + "custom-event-polyfill": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", + "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==" + }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -5963,11 +5849,6 @@ } } }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=" - }, "del": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", @@ -6053,14 +5934,6 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", "dev": true }, - "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", - "requires": { - "fs-exists-sync": "^0.1.0" - } - }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -6108,15 +5981,6 @@ } } }, - "detective": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", - "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", - "requires": { - "acorn": "^5.2.1", - "defined": "^1.0.0" - } - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -6219,7 +6083,7 @@ }, "document-register-element": { "version": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", - "from": "github:dmarcos/document-register-element#8ccc532b7" + "from": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90" }, "dom-converter": { "version": "0.2.0", @@ -6595,15 +6459,6 @@ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", "dev": true }, - "envify": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/envify/-/envify-3.4.1.tgz", - "integrity": "sha1-1xIjKejfFoi6dxsSUBkXyc5cvOg=", - "requires": { - "jstransform": "^11.0.3", - "through": "~2.3.4" - } - }, "envinfo": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.5.0.tgz", @@ -7381,11 +7236,6 @@ } } }, - "esprima-fb": { - "version": "15001.1.0-dev-harmony-fb", - "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", - "integrity": "sha1-MKlHMDxrjV6VW+4rmbHSMyBqaQE=" - }, "esquery": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", @@ -7532,6 +7382,7 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, "requires": { "is-posix-bracket": "^0.1.0" } @@ -7540,18 +7391,11 @@ "version": "1.8.2", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, "requires": { "fill-range": "^2.1.0" } }, - "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", - "requires": { - "os-homedir": "^1.0.1" - } - }, "expect": { "version": "23.6.0", "resolved": "https://registry.npmjs.org/expect/-/expect-23.6.0.tgz", @@ -7724,6 +7568,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, "requires": { "is-extglob": "^1.0.0" } @@ -8158,7 +8003,8 @@ "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true }, "fileset": { "version": "2.0.3", @@ -8196,6 +8042,7 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, "requires": { "is-number": "^2.1.0", "isobject": "^2.0.0", @@ -8207,12 +8054,14 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true }, "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, "requires": { "isarray": "1.0.0" } @@ -8262,15 +8111,6 @@ "pkg-dir": "^2.0.0" } }, - "find-node-modules": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/find-node-modules/-/find-node-modules-1.0.4.tgz", - "integrity": "sha1-tt6zzMtpnIcDdne87eLF9YYrJVA=", - "requires": { - "findup-sync": "0.4.2", - "merge": "^1.2.0" - } - }, "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", @@ -8284,17 +8124,6 @@ "locate-path": "^3.0.0" } }, - "findup-sync": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.2.tgz", - "integrity": "sha1-qBF9D3MST1pFRoOVef5S1xKfteU=", - "requires": { - "detect-file": "^0.1.0", - "is-glob": "^2.0.1", - "micromatch": "^2.3.7", - "resolve-dir": "^0.1.0" - } - }, "flat-cache": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", @@ -8404,12 +8233,14 @@ "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true }, "for-own": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, "requires": { "for-in": "^1.0.1" } @@ -8851,11 +8682,6 @@ } } }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" - }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -9501,22 +9327,11 @@ "resolved": "https://registry.npmjs.org/gl-preserve-state/-/gl-preserve-state-1.0.0.tgz", "integrity": "sha512-zQZ25l3haD4hvgJZ6C9+s0ebdkW9y+7U2qxvGu1uWOJh8a4RU+jURIKEQhf8elIlFpMH6CrAY2tH0mYrRjet3Q==" }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "glob-base": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, "requires": { "glob-parent": "^2.0.0", "is-glob": "^2.0.0" @@ -9526,6 +9341,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, "requires": { "is-glob": "^2.0.0" } @@ -9545,26 +9361,6 @@ "process": "~0.5.1" } }, - "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", - "requires": { - "global-prefix": "^0.1.4", - "is-windows": "^0.2.0" - } - }, - "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", - "requires": { - "homedir-polyfill": "^1.0.0", - "ini": "^1.3.4", - "is-windows": "^0.2.0", - "which": "^1.2.12" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -9979,6 +9775,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, "requires": { "parse-passwd": "^1.0.0" } @@ -10735,7 +10532,8 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true }, "inquirer": { "version": "7.0.4", @@ -10979,12 +10777,14 @@ "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true }, "is-equal-shallow": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, "requires": { "is-primitive": "^2.0.0" } @@ -10992,12 +10792,14 @@ "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true }, "is-extglob": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true }, "is-finite": { "version": "1.1.0", @@ -11025,6 +10827,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, "requires": { "is-extglob": "^1.0.0" } @@ -11038,6 +10841,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, "requires": { "kind-of": "^3.0.2" } @@ -11088,7 +10892,8 @@ "is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true }, "is-potential-custom-element-name": { "version": "1.0.0", @@ -11099,7 +10904,8 @@ "is-primitive": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true }, "is-regex": { "version": "1.1.0", @@ -11179,11 +10985,6 @@ "resolved": "https://registry.npmjs.org/is-what/-/is-what-3.10.0.tgz", "integrity": "sha512-U4RYCXNOmATQHlOPlOCHCfXyKEFIPqvyaKDqYRuLbD6EYKcTTfc3YXkAYjzOVxO3zt34L+Wh2feIyWrYiZ7kng==" }, - "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=" - }, "is-wsl": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", @@ -13469,33 +13270,6 @@ "css-vendor": "^0.3.8" } }, - "jstransform": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-11.0.3.tgz", - "integrity": "sha1-CaeJk+CuTU70SH9hVakfYZDLQiM=", - "requires": { - "base62": "^1.1.0", - "commoner": "^0.10.1", - "esprima-fb": "^15001.1.0-dev-harmony-fb", - "object-assign": "^2.0.0", - "source-map": "^0.4.2" - }, - "dependencies": { - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=" - }, - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, "jsx-ast-utils": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz", @@ -13521,6 +13295,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -13945,7 +13720,8 @@ "math-random": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", - "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true }, "md5.js": { "version": "1.3.5", @@ -14031,7 +13807,8 @@ "merge": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==" + "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", + "dev": true }, "merge-anything": { "version": "2.4.4", @@ -14115,6 +13892,7 @@ "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, "requires": { "arr-diff": "^2.0.0", "array-unique": "^0.2.1", @@ -14530,9 +14308,9 @@ } }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", "dev": true }, "node-int64": { @@ -14696,6 +14474,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, "requires": { "remove-trailing-separator": "^1.0.1" } @@ -14890,6 +14669,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, "requires": { "for-own": "^0.1.4", "is-extendable": "^0.1.1" @@ -15002,7 +14782,8 @@ "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true }, "os-locale": { "version": "3.1.0", @@ -15175,6 +14956,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, "requires": { "glob-base": "^0.3.0", "is-dotfile": "^1.0.0", @@ -15201,7 +14983,8 @@ "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true }, "parse5": { "version": "3.0.3", @@ -21062,7 +20845,8 @@ "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true }, "prettier": { "version": "1.19.1", @@ -21131,7 +20915,8 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true }, "process": { "version": "0.5.2", @@ -21289,7 +21074,8 @@ "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true }, "qr.js": { "version": "0.0.0", @@ -21404,6 +21190,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, "requires": { "is-number": "^4.0.0", "kind-of": "^6.0.0", @@ -21413,12 +21200,14 @@ "is-number": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true } } }, @@ -22747,29 +22536,6 @@ "util.promisify": "^1.0.0" } }, - "recast": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", - "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", - "requires": { - "ast-types": "0.9.6", - "esprima": "~3.1.0", - "private": "~0.1.5", - "source-map": "~0.5.0" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, "recompose": { "version": "0.28.2", "resolved": "https://registry.npmjs.org/recompose/-/recompose-0.28.2.tgz", @@ -22918,6 +22684,7 @@ "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, "requires": { "is-equal-shallow": "^0.1.3" } @@ -22993,7 +22760,8 @@ "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true }, "renderkid": { "version": "2.0.3", @@ -23028,12 +22796,14 @@ "repeat-element": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true }, "repeating": { "version": "2.0.1", @@ -23174,15 +22944,6 @@ } } }, - "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", - "requires": { - "expand-tilde": "^1.2.2", - "global-modules": "^0.2.3" - } - }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", @@ -23743,12 +23504,12 @@ "dev": true }, "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz", + "integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==", "dev": true, "requires": { - "node-forge": "0.9.0" + "node-forge": "^0.10.0" } }, "semver": { @@ -24009,9 +23770,9 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "simple-concat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" }, "simple-get": { "version": "2.8.1", @@ -24309,14 +24070,6 @@ "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", "dev": true }, - "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "requires": { - "amdefine": ">=0.0.4" - } - }, "source-map-explorer": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/source-map-explorer/-/source-map-explorer-1.8.0.tgz", @@ -24870,11 +24623,6 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, - "style-attr": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/style-attr/-/style-attr-1.3.0.tgz", - "integrity": "sha512-srFr54gzEZoy73WgYfnbxCAtNCzF0Hn5RGzK7gi/0G6ttZd9v3WZFGY4ed5ABr43dbGjPNr4T46geUxxUP9i6w==" - }, "style-loader": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.0.tgz", @@ -25044,6 +24792,16 @@ "resolved": "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz", "integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==" }, + "super-animejs": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/super-animejs/-/super-animejs-3.1.0.tgz", + "integrity": "sha512-6MFAFJDRuvwkovxQZPruuyHinTa4rgj4hNLOndjcYYhZLckoXtVRY9rJPuq8p6c/tgZJrFYEAYAfJ2/hhNtUCA==" + }, + "super-three": { + "version": "0.111.6", + "resolved": "https://registry.npmjs.org/super-three/-/super-three-0.111.6.tgz", + "integrity": "sha512-/OJTOBpmm7MRx8R0G5Zr9sX8EqsELy7SwATb5n0FP145QsrP134pY2W489sfkJYqZmGkpHmG1ulQ0M94icThBw==" + }, "supports-color": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", @@ -25509,9 +25267,8 @@ "integrity": "sha512-fihjYVjCmQbI03zt1+YCl/m+UrZCcDHFNLexgqBOIdPwnO6PYkQaYUsIbqtvNNse+BiMeu+pQWzZn9/NSnIv6A==" }, "three-bmfont-text": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/three-bmfont-text/-/three-bmfont-text-2.3.0.tgz", - "integrity": "sha512-HG6QHR129cNMGBhMgLsyKJiNW5r2XI+2P1JyjJl/9+D1e0iySzVZl3r8peTFpoJzPODl5Ckb8nu0U1zWjc6dNg==", + "version": "github:dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e", + "from": "github:dmarcos/three-bmfont-text#1babdf8507c731a18f8af3b807292e2b9740955e", "requires": { "array-shuffle": "^1.0.1", "inherits": "^2.0.1", @@ -25519,13 +25276,12 @@ "nice-color-palettes": "^1.0.1", "object-assign": "^4.0.1", "quad-indices": "^2.0.1", - "three-buffer-vertex-data": "^1.0.0" + "three-buffer-vertex-data": "github:dmarcos/three-buffer-vertex-data#69378fc58daf27d3b1d930df9f233473e4a4818c" } }, "three-buffer-vertex-data": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/three-buffer-vertex-data/-/three-buffer-vertex-data-1.1.0.tgz", - "integrity": "sha1-zyKOeEJ2ZYhLlhpMq+H4XtOfgrE=", + "version": "github:dmarcos/three-buffer-vertex-data#69378fc58daf27d3b1d930df9f233473e4a4818c", + "from": "github:dmarcos/three-buffer-vertex-data#69378fc58daf27d3b1d930df9f233473e4a4818c", "requires": { "flatten-vertex-data": "^1.0.0" } @@ -25785,7 +25541,8 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true }, "ua-parser-js": { "version": "0.7.21", diff --git a/package.json b/package.json index 2b4af10b..f571bcbc 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@material-ui/core": "^1.5.1", - "aframe": "^0.8.2", + "aframe": "^1.0.4", "aframe-animation-component": "^5.0.0", "aframe-environment-component": "^1.0.0", "aframe-extras": "^4.1.2", diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 2e20259b..47fc10cb 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -1,7 +1,6 @@ import React, { Component, Fragment } from "react"; -import { isMobile } from "../../utils/mobileCheck"; +import { browserType } from "../../utils/browserType"; import "aframe"; -import "aframe-animation-component"; import "three-pathfinding/dist/three-pathfinding"; import "aframe-extras/dist/aframe-extras.min.js"; import "aframe-physics-system"; @@ -145,7 +144,7 @@ class View extends Component { } basicMoveCam = () => { - if (isMobile()) { + if (browserType() === "mobile") { return ( ); } + if (browserType() === "vr") { + return ( + + + + + + ); + } else { return ( diff --git a/src/components/structural/WelcomeScene.js b/src/components/structural/WelcomeScene.js index cbd49ea9..59b8927f 100644 --- a/src/components/structural/WelcomeScene.js +++ b/src/components/structural/WelcomeScene.js @@ -1,10 +1,9 @@ import React, { Component } from "react"; -import { isMobile } from "../../utils/mobileCheck"; - +import { browserType } from "../../utils/browserType"; class WelcomeScene extends Component { createCam = () => { - if (isMobile()) { + if (browserType() === "mobile") { return ( ); } + if (browserType() === "vr") { + return ( + + + + + + ); + } else { return ( diff --git a/src/utils/browserType.js b/src/utils/browserType.js new file mode 100644 index 00000000..022a9f29 --- /dev/null +++ b/src/utils/browserType.js @@ -0,0 +1,26 @@ +import { UAParser } from "ua-parser-js"; + +const MOBILE_TYPES = [ + "mobile", + "tablet", + "wearable" +]; + +export const browserType = () => { + let parser = new UAParser(); + const device = parser.getDevice(); + + if("xr" in navigator) { + return "vr"; + } + else if("getVRDisplays" in navigator && navigator.getVRDisplays().length > 0) { + + return "vr"; + } + else if(MOBILE_TYPES.indexOf(device.type) === -1) { + return "desktop"; + } + else { + return "mobile"; + } +}; diff --git a/src/utils/mobileCheck.js b/src/utils/mobileCheck.js deleted file mode 100644 index c79459df..00000000 --- a/src/utils/mobileCheck.js +++ /dev/null @@ -1,18 +0,0 @@ -import { UAParser } from "ua-parser-js"; - -const MOBILE_TYPES = [ - "mobile", - "tablet", - "wearable" -]; - -export const isMobile = () => { - let parser = new UAParser(); - const device = parser.getDevice(); - if(MOBILE_TYPES.indexOf(device.type) !== -1) { - return true; - } - else { - return false; - } -}; From 92726903bc4ff538d396a904fdc7a6af48aa97ef Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Tue, 20 Oct 2020 14:52:31 -0400 Subject: [PATCH 09/37] wasd-plus-controls now works on desktop after registering schema --- src/components/structural/View.js | 2 +- src/utils/WASDPlusControls.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 47fc10cb..f53126ae 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -181,7 +181,7 @@ class View extends Component { + wasd-plus-controls="enabled: true"> { AFRAME.registerComponent("wasd-plus-controls", { schema: { - acceleration: {default : 150}, - enabled : {default : true}, - xInverted : {default : false}, - yInverted : {default : false}, - zInverted : {default : false}, + acceleration: {type: "number", default : 150}, + enabled : {type: "boolean", default : true}, + xInverted : {type: "boolean", default : false}, + yInverted : {type: "boolean", default : false}, + zInverted : {type: "boolean", default : false}, }, init: function() { //tracks the state of keypresses @@ -79,7 +80,7 @@ AFRAME.registerComponent("wasd-plus-controls", { let xSign; let ySign; let zSign; - + // If FPS too low, reset velocity. if (delta > MAX_DELTA) { velocity["x"] = 0; @@ -87,7 +88,6 @@ AFRAME.registerComponent("wasd-plus-controls", { velocity["z"] = 0; return; } - // https://gamedev.stackexchange.com/questions/151383/frame-rate-independant-movement-with-acceleration let scaledEasing = Math.pow(1 / this.easing, delta * 60); // Velocity Easing based on framerate @@ -190,4 +190,4 @@ AFRAME.registerComponent("wasd-plus-controls", { let code = event.code; delete this.keys[code]; } -}); +}); \ No newline at end of file From eddaa96bc6af925c2f1a1dc3809240fb6b3d55b1 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Wed, 20 Jan 2021 17:21:32 -0500 Subject: [PATCH 10/37] Changed the control components mounted when a VR device is detected. --- src/components/structural/View.js | 5 ++--- src/utils/browserType.js | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index f53126ae..5ee115fe 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -132,8 +132,7 @@ class View extends Component { + look-controls="pointerLockEnabled: true"> + movement-controls> { return "vr"; } else if("getVRDisplays" in navigator && navigator.getVRDisplays().length > 0) { - return "vr"; } else if(MOBILE_TYPES.indexOf(device.type) === -1) { From c87fde30d21378a2995b4bb9daf3208b3355d178 Mon Sep 17 00:00:00 2001 From: Samuel Zuk Date: Thu, 11 Feb 2021 00:39:01 -0500 Subject: [PATCH 11/37] If statements -> switch statements for clarity when mounting controls --- src/components/structural/View.js | 90 +++++++++++----------- src/components/structural/WelcomeScene.js | 92 +++++++++++------------ 2 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 5ee115fe..1a556e18 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -143,51 +143,51 @@ class View extends Component { } basicMoveCam = () => { - if (browserType() === "mobile") { - return ( - - - - - - ); - } - if (browserType() === "vr") { - return ( - - - - - - ); - } - else { - return ( - - - - - - ); + switch(browserType()) { + case "mobile": + return ( + + + + + + ); + case "vr": + return ( + + + + + + ); + case "desktop": + default: + return ( + + + + + + ); } } diff --git a/src/components/structural/WelcomeScene.js b/src/components/structural/WelcomeScene.js index 59b8927f..5b76ad15 100644 --- a/src/components/structural/WelcomeScene.js +++ b/src/components/structural/WelcomeScene.js @@ -3,52 +3,52 @@ import { browserType } from "../../utils/browserType"; class WelcomeScene extends Component { createCam = () => { - if (browserType() === "mobile") { - return ( - - - - - - ); - } - if (browserType() === "vr") { - return ( - - - - - - ); - } - else { - return ( - - - - - - ); + switch(browserType()) { + case "mobile": + return ( + + + + + + ); + case "vr": + return ( + + + + + + ); + case "desktop": + default: + return ( + + + + + + ); } } From 9f23a85e09e70eb192799208a8c7c33bd59aa66f Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Wed, 24 Feb 2021 16:46:56 -0500 Subject: [PATCH 12/37] Updated defaults for all scenes, issue is that this also affects the courses --- src/reducers/scene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reducers/scene.js b/src/reducers/scene.js index fe76d3df..25ffac46 100644 --- a/src/reducers/scene.js +++ b/src/reducers/scene.js @@ -4,9 +4,9 @@ export const DEF_SETTINGS = { skyColor: "white", floorColor: "#222", camConfig: 0, - showCoordHelper: false, + showCoordHelper: true, canFly: false, - showFloor: true, + showFloor: false, cameraPosition: "0 1.6 3", viewOnly: false, defaultLight: true, From badaec5635c7f287d410c14548075e71a70e2040 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Wed, 24 Feb 2021 16:51:53 -0500 Subject: [PATCH 13/37] Forgot to update the unit test --- src/tests/App.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/App.test.js b/src/tests/App.test.js index ea0b3e99..2b333bd2 100644 --- a/src/tests/App.test.js +++ b/src/tests/App.test.js @@ -317,9 +317,9 @@ describe("Scene Reducer", () => { skyColor: "white", floorColor: "#222", camConfig: 0, - showCoordHelper: false, + showCoordHelper: true, canFly: false, - showFloor: true, + showFloor: false, cameraPosition: "0 1.6 3", viewOnly: false, defaultLight: true, From bb43304bfe63fb4e6d4633b7a249c1a3cba4c866 Mon Sep 17 00:00:00 2001 From: Joshua119 Date: Thu, 4 Mar 2021 21:54:58 -0500 Subject: [PATCH 14/37] incorrect texture error --- src/myr/Myr.js | 2 +- src/tests/Myr.test.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/myr/Myr.js b/src/myr/Myr.js index ece7bd3f..f41010ad 100644 --- a/src/myr/Myr.js +++ b/src/myr/Myr.js @@ -582,7 +582,7 @@ class Myr { } else { console.error("Not a usable texture or URL."); - this.cursor.texture = ""; + throw new Error("Not a usable texture or URL."); } return this.cursor.texture; diff --git a/src/tests/Myr.test.js b/src/tests/Myr.test.js index 369ddc99..091ad2c3 100644 --- a/src/tests/Myr.test.js +++ b/src/tests/Myr.test.js @@ -54,11 +54,13 @@ describe("Updates to Myr's Model", () => { expect(myr.cursor.texture).toEqual("https://learnmyr.org/img/MYR-Logo.png"); }); - it("improper texture should return empty texture", () => { - myr.setTexture("asdfghjkl"); - expect(myr.cursor.texture).toEqual(""); - let getUndefinedTest = myr.getTexture(); - expect(getUndefinedTest).toEqual(""); + it("improper texture should throw an error", () => { + try { + myr.setTexture("asdfghjkl"); + } + catch(err) { + expect(err).toEqual(Error("Not a usable texture or URL.")); + } }); it("setTextureColoring(true) should allow a textured object to have a color other than white", () => { From af5b78569e7be5bfbb1fb2b02a3b916e906d640e Mon Sep 17 00:00:00 2001 From: Joshua119 Date: Thu, 4 Mar 2021 23:28:38 -0500 Subject: [PATCH 15/37] texture case sensitivity fixed --- src/myr/Myr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/myr/Myr.js b/src/myr/Myr.js index f41010ad..16e55029 100644 --- a/src/myr/Myr.js +++ b/src/myr/Myr.js @@ -574,8 +574,8 @@ class Myr { let textureURL = [...textures.TexturePack.map(obj => obj.url)]; let urlregex = /^(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png)/; - if (textureURL[textureTitle.indexOf(texture)] !== undefined) { - this.cursor.texture = textureURL[textureTitle.indexOf(texture)]; + if (textureURL[textureTitle.indexOf(texture.toLowerCase())] !== undefined) { + this.cursor.texture = textureURL[textureTitle.indexOf(texture.toLowerCase())]; } else if(urlregex.test(texture) || (texture === "")) { this.cursor.texture = texture; From 41d2002564fee2de048cb4d83659d6ff69c38dfd Mon Sep 17 00:00:00 2001 From: jlu18 Date: Fri, 5 Mar 2021 09:59:15 -0500 Subject: [PATCH 16/37] fix typo --- src/myr/reference.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/myr/reference.js b/src/myr/reference.js index b5749ba5..50380c71 100644 --- a/src/myr/reference.js +++ b/src/myr/reference.js @@ -521,7 +521,7 @@ let animations = [ { name: "getMagnitude", parameters: [], - desription: The getMagnitude function returns the current magnitude attribute of the cursor. The magnitude can be changed by the setMagnitude function. + description: The getMagnitude function returns the current magnitude attribute of the cursor. The magnitude can be changed by the setMagnitude function. }, { name: "spin", From bc25ac04d6a87e1f5fb19848b284f2bf2821a5be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:27:09 +0000 Subject: [PATCH 17/37] Bump bootstrap from 4.5.0 to 4.6.0 Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/twbs/bootstrap/releases) - [Commits](https://github.com/twbs/bootstrap/compare/v4.5.0...v4.6.0) Signed-off-by: dependabot[bot] --- package-lock.json | 44 +++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 09494b61..495a1fb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "myr", - "version": "2.1.0", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1957,9 +1957,17 @@ "webvr-polyfill": "^0.10.5" }, "dependencies": { + "debug": { + "version": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", + "from": "github:ngokevin/debug#noTimestamp" + }, + "document-register-element": { + "version": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", + "from": "github:dmarcos/document-register-element#8ccc532b7" + }, "three": { "version": "github:supermedium/three.js#5ef2887ab3621cae54fa129a500424d6caa25b62", - "from": "github:supermedium/three.js#r90fixMTLLoader" + "from": "github:supermedium/three.js#5ef2887ab3621cae54fa129a500424d6caa25b62" } } }, @@ -1996,7 +2004,7 @@ "dependencies": { "cannon": { "version": "github:donmccurdy/cannon.js#022e8ba53fa83abf0ad8a0e4fd08623123838a17", - "from": "github:donmccurdy/cannon.js#v0.6.2-dev1" + "from": "github:donmccurdy/cannon.js#022e8ba53fa83abf0ad8a0e4fd08623123838a17" } } }, @@ -3863,9 +3871,9 @@ "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=" }, "bootstrap": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.0.tgz", - "integrity": "sha512-Z93QoXvodoVslA+PWNdk23Hze4RBYIkpb5h8I2HY2Tu2h7A0LpAgLcyrhrSUyo2/Oxm2l1fRZPs1e5hnxnliXA==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz", + "integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw==" }, "brace": { "version": "0.11.1", @@ -5806,10 +5814,6 @@ "whatwg-url": "^8.0.0" } }, - "debug": { - "version": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", - "from": "github:ngokevin/debug#noTimestamp" - }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -6253,10 +6257,6 @@ "esutils": "^2.0.2" } }, - "document-register-element": { - "version": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", - "from": "github:dmarcos/document-register-element#8ccc532b7" - }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -10957,7 +10957,8 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=", - "dev": true + "dev": true, + "optional": true }, "acorn-globals": { "version": "1.0.9", @@ -10993,7 +10994,8 @@ "version": "0.3.8", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "dev": true, + "optional": true }, "cssstyle": { "version": "0.2.37", @@ -15816,7 +15818,8 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true + "dev": true, + "optional": true }, "pify": { "version": "2.3.0", @@ -26917,13 +26920,15 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, + "optional": true, "requires": { "is-extglob": "^2.1.1" } @@ -26939,7 +26944,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "dev": true, + "optional": true }, "readdirp": { "version": "3.4.0", diff --git a/package.json b/package.json index 370e83f6..06a79194 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "aframe-extras": "^4.1.2", "aframe-physics-system": "^3.2.0", "aframe-react": "^4.4.0", - "bootstrap": "^4.0.0", + "bootstrap": "^4.6.0", "browserslist": "^4.6.2", "cannon": "^0.6.2", "create-react-app": "^3.0.1", From 316568fe1fc9199e7d7eb1ff2e1fc8c80f50f24b Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 12 Mar 2021 17:02:41 -0500 Subject: [PATCH 18/37] Updated package dependencies --- package-lock.json | 89 +++++++++++++++++++++++++++-------------------- package.json | 3 +- src/index.js | 1 - 3 files changed, 53 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 871424b0..df7ed67e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1938,7 +1938,7 @@ "integrity": "sha512-iG/4VyRt22zUPxDsFjP4SHUXNPGIStM2hHX/iPblht6dtN8m09e7LAaFq4iQdXoT0EkZBWEVmXVBF1J7Tca3QQ==", "requires": { "custom-event-polyfill": "^1.0.6", - "debug": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", + "debug": "github:ngokevin/debug#noTimestamp", "deep-assign": "^2.0.0", "document-register-element": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", "load-bmfont": "^1.2.3", @@ -5692,6 +5692,10 @@ "whatwg-url": "^8.0.0" } }, + "debug": { + "version": "github:ngokevin/debug#ef5f8e66d49ce8bc64c6f282c15f8b7164409e3a", + "from": "github:ngokevin/debug#noTimestamp" + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", @@ -6113,6 +6117,10 @@ "esutils": "^2.0.2" } }, + "document-register-element": { + "version": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90", + "from": "github:dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90" + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -9048,7 +9056,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -9069,12 +9078,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -9089,17 +9100,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -9216,7 +9230,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -9228,6 +9243,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -9242,6 +9258,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -9249,12 +9266,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -9273,6 +9292,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -9353,7 +9373,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -9365,6 +9386,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -9450,7 +9472,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -9486,6 +9509,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -9505,6 +9529,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -9548,12 +9573,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -15574,7 +15601,8 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true + "dev": true, + "optional": true }, "pify": { "version": "2.3.0", @@ -22964,29 +22992,6 @@ "util.promisify": "^1.0.0" } }, - "recast": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", - "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", - "requires": { - "ast-types": "0.9.6", - "esprima": "~3.1.0", - "private": "~0.1.5", - "source-map": "~0.5.0" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - } - } - }, "recursive-readdir": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", @@ -25969,6 +25974,11 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "ua-parser-js": { + "version": "0.7.24", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.24.tgz", + "integrity": "sha512-yo+miGzQx5gakzVK3QFfN0/L9uVhosXBBO7qmnk7c2iw1IhL212wfA3zbnI54B0obGwC/5NWub/iT9sReMx+Fw==" + }, "uglify-js": { "version": "3.4.10", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", @@ -26672,13 +26682,15 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, + "optional": true, "requires": { "is-extglob": "^2.1.1" } @@ -26694,7 +26706,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "dev": true, + "optional": true }, "readdirp": { "version": "3.4.0", diff --git a/package.json b/package.json index 02fb7c41..671ef35e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ "socket.io-client": "^2.3.0", "source-map-explorer": "^1.6.0", "styled-components": "^4.0.3", - "three": "^0.98.0" + "three": "^0.98.0", + "ua-parser-js": "^0.7.24" }, "scripts": { "start": "react-scripts start", diff --git a/src/index.js b/src/index.js index c6927206..04e52654 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,6 @@ import ReactDOM from "react-dom"; import { Provider } from "react-redux"; import "./utils/AFramePhysics"; import "./utils/WASDPlusControls"; -import "./utils/AframeReg"; import "./utils/AframeRegIndicator"; import "bootstrap/dist/css/bootstrap.css"; import "./css/App.css"; From 0324117aeae66e6f9331419153f56e1fde77a32a Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 14:38:00 -0400 Subject: [PATCH 19/37] Changed from circle ci to github actions --- .circleci/config.yml | 40 ---------------------------------------- .dockerignore | 1 + .github/ci.yml | 16 ++++++++++++++++ .github/deploy.yml | 29 +++++++++++++++++++++++++++++ Dockerfile | 8 ++++++++ 5 files changed, 54 insertions(+), 40 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .dockerignore create mode 100644 .github/ci.yml create mode 100644 .github/deploy.yml create mode 100644 Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 529c4d18..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 2 -jobs: - build: - docker: - # specify the version you desire here - - image: circleci/node:12.18 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/mongo:3.4.4 - - working_directory: ~/MYR - - steps: - - checkout - - run: - name: Create firebase key file - command: mkdir ~/MYR/src/keys && touch ~/MYR/src/keys/firebase.js && echo -e "export const firebaseKey = \"$FIREBASE_KEY\";\nexport default firebaseKey;" > src/keys/firebase.js - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: npm ci - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - # run tests! - - run: - name: Run test suites - command: npm test - - run: - name: Run eslint - command: npm run lint diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.github/ci.yml b/.github/ci.yml new file mode 100644 index 00000000..67537294 --- /dev/null +++ b/.github/ci.yml @@ -0,0 +1,16 @@ +name: Build MYR + +on: [push, pull_request] + +jobs: + ci-checks: + runs-on: ubuntu-latest + container: + image: node:10.13 + + steps: + - uses: actions/@checkoutv1 + - run: npm ci + - run: npm lint + - run: npm test + - run: npm build \ No newline at end of file diff --git a/.github/deploy.yml b/.github/deploy.yml new file mode 100644 index 00000000..d0b7a3e5 --- /dev/null +++ b/.github/deploy.yml @@ -0,0 +1,29 @@ +name: Deploy MYR + +on: + push: + branches: + - master + - dev + +jobs: + update_upstream: + runs-on: ubuntu-latest + container: + image: docker + steps: + - uses: actions/@checkoutv1 + - name: Set the branch variable + uses: nelonoel/branch-name@v1.0.1 + - name: Log into Quay + run: docker login quay.io -u umlecg+myr_bot -p $QUAY_BOT_PASSWORD + - name: Build the docker image + run: docker build -t quay.io/ecgmyr/myr-frontend . + - name: Push the new image + run: docker push quay.io/ecgmyr/myr-frontend:${BRANCH_NAME} + - name: Notify the build repository + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.MYR_ACCESS_TOKEN }} + event-type: update_${BRANCH_NAME} + repository: engaging-computing/MYR-build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..731ce52c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:10.13 + +WORKDIR /app +COPY . /app + +RUN npm install +RUN npm run build +RUN npm run doc \ No newline at end of file From ccd6a25942673e9e87622c44be4c96ec900c3eb9 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 14:39:49 -0400 Subject: [PATCH 20/37] Moved files to proper location --- .github/{ => workflows}/ci.yml | 0 .github/{ => workflows}/deploy.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/ci.yml (100%) rename .github/{ => workflows}/deploy.yml (100%) diff --git a/.github/ci.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/ci.yml rename to .github/workflows/ci.yml diff --git a/.github/deploy.yml b/.github/workflows/deploy.yml similarity index 100% rename from .github/deploy.yml rename to .github/workflows/deploy.yml From 7785954f1b7e24751daeac8c475775cfe9e31f66 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 14:41:09 -0400 Subject: [PATCH 21/37] Fixed typo --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67537294..b1867782 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: image: node:10.13 steps: - - uses: actions/@checkoutv1 + - uses: actions/checkout@v1 - run: npm ci - run: npm lint - run: npm test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d0b7a3e5..665427b5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,7 +12,7 @@ jobs: container: image: docker steps: - - uses: actions/@checkoutv1 + - uses: actions/checkout@v1 - name: Set the branch variable uses: nelonoel/branch-name@v1.0.1 - name: Log into Quay From 3640b0dda7868ae9c03737dcb2dc303234d89bad Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 14:44:04 -0400 Subject: [PATCH 22/37] More pipeline fixes --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1867782..b0133774 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,11 @@ jobs: steps: - uses: actions/checkout@v1 - - run: npm ci - - run: npm lint - - run: npm test - - run: npm build \ No newline at end of file + - name: Fetch packages + run: npm ci + - name: Run Linter + run: npm run lint + - name: Run unit tests + run: npm test + - name: Build production build + run: npm run build \ No newline at end of file From 1289e32865655c7d041a7633415c55132a7230c9 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 14:50:22 -0400 Subject: [PATCH 23/37] Setting up cache --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0133774..531fd24e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,11 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Setup cache + uses: actions/cache@v2 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - name: Fetch packages run: npm ci - name: Run Linter From d256b71cf33f68dc928a1f00bebcae38343ea601 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 18 Mar 2021 21:23:29 -0400 Subject: [PATCH 24/37] Updated bot password variable to use proper secret notation for GitHub Actions --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 665427b5..8ca94f1c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,7 +16,7 @@ jobs: - name: Set the branch variable uses: nelonoel/branch-name@v1.0.1 - name: Log into Quay - run: docker login quay.io -u umlecg+myr_bot -p $QUAY_BOT_PASSWORD + run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} - name: Build the docker image run: docker build -t quay.io/ecgmyr/myr-frontend . - name: Push the new image From 8b5acbee85f6fee93d330d8d0f9b27ad8b6b0da9 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Fri, 19 Mar 2021 13:27:09 -0400 Subject: [PATCH 25/37] Fix the name of the Quay organization --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ca94f1c..0aaf1fad 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,9 +18,9 @@ jobs: - name: Log into Quay run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} - name: Build the docker image - run: docker build -t quay.io/ecgmyr/myr-frontend . + run: docker build -t quay.io/umlecg/myr-frontend . - name: Push the new image - run: docker push quay.io/ecgmyr/myr-frontend:${BRANCH_NAME} + run: docker push quay.io/umlecg/myr-frontend:${BRANCH_NAME} - name: Notify the build repository uses: peter-evans/repository-dispatch@v1 with: From efaf7243f1ca74fda26359c5176771cb313ac69f Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 23 Mar 2021 14:53:17 -0400 Subject: [PATCH 26/37] Fixed tagging issue seen in backend --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0aaf1fad..32554bbe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,7 @@ jobs: - name: Log into Quay run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} - name: Build the docker image - run: docker build -t quay.io/umlecg/myr-frontend . + run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} . - name: Push the new image run: docker push quay.io/umlecg/myr-frontend:${BRANCH_NAME} - name: Notify the build repository From 3fcb7e6ab0d2e875e55b7b88e2245bd6e8c33ab5 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 23 Mar 2021 16:17:31 -0400 Subject: [PATCH 27/37] Splitting out dev and master deployments --- .github/workflows/deploy_beta.yml | 28 +++++++++++++++++++ .../workflows/{deploy.yml => deploy_prod.yml} | 3 +- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy_beta.yml rename .github/workflows/{deploy.yml => deploy_prod.yml} (93%) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml new file mode 100644 index 00000000..2dd8b9b9 --- /dev/null +++ b/.github/workflows/deploy_beta.yml @@ -0,0 +1,28 @@ +name: Deploy to beta.learnmyr.org + +on: + push: + branches: + - dev + +jobs: + update_upstream: + runs-on: ubuntu-latest + container: + image: docker + steps: + - uses: actions/checkout@v1 + - name: Set the branch variable + uses: nelonoel/branch-name@v1.0.1 + - name: Log into Quay + run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} + - name: Build the docker image + run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} . + - name: Push the new image + run: docker push quay.io/umlecg/myr-frontend:${BRANCH_NAME} + - name: Notify the build repository + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.MYR_ACCESS_TOKEN }} + event-type: update_dev + repository: engaging-computing/MYR-build \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy_prod.yml similarity index 93% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy_prod.yml index 32554bbe..b1224094 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy_prod.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - dev jobs: update_upstream: @@ -25,5 +24,5 @@ jobs: uses: peter-evans/repository-dispatch@v1 with: token: ${{ secrets.MYR_ACCESS_TOKEN }} - event-type: update_${BRANCH_NAME} + event-type: update_master repository: engaging-computing/MYR-build \ No newline at end of file From 6735b4d57a7790e6fc001ad60bda1dd54295e8c4 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 23 Mar 2021 16:20:22 -0400 Subject: [PATCH 28/37] Updated names --- .github/workflows/deploy_beta.yml | 2 +- .github/workflows/deploy_prod.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index 2dd8b9b9..a3a5eeef 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -1,4 +1,4 @@ -name: Deploy to beta.learnmyr.org +name: Deploy staging image on: push: diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index b1224094..f22642a5 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -1,4 +1,4 @@ -name: Deploy MYR +name: Deploy production image on: push: From 76386bf25939bf29e2f290972b34e9c15ecbba9b Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Thu, 25 Mar 2021 13:16:34 -0400 Subject: [PATCH 29/37] Added build-time arg for google client id --- .github/workflows/deploy_beta.yml | 2 +- .github/workflows/deploy_prod.yml | 2 +- Dockerfile | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_beta.yml b/.github/workflows/deploy_beta.yml index a3a5eeef..09383f9e 100644 --- a/.github/workflows/deploy_beta.yml +++ b/.github/workflows/deploy_beta.yml @@ -17,7 +17,7 @@ jobs: - name: Log into Quay run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} - name: Build the docker image - run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} . + run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} --build-arg REACT_APP_GOOGLE_CLIENTID=${{ secrets.MYR_GOOGLE_OAUTH2 }} . - name: Push the new image run: docker push quay.io/umlecg/myr-frontend:${BRANCH_NAME} - name: Notify the build repository diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index f22642a5..00c2ce32 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -17,7 +17,7 @@ jobs: - name: Log into Quay run: docker login quay.io -u umlecg+myr_bot -p ${{ secrets.QUAY_BOT_PASSWORD }} - name: Build the docker image - run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} . + run: docker build -t quay.io/umlecg/myr-frontend:${BRANCH_NAME} --build-arg REACT_APP_GOOGLE_CLIENTID=${{ secrets.MYR_GOOGLE_OAUTH2 }} . - name: Push the new image run: docker push quay.io/umlecg/myr-frontend:${BRANCH_NAME} - name: Notify the build repository diff --git a/Dockerfile b/Dockerfile index 731ce52c..d90e8872 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ FROM node:10.13 WORKDIR /app COPY . /app +ARG REACT_APP_GOOGLE_CLIENTID="totally invalid.apps.googleusercontent.com" +ENV REACT_APP_GOOGLE_CLIENTID ${REACT_APP_GOOGLE_CLIENTID} + RUN npm install RUN npm run build RUN npm run doc \ No newline at end of file From 0038a220da7d1f7a2e474ce294ee347d89972f9d Mon Sep 17 00:00:00 2001 From: Joshua119 Date: Thu, 25 Mar 2021 21:53:47 -0400 Subject: [PATCH 30/37] testure tiling --- src/myr/Myr.js | 44 +++++++++++++++++++++++++------------------ src/myr/reference.js | 4 ++-- src/tests/Myr.test.js | 6 +++++- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/myr/Myr.js b/src/myr/Myr.js index 16e55029..86aeff2b 100644 --- a/src/myr/Myr.js +++ b/src/myr/Myr.js @@ -35,6 +35,8 @@ class Myr { phiLength: 360, loop: true, textureColoring: false, + textureRepeatWidth: 1, + textureRepeatHeight: 1, duration: 1000, magnitude: { spin: 360, @@ -105,6 +107,8 @@ class Myr { phiLength: 360, loop: true, textureColoring: false, + textureRepeatWidth: 1, + textureRepeatHeight: 1, duration: 1000, magnitude: { spin: 360, @@ -150,6 +154,8 @@ class Myr { phiLength: 360, loop: true, textureColoring: false, + textureRepeatWidth: 1, + textureRepeatHeight: 1, duration: 1000, magnitude: { spin: 360, @@ -568,7 +574,7 @@ class Myr { return this.cursor.color; } - setTexture = (texture = "") => { + setTexture = (texture = "", w = 1, h = 1) => { let textures = TexturePack(); let textureTitle = [...textures.TexturePack.map(obj => obj.title)]; let textureURL = [...textures.TexturePack.map(obj => obj.url)]; @@ -584,6 +590,8 @@ class Myr { console.error("Not a usable texture or URL."); throw new Error("Not a usable texture or URL."); } + this.cursor.textureRepeatWidth = w; + this.cursor.textureRepeatHeight = h; return this.cursor.texture; } @@ -764,7 +772,7 @@ class Myr { position: { ...this.cursor.position }, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); @@ -782,7 +790,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -799,7 +807,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -816,7 +824,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -834,7 +842,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -851,7 +859,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -868,7 +876,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -887,7 +895,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -904,7 +912,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -921,7 +929,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -938,7 +946,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -955,7 +963,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -972,7 +980,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -1018,7 +1026,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -1037,7 +1045,7 @@ class Myr { p: 2, q: 3, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -1054,7 +1062,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } @@ -1073,7 +1081,7 @@ class Myr { position: this.cursor.position, rotation: this.cursor.rotation, scale: this.cursor.scale, - material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; opacity: ${1 - this.cursor.transparency};`, + material: ((this.cursor.texture === "" || this.cursor.textureColoring) ? `color: ${this.cursor.color};` : "color: white;") + `side: double; src: ${this.cursor.texture}; repeat: ${this.cursor.textureRepeatWidth + " " + this.cursor.textureRepeatHeight}; opacity: ${1 - this.cursor.transparency};`, }; return this.mergeProps(base, params); } diff --git a/src/myr/reference.js b/src/myr/reference.js index 825e776c..daf2c4f9 100644 --- a/src/myr/reference.js +++ b/src/myr/reference.js @@ -270,8 +270,8 @@ let transformations = [ }, { name: "setTexture", - parameters: [{type: "string", name: "texture"}], - description: The setTexture function changes the texture of the cursor. The texture's normal color is displayed when setTextureColoring() is false, otherwise the texture will be affected by the current color. Textures can be applied either by using the name of one of or by inserting a valid url (e.g. "bricks" or "https://learnmyr.org/img/MYR-Logo.png"). An empty setTexture() or setTexture("") statement will remove the current texture., + parameters: [{type: "string", name: "texture"}, {type: "number", name: "widthRepeat"}, {type: "number", name: "heightRepeat"}], + description: The setTexture function changes the texture of the cursor. The texture's normal color is displayed when setTextureColoring() is false, otherwise the texture will be affected by the current color. Textures can be applied either by using the name of one of or by inserting a valid url (e.g. "bricks" or "https://learnmyr.org/img/MYR-Logo.png"). WidthRepeat and heightRepeat will change how many times the texture is displayed on the object in each direction. If widthRepeat and heightRepeat are not declared they will be set to default settings. Depending on the policy of the website they’re from, image URLs may not be usable, which will result in a blank Texture and Color. An empty setTexture() or setTexture("") statement will remove the current texture., example: "setTexture" }, { diff --git a/src/tests/Myr.test.js b/src/tests/Myr.test.js index 091ad2c3..5d4fd3fe 100644 --- a/src/tests/Myr.test.js +++ b/src/tests/Myr.test.js @@ -27,6 +27,8 @@ const defaultCursor = { phiLength: 360, loop: true, textureColoring: false, + textureRepeatWidth: 1, + textureRepeatHeight: 1, duration: 1000, magnitude: { spin: 360, @@ -43,8 +45,10 @@ describe("Updates to Myr's Model", () => { }); it("should set the texture by using a title and getTexture() should return that title", () => { - myr.setTexture("bricks"); + myr.setTexture("bricks", 2, 2); expect(myr.cursor.texture).toEqual("/img/textures/bricks.jpg"); + expect(myr.cursor.textureRepeatWidth).toEqual(2); + expect(myr.cursor.textureRepeatHeight).toEqual(2); let getTest = myr.getTexture(); expect(getTest).toEqual("bricks"); }); From 50544e4866c639c6205fb6a31cbb7d128eadc77a Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 26 Mar 2021 15:38:32 -0400 Subject: [PATCH 31/37] Updated scene reducer to display coordinate grid by default --- src/reducers/scene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reducers/scene.js b/src/reducers/scene.js index f542bfa5..9cc8cfd7 100644 --- a/src/reducers/scene.js +++ b/src/reducers/scene.js @@ -4,8 +4,8 @@ export const DEF_SETTINGS = { skyColor: "white", floorColor: "#222", camConfig: 0, - showCoordHelper: false, - showFloor: true, + showCoordHelper: true, + showFloor: false, cameraPosition: "0 1.6 3", viewOnly: false, defaultLight: true, From 1b804423f7e15b228661d838715dc91c9f7381aa Mon Sep 17 00:00:00 2001 From: Samuel Date: Sat, 27 Mar 2021 22:42:14 -0400 Subject: [PATCH 32/37] Fixed bug where spacebar keypresses would get caught before reaching ace editor --- src/components/structural/View.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index a303bc87..3961ca5a 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -30,7 +30,7 @@ class View extends Component { } window.addEventListener("keydown", function (e) { //KEYS: left and right: 37, 39; up and down: 38, 40; space: 32 - if ([38, 40, 32].indexOf(e.keyCode) > -1) { + if ([32, 38, 40].indexOf(e.keyCode) > -1 && e.target === document.body) { e.preventDefault(); } }, false); From c3508594194ba90f4f16bda5138214e908c015de Mon Sep 17 00:00:00 2001 From: jlu18 Date: Wed, 31 Mar 2021 14:01:37 -0400 Subject: [PATCH 33/37] Hot-Fixed: freeze problem with indicator --- src/components/structural/View.js | 31 ++++++++++++++++--------------- src/utils/AFramePhysics.js | 4 ++-- src/utils/AframeRegIndicator.js | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 3961ca5a..9c5506fb 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -154,18 +154,18 @@ class View extends Component { //ambient light doesn't have an indicator switch(ent.light.type){ case "point": - return ; + return ; case "spot": let target = true; if(!ent.light.target) { position = ""; target = false; } - return ; + return ; case "directional": - return ; + return ; case "hemisphere": - return ; + return ; default: } } @@ -231,6 +231,7 @@ class View extends Component { position={this.props.sceneConfig.settings.cameraPosition} look-controls="pointerLockEnabled: true"> @@ -245,6 +246,7 @@ class View extends Component { @@ -260,6 +262,7 @@ class View extends Component { look-controls="pointerLockEnabled: true" wasd-plus-controls="enabled: true"> @@ -278,9 +281,9 @@ class View extends Component { if (this.props.sceneConfig.settings.showCoordHelper) { return ( - - - + + + + setlayer="type:text;layer:1;"> + setlayer="type:text;layer:1;"> + setlayer="type:text;layer:1;"> ); } else { @@ -341,7 +344,6 @@ class View extends Component { {this.props.assets ? this.props.assets.map((x) => this.assetsHelper(x)) : null} - @@ -354,8 +356,8 @@ class View extends Component { } {this.props.sceneConfig.settings.lightIndicator||this.props.sceneConfig.settings.showCoordHelper ? - - + + : null} { // create the entities @@ -363,8 +365,7 @@ class View extends Component { return this.helper(this.props.objects[it]); }) } - - + {this.props.sceneConfig.settings.camConfig === 1 ? diff --git a/src/utils/AFramePhysics.js b/src/utils/AFramePhysics.js index ff7fd6c3..b59fa2fe 100644 --- a/src/utils/AFramePhysics.js +++ b/src/utils/AFramePhysics.js @@ -1,5 +1,5 @@ import AFRAME from "aframe"; -import * as THREE from "three"; +const THREE = AFRAME.THREE; AFRAME.registerComponent("force-pushable", { schema: { @@ -27,7 +27,7 @@ AFRAME.registerComponent("force-pushable", { //This set aframe entity to different layer (range from 0-31) //all the regular MYR entities will goes to layer 0 //And other, such as grid, light indicator will goes to layer 1 so it won't take effect of user created light -AFRAME.registerComponent("layer",{ +AFRAME.registerComponent("setlayer",{ schema:{ type:{ type:"string", diff --git a/src/utils/AframeRegIndicator.js b/src/utils/AframeRegIndicator.js index c2a9dd51..0caac3b6 100644 --- a/src/utils/AframeRegIndicator.js +++ b/src/utils/AframeRegIndicator.js @@ -1,5 +1,5 @@ import AFRAME from "aframe"; -import * as THREE from "three"; +const THREE = AFRAME.THREE; AFRAME.registerComponent("spotlightindicator",{ From d48bffd4386a8d75123e07ac623a9797f7aa0244 Mon Sep 17 00:00:00 2001 From: jlu18 Date: Wed, 31 Mar 2021 14:07:42 -0400 Subject: [PATCH 34/37] Change to reference three from aframe --- src/utils/WASDPlusControls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/WASDPlusControls.js b/src/utils/WASDPlusControls.js index 612800a4..a03fd75f 100644 --- a/src/utils/WASDPlusControls.js +++ b/src/utils/WASDPlusControls.js @@ -1,6 +1,6 @@ import AFRAME from "aframe"; -import * as THREE from "three"; +const THREE = AFRAME.THREE; const bind = AFRAME.utils.bind; const shouldCaptureKeyEvent = AFRAME.utils.shouldCaptureKeyEvent; From 6ba4a4b7303535d6a55f630f15710941975485f2 Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Tue, 6 Apr 2021 17:48:59 -0400 Subject: [PATCH 35/37] Improving user agent checking using AFrame's device --- src/utils/browserType.js | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/utils/browserType.js b/src/utils/browserType.js index da211a1f..802d76f2 100644 --- a/src/utils/browserType.js +++ b/src/utils/browserType.js @@ -1,25 +1,12 @@ -import { UAParser } from "ua-parser-js"; - -const MOBILE_TYPES = [ - "mobile", - "tablet", - "wearable" -]; +import AFRAME from "aframe"; export const browserType = () => { - let parser = new UAParser(); - const device = parser.getDevice(); + const device = AFRAME.utils.device; - if("xr" in navigator) { - return "vr"; - } - else if("getVRDisplays" in navigator && navigator.getVRDisplays().length > 0) { - return "vr"; - } - else if(MOBILE_TYPES.indexOf(device.type) === -1) { - return "desktop"; - } - else { + if(device.isMobile()) { return "mobile"; + }else if(device.getVRDisplay() && device.getVRDisplay().length >= 0) { + return "vr"; } + return "desktop"; }; From 8d80f0c5ded6f0451c78353a8b5427c02e8c7320 Mon Sep 17 00:00:00 2001 From: jlu18 Date: Fri, 9 Apr 2021 13:40:39 -0400 Subject: [PATCH 36/37] Fixed the black fickering bug on VR mode --- src/components/structural/View.js | 95 ++++++++++++++----------------- src/utils/AFramePhysics.js | 54 +++++++----------- 2 files changed, 62 insertions(+), 87 deletions(-) diff --git a/src/components/structural/View.js b/src/components/structural/View.js index 9c5506fb..f14ea02b 100644 --- a/src/components/structural/View.js +++ b/src/components/structural/View.js @@ -154,18 +154,18 @@ class View extends Component { //ambient light doesn't have an indicator switch(ent.light.type){ case "point": - return ; + return ; case "spot": let target = true; if(!ent.light.target) { position = ""; target = false; } - return ; + return ; case "directional": - return ; + return ; case "hemisphere": - return ; + return ; default: } } @@ -281,32 +281,29 @@ class View extends Component { if (this.props.sceneConfig.settings.showCoordHelper) { return ( - - - + + + + value="- X X +"> + value="+ Z Z -"> + value=" Y + "> ); } else { @@ -337,46 +334,40 @@ class View extends Component { /* eslint-disable */ return ( !this.state.welcomeOpen ? - - - - - - {this.props.assets ? this.props.assets.map((x) => this.assetsHelper(x)) : null} - - - - - {this.props.sceneConfig.settings.defaultLight ? - - - - - : null - } - {this.props.sceneConfig.settings.lightIndicator||this.props.sceneConfig.settings.showCoordHelper ? - - - + + + + + + {this.props.assets ? this.props.assets.map((x) => this.assetsHelper(x)) : null} + + + + + {this.props.sceneConfig.settings.defaultLight ? + + + - : null} - { // create the entities - Object.keys(this.props.objects).map(it => { - return this.helper(this.props.objects[it]); - }) - } - - {this.props.sceneConfig.settings.camConfig === 1 ? - - - - - - - - : null - } - + : null + } + { // create the entities + Object.keys(this.props.objects).map(it => { + return this.helper(this.props.objects[it]); + }) + } + + {this.props.sceneConfig.settings.camConfig === 1 ? + + + + + + + + : null + } + : null ); diff --git a/src/utils/AFramePhysics.js b/src/utils/AFramePhysics.js index b59fa2fe..5172cb3a 100644 --- a/src/utils/AFramePhysics.js +++ b/src/utils/AFramePhysics.js @@ -24,50 +24,34 @@ AFRAME.registerComponent("force-pushable", { } }); -//This set aframe entity to different layer (range from 0-31) -//all the regular MYR entities will goes to layer 0 -//And other, such as grid, light indicator will goes to layer 1 so it won't take effect of user created light -AFRAME.registerComponent("setlayer",{ + +//change the type of the material to the MeshBasicMaterial +AFRAME.registerComponent("basicmaterial",{ schema:{ - type:{ - type:"string", - default: "mesh" - }, - layer:{ - type:"number", - default: 0 - }, + default:"" }, init: function(){ - let obj = this.el.getObject3D(this.data.type); - if(this.data.type === "group"){ - obj.children.forEach((child)=>{ - child.layers.set(this.data.layer); - }); - } else { - obj.layers.set(this.data.layer); - } + const color = this.el.getObject3D("mesh").material.color; + this.el.getObject3D("mesh").material = new THREE.MeshBasicMaterial({ + color:color, + }); } -}); +}); -//Attached to the a-scene. Display aframe entities in different layer in scene every frame -AFRAME.registerComponent("scenelayer",{ +//change the material of a-grid to MeshBasicMaterial +AFRAME.registerComponent("gridmaterial",{ schema:{ default:"" }, init: function(){ - this.renderer = this.el.renderer; - this.camera = this.el.camera; - this.scene = this.el.sceneEl.object3D; - }, - tick: function(){ - this.renderer.autoClear = true; - this.camera.layers.set(1); - this.renderer.render(this.scene, this.camera); - - this.renderer.autoClear = false; - this.camera.layers.set(0); - this.renderer.render(this.scene, this.camera); + const texture = new THREE.TextureLoader().load("https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v1.16.3/assets/grid.png"); + texture.repeat = new THREE.Vector2(75,75); + texture.wrapS = THREE.RepeatWrapping; + texture.wrapT = THREE.RepeatWrapping; + + this.el.getObject3D("mesh").material = new THREE.MeshBasicMaterial({ + map: texture + }); } }); From b055931bebbdee93cd36f7c4680125e08b4580fe Mon Sep 17 00:00:00 2001 From: Keith Valin Date: Fri, 16 Apr 2021 13:46:42 -0400 Subject: [PATCH 37/37] Update README and package file to display 2.3.0 --- README.md | 14 ++++++++++---- package.json | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6b413e43..ff37e0a9 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,16 @@ The Engaging Computing Group develops new technologies to enable learners—yout ## Status [![CircleCI](https://circleci.com/gh/engaging-computing/MYR.svg?style=shield)](https://circleci.com/gh/engaging-computing/MYR) -## Change Log - 2.1.1 -> 2.2.0 -- Adds Lighting features to MYR -- Adds Texture features to MYR -- Updates copyright in the footer to be in the form `2018 - ` +## Change Log - 2.2.0 -> 2.3.0 +- Adds Minecraft style flying controls + - Removes flying setting toggle +- Updates default scene to show helper grid by default +- MYR provided textures are now case insensitive +- Textures can be tiled +- Fixes black flickering bug when entering VR mode on mobile +- Spelling fixes +- Updated AFrame to use v1.x.y + ## Acknowledgments diff --git a/package.json b/package.json index 671ef35e..9e95f806 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "myr", - "version": "2.2.0", + "version": "2.3.0", "private": false, "engines": { "node": "12.18.2"