diff --git a/package.json b/package.json index c05bbb02..6c0d27c7 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,13 @@ { "name": "@code-dot-org/ml-activities", - "version": "0.0.1", + "version": "0.0.2", "description": "", "main": "dist/main.js", "jest": { - "testEnvironment": "node" + "testEnvironment": "node", + "moduleNameMapper": { + ".+\\.(jpg|jpeg|png)$": "identity-obj-proxy" + } }, "scripts": { "build": "webpack -p", @@ -19,7 +22,7 @@ }, "repository": { "type": "git", - "url": "git+ssh://git@github.com/code-dot-org/dance-party.git" + "url": "git+ssh://git@github.com/code-dot-org/ml-activities.git" }, "author": "", "license": "Apache-2.0", @@ -45,6 +48,8 @@ "css-loader": "^3.2.0", "eslint": ">=4.18.2", "eslint-plugin-react": "^7.11.0", + "idempotent-babel-polyfill": "6.26.0-1", + "identity-obj-proxy": "^3.0.0", "jest": "^15.0.0", "jquery": "1.12.1", "jquery-ui": "^1.12.1", @@ -60,6 +65,7 @@ "react-dom": "~15.4.0", "react-test-renderer": "~15.4.0", "style-loader": "^1.0.0", + "url-loader": "^2.2.0", "webpack": "4.19.1", "webpack-cli": "^3.3.6", "webpack-dev-server": "^3.1.4", diff --git a/src/demo/helpers.js b/src/demo/helpers.js index 8bb60e80..28b9932b 100644 --- a/src/demo/helpers.js +++ b/src/demo/helpers.js @@ -1,6 +1,7 @@ import queryString from 'query-string'; import {Modes} from './constants'; import {FishBodyPart} from '../utils/fishData'; +import underwaterBackground from '../../public/images/underwater-background.png'; export const backgroundPathForMode = mode => { let imgName; @@ -11,7 +12,8 @@ export const backgroundPathForMode = mode => { // Temporarily show background for every mode. imgName = 'underwater'; - return imgName ? backgroundPath(imgName) : null; + // TODO: fix this + return imgName ? underwaterBackground : null; }; export const backgroundPath = imgName => { diff --git a/src/demo/models/loading.js b/src/demo/models/loading.js index 8abfe70d..3eb9e661 100644 --- a/src/demo/models/loading.js +++ b/src/demo/models/loading.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import 'idempotent-babel-polyfill'; import {initRenderer} from '../renderer'; import {setState} from '../state'; import {Modes} from '../constants'; diff --git a/src/demo/models/pond.js b/src/demo/models/pond.js index 2d253ccd..4e163873 100644 --- a/src/demo/models/pond.js +++ b/src/demo/models/pond.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import 'idempotent-babel-polyfill'; import _ from 'lodash'; import {setState, getState} from '../state'; import constants, {ClassType} from '../constants'; diff --git a/src/demo/models/predict.js b/src/demo/models/predict.js index 79b580c8..7c26f977 100644 --- a/src/demo/models/predict.js +++ b/src/demo/models/predict.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import 'idempotent-babel-polyfill'; import {setState} from '../state'; import {generateOcean} from '../../utils/generateOcean'; diff --git a/src/demo/models/train.js b/src/demo/models/train.js index 241c3a6e..87ea4e2b 100644 --- a/src/demo/models/train.js +++ b/src/demo/models/train.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import 'idempotent-babel-polyfill'; import {setState, getState} from '../state'; import {ClassType} from '../constants'; import SimpleTrainer from '../../utils/SimpleTrainer'; diff --git a/src/demo/renderer.js b/src/demo/renderer.js index 6a245f57..b3067d53 100644 --- a/src/demo/renderer.js +++ b/src/demo/renderer.js @@ -1,4 +1,4 @@ -import 'babel-polyfill'; +import 'idempotent-babel-polyfill'; import {getState, setState} from './state'; import constants, {Modes, ClassType} from './constants'; import CanvasCache from './canvasCache'; diff --git a/src/demo/ui.jsx b/src/demo/ui.jsx index a1da0f02..f0138c81 100644 --- a/src/demo/ui.jsx +++ b/src/demo/ui.jsx @@ -6,6 +6,7 @@ import {Modes, DataSet} from './constants'; import {toMode} from './toMode'; import {init as initModel} from './models'; import {onClassifyFish} from './models/train'; +import aiBotClosed from '../../public/images/ai-bot-closed.png'; const styles = { header: { @@ -217,7 +218,7 @@ class ActivityIntro extends React.Component { Next, you’re going to teach A.I. a new word just by showing examples of that type of fish. - +